Mesa (staging/22.0): mesa: unref syncobj after wait_sync

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 2 17:43:45 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: 9d3c4c0a7b2e090665199f934113fae6ec044535
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9d3c4c0a7b2e090665199f934113fae6ec044535

Author: Juan A. Suarez Romero <jasuarez at igalia.com>
Date:   Thu Apr 28 18:05:55 2022 +0200

mesa: unref syncobj after wait_sync

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 <jasuarez at igalia.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16242>
(cherry picked from commit a47375d4dabc2552e4866ba5b7d8c62d4cd4b904)

---

 .pick_status.json       | 2 +-
 src/mesa/main/syncobj.c | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 34eb55b21a4..bf58526db98 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -868,7 +868,7 @@
         "description": "mesa: unref syncobj after wait_sync",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "because_sha": "0af7c1e385b94c4d3610c4bff4c3af8a1afb26c6"
     },
     {
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;
    }
 



More information about the mesa-commit mailing list