freedreno: unref old fence
authorRob Clark <robclark@freedesktop.org>
Wed, 8 Jul 2015 18:48:01 +0000 (14:48 -0400)
committerRob Clark <robclark@freedesktop.org>
Fri, 10 Jul 2015 15:57:30 +0000 (11:57 -0400)
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@freedesktop.org>
src/gallium/drivers/freedreno/freedreno_context.c

index 668ef3629bf1bf5836decbf155d8413f78b6847a..127fb5f5aa04589c1c2e1b7c46510e3b05a70b98 100644 (file)
@@ -144,8 +144,10 @@ fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
 {
        fd_context_render(pctx);
 
-       if (fence)
+       if (fence) {
+               fd_screen_fence_ref(pctx->screen, fence, NULL);
                *fence = fd_fence_create(pctx);
+       }
 }
 
 void