From: Danylo Piliaiev Date: Thu, 12 Sep 2019 11:17:28 +0000 (+0300) Subject: iris: Fix fence leak in iris_fence_flush X-Git-Tag: upstream/19.3.0~1937 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f5a8617b40ebeca312a5cb28a5ef4375f126072;p=platform%2Fupstream%2Fmesa.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 3aaa0af..2225774 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; }