Module: Mesa
Branch: staging/23.1
Commit: 3f3b84c423efbd1a85c279157e18856457c079a9
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3f3b84c423efbd1a85c279157e18856457c079a9

Author: Tapani Pälli <[email protected]>
Date:   Tue Sep 26 12:25:42 2023 +0300

iris: flush data cache when flushing HDC on GFX < 12

This matches what anv driver does.

Fixes: a969ad1d ("iris: Demote DC flush to HDC flush in cache tracker")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6314
Signed-off-by: Tapani Pälli <[email protected]>
Acked-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25399>
(cherry picked from commit c02db0d90ff749977170163479c06a87429de942)

---

 .pick_status.json                     | 2 +-
 src/gallium/drivers/iris/iris_state.c | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 627138a9260..8b77e460145 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -553,7 +553,7 @@
         "description": "iris: flush data cache when flushing HDC on GFX < 12",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "a969ad1ddfd6b0b94cc484da45293c407203e3ac"
     },
diff --git a/src/gallium/drivers/iris/iris_state.c 
b/src/gallium/drivers/iris/iris_state.c
index d65c56383e6..ce79d82070c 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -8479,6 +8479,14 @@ iris_emit_raw_pipe_control(struct iris_batch *batch,
       assert(flags & PIPE_CONTROL_WRITE_IMMEDIATE);
    }
 
+   /* Emulate a HDC flush with a full Data Cache Flush on older hardware which
+    * doesn't support the new lightweight flush.
+    */
+#if GFX_VER < 12
+      if (flags & PIPE_CONTROL_FLUSH_HDC)
+         flags |= PIPE_CONTROL_DATA_CACHE_FLUSH;
+#endif
+
    /* "Post-Sync Operation" workarounds -------------------------------- */
 
    /* Project: All / Argument: Global Snapshot Count Reset [19]

Reply via email to