Mesa (master): vc4: unref old fence

Rob Clark robclark at kemper.freedesktop.org
Fri Jul 10 15:58:21 UTC 2015


Module: Mesa
Branch: master
Commit: ab3ba21f979605b90b2fb44482138732b42514b0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ab3ba21f979605b90b2fb44482138732b42514b0

Author: Rob Clark <robclark at freedesktop.org>
Date:   Wed Jul  8 14:51:46 2015 -0400

vc4: unref old fence

Some, but not all, state trackers will explicitly unref (and set to
NULL) the previous *fence before calling pipe->flush().  So driver
should use fence_ref() which will unref the old fence if not NULL.

Signed-off-by: Rob Clark <robclark at freedesktop.org>
Acked-by: Eric Anholt <eric at anholt.net>

---

 src/gallium/drivers/vc4/vc4_context.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/vc4/vc4_context.c b/src/gallium/drivers/vc4/vc4_context.c
index 630f8e6..316598f 100644
--- a/src/gallium/drivers/vc4/vc4_context.c
+++ b/src/gallium/drivers/vc4/vc4_context.c
@@ -103,8 +103,10 @@ vc4_pipe_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
         vc4_flush(pctx);
 
         if (fence) {
+                struct pipe_screen *screen = pctx->screen;
                 struct vc4_fence *f = vc4_fence_create(vc4->screen,
                                                        vc4->last_emit_seqno);
+                screen->fence_reference(screen, fence, NULL);
                 *fence = (struct pipe_fence_handle *)f;
         }
 }




More information about the mesa-commit mailing list