summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2020-09-04 16:16:48 -0700
committerKenneth Graunke <kenneth@whitecape.org>2022-02-07 09:50:01 -0800
commit604d97671b663501195644f2a5f12535e88c563f (patch)
tree7e2c9fc47dbfc8a9ee8159e6b249b301fb831ad5
parent9c5dc4985b2cb832eea2b943eccc096f26cf3611 (diff)
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@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14912>
-rw-r--r--src/gallium/drivers/iris/iris_state.c23
1 files changed, 23 insertions, 0 deletions
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)
*