summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_fence.c
diff options
context:
space:
mode:
authorRob Clark <robclark@freedesktop.org>2015-08-18 15:07:02 -0400
committerRob Clark <robclark@freedesktop.org>2015-08-18 15:36:30 -0400
commit4a0bea38635e29b20701855131fa2b5dd6d3978f (patch)
tree106b88eedd4b4d3f3dc51cc5542f9657d7af1597 /src/gallium/drivers/freedreno/freedreno_fence.c
parentfd7a14f8ddeae5fc868a8d452445d708505cc930 (diff)
downloadexternal_mesa3d-4a0bea38635e29b20701855131fa2b5dd6d3978f.zip
external_mesa3d-4a0bea38635e29b20701855131fa2b5dd6d3978f.tar.gz
external_mesa3d-4a0bea38635e29b20701855131fa2b5dd6d3978f.tar.bz2
freedreno: use fd_pipe_wait_timeout()
To properly support the case of waiting on a fence with a 0 timeout, we still need to call down to the kernel. Which requires the use of the new fd_pipe_wait_timeout() API. Signed-off-by: Rob Clark <robclark@freedesktop.org>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_fence.c')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_fence.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_fence.c b/src/gallium/drivers/freedreno/freedreno_fence.c
index 337359c..5125f09 100644
--- a/src/gallium/drivers/freedreno/freedreno_fence.c
+++ b/src/gallium/drivers/freedreno/freedreno_fence.c
@@ -50,29 +50,11 @@ fd_screen_fence_ref(struct pipe_screen *pscreen,
*ptr = pfence;
}
-/* TODO we need to spiff out libdrm_freedreno a bit to allow passing
- * the timeout.. and maybe a better way to check if fence has been
- * signaled. The current implementation is a bit lame for now to
- * avoid bumping libdrm version requirement.
- */
-
-boolean fd_screen_fence_signalled(struct pipe_screen *screen,
- struct pipe_fence_handle *fence)
-{
- uint32_t timestamp = fd_ringbuffer_timestamp(fence->ctx->ring);
-
- /* TODO util helper for compare w/ rollover? */
- return timestamp >= fence->timestamp;
-}
-
boolean fd_screen_fence_finish(struct pipe_screen *screen,
struct pipe_fence_handle *fence,
uint64_t timeout)
{
- if (!timeout)
- return fd_screen_fence_signalled(screen, fence);
-
- if (fd_pipe_wait(fence->screen->pipe, fence->timestamp))
+ if (fd_pipe_wait_timeout(fence->screen->pipe, fence->timestamp, timeout))
return false;
return true;