Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
87032e11
Commit
87032e11
authored
Feb 23, 2014
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nve0/fifo: allow channels to be marked as unrunnable
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
0a7760e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
13 deletions
+24
-13
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
+24
-13
No files found.
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
View file @
87032e11
...
@@ -82,6 +82,11 @@ struct nve0_fifo_base {
...
@@ -82,6 +82,11 @@ struct nve0_fifo_base {
struct
nve0_fifo_chan
{
struct
nve0_fifo_chan
{
struct
nouveau_fifo_chan
base
;
struct
nouveau_fifo_chan
base
;
u32
engine
;
u32
engine
;
enum
{
STOPPED
,
RUNNING
,
KILLED
}
state
;
};
};
/*******************************************************************************
/*******************************************************************************
...
@@ -94,7 +99,6 @@ nve0_fifo_runlist_update(struct nve0_fifo_priv *priv, u32 engine)
...
@@ -94,7 +99,6 @@ nve0_fifo_runlist_update(struct nve0_fifo_priv *priv, u32 engine)
struct
nouveau_bar
*
bar
=
nouveau_bar
(
priv
);
struct
nouveau_bar
*
bar
=
nouveau_bar
(
priv
);
struct
nve0_fifo_engn
*
engn
=
&
priv
->
engine
[
engine
];
struct
nve0_fifo_engn
*
engn
=
&
priv
->
engine
[
engine
];
struct
nouveau_gpuobj
*
cur
;
struct
nouveau_gpuobj
*
cur
;
u32
match
=
(
engine
<<
16
)
|
0x00000001
;
int
i
,
p
;
int
i
,
p
;
mutex_lock
(
&
nv_subdev
(
priv
)
->
mutex
);
mutex_lock
(
&
nv_subdev
(
priv
)
->
mutex
);
...
@@ -102,17 +106,18 @@ nve0_fifo_runlist_update(struct nve0_fifo_priv *priv, u32 engine)
...
@@ -102,17 +106,18 @@ nve0_fifo_runlist_update(struct nve0_fifo_priv *priv, u32 engine)
engn
->
cur_runlist
=
!
engn
->
cur_runlist
;
engn
->
cur_runlist
=
!
engn
->
cur_runlist
;
for
(
i
=
0
,
p
=
0
;
i
<
priv
->
base
.
max
;
i
++
)
{
for
(
i
=
0
,
p
=
0
;
i
<
priv
->
base
.
max
;
i
++
)
{
u32
ctrl
=
nv_rd32
(
priv
,
0x800004
+
(
i
*
8
))
&
0x001f0001
;
struct
nve0_fifo_chan
*
chan
=
(
void
*
)
priv
->
base
.
channel
[
i
]
;
if
(
c
trl
!=
match
)
if
(
c
han
&&
chan
->
state
==
RUNNING
&&
chan
->
engine
==
engine
)
{
continue
;
nv_wo32
(
cur
,
p
+
0
,
i
)
;
nv_wo32
(
cur
,
p
+
0
,
i
);
nv_wo32
(
cur
,
p
+
4
,
0x00000000
);
nv_wo32
(
cur
,
p
+
4
,
0x00000000
)
;
p
+=
8
;
p
+=
8
;
}
}
}
bar
->
flush
(
bar
);
bar
->
flush
(
bar
);
nv_wr32
(
priv
,
0x002270
,
cur
->
addr
>>
12
);
nv_wr32
(
priv
,
0x002270
,
cur
->
addr
>>
12
);
nv_wr32
(
priv
,
0x002274
,
(
engine
<<
20
)
|
(
p
>>
3
));
nv_wr32
(
priv
,
0x002274
,
(
engine
<<
20
)
|
(
p
>>
3
));
if
(
!
nv_wait
(
priv
,
0x002284
+
(
engine
*
8
),
0x00100000
,
0x00000000
))
if
(
!
nv_wait
(
priv
,
0x002284
+
(
engine
*
8
),
0x00100000
,
0x00000000
))
nv_error
(
priv
,
"runlist %d update timeout
\n
"
,
engine
);
nv_error
(
priv
,
"runlist %d update timeout
\n
"
,
engine
);
mutex_unlock
(
&
nv_subdev
(
priv
)
->
mutex
);
mutex_unlock
(
&
nv_subdev
(
priv
)
->
mutex
);
...
@@ -280,9 +285,13 @@ nve0_fifo_chan_init(struct nouveau_object *object)
...
@@ -280,9 +285,13 @@ nve0_fifo_chan_init(struct nouveau_object *object)
nv_mask
(
priv
,
0x800004
+
(
chid
*
8
),
0x000f0000
,
chan
->
engine
<<
16
);
nv_mask
(
priv
,
0x800004
+
(
chid
*
8
),
0x000f0000
,
chan
->
engine
<<
16
);
nv_wr32
(
priv
,
0x800000
+
(
chid
*
8
),
0x80000000
|
base
->
addr
>>
12
);
nv_wr32
(
priv
,
0x800000
+
(
chid
*
8
),
0x80000000
|
base
->
addr
>>
12
);
nv_mask
(
priv
,
0x800004
+
(
chid
*
8
),
0x00000400
,
0x00000400
);
nve0_fifo_runlist_update
(
priv
,
chan
->
engine
);
if
(
chan
->
state
==
STOPPED
&&
(
chan
->
state
=
RUNNING
)
==
RUNNING
)
{
nv_mask
(
priv
,
0x800004
+
(
chid
*
8
),
0x00000400
,
0x00000400
);
nv_mask
(
priv
,
0x800004
+
(
chid
*
8
),
0x00000400
,
0x00000400
);
nve0_fifo_runlist_update
(
priv
,
chan
->
engine
);
nv_mask
(
priv
,
0x800004
+
(
chid
*
8
),
0x00000400
,
0x00000400
);
}
return
0
;
return
0
;
}
}
...
@@ -293,10 +302,12 @@ nve0_fifo_chan_fini(struct nouveau_object *object, bool suspend)
...
@@ -293,10 +302,12 @@ nve0_fifo_chan_fini(struct nouveau_object *object, bool suspend)
struct
nve0_fifo_chan
*
chan
=
(
void
*
)
object
;
struct
nve0_fifo_chan
*
chan
=
(
void
*
)
object
;
u32
chid
=
chan
->
base
.
chid
;
u32
chid
=
chan
->
base
.
chid
;
nv_mask
(
priv
,
0x800004
+
(
chid
*
8
),
0x00000800
,
0x00000800
);
if
(
chan
->
state
==
RUNNING
&&
(
chan
->
state
=
STOPPED
)
==
STOPPED
)
{
nve0_fifo_runlist_update
(
priv
,
chan
->
engine
);
nv_mask
(
priv
,
0x800004
+
(
chid
*
8
),
0x00000800
,
0x00000800
);
nv_wr32
(
priv
,
0x800000
+
(
chid
*
8
),
0x00000000
);
nve0_fifo_runlist_update
(
priv
,
chan
->
engine
);
}
nv_wr32
(
priv
,
0x800000
+
(
chid
*
8
),
0x00000000
);
return
nouveau_fifo_channel_fini
(
&
chan
->
base
,
suspend
);
return
nouveau_fifo_channel_fini
(
&
chan
->
base
,
suspend
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment