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
78e2933d
Commit
78e2933d
authored
Jun 18, 2011
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau: add function to wait until a callback returns true
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
95f0de3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+4
-0
drivers/gpu/drm/nouveau/nouveau_state.c
drivers/gpu/drm/nouveau/nouveau_state.c
+17
-0
No files found.
drivers/gpu/drm/nouveau/nouveau_drv.h
View file @
78e2933d
...
@@ -833,6 +833,8 @@ extern bool nouveau_wait_eq(struct drm_device *, uint64_t timeout,
...
@@ -833,6 +833,8 @@ extern bool nouveau_wait_eq(struct drm_device *, uint64_t timeout,
uint32_t
reg
,
uint32_t
mask
,
uint32_t
val
);
uint32_t
reg
,
uint32_t
mask
,
uint32_t
val
);
extern
bool
nouveau_wait_ne
(
struct
drm_device
*
,
uint64_t
timeout
,
extern
bool
nouveau_wait_ne
(
struct
drm_device
*
,
uint64_t
timeout
,
uint32_t
reg
,
uint32_t
mask
,
uint32_t
val
);
uint32_t
reg
,
uint32_t
mask
,
uint32_t
val
);
extern
bool
nouveau_wait_cb
(
struct
drm_device
*
,
u64
timeout
,
bool
(
*
cond
)(
void
*
),
void
*
);
extern
bool
nouveau_wait_for_idle
(
struct
drm_device
*
);
extern
bool
nouveau_wait_for_idle
(
struct
drm_device
*
);
extern
int
nouveau_card_init
(
struct
drm_device
*
);
extern
int
nouveau_card_init
(
struct
drm_device
*
);
...
@@ -1457,6 +1459,8 @@ static inline void nv_wr08(struct drm_device *dev, unsigned reg, u8 val)
...
@@ -1457,6 +1459,8 @@ static inline void nv_wr08(struct drm_device *dev, unsigned reg, u8 val)
nouveau_wait_eq(dev, 2000000000ULL, (reg), (mask), (val))
nouveau_wait_eq(dev, 2000000000ULL, (reg), (mask), (val))
#define nv_wait_ne(dev, reg, mask, val) \
#define nv_wait_ne(dev, reg, mask, val) \
nouveau_wait_ne(dev, 2000000000ULL, (reg), (mask), (val))
nouveau_wait_ne(dev, 2000000000ULL, (reg), (mask), (val))
#define nv_wait_cb(dev, func, data) \
nouveau_wait_cb(dev, 2000000000ULL, (func), (data))
/* PRAMIN access */
/* PRAMIN access */
static
inline
u32
nv_ri32
(
struct
drm_device
*
dev
,
unsigned
offset
)
static
inline
u32
nv_ri32
(
struct
drm_device
*
dev
,
unsigned
offset
)
...
...
drivers/gpu/drm/nouveau/nouveau_state.c
View file @
78e2933d
...
@@ -1200,6 +1200,23 @@ nouveau_wait_ne(struct drm_device *dev, uint64_t timeout,
...
@@ -1200,6 +1200,23 @@ nouveau_wait_ne(struct drm_device *dev, uint64_t timeout,
return
false
;
return
false
;
}
}
/* Wait until cond(data) == true, up until timeout has hit */
bool
nouveau_wait_cb
(
struct
drm_device
*
dev
,
u64
timeout
,
bool
(
*
cond
)(
void
*
),
void
*
data
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_timer_engine
*
ptimer
=
&
dev_priv
->
engine
.
timer
;
u64
start
=
ptimer
->
read
(
dev
);
do
{
if
(
cond
(
data
)
==
true
)
return
true
;
}
while
(
ptimer
->
read
(
dev
)
-
start
<
timeout
);
return
false
;
}
/* Waits for PGRAPH to go completely idle */
/* Waits for PGRAPH to go completely idle */
bool
nouveau_wait_for_idle
(
struct
drm_device
*
dev
)
bool
nouveau_wait_for_idle
(
struct
drm_device
*
dev
)
{
{
...
...
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