From: Danylo Piliaiev Date: Thu, 12 Sep 2019 11:17:28 +0000 (+0300) Subject: iris: Fix fence leak in iris_fence_flush X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6f5a8617b40ebeca312a5cb28a5ef4375f126072;p=mesa.git iris: Fix fence leak in iris_fence_flush 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 Reviewed-by: Kenneth Graunke --- diff --git a/src/gallium/drivers/iris/iris_fence.c b/src/gallium/drivers/iris/iris_fence.c index 3aaa0af2281..2225774a601 100644 --- a/src/gallium/drivers/iris/iris_fence.c +++ b/src/gallium/drivers/iris/iris_fence.c @@ -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; }