Mesa (main): iris: Add support for flushing the blitter (hackily)

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Feb 7 18:13:21 UTC 2022


Module: Mesa
Branch: main
Commit: 604d97671b663501195644f2a5f12535e88c563f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=604d97671b663501195644f2a5f12535e88c563f

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Sep  4 16:16:48 2020 -0700

iris: Add support for flushing the blitter (hackily)

To flush the blitter, we need to use MI_FLUSH_DW rather than the usual
PIPE_CONTROL we use on the 3D engine.  Most of our code is set up to
suggest flushes via PIPE_CONTROL commands, however, so we hackily just
emit MI_FLUSH_DW when they ask for any kind of PIPE_CONTROL flush.

Reviewed-by: Caio Oliveira <caio.oliveira at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14912>

---

 src/gallium/drivers/iris/iris_state.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index 74c6010df3f..fafa7c3a77b 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -7651,6 +7651,29 @@ iris_emit_raw_pipe_control(struct iris_batch *batch,
    enum pipe_control_flags non_lri_post_sync_flags =
       post_sync_flags & ~PIPE_CONTROL_LRI_POST_SYNC_OP;
 
+#if GFX_VER >= 12
+   if (batch->name == IRIS_BATCH_BLITTER) {
+      batch_mark_sync_for_pipe_control(batch, flags);
+      iris_batch_sync_region_start(batch);
+
+      /* The blitter doesn't actually use PIPE_CONTROL; rather it uses the
+       * MI_FLUSH_DW command.  However, all of our code is set up to flush
+       * via emitting a pipe control, so we just translate it at this point,
+       * even if it is a bit hacky.
+       */
+      iris_emit_cmd(batch, GENX(MI_FLUSH_DW), fd) {
+         fd.Address = rw_bo(bo, offset, IRIS_DOMAIN_OTHER_WRITE);
+         fd.ImmediateData = imm;
+#if GFX_VERx10 >= 125
+         /* TODO: This may not always be necessary */
+         fd.FlushCCS = true;
+#endif
+      }
+      iris_batch_sync_region_end(batch);
+      return;
+   }
+#endif
+
    /* Recursive PIPE_CONTROL workarounds --------------------------------
     * (http://knowyourmeme.com/memes/xzibit-yo-dawg)
     *



More information about the mesa-commit mailing list