iris: Fix fence leak in iris_fence_flush
authorDanylo Piliaiev <danylo.piliaiev@globallogic.com>
Thu, 12 Sep 2019 11:17:28 +0000 (14:17 +0300)
committerDanylo Piliaiev <danylo.piliaiev@gmail.com>
Mon, 16 Sep 2019 08:47:37 +0000 (08:47 +0000)
Documentation for pipe_context::flush states:
 "NOTE: use screen->fence_reference() (or equivalent) to transfer
  new fence ref to **fence, to ensure that previous fence is unref'd"

Hence we need to unref previous out_fence.

Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/drivers/iris/iris_fence.c

index 3aaa0af..2225774 100644 (file)
@@ -184,6 +184,8 @@ iris_fence_flush(struct pipe_context *ctx,
       iris_syncpt_reference(screen, &fence->syncpt[fence->count++],
                             ice->batches[b].last_syncpt);
    }
+
+   iris_fence_reference(ctx->screen, out_fence, NULL);
    *out_fence = fence;
 }