Mesa (master): radeonsi/compute: Free program and program. kernels on shutdown

Tom Stellard tstellar at kemper.freedesktop.org
Fri Nov 15 17:19:41 UTC 2013


Module: Mesa
Branch: master
Commit: 35dad4a1e235b2bf7fb3ecdb82aed0214db69a35
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=35dad4a1e235b2bf7fb3ecdb82aed0214db69a35

Author: Aaron Watry <awatry at gmail.com>
Date:   Wed Nov  6 16:49:22 2013 -0600

radeonsi/compute: Free program and program.kernels on shutdown

v2: Fix indentation

Reviewed-by: Tom Stellard <thomas.stellard at amd.com>

CC: "10.0" <mesa-stable at lists.freedesktop.org>

---

 src/gallium/drivers/radeonsi/radeonsi_compute.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/radeonsi_compute.c b/src/gallium/drivers/radeonsi/radeonsi_compute.c
index 49caa2c..e7bf5a4 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_compute.c
+++ b/src/gallium/drivers/radeonsi/radeonsi_compute.c
@@ -245,7 +245,21 @@ static void radeonsi_launch_grid(
 }
 
 
-static void si_delete_compute_state(struct pipe_context *ctx, void* state){}
+static void si_delete_compute_state(struct pipe_context *ctx, void* state){
+	struct si_pipe_compute *program = (struct si_pipe_compute *)state;
+
+	if (!state) {
+		return;
+	}
+
+	if (program->kernels) {
+		FREE(program->kernels);
+	}
+
+	//And then free the program itself.
+	FREE(program);
+}
+
 static void si_set_compute_resources(struct pipe_context * ctx_,
 		unsigned start, unsigned count,
 		struct pipe_surface ** surfaces) { }




More information about the mesa-commit mailing list