From 8c872d46a8dd5d60832a26fe499eb39b951fb472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 19 Aug 2024 20:28:52 -0400 Subject: [PATCH] radeonsi: don't use get_cache_policy in si_launch_grid_internal_ssbos This is more correct. Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_compute_blit.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_compute_blit.c b/src/gallium/drivers/radeonsi/si_compute_blit.c index a409b091758..952d683ada0 100644 --- a/src/gallium/drivers/radeonsi/si_compute_blit.c +++ b/src/gallium/drivers/radeonsi/si_compute_blit.c @@ -185,8 +185,13 @@ void si_launch_grid_internal_ssbos(struct si_context *sctx, struct pipe_grid_inf true /* don't update bind_history to prevent unnecessary syncs later */); si_launch_grid_internal(sctx, info, shader, flags); - /* Do cache flushing at the end. */ - if (flags & SI_OP_SYNC_AFTER && get_cache_policy(sctx, coher) == L2_BYPASS) { + /* Do additional cache flushing if needed: + * - CP, CB, DB don't use L2 on GFX6-8. If the coherency is not "shader", flush L2 now. + * - CP doesn't use L2 on GFX12. + * + * Set TC_L2_dirty if not flushing now. + */ + if (flags & SI_OP_SYNC_AFTER && coher != SI_COHERENCY_SHADER && sctx->gfx_level <= GFX8) { sctx->flags |= SI_CONTEXT_WB_L2; si_mark_atom_dirty(sctx, &sctx->atoms.s.cache_flush); } else {