From fb8a9be463fd4e8bbe6e9340f4a7e61f97018630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Mon, 31 Jan 2022 11:52:21 +0200 Subject: [PATCH] iris: invalidate L3 read only cache when VF cache is invalidated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When enabling the caching of index,vertex data in the L3 RO Cache (L3BypassDisable), we need to use L3ReadOnlyCacheInvalidationEnable to invalidate cache when buffer is modified by CPU/GPU. Ref: bspec 46314 Fixes: ed8f2c4cbee ("iris: Cache VB/IB in L3$ for Gen12") Signed-off-by: Tapani Pälli Reviewed-by: Lionel Landwerlin Part-of: (cherry picked from commit 562f7eef5b4f5a4d4fb4d93418e6373e853550fa) --- .pick_status.json | 2 +- src/gallium/drivers/iris/iris_state.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 658e4e5fdb2..bbb53d6f9f6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -58,7 +58,7 @@ "description": "iris: invalidate L3 read only cache when VF cache is invalidated", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "ed8f2c4cbee1096c67cae288b85302ffadfba2bb" }, diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 74c6010df3f..5cec1a75ed2 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -8034,6 +8034,13 @@ iris_emit_raw_pipe_control(struct iris_batch *batch, pc.DepthCacheFlushEnable = flags & PIPE_CONTROL_DEPTH_CACHE_FLUSH; pc.StateCacheInvalidationEnable = flags & PIPE_CONTROL_STATE_CACHE_INVALIDATE; +#if GFX_VER >= 12 + /* Invalidates the L3 cache part in which index & vertex data is loaded + * when VERTEX_BUFFER_STATE::L3BypassDisable is set. + */ + pc.L3ReadOnlyCacheInvalidationEnable = + flags & PIPE_CONTROL_VF_CACHE_INVALIDATE; +#endif pc.VFCacheInvalidationEnable = flags & PIPE_CONTROL_VF_CACHE_INVALIDATE; pc.ConstantCacheInvalidationEnable = flags & PIPE_CONTROL_CONST_CACHE_INVALIDATE;