panfrost: Destroy panfrost_context::syncobj in the ctx desctruction path
authorBoris Brezillon <boris.brezillon@collabora.com>
Wed, 16 Nov 2022 09:48:34 +0000 (10:48 +0100)
committerMarge Bot <emma+marge@anholt.net>
Thu, 1 Dec 2022 13:52:05 +0000 (13:52 +0000)
Destroy panfrost_context::syncobj in the ctx desctruction path so we
don't leak a sync object.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19774>

src/gallium/drivers/panfrost/pan_context.c

index 97b5905796ffdea11a946604b1950ac1a18c5151..3aede0c36781c6985a530ebcf644baa3da35d135 100644 (file)
@@ -566,6 +566,7 @@ static void
 panfrost_destroy(struct pipe_context *pipe)
 {
         struct panfrost_context *panfrost = pan_context(pipe);
+        struct panfrost_device *dev = pan_device(pipe->screen);
 
         _mesa_hash_table_destroy(panfrost->writers, NULL);
 
@@ -578,6 +579,7 @@ panfrost_destroy(struct pipe_context *pipe)
         panfrost_pool_cleanup(&panfrost->descs);
         panfrost_pool_cleanup(&panfrost->shaders);
 
+        drmSyncobjDestroy(dev->fd, panfrost->syncobj);
         ralloc_free(pipe);
 }