gallium: handle fence_finish timeout in various drivers
authorMarek Olšák <marek.olsak@amd.com>
Fri, 26 Jun 2015 11:13:16 +0000 (13:13 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Sun, 5 Jul 2015 13:08:58 +0000 (15:08 +0200)
I copied what fence_signalled does.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/freedreno/freedreno_fence.c
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/nouveau/nouveau_screen.c
src/gallium/drivers/svga/svga_screen.c

index 375e58f702278e421ea10e00a34fbc05850076d1..04a9feacd5854af51f498522864e426e02d0591d 100644 (file)
@@ -69,6 +69,9 @@ 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))
                return false;
 
index 0590da07b9a71ba5317a7640eac0e5c24d660acf..10508ced2bed69503a97bab1291de00900d97b10 100644 (file)
@@ -478,6 +478,9 @@ i915_fence_finish(struct pipe_screen *screen,
 {
    struct i915_screen *is = i915_screen(screen);
 
+   if (!timeout)
+      return is->iws->fence_signalled(is->iws, fence) == 1;
+
    return is->iws->fence_finish(is->iws, fence) == 1;
 }
 
index 47f1897c7324570457f933449e342c15f8b9b5cd..d3392e7d63d490b2934b8a55bf4ff2ba3b9d25b0 100644 (file)
@@ -550,6 +550,9 @@ llvmpipe_fence_finish(struct pipe_screen *screen,
 {
    struct lp_fence *f = (struct lp_fence *) fence_handle;
 
+   if (!timeout)
+      return lp_fence_signalled(f);
+
    lp_fence_wait(f);
    return TRUE;
 }
index c6e5074db1954afdb058ee914b896723388a3a6c..9f77db082ea487bef083ef9ae04c57beae7e1a45 100644 (file)
@@ -79,6 +79,9 @@ nouveau_screen_fence_finish(struct pipe_screen *screen,
                            struct pipe_fence_handle *pfence,
                             uint64_t timeout)
 {
+       if (!timeout)
+               return nouveau_fence_signalled(nouveau_fence(pfence));
+
        return nouveau_fence_wait(nouveau_fence(pfence));
 }
 
index 770f4933b4cc0a49a6d78c40c486f2858ee6a358..8eff3d5e337dd637c696dc9cb91239e8a2938517 100644 (file)
@@ -560,6 +560,9 @@ svga_fence_finish(struct pipe_screen *screen,
 {
    struct svga_winsys_screen *sws = svga_screen(screen)->sws;
 
+   if (!timeout)
+      return sws->fence_signalled(sws, fence, 0) == 0;
+
    SVGA_DBG(DEBUG_DMA|DEBUG_PERF, "%s fence_ptr %p\n",
             __FUNCTION__, fence);