Mesa (main): panfrost: Call primconvert and u_transfer_helper destroy functions

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Aug 16 14:35:20 UTC 2021


Module: Mesa
Branch: main
Commit: b85ff566960312252f0525d51d1515d8914151ca
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b85ff566960312252f0525d51d1515d8914151ca

Author: Icecream95 <ixn at disroot.org>
Date:   Sat Aug 14 23:01:42 2021 +1200

panfrost: Call primconvert and u_transfer_helper destroy functions

Fixes a couple of small memory leaks.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12376>

---

 src/gallium/drivers/panfrost/pan_context.c  | 2 ++
 src/gallium/drivers/panfrost/pan_resource.c | 5 +++++
 src/gallium/drivers/panfrost/pan_resource.h | 2 ++
 src/gallium/drivers/panfrost/pan_screen.c   | 1 +
 4 files changed, 10 insertions(+)

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 064c8fd6c9a..5206d171cb4 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -802,6 +802,8 @@ panfrost_destroy(struct pipe_context *pipe)
         panfrost_pool_cleanup(&panfrost->descs);
         panfrost_pool_cleanup(&panfrost->shaders);
 
+        util_primconvert_destroy(panfrost->primconvert);
+
         ralloc_free(pipe);
 }
 
diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c
index 6d8af181773..6e46cf0f61d 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -1333,6 +1333,11 @@ panfrost_resource_screen_init(struct pipe_screen *pscreen)
                                         true, false,
                                         fake_rgtc, true);
 }
+void
+panfrost_resource_screen_destroy(struct pipe_screen *pscreen)
+{
+        u_transfer_helper_destroy(pscreen->transfer_helper);
+}
 
 void
 panfrost_resource_context_init(struct pipe_context *pctx)
diff --git a/src/gallium/drivers/panfrost/pan_resource.h b/src/gallium/drivers/panfrost/pan_resource.h
index 6150e161956..7ee2ef0e245 100644
--- a/src/gallium/drivers/panfrost/pan_resource.h
+++ b/src/gallium/drivers/panfrost/pan_resource.h
@@ -113,6 +113,8 @@ panfrost_get_afbc_pointers(struct panfrost_resource *rsrc,
 
 void panfrost_resource_screen_init(struct pipe_screen *screen);
 
+void panfrost_resource_screen_destroy(struct pipe_screen *screen);
+
 void panfrost_resource_context_init(struct pipe_context *pctx);
 
 /* Blitting */
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index 850d83af8be..3a55c272f77 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -694,6 +694,7 @@ panfrost_destroy_screen(struct pipe_screen *pscreen)
         struct panfrost_device *dev = pan_device(pscreen);
         struct panfrost_screen *screen = pan_screen(pscreen);
 
+        panfrost_resource_screen_destroy(pscreen);
         pan_indirect_dispatch_cleanup(dev);
         panfrost_cleanup_indirect_draw_shaders(dev);
         panfrost_pool_cleanup(&screen->indirect_draw.bin_pool);



More information about the mesa-commit mailing list