gallium: add a pipe_context parameter to fence_finish
authorMarek Olšák <marek.olsak@amd.com>
Sat, 6 Aug 2016 14:41:42 +0000 (16:41 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 9 Aug 2016 23:11:10 +0000 (01:11 +0200)
required by glClientWaitSync (GL 4.5 Core spec) that can optionally flush
the context

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
39 files changed:
src/gallium/docs/source/context.rst
src/gallium/drivers/ddebug/dd_draw.c
src/gallium/drivers/ddebug/dd_screen.c
src/gallium/drivers/freedreno/freedreno_fence.c
src/gallium/drivers/freedreno/freedreno_fence.h
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/ilo/ilo_screen.c
src/gallium/drivers/llvmpipe/lp_flush.c
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/nouveau/nouveau_screen.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/radeon/r600_query.c
src/gallium/drivers/rbug/rbug_screen.c
src/gallium/drivers/softpipe/sp_fence.c
src/gallium/drivers/softpipe/sp_flush.c
src/gallium/drivers/svga/svga_context.c
src/gallium/drivers/svga/svga_screen.c
src/gallium/drivers/swr/swr_context.cpp
src/gallium/drivers/swr/swr_draw.cpp
src/gallium/drivers/swr/swr_fence.cpp
src/gallium/drivers/swr/swr_fence.h
src/gallium/drivers/swr/swr_query.cpp
src/gallium/drivers/swr/swr_screen.cpp
src/gallium/drivers/swr/swr_state.cpp
src/gallium/drivers/trace/tr_screen.c
src/gallium/drivers/vc4/vc4_fence.c
src/gallium/drivers/virgl/virgl_screen.c
src/gallium/include/pipe/p_screen.h
src/gallium/state_trackers/clover/core/event.cpp
src/gallium/state_trackers/dri/dri2.c
src/gallium/state_trackers/dri/dri_drawable.c
src/gallium/state_trackers/glx/xlib/xm_api.c
src/gallium/state_trackers/nine/swapchain9.c
src/gallium/state_trackers/vdpau/presentation.c
src/gallium/state_trackers/xa/xa_context.c
src/gallium/state_trackers/xvmc/surface.c
src/mesa/state_tracker/st_cb_flush.c
src/mesa/state_tracker/st_cb_syncobj.c

index 7fddabffeb4af047f0837c85887c0869b34abe66..1b045fa6ec07d12707b734a9f3c3ffc6d988f45c 100644 (file)
@@ -467,12 +467,10 @@ Flushing
 PIPE_FLUSH_END_OF_FRAME: Whether the flush marks the end of frame.
 
 PIPE_FLUSH_DEFERRED: It is not required to flush right away, but it is required
-to return a valid fence. The behavior of fence_finish or any other call isn't
-changed. The only side effect can be that fence_finish will wait a little
-longer. No guidance is given as to how drivers should implement fence_finish
-with deferred flushes. If some drivers can't do deferred flushes safely, they
-should just ignore the flag.
-
+to return a valid fence. If fence_finish is called with the returned fence
+and the context is still unflushed, and the ctx parameter of fence_finish is
+equal to the context where the fence was created, fence_finish will flush
+the context.
 
 
 ``flush_resource``
index 7abcf877a3b1841ce77828f095c5653e38217bba..3124d0552d0ee4490f020d62ca99134d36c1321b 100644 (file)
@@ -548,7 +548,7 @@ dd_flush_and_check_hang(struct dd_context *dctx,
    if (!fence)
       return false;
 
-   idle = screen->fence_finish(screen, fence, timeout_ms * 1000000);
+   idle = screen->fence_finish(screen, NULL, fence, timeout_ms * 1000000);
    screen->fence_reference(screen, &fence, NULL);
    if (!idle)
       fprintf(stderr, "dd: GPU hang detected!\n");
index 412ea365ce2d3a5cdb5d515fbf4056620e476fbb..3deba0a6e27819836b7543b674e7d718ecb2ca25 100644 (file)
@@ -263,12 +263,14 @@ dd_screen_fence_reference(struct pipe_screen *_screen,
 
 static boolean
 dd_screen_fence_finish(struct pipe_screen *_screen,
+                       struct pipe_context *_ctx,
                        struct pipe_fence_handle *fence,
                        uint64_t timeout)
 {
    struct pipe_screen *screen = dd_screen(_screen)->screen;
+   struct pipe_context *ctx = _ctx ? dd_context(_ctx)->pipe : NULL;
 
-   return screen->fence_finish(screen, fence, timeout);
+   return screen->fence_finish(screen, ctx, fence, timeout);
 }
 
 
index 5125f0918601aa7d3e041780a0ee62ff33ea85c8..df4cf4dd56072fdab9e3ae63870ab0398226d56e 100644 (file)
@@ -51,6 +51,7 @@ fd_screen_fence_ref(struct pipe_screen *pscreen,
 }
 
 boolean fd_screen_fence_finish(struct pipe_screen *screen,
+               struct pipe_context *ctx,
                struct pipe_fence_handle *fence,
                uint64_t timeout)
 {
index 06c314a6116945efe78fcbafaeb9fbaeae3cba8c..df7664bf8cd434a9b9ac559ee7e7829a586c3aa8 100644 (file)
@@ -35,6 +35,7 @@ void fd_screen_fence_ref(struct pipe_screen *pscreen,
                struct pipe_fence_handle **ptr,
                struct pipe_fence_handle *pfence);
 boolean fd_screen_fence_finish(struct pipe_screen *screen,
+               struct pipe_context *ctx,
                struct pipe_fence_handle *pfence,
                uint64_t timeout);
 struct pipe_fence_handle * fd_fence_create(struct pipe_context *pctx,
index 6b5218bc4673fb6e1b52ca9dc2b32ff418109430..ab3d4a6b2774a3416b64b701806742e32d41b67e 100644 (file)
@@ -500,6 +500,7 @@ i915_fence_reference(struct pipe_screen *screen,
 
 static boolean
 i915_fence_finish(struct pipe_screen *screen,
+                  struct pipe_context *ctx,
                   struct pipe_fence_handle *fence,
                   uint64_t timeout)
 {
index 448f512d7d15554e9aa15e4e201fc81ab45b2b7d..e98b6f20c39fc1af651ace896a00c51be8c7091f 100644 (file)
@@ -696,6 +696,7 @@ ilo_screen_fence_reference(struct pipe_screen *screen,
 
 static boolean
 ilo_screen_fence_finish(struct pipe_screen *screen,
+                        struct pipe_context *ctx,
                         struct pipe_fence_handle *fence,
                         uint64_t timeout)
 {
index 241c2ccafb7fbd5d1470bee9c314a779e58c8ca7..452753f881052908b8cf665767db6e616a481995 100644 (file)
@@ -82,7 +82,8 @@ llvmpipe_finish( struct pipe_context *pipe,
    struct pipe_fence_handle *fence = NULL;
    llvmpipe_flush(pipe, &fence, reason);
    if (fence) {
-      pipe->screen->fence_finish(pipe->screen, fence, PIPE_TIMEOUT_INFINITE);
+      pipe->screen->fence_finish(pipe->screen, NULL, fence,
+                                 PIPE_TIMEOUT_INFINITE);
       pipe->screen->fence_reference(pipe->screen, &fence, NULL);
    }
 }
index 61c3fb7a41030eed91035a077bb610bbe80f033c..1c00aa91034f4c3f14d5e4daa797a96ad754875b 100644 (file)
@@ -572,6 +572,7 @@ llvmpipe_fence_reference(struct pipe_screen *screen,
  */
 static boolean
 llvmpipe_fence_finish(struct pipe_screen *screen,
+                      struct pipe_context *ctx,
                       struct pipe_fence_handle *fence_handle,
                       uint64_t timeout)
 {
index 2c421cc748c1214037bc0f1127d9bc0ca4a6a6e2..f59e101cafb5565270c2cb35ed06e9d3b0109e53 100644 (file)
@@ -70,6 +70,7 @@ nouveau_screen_fence_ref(struct pipe_screen *pscreen,
 
 static boolean
 nouveau_screen_fence_finish(struct pipe_screen *screen,
+                            struct pipe_context *ctx,
                             struct pipe_fence_handle *pfence,
                             uint64_t timeout)
 {
index 7d2ea4a476734ea53d1a43553cc573ff69618e5b..b69e5246ef03313bdadb7848749883ee8c79f2e4 100644 (file)
@@ -698,6 +698,7 @@ static void r300_fence_reference(struct pipe_screen *screen,
 }
 
 static boolean r300_fence_finish(struct pipe_screen *screen,
+                                 struct pipe_context *ctx,
                                  struct pipe_fence_handle *fence,
                                  uint64_t timeout)
 {
index 2d05e16fc159fd4b71c33b0befde042c710edcc9..4dd2b3b75751a330b5502905aecfc15f15a29881 100644 (file)
@@ -954,6 +954,7 @@ static void r600_fence_reference(struct pipe_screen *screen,
 }
 
 static boolean r600_fence_finish(struct pipe_screen *screen,
+                                struct pipe_context *ctx,
                                 struct pipe_fence_handle *fence,
                                 uint64_t timeout)
 {
index 87352032ad7e326f31f9e19dfd1f923fe2481f9c..592cec1c2c0d736a8994cbe86139da9ea1343148 100644 (file)
@@ -215,7 +215,7 @@ static bool r600_query_sw_get_result(struct r600_common_context *rctx,
                return true;
        case PIPE_QUERY_GPU_FINISHED: {
                struct pipe_screen *screen = rctx->b.screen;
-               result->b = screen->fence_finish(screen, query->fence,
+               result->b = screen->fence_finish(screen, NULL, query->fence,
                                                 wait ? PIPE_TIMEOUT_INFINITE : 0);
                return result->b;
        }
index c2950e4a703c6eae6106d9db0890d7942ed3122b..8d216691fdb7d65538cd147e04cba8cfd8f4234e 100644 (file)
@@ -229,15 +229,15 @@ rbug_screen_fence_reference(struct pipe_screen *_screen,
 
 static boolean
 rbug_screen_fence_finish(struct pipe_screen *_screen,
+                         struct pipe_context *_ctx,
                          struct pipe_fence_handle *fence,
                          uint64_t timeout)
 {
    struct rbug_screen *rb_screen = rbug_screen(_screen);
    struct pipe_screen *screen = rb_screen->screen;
+   struct pipe_context *ctx = _ctx ? rbug_context(_ctx)->pipe : NULL;
 
-   return screen->fence_finish(screen,
-                               fence,
-                               timeout);
+   return screen->fence_finish(screen, ctx, fence, timeout);
 }
 
 boolean
index 6168236ec96798a2b8399b445244a1fc3af7ef47..1861b0da07ea17dc81dc2c579d1a5005a63b10c7 100644 (file)
@@ -42,6 +42,7 @@ softpipe_fence_reference(struct pipe_screen *screen,
 
 static boolean
 softpipe_fence_finish(struct pipe_screen *screen,
+                      struct pipe_context *ctx,
                       struct pipe_fence_handle *fence,
                       uint64_t timeout)
 {
index 29fcf7f16281e5690fb7e3df8585131aded0206e..656d8a3257ab086759f95f1a969add583832f7e1 100644 (file)
@@ -153,7 +153,7 @@ softpipe_flush_resource(struct pipe_context *pipe,
              * This is for illustrative purposes only, as softpipe does not
              * have fences.
              */
-            pipe->screen->fence_finish(pipe->screen, fence,
+            pipe->screen->fence_finish(pipe->screen, NULL, fence,
                                        PIPE_TIMEOUT_INFINITE);
             pipe->screen->fence_reference(pipe->screen, &fence, NULL);
          }
index c7f4aae246d0772095b4ee805a6bb74a797c77ae..f623caf94010e1f98dd52fb6f432c972da52fb77 100644 (file)
@@ -348,7 +348,7 @@ void svga_context_flush( struct svga_context *svga,
 
    if (SVGA_DEBUG & DEBUG_SYNC) {
       if (fence)
-         svga->pipe.screen->fence_finish( svga->pipe.screen, fence,
+         svga->pipe.screen->fence_finish( svga->pipe.screen, NULL, fence,
                                           PIPE_TIMEOUT_INFINITE);
    }
 
@@ -369,7 +369,7 @@ svga_context_finish(struct svga_context *svga)
    struct pipe_fence_handle *fence = NULL;
 
    svga_context_flush(svga, &fence);
-   screen->fence_finish(screen, fence, PIPE_TIMEOUT_INFINITE);
+   screen->fence_finish(screen, NULL, fence, PIPE_TIMEOUT_INFINITE);
    screen->fence_reference(screen, &fence, NULL);
 }
 
index 13253aca43f2fcf5780b786ba64771193a505f69..7c4e305f504e085fcf46827a39c7379812fc7fab 100644 (file)
@@ -804,6 +804,7 @@ svga_fence_reference(struct pipe_screen *screen,
 
 static boolean
 svga_fence_finish(struct pipe_screen *screen,
+                  struct pipe_context *ctx,
                   struct pipe_fence_handle *fence,
                   uint64_t timeout)
 {
index 1083c9de194ec02adb6020c1c6c491036901a853..835c35393f0d6fea01d1a9879303f399867b2e04 100644 (file)
@@ -128,7 +128,7 @@ swr_transfer_map(struct pipe_context *pipe,
             if (!swr_is_fence_pending(screen->flush_fence))
                swr_fence_submit(swr_context(pipe), screen->flush_fence);
 
-            swr_fence_finish(pipe->screen, screen->flush_fence, 0);
+            swr_fence_finish(pipe->screen, NULL, screen->flush_fence, 0);
             swr_resource_unused(resource);
          }
       }
@@ -205,7 +205,7 @@ swr_resource_copy(struct pipe_context *pipe,
    swr_store_dirty_resource(pipe, src, SWR_TILE_RESOLVED);
    swr_store_dirty_resource(pipe, dst, SWR_TILE_RESOLVED);
 
-   swr_fence_finish(pipe->screen, screen->flush_fence, 0);
+   swr_fence_finish(pipe->screen, NULL, screen->flush_fence, 0);
    swr_resource_unused(src);
    swr_resource_unused(dst);
 
index ab8d275062334d6daf7251d566407fb0330ef6cc..0f6a8c6d88cfdc850ee726dfc3cf0e039334dacd 100644 (file)
@@ -239,7 +239,7 @@ swr_finish(struct pipe_context *pipe)
    struct pipe_fence_handle *fence = nullptr;
 
    swr_flush(pipe, &fence, 0);
-   swr_fence_finish(pipe->screen, fence, 0);
+   swr_fence_finish(pipe->screen, NULL, fence, 0);
    swr_fence_reference(pipe->screen, &fence, NULL);
 }
 
index 8a8e864397d010eb945b974f53986e3d5e15481e..7fe24700bfafcb8fe40479783a1f2b69971be402 100644 (file)
@@ -111,6 +111,7 @@ swr_fence_reference(struct pipe_screen *screen,
  */
 boolean
 swr_fence_finish(struct pipe_screen *screen,
+                 struct pipe_context *ctx,
                  struct pipe_fence_handle *fence_handle,
                  uint64_t timeout)
 {
index 47f4d2e7c9f69792277294e07c871149d1deefc2..80a4345af87d4650ca7ab70e4750eb1bc3966f5d 100644 (file)
@@ -69,6 +69,7 @@ void swr_fence_reference(struct pipe_screen *screen,
                          struct pipe_fence_handle *f);
 
 boolean swr_fence_finish(struct pipe_screen *screen,
+                         struct pipe_context *ctx,
                          struct pipe_fence_handle *fence_handle,
                          uint64_t timeout);
 
index 7867db3fc12a7cc07122f57f1a2cf68558344a7b..5b8f059cdae385f658bc7ecdb5215f9c2831df60 100644 (file)
@@ -63,7 +63,7 @@ swr_destroy_query(struct pipe_context *pipe, struct pipe_query *q)
 
    if (pq->fence) {
       if (swr_is_fence_pending(pq->fence))
-         swr_fence_finish(pipe->screen, pq->fence, 0);
+         swr_fence_finish(pipe->screen, NULL, pq->fence, 0);
       swr_fence_reference(pipe->screen, &pq->fence, NULL);
    }
 
@@ -128,7 +128,7 @@ swr_get_query_result(struct pipe_context *pipe,
       if (!wait && !swr_is_fence_done(pq->fence))
          return FALSE;
 
-      swr_fence_finish(pipe->screen, pq->fence, 0);
+      swr_fence_finish(pipe->screen, NULL, pq->fence, 0);
       swr_fence_reference(pipe->screen, &pq->fence, NULL);
    }
 
index e0e59fa674c14fc6eb25e51929b1ef0ec56fcbe3..df44967feee69ae2e0f842353e6e614d40652466 100644 (file)
@@ -657,7 +657,7 @@ swr_resource_destroy(struct pipe_screen *p_screen, struct pipe_resource *pt)
       if (!swr_is_fence_pending(screen->flush_fence))
          swr_fence_submit(swr_context(pipe), screen->flush_fence);
 
-      swr_fence_finish(p_screen, screen->flush_fence, 0);
+      swr_fence_finish(p_screen, NULL, screen->flush_fence, 0);
       swr_resource_unused(pt);
    }
 
@@ -692,7 +692,7 @@ swr_flush_frontbuffer(struct pipe_screen *p_screen,
    struct pipe_context *pipe = screen->pipe;
 
    if (pipe) {
-      swr_fence_finish(p_screen, screen->flush_fence, 0);
+      swr_fence_finish(p_screen, NULL, screen->flush_fence, 0);
       swr_resource_unused(resource);
       SwrEndFrame(swr_context(pipe)->swrContext);
    }
@@ -712,7 +712,7 @@ swr_destroy_screen(struct pipe_screen *p_screen)
 
    fprintf(stderr, "SWR destroy screen!\n");
 
-   swr_fence_finish(p_screen, screen->flush_fence, 0);
+   swr_fence_finish(p_screen, NULL, screen->flush_fence, 0);
    swr_fence_reference(p_screen, &screen->flush_fence, NULL);
 
    JitDestroyContext(screen->hJitMgr);
index dac95ce42e7f55d5636a45832e97704955ab84dd..2df79855358f7b5fcabc082d7b2dd7f2180f7e23 100644 (file)
@@ -1390,7 +1390,7 @@ swr_update_derived(struct pipe_context *pipe,
 
    /* Ensure that any in-progress attachment change StoreTiles finish */
    if (swr_is_fence_pending(screen->flush_fence))
-      swr_fence_finish(pipe->screen, screen->flush_fence, 0);
+      swr_fence_finish(pipe->screen, NULL, screen->flush_fence, 0);
 
    /* Finally, update the in-use status of all resources involved in draw */
    swr_update_resource_status(pipe, p_draw_info);
index 260f1df5ce7f05ef92b316c894b949a6e15fbc06..67241ca2ba1cf7d397fb3cbd152758864bd7d5e3 100644 (file)
@@ -402,20 +402,23 @@ trace_screen_fence_reference(struct pipe_screen *_screen,
 
 static boolean
 trace_screen_fence_finish(struct pipe_screen *_screen,
+                          struct pipe_context *_ctx,
                           struct pipe_fence_handle *fence,
                           uint64_t timeout)
 {
    struct trace_screen *tr_scr = trace_screen(_screen);
    struct pipe_screen *screen = tr_scr->screen;
+   struct pipe_context *ctx = _ctx ? trace_context(_ctx)->pipe : NULL;
    int result;
 
    trace_dump_call_begin("pipe_screen", "fence_finish");
 
    trace_dump_arg(ptr, screen);
+   trace_dump_arg(ptr, ctx);
    trace_dump_arg(ptr, fence);
    trace_dump_arg(uint, timeout);
 
-   result = screen->fence_finish(screen, fence, timeout);
+   result = screen->fence_finish(screen, ctx, fence, timeout);
 
    trace_dump_ret(bool, result);
 
index b6fb2a8a460e9be98c934620a278f132ce328ad3..f61e7c6a5e845884825c144aeeecd6d3bd85c514 100644 (file)
@@ -61,6 +61,7 @@ vc4_fence_reference(struct pipe_screen *pscreen,
 
 static boolean
 vc4_fence_finish(struct pipe_screen *pscreen,
+                struct pipe_context *ctx,
                  struct pipe_fence_handle *pf,
                  uint64_t timeout_ns)
 {
index fd3d35dc745814a4df0392d84f600f78205cd7ae..e01b5b405afca0edca7c55f9668c40b830e10c51 100644 (file)
@@ -524,6 +524,7 @@ static void virgl_fence_reference(struct pipe_screen *screen,
 }
 
 static boolean virgl_fence_finish(struct pipe_screen *screen,
+                                  struct pipe_context *ctx,
                                   struct pipe_fence_handle *fence,
                                   uint64_t timeout)
 {
index 755291ae501c52093991b13c438db8f0b91abac1..dd40e07b7eeb148e1926266f0af205ff77c45a6c 100644 (file)
@@ -242,11 +242,20 @@ struct pipe_screen {
 
    /**
     * Wait for the fence to finish.
+    *
+    * If the fence was created with PIPE_FLUSH_DEFERRED, and the context is
+    * still unflushed, and the ctx parameter of fence_finish is equal to
+    * the context where the fence was created, fence_finish will flush
+    * the context prior to waiting for the fence.
+    *
+    * In all other cases, the ctx parameter has no effect.
+    *
     * \param timeout  in nanoseconds (may be PIPE_TIMEOUT_INFINITE).
     */
-   boolean (*fence_finish)( struct pipe_screen *screen,
-                            struct pipe_fence_handle *fence,
-                            uint64_t timeout );
+   boolean (*fence_finish)(struct pipe_screen *screen,
+                           struct pipe_context *ctx,
+                           struct pipe_fence_handle *fence,
+                           uint64_t timeout);
 
    /**
     * Returns a driver-specific query.
index d75b839779472eec009e6ace645e120f7106ec4b..8275e16a4dd5a22ddd06220a9adb080e6bc98883 100644 (file)
@@ -141,7 +141,7 @@ hard_event::status() const {
    else if (!_fence)
       return CL_QUEUED;
 
-   else if (!screen->fence_finish(screen, _fence, 0))
+   else if (!screen->fence_finish(screen, NULL, _fence, 0))
       return CL_SUBMITTED;
 
    else
@@ -168,7 +168,7 @@ hard_event::wait() const {
       queue()->flush();
 
    if (!_fence ||
-       !screen->fence_finish(screen, _fence, PIPE_TIMEOUT_INFINITE))
+       !screen->fence_finish(screen, NULL, _fence, PIPE_TIMEOUT_INFINITE))
       throw error(CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST);
 }
 
index c22a8cdc43065267eeebbaf8d65abf1f5bca5faf..9803b0e1971b90ab6c1fa844a1fdf0886fbcc244 100644 (file)
@@ -1252,7 +1252,7 @@ dri2_blit_image(__DRIcontext *context, __DRIimage *dst, __DRIimage *src,
       screen = dri_screen(ctx->sPriv)->base.screen;
       pipe->flush_resource(pipe, dst->texture);
       ctx->st->flush(ctx->st, 0, &fence);
-      (void) screen->fence_finish(screen, fence, PIPE_TIMEOUT_INFINITE);
+      (void) screen->fence_finish(screen, NULL, fence, PIPE_TIMEOUT_INFINITE);
       screen->fence_reference(screen, &fence, NULL);
    }
 }
@@ -1451,13 +1451,13 @@ dri2_client_wait_sync(__DRIcontext *_ctx, void *_fence, unsigned flags,
    /* No need to flush. The context was flushed when the fence was created. */
 
    if (fence->pipe_fence)
-      return screen->fence_finish(screen, fence->pipe_fence, timeout);
+      return screen->fence_finish(screen, NULL, fence->pipe_fence, timeout);
    else if (fence->cl_event) {
       struct pipe_fence_handle *pipe_fence =
          driscreen->opencl_dri_event_get_fence(fence->cl_event);
 
       if (pipe_fence)
-         return screen->fence_finish(screen, pipe_fence, timeout);
+         return screen->fence_finish(screen, NULL, pipe_fence, timeout);
       else
          return driscreen->opencl_dri_event_wait(fence->cl_event, timeout);
    }
index adc5128476786bdb5cb9b6d5720f2c589b9a2212..edcd0e68439924b6137f5122044775d08d0bcef8 100644 (file)
@@ -525,7 +525,7 @@ dri_flush(__DRIcontext *cPriv,
 
       fence = swap_fences_pop_front(drawable);
       if (fence) {
-         (void) screen->fence_finish(screen, fence, PIPE_TIMEOUT_INFINITE);
+         (void) screen->fence_finish(screen, NULL, fence, PIPE_TIMEOUT_INFINITE);
          screen->fence_reference(screen, &fence, NULL);
       }
 
index 5799cce033c61d6cde94f62ebf6187824b8d7228..8d1b36056eeff820d7aa7cd8a245cdb1ee8f5daa 100644 (file)
@@ -1376,7 +1376,7 @@ void XMesaFlush( XMesaContext c )
 
       c->st->flush(c->st, ST_FLUSH_FRONT, &fence);
       if (fence) {
-         xmdpy->screen->fence_finish(xmdpy->screen, fence,
+         xmdpy->screen->fence_finish(xmdpy->screen, NULL, fence,
                                      PIPE_TIMEOUT_INFINITE);
          xmdpy->screen->fence_reference(xmdpy->screen, &fence, NULL);
       }
index bc01c2dd4cfce70e45beaf860514b4cba1cab9f5..08ee482f0d391e0d306b4eae287bfc3a51dc0088 100644 (file)
@@ -621,7 +621,7 @@ static void work_present(void *data)
 {
     struct end_present_struct *work = data;
     if (work->fence_to_wait) {
-        (void) work->screen->fence_finish(work->screen, work->fence_to_wait, PIPE_TIMEOUT_INFINITE);
+        (void) work->screen->fence_finish(work->screen, NULL, work->fence_to_wait, PIPE_TIMEOUT_INFINITE);
         work->screen->fence_reference(work->screen, &(work->fence_to_wait), NULL);
     }
     ID3DPresent_PresentBuffer(work->present, work->present_handle, work->hDestWindowOverride, NULL, NULL, NULL, 0);
@@ -743,7 +743,7 @@ bypass_rendering:
         BOOL still_draw = FALSE;
         fence = swap_fences_see_front(This);
         if (fence) {
-            still_draw = !This->screen->fence_finish(This->screen, fence, 0);
+            still_draw = !This->screen->fence_finish(This->screen, NULL, fence, 0);
             This->screen->fence_reference(This->screen, &fence, NULL);
         }
         if (still_draw)
@@ -754,7 +754,7 @@ bypass_rendering:
         This->tasks[0]=NULL;
         fence = swap_fences_pop_front(This);
         if (fence) {
-            (void) This->screen->fence_finish(This->screen, fence, PIPE_TIMEOUT_INFINITE);
+            (void) This->screen->fence_finish(This->screen, NULL, fence, PIPE_TIMEOUT_INFINITE);
             This->screen->fence_reference(This->screen, &fence, NULL);
         }
 
index e7f387e6173809e2db3e637ef9b03940c73d9bda..2862eafa1da6202b5e6cf7cc979abd356374b741 100644 (file)
@@ -327,7 +327,7 @@ vlVdpPresentationQueueBlockUntilSurfaceIdle(VdpPresentationQueue presentation_qu
    pipe_mutex_lock(pq->device->mutex);
    if (surf->fence) {
       screen = pq->device->vscreen->pscreen;
-      screen->fence_finish(screen, surf->fence, PIPE_TIMEOUT_INFINITE);
+      screen->fence_finish(screen, NULL, surf->fence, PIPE_TIMEOUT_INFINITE);
       screen->fence_reference(screen, &surf->fence, NULL);
    }
    pipe_mutex_unlock(pq->device->mutex);
@@ -369,7 +369,7 @@ vlVdpPresentationQueueQuerySurfaceStatus(VdpPresentationQueue presentation_queue
    } else {
       pipe_mutex_lock(pq->device->mutex);
       screen = pq->device->vscreen->pscreen;
-      if (screen->fence_finish(screen, surf->fence, 0)) {
+      if (screen->fence_finish(screen, NULL, surf->fence, 0)) {
          screen->fence_reference(screen, &surf->fence, NULL);
          *status = VDP_PRESENTATION_QUEUE_STATUS_VISIBLE;
          pipe_mutex_unlock(pq->device->mutex);
index 5553beb2014b945475c40c05c1ef7c67121be280..715b48d7c84bf159002b44b2340c9f9987685c8e 100644 (file)
@@ -383,7 +383,7 @@ xa_fence_wait(struct xa_fence *fence, uint64_t timeout)
        struct pipe_screen *screen = fence->xa->screen;
        boolean timed_out;
 
-       timed_out = !screen->fence_finish(screen, fence->pipe_fence, timeout);
+       timed_out = !screen->fence_finish(screen, NULL, fence->pipe_fence, timeout);
        if (timed_out)
            return -XA_ERR_BUSY;
 
index 199712ba16825705c933f1077c5aba9ca387ea5b..a4cd2aa2e12985dc245bb8376c0d541c76424eca 100644 (file)
@@ -488,7 +488,7 @@ Status XvMCGetSurfaceStatus(Display *dpy, XvMCSurface *surface, int *status)
    *status = 0;
 
    if (surface_priv->fence)
-      if (!pipe->screen->fence_finish(pipe->screen, surface_priv->fence, 0))
+      if (!pipe->screen->fence_finish(pipe->screen, NULL, surface_priv->fence, 0))
          *status |= XVMC_RENDERING;
 
    return Success;
index 82affd2de3eebd7005d80b4aa20b4a1e4dd17359..5cab5a7f156e2f14226d87cea06c56470fb4ff85 100644 (file)
@@ -98,7 +98,7 @@ void st_finish( struct st_context *st )
    st_flush(st, &fence, 0);
 
    if(fence) {
-      st->pipe->screen->fence_finish(st->pipe->screen, fence,
+      st->pipe->screen->fence_finish(st->pipe->screen, NULL, fence,
                                      PIPE_TIMEOUT_INFINITE);
       st->pipe->screen->fence_reference(st->pipe->screen, &fence, NULL);
    }
index 69f2a289adab97cd961a969c313f583fad5f8fe7..1fa14039b5908983d1e75c05378e3fefa8dc1c76 100644 (file)
@@ -87,7 +87,7 @@ static void st_check_sync(struct gl_context *ctx, struct gl_sync_object *obj)
       return;
    }
 
-   if (screen->fence_finish(screen, so->fence, 0)) {
+   if (screen->fence_finish(screen, NULL, so->fence, 0)) {
       screen->fence_reference(screen, &so->fence, NULL);
       so->b.StatusFlag = GL_TRUE;
    }
@@ -110,7 +110,7 @@ static void st_client_wait_sync(struct gl_context *ctx,
     * already called when creating a fence. */
 
    if (so->fence &&
-       screen->fence_finish(screen, so->fence, timeout)) {
+       screen->fence_finish(screen, NULL, so->fence, timeout)) {
       screen->fence_reference(screen, &so->fence, NULL);
       so->b.StatusFlag = GL_TRUE;
    }