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
nexedi
linux
Commits
12fb9525
Commit
12fb9525
authored
Nov 19, 2010
by
Ben Skeggs
Committed by
Francisco Jerez
Dec 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau: introduce a util function to wait on reg != val
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
ceac3099
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
13 deletions
+35
-13
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+7
-3
drivers/gpu/drm/nouveau/nouveau_hw.c
drivers/gpu/drm/nouveau/nouveau_hw.c
+2
-2
drivers/gpu/drm/nouveau/nouveau_state.c
drivers/gpu/drm/nouveau/nouveau_state.c
+20
-2
drivers/gpu/drm/nouveau/nv04_dac.c
drivers/gpu/drm/nouveau/nv04_dac.c
+6
-6
No files found.
drivers/gpu/drm/nouveau/nouveau_drv.h
View file @
12fb9525
...
...
@@ -795,8 +795,10 @@ extern int nouveau_ioctl_getparam(struct drm_device *, void *data,
struct
drm_file
*
);
extern
int
nouveau_ioctl_setparam
(
struct
drm_device
*
,
void
*
data
,
struct
drm_file
*
);
extern
bool
nouveau_wait_until
(
struct
drm_device
*
,
uint64_t
timeout
,
uint32_t
reg
,
uint32_t
mask
,
uint32_t
val
);
extern
bool
nouveau_wait_eq
(
struct
drm_device
*
,
uint64_t
timeout
,
uint32_t
reg
,
uint32_t
mask
,
uint32_t
val
);
extern
bool
nouveau_wait_ne
(
struct
drm_device
*
,
uint64_t
timeout
,
uint32_t
reg
,
uint32_t
mask
,
uint32_t
val
);
extern
bool
nouveau_wait_for_idle
(
struct
drm_device
*
);
extern
int
nouveau_card_init
(
struct
drm_device
*
);
...
...
@@ -1434,7 +1436,9 @@ static inline void nv_wr08(struct drm_device *dev, unsigned reg, u8 val)
}
#define nv_wait(dev, reg, mask, val) \
nouveau_wait_until(dev, 2000000000ULL, (reg), (mask), (val))
nouveau_wait_eq(dev, 2000000000ULL, (reg), (mask), (val))
#define nv_wait_ne(dev, reg, mask, val) \
nouveau_wait_ne(dev, 2000000000ULL, (reg), (mask), (val))
/* PRAMIN access */
static
inline
u32
nv_ri32
(
struct
drm_device
*
dev
,
unsigned
offset
)
...
...
drivers/gpu/drm/nouveau/nouveau_hw.c
View file @
12fb9525
...
...
@@ -999,8 +999,8 @@ nv_load_state_ext(struct drm_device *dev, int head,
if
(
dev_priv
->
card_type
==
NV_10
)
{
/* Not waiting for vertical retrace before modifying
CRE_53/CRE_54 causes lockups. */
nouveau_wait_
until
(
dev
,
650000000
,
NV_PRMCIO_INP0__COLOR
,
0x8
,
0x8
);
nouveau_wait_
until
(
dev
,
650000000
,
NV_PRMCIO_INP0__COLOR
,
0x8
,
0x0
);
nouveau_wait_
eq
(
dev
,
650000000
,
NV_PRMCIO_INP0__COLOR
,
0x8
,
0x8
);
nouveau_wait_
eq
(
dev
,
650000000
,
NV_PRMCIO_INP0__COLOR
,
0x8
,
0x0
);
}
wr_cio_state
(
dev
,
head
,
regp
,
NV_CIO_CRE_53
);
...
...
drivers/gpu/drm/nouveau/nouveau_state.c
View file @
12fb9525
...
...
@@ -1126,8 +1126,9 @@ nouveau_ioctl_setparam(struct drm_device *dev, void *data,
}
/* Wait until (value(reg) & mask) == val, up until timeout has hit */
bool
nouveau_wait_until
(
struct
drm_device
*
dev
,
uint64_t
timeout
,
uint32_t
reg
,
uint32_t
mask
,
uint32_t
val
)
bool
nouveau_wait_eq
(
struct
drm_device
*
dev
,
uint64_t
timeout
,
uint32_t
reg
,
uint32_t
mask
,
uint32_t
val
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_timer_engine
*
ptimer
=
&
dev_priv
->
engine
.
timer
;
...
...
@@ -1141,6 +1142,23 @@ bool nouveau_wait_until(struct drm_device *dev, uint64_t timeout,
return
false
;
}
/* Wait until (value(reg) & mask) != val, up until timeout has hit */
bool
nouveau_wait_ne
(
struct
drm_device
*
dev
,
uint64_t
timeout
,
uint32_t
reg
,
uint32_t
mask
,
uint32_t
val
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_timer_engine
*
ptimer
=
&
dev_priv
->
engine
.
timer
;
uint64_t
start
=
ptimer
->
read
(
dev
);
do
{
if
((
nv_rd32
(
dev
,
reg
)
&
mask
)
!=
val
)
return
true
;
}
while
(
ptimer
->
read
(
dev
)
-
start
<
timeout
);
return
false
;
}
/* Waits for PGRAPH to go completely idle */
bool
nouveau_wait_for_idle
(
struct
drm_device
*
dev
)
{
...
...
drivers/gpu/drm/nouveau/nv04_dac.c
View file @
12fb9525
...
...
@@ -74,14 +74,14 @@ static int sample_load_twice(struct drm_device *dev, bool sense[2])
* use a 10ms timeout (guards against crtc being inactive, in
* which case blank state would never change)
*/
if
(
!
nouveau_wait_
until
(
dev
,
10000000
,
NV_PRMCIO_INP0__COLOR
,
0x00000001
,
0x00000000
))
if
(
!
nouveau_wait_
eq
(
dev
,
10000000
,
NV_PRMCIO_INP0__COLOR
,
0x00000001
,
0x00000000
))
return
-
EBUSY
;
if
(
!
nouveau_wait_
until
(
dev
,
10000000
,
NV_PRMCIO_INP0__COLOR
,
0x00000001
,
0x00000001
))
if
(
!
nouveau_wait_
eq
(
dev
,
10000000
,
NV_PRMCIO_INP0__COLOR
,
0x00000001
,
0x00000001
))
return
-
EBUSY
;
if
(
!
nouveau_wait_
until
(
dev
,
10000000
,
NV_PRMCIO_INP0__COLOR
,
0x00000001
,
0x00000000
))
if
(
!
nouveau_wait_
eq
(
dev
,
10000000
,
NV_PRMCIO_INP0__COLOR
,
0x00000001
,
0x00000000
))
return
-
EBUSY
;
udelay
(
100
);
...
...
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