From 604d97671b663501195644f2a5f12535e88c563f Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 4 Sep 2020 16:16:48 -0700 Subject: [PATCH] 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 Part-of: --- 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 74c6010..fafa7c3 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) * -- 2.7.4