File 0001-radeonsi-add-a-workaround-for-hanging-compute-queues.patch of Package Mesa
From 884e65d6f2141658ab4ff88143a98ef0e610cc16 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= <marek.olsak@amd.com>
Date: Wed, 8 Jan 2025 14:05:38 -0500
Subject: [PATCH] radeonsi: add a workaround for hanging compute queues on gfx9
APUs
Fixes: 58b512ddd6e - radeonsi: execute clears at resource allocation using compute instead of gfx
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12310
---
src/gallium/drivers/radeonsi/si_pipe.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 13673399c22..62b90e3031a 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -1491,9 +1491,14 @@ static struct pipe_screen *radeonsi_screen_create_impl(struct radeon_winsys *ws,
/* Create the auxiliary context. This must be done last. */
for (unsigned i = 0; i < ARRAY_SIZE(sscreen->aux_contexts); i++) {
(void)mtx_init(&sscreen->aux_contexts[i].lock, mtx_plain | mtx_recursive);
+ /* Compute queues hang on gfx9 APUs, see:
+ * https://gitlab.freedesktop.org/mesa/mesa/-/issues/12310
+ */
+ bool is_gfx9_apu = sscreen->info.gfx_level == GFX9 && !sscreen->info.has_dedicated_vram;
bool compute = !sscreen->info.has_graphics ||
- &sscreen->aux_contexts[i] == &sscreen->aux_context.compute_resource_init ||
+ (&sscreen->aux_contexts[i] == &sscreen->aux_context.compute_resource_init &&
+ !is_gfx9_apu) ||
&sscreen->aux_contexts[i] == &sscreen->aux_context.shader_upload;
sscreen->aux_contexts[i].ctx =
si_create_context(&sscreen->b,
--
2.43.0