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
43ce028f
Commit
43ce028f
authored
Oct 19, 2010
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nv50: rework evo init to match nvidia more closely
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
1e96268a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
47 deletions
+26
-47
drivers/gpu/drm/nouveau/nv50_evo.c
drivers/gpu/drm/nouveau/nv50_evo.c
+26
-47
No files found.
drivers/gpu/drm/nouveau/nv50_evo.c
View file @
43ce028f
...
...
@@ -149,60 +149,36 @@ nv50_evo_channel_new(struct drm_device *dev, struct nouveau_channel **pevo)
static
int
nv50_evo_channel_init
(
struct
nouveau_channel
*
evo
)
{
struct
drm_nouveau_private
*
dev_priv
=
evo
->
dev
->
dev_private
;
struct
nouveau_timer_engine
*
ptimer
=
&
dev_priv
->
engine
.
timer
;
struct
drm_device
*
dev
=
evo
->
dev
;
int
id
=
evo
->
id
,
ret
,
i
;
u64
start
;
u64
pushbuf
=
evo
->
pushbuf_bo
->
bo
.
mem
.
start
<<
PAGE_SHIFT
;
u32
tmp
;
/* taken from nv bug #12637, attempts to un-wedge the hw if it's
* stuck in some unspecified state
*/
start
=
ptimer
->
read
(
dev
);
nv_wr32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
),
0x2b00
);
while
((
tmp
=
nv_rd32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
)))
&
0x1e0000
)
{
if
((
tmp
&
0x9f0000
)
==
0x20000
)
nv_wr32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
),
tmp
|
0x800000
);
if
((
tmp
&
0x3f0000
)
==
0x30000
)
nv_wr32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
),
tmp
|
0x200000
);
if
(
ptimer
->
read
(
dev
)
-
start
>
1000000000ULL
)
{
NV_ERROR
(
dev
,
"timeout: (0x610200 & 0x1e0000) != 0
\n
"
);
NV_ERROR
(
dev
,
"0x610200 = 0x%08x
\n
"
,
tmp
);
return
-
EBUSY
;
}
}
tmp
=
nv_rd32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
));
if
((
tmp
&
0x009f0000
)
==
0x00020000
)
nv_wr32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
),
tmp
|
0x00800000
);
nv_wr32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
),
0x1000b03
);
if
(
!
nv_wait
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
),
0x40000000
,
0x40000000
))
{
NV_ERROR
(
dev
,
"timeout: (0x610200 & 0x40000000) == 0x40000000
\n
"
);
NV_ERROR
(
dev
,
"0x610200 = 0x%08x
\n
"
,
nv_rd32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
)));
return
-
EBUSY
;
}
tmp
=
nv_rd32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
));
if
((
tmp
&
0x003f0000
)
==
0x00030000
)
nv_wr32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
),
tmp
|
0x00600000
);
/* initialise fifo */
nv_wr32
(
dev
,
NV50_PDISPLAY_EVO_DMA_CB
(
id
),
((
evo
->
pushbuf_bo
->
bo
.
mem
.
start
<<
PAGE_SHIFT
)
>>
8
)
|
NV50_PDISPLAY_EVO_DMA_CB_LOCATION_VRAM
|
NV50_PDISPLAY_EVO_DMA_CB_VALID
);
nv_wr32
(
dev
,
NV50_PDISPLAY_EVO_DMA_CB
(
id
),
pushbuf
>>
8
|
NV50_PDISPLAY_EVO_DMA_CB_LOCATION_VRAM
|
NV50_PDISPLAY_EVO_DMA_CB_VALID
);
nv_wr32
(
dev
,
NV50_PDISPLAY_EVO_UNK2
(
id
),
0x00010000
);
nv_wr32
(
dev
,
NV50_PDISPLAY_EVO_HASH_TAG
(
id
),
id
);
nv_mask
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
),
NV50_PDISPLAY_EVO_CTRL_DMA
,
NV50_PDISPLAY_EVO_CTRL_DMA_ENABLED
);
nv_wr32
(
dev
,
NV50_PDISPLAY_USER_PUT
(
id
),
0x00000000
);
nv_wr32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
),
0x01000003
|
NV50_PDISPLAY_EVO_CTRL_DMA_ENABLED
);
if
(
!
nv_wait
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
),
0x80000000
,
0x00000000
))
{
NV_ERROR
(
dev
,
"timeout: (0x610200 & 0x80000000) == 0
\n
"
);
NV_ERROR
(
dev
,
"0x610200 = 0x%08x
\n
"
,
NV_ERROR
(
dev
,
"EvoCh %d init timeout: 0x%08x
\n
"
,
id
,
nv_rd32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
)));
return
-
EBUSY
;
}
nv_wr32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
),
(
nv_rd32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
))
&
~
0x00000003
)
|
NV50_PDISPLAY_EVO_CTRL_DMA_ENABLED
);
nv_wr32
(
dev
,
NV50_PDISPLAY_USER_PUT
(
id
),
0
);
nv_wr32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
),
0x01000003
|
NV50_PDISPLAY_EVO_CTRL_DMA_ENABLED
);
/* enable error reporting on the channel */
nv_mask
(
dev
,
0x610028
,
0x00000000
,
0x00010001
<<
id
);
...
...
@@ -226,12 +202,15 @@ static void
nv50_evo_channel_fini
(
struct
nouveau_channel
*
evo
)
{
struct
drm_device
*
dev
=
evo
->
dev
;
nv_wr32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
evo
->
id
),
0
);
if
(
!
nv_wait
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
evo
->
id
),
0x1e0000
,
0
))
{
NV_ERROR
(
dev
,
"timeout: (0x610200 & 0x1e0000) == 0
\n
"
);
NV_ERROR
(
dev
,
"0x610200 = 0x%08x
\n
"
,
nv_rd32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
evo
->
id
)));
int
id
=
evo
->
id
;
nv_mask
(
dev
,
0x610028
,
0x00010001
<<
id
,
0x00000000
);
nv_mask
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
),
0x00001010
,
0x00001000
);
nv_wr32
(
dev
,
NV50_PDISPLAY_INTR_0
,
(
1
<<
id
));
nv_mask
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
),
0x00000003
,
0x00000000
);
if
(
!
nv_wait
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
),
0x001e0000
,
0x00000000
))
{
NV_ERROR
(
dev
,
"EvoCh %d takedown timeout: 0x%08x
\n
"
,
id
,
nv_rd32
(
dev
,
NV50_PDISPLAY_EVO_CTRL
(
id
)));
}
}
...
...
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