ilo: unref old fence
authorRob Clark <robclark@freedesktop.org>
Wed, 8 Jul 2015 18:51:10 +0000 (14:51 -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>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
src/gallium/drivers/ilo/ilo_context.c

index 3d5c7b636a8ddf010f281fa9808426b0edee0109..b9a16aab81d5b3bf7c64b9965c88257ea8834610 100644 (file)
@@ -62,6 +62,8 @@ ilo_flush(struct pipe_context *pipe,
          (flags & PIPE_FLUSH_END_OF_FRAME) ? "frame end" : "user request");
 
    if (f) {
+      struct pipe_screen *screen = pipe->screen;
+      screen->fence_reference(screen, f, NULL);
       *f = ilo_screen_fence_create(pipe->screen, ilo->cp->last_submitted_bo);
    }
 }