diff options
author | Marek Olšák <[email protected]> | 2013-10-08 21:26:34 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2013-10-25 11:55:55 +0200 |
commit | 6067a30838535c838262a9229b400afe4d92c184 (patch) | |
tree | c32d65547f27684ff0f8360a71fa1c2cb5b0833c /src/gallium/drivers/r300/r300_screen.c | |
parent | 48784f3591a4608509ccad8c73618999765711b3 (diff) |
winsys/radeon: add the implementation of fences from r300g
Diffstat (limited to 'src/gallium/drivers/r300/r300_screen.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_screen.c | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index dd036fcd837..9ec58a9f504 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -558,17 +558,17 @@ static void r300_fence_reference(struct pipe_screen *screen, struct pipe_fence_handle **ptr, struct pipe_fence_handle *fence) { - pb_reference((struct pb_buffer**)ptr, - (struct pb_buffer*)fence); + struct radeon_winsys *rws = r300_screen(screen)->rws; + + rws->fence_reference(ptr, fence); } static boolean r300_fence_signalled(struct pipe_screen *screen, struct pipe_fence_handle *fence) { struct radeon_winsys *rws = r300_screen(screen)->rws; - struct pb_buffer *rfence = (struct pb_buffer*)fence; - return !rws->buffer_is_busy(rfence, RADEON_USAGE_READWRITE); + return rws->fence_wait(rws, fence, 0); } static boolean r300_fence_finish(struct pipe_screen *screen, @@ -576,26 +576,8 @@ static boolean r300_fence_finish(struct pipe_screen *screen, uint64_t timeout) { struct radeon_winsys *rws = r300_screen(screen)->rws; - struct pb_buffer *rfence = (struct pb_buffer*)fence; - - if (timeout != PIPE_TIMEOUT_INFINITE) { - int64_t start_time = os_time_get(); - - /* Convert to microseconds. */ - timeout /= 1000; - - /* Wait in a loop. */ - while (rws->buffer_is_busy(rfence, RADEON_USAGE_READWRITE)) { - if (os_time_get() - start_time >= timeout) { - return FALSE; - } - os_time_sleep(10); - } - return TRUE; - } - rws->buffer_wait(rfence, RADEON_USAGE_READWRITE); - return TRUE; + return rws->fence_wait(rws, fence, timeout); } struct pipe_screen* r300_screen_create(struct radeon_winsys *rws) |