Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
R128
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ermine
R128
Commits
7c74cbd0
Commit
7c74cbd0
authored
14 years ago
by
Ben Skeggs
Browse files
Options
Downloads
Patches
Plain Diff
drm/nouveau: tidy fifo swmthd handler a little
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
f7eb0c55
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/gpu/drm/nouveau/nouveau_irq.c
+31
-25
31 additions, 25 deletions
drivers/gpu/drm/nouveau/nouveau_irq.c
with
31 additions
and
25 deletions
drivers/gpu/drm/nouveau/nouveau_irq.c
+
31
−
25
View file @
7c74cbd0
...
...
@@ -108,36 +108,45 @@ nouveau_call_method(struct nouveau_channel *chan, int class, int mthd, int data)
}
static
bool
nouveau_fifo_swmthd
(
struct
nouveau_channel
*
chan
,
uint32_t
addr
,
u
int32_t
data
)
nouveau_fifo_swmthd
(
struct
drm_device
*
dev
,
u32
chid
,
u32
addr
,
u
32
data
)
{
struct
drm_device
*
dev
=
chan
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_channel
*
chan
=
NULL
;
struct
nouveau_gpuobj
*
obj
;
const
int
subc
=
(
addr
>>
13
)
&
0x7
;
const
int
mthd
=
addr
&
0x1ffc
;
bool
handled
=
false
;
u32
engine
;
if
(
mthd
==
0x0000
)
{
struct
nouveau_gpuobj
*
gpuobj
;
gpuobj
=
nouveau_ramht_find
(
chan
,
data
);
if
(
!
gpuobj
)
return
false
;
if
(
likely
(
chid
>=
0
&&
chid
<
dev_priv
->
engine
.
fifo
.
channels
))
chan
=
dev_priv
->
fifos
[
chid
];
if
(
unlikely
(
!
chan
))
return
false
;
if
(
gpuobj
->
engine
!=
NVOBJ_ENGINE_SW
)
return
false
;
switch
(
mthd
)
{
case
0x0000
:
/* bind object to subchannel */
obj
=
nouveau_ramht_find
(
chan
,
data
);
if
(
unlikely
(
!
obj
||
obj
->
engine
!=
NVOBJ_ENGINE_SW
))
break
;
chan
->
sw_subchannel
[
subc
]
=
gpuobj
->
class
;
nv_wr32
(
dev
,
NV04_PFIFO_CACHE1_ENGINE
,
nv_rd32
(
dev
,
NV04_PFIFO_CACHE1_ENGINE
)
&
~
(
0xf
<<
subc
*
4
));
return
true
;
}
chan
->
sw_subchannel
[
subc
]
=
obj
->
class
;
engine
=
0x0000000f
<<
(
subc
*
4
);
/* hw object */
if
(
nv_rd32
(
dev
,
NV04_PFIFO_CACHE1_ENGINE
)
&
(
1
<<
(
subc
*
4
)))
return
false
;
nv_mask
(
dev
,
NV04_PFIFO_CACHE1_ENGINE
,
engine
,
0x00000000
);
handled
=
true
;
break
;
default:
engine
=
nv_rd32
(
dev
,
NV04_PFIFO_CACHE1_ENGINE
);
if
(
unlikely
(((
engine
>>
(
subc
*
4
))
&
0xf
)
!=
0
))
break
;
if
(
nouveau_call_method
(
chan
,
chan
->
sw_subchannel
[
subc
],
mthd
,
data
))
return
false
;
if
(
!
nouveau_call_method
(
chan
,
chan
->
sw_subchannel
[
subc
],
mthd
,
data
))
handled
=
true
;
break
;
}
return
true
;
return
handled
;
}
static
void
...
...
@@ -150,14 +159,11 @@ nouveau_fifo_irq_handler(struct drm_device *dev)
reassign
=
nv_rd32
(
dev
,
NV03_PFIFO_CACHES
)
&
1
;
while
((
status
=
nv_rd32
(
dev
,
NV03_PFIFO_INTR_0
))
&&
(
cnt
++
<
100
))
{
struct
nouveau_channel
*
chan
=
NULL
;
uint32_t
chid
,
get
;
nv_wr32
(
dev
,
NV03_PFIFO_CACHES
,
0
);
chid
=
engine
->
fifo
.
channel_id
(
dev
);
if
(
chid
>=
0
&&
chid
<
engine
->
fifo
.
channels
)
chan
=
dev_priv
->
fifos
[
chid
];
get
=
nv_rd32
(
dev
,
NV03_PFIFO_CACHE1_GET
);
if
(
status
&
NV_PFIFO_INTR_CACHE_ERROR
)
{
...
...
@@ -184,7 +190,7 @@ nouveau_fifo_irq_handler(struct drm_device *dev)
NV40_PFIFO_CACHE1_DATA
(
ptr
));
}
if
(
!
chan
||
!
nouveau_fifo_swmthd
(
chan
,
mthd
,
data
))
{
if
(
!
nouveau_fifo_swmthd
(
dev
,
chid
,
mthd
,
data
))
{
NV_INFO
(
dev
,
"PFIFO_CACHE_ERROR - Ch %d/%d "
"Mthd 0x%04x Data 0x%08x
\n
"
,
chid
,
(
mthd
>>
13
)
&
7
,
mthd
&
0x1ffc
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment