From a47375d4dabc2552e4866ba5b7d8c62d4cd4b904 Mon Sep 17 00:00:00 2001 From: "Juan A. Suarez Romero" Date: Thu, 28 Apr 2022 18:05:55 +0200 Subject: [PATCH] mesa: unref syncobj after wait_sync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before returning the wait_sync() function, the sync object must be unreferenced. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6377 Fixes: 0af7c1e385b ("mesa/st: merge the syncobj code from st into mesa") Signed-off-by: Juan A. Suarez Romero Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/syncobj.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c index 918604df71a..4a117566d75 100644 --- a/src/mesa/main/syncobj.c +++ b/src/mesa/main/syncobj.c @@ -409,14 +409,17 @@ wait_sync(struct gl_context *ctx, struct gl_sync_object *syncObj, /* Nothing needs to be done here if the driver does not support async * flushes. */ - if (!pipe->fence_server_sync) + if (!pipe->fence_server_sync) { + _mesa_unref_sync_object(ctx, syncObj, 1); return; + } /* If the fence doesn't exist, assume it's signalled. */ simple_mtx_lock(&syncObj->mutex); if (!syncObj->fence) { simple_mtx_unlock(&syncObj->mutex); syncObj->StatusFlag = GL_TRUE; + _mesa_unref_sync_object(ctx, syncObj, 1); return; }