From 2f18e16512f7ed08ec68f0969f4fe884ef67c4dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 4 Aug 2022 02:09:23 -0400 Subject: [PATCH] radeonsi: don't assume that TC_ACTION_ENA invalidates L1 cache on gfx9 Just got into a midnight discussion with a hw guy. TC_ACTION_ENA apparently doesn't invalidate L1, so don't clear the INV_VCACHE flag. Fixes: 4056e953fe43bd667 - radeonsi: move emit_cache_flush functions into si_gfx_cs.c Reviewed-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Dave Airlie Part-of: (cherry picked from commit 279315fd73e981f0c8876811327bcee0f0ccf7a3) --- .pick_status.json | 2 +- src/gallium/drivers/radeonsi/si_gfx_cs.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index c7cf44294b1..0ca941ced9e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -202,7 +202,7 @@ "description": "radeonsi: don't assume that TC_ACTION_ENA invalidates L1 cache on gfx9", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "4056e953fe43bd667e1812c1c7075285d24b42c2" }, diff --git a/src/gallium/drivers/radeonsi/si_gfx_cs.c b/src/gallium/drivers/radeonsi/si_gfx_cs.c index cfbda71becd..0c48240a5f0 100644 --- a/src/gallium/drivers/radeonsi/si_gfx_cs.c +++ b/src/gallium/drivers/radeonsi/si_gfx_cs.c @@ -1027,7 +1027,7 @@ void si_emit_cache_flush(struct si_context *sctx, struct radeon_cmdbuf *cs) * All operations that invalidate L2 also seem to invalidate * metadata. Volatile (VOL) and WC flushes are not listed here. * - * TC | TC_WB = writeback & invalidate L2 & L1 + * TC | TC_WB = writeback & invalidate L2 * TC | TC_WB | TC_NC = writeback & invalidate L2 for MTYPE == NC * TC_WB | TC_NC = writeback L2 for MTYPE == NC * TC | TC_NC = invalidate L2 for MTYPE == NC @@ -1046,7 +1046,7 @@ void si_emit_cache_flush(struct si_context *sctx, struct radeon_cmdbuf *cs) tc_flags = EVENT_TC_ACTION_ENA | EVENT_TC_WB_ACTION_ENA; /* Clear the flags. */ - flags &= ~(SI_CONTEXT_INV_L2 | SI_CONTEXT_WB_L2 | SI_CONTEXT_INV_VCACHE); + flags &= ~(SI_CONTEXT_INV_L2 | SI_CONTEXT_WB_L2); sctx->num_L2_invalidates++; }