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

Author: Rob Clark <[email protected]>
Date:   Sat Jan 30 11:12:36 2021 -0800

freedreno/ir3: Add ir3_screen_fini()

Move ir3_compiler_destroy() into ir3_screen_fini().  This gives us a
good place to cleanup an sync compile queue.

Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8795>

---

 src/gallium/drivers/freedreno/freedreno_screen.c | 4 ++--
 src/gallium/drivers/freedreno/ir3/ir3_gallium.c  | 9 +++++++++
 src/gallium/drivers/freedreno/ir3/ir3_gallium.h  | 1 +
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c 
b/src/gallium/drivers/freedreno/freedreno_screen.c
index 68fef4dee12..fb442996469 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -61,7 +61,7 @@
 #include "common/freedreno_uuid.h"
 
 #include "ir3/ir3_nir.h"
-#include "ir3/ir3_compiler.h"
+#include "ir3/ir3_gallium.h"
 #include "a2xx/ir2.h"
 
 static const struct debug_named_value fd_debug_options[] = {
@@ -165,7 +165,7 @@ fd_screen_destroy(struct pipe_screen *pscreen)
        u_transfer_helper_destroy(pscreen->transfer_helper);
 
        if (screen->compiler)
-               ir3_compiler_destroy(screen->compiler);
+               ir3_screen_fini(pscreen);
 
        ralloc_free(screen->live_batches);
 
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c 
b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
index 684c1a69c4f..7b041530458 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
@@ -399,3 +399,12 @@ ir3_screen_init(struct pipe_screen *pscreen)
 
        pscreen->finalize_nir = ir3_screen_finalize_nir;
 }
+
+void
+ir3_screen_fini(struct pipe_screen *pscreen)
+{
+       struct fd_screen *screen = fd_screen(pscreen);
+
+       ir3_compiler_destroy(screen->compiler);
+       screen->compiler = NULL;
+}
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_gallium.h 
b/src/gallium/drivers/freedreno/ir3/ir3_gallium.h
index 3fef6249ffa..d52c84f4ddb 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_gallium.h
+++ b/src/gallium/drivers/freedreno/ir3/ir3_gallium.h
@@ -56,6 +56,7 @@ struct shader_info * ir3_get_shader_info(struct 
ir3_shader_state *hwcso);
 
 void ir3_prog_init(struct pipe_context *pctx);
 void ir3_screen_init(struct pipe_screen *pscreen);
+void ir3_screen_fini(struct pipe_screen *pscreen);
 
 /**
  * A helper to determine if a fs input 'i' is point/sprite coord, given

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to