Mesa (master): tu: Remove useless post-binning flushes
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jun 9 15:03:44 UTC 2020
Module: Mesa
Branch: master
Commit: dfb176a0acf2326d36d4867fc43751e1b7d0d66f
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dfb176a0acf2326d36d4867fc43751e1b7d0d66f
Author: Connor Abbott <cwabbott0 at gmail.com>
Date: Tue Jun 9 15:25:40 2020 +0200
tu: Remove useless post-binning flushes
The Vulkan blob doesn't do this, and based on my understanding of how
the blob works this is unnecessary. CACHE_FLUSH is already serialized
against all 3d commands so you don't need to wait for rendering commands
to finish before issuing it, and the subsequent wfi + WAIT_FOR_ME will
cause the CP to wait for the CACHE_FLUSH to finish, so there's also no
need to wait for it to complete. The CACHE_INVALIDATE also seems
unnecessary, and also isn't done by the blob.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4964>
---
src/freedreno/vulkan/tu_cmd_buffer.c | 34 +++++++++-------------------------
1 file changed, 9 insertions(+), 25 deletions(-)
diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c
index a1f690288d7..2ba4964fa31 100644
--- a/src/freedreno/vulkan/tu_cmd_buffer.c
+++ b/src/freedreno/vulkan/tu_cmd_buffer.c
@@ -883,29 +883,6 @@ tu6_init_hw(struct tu_cmd_buffer *cmd, struct tu_cs *cs)
tu_cs_sanity_check(cs);
}
-static void
-tu6_cache_flush(struct tu_cmd_buffer *cmd, struct tu_cs *cs)
-{
- unsigned seqno;
-
- seqno = tu6_emit_event_write(cmd, cs, RB_DONE_TS, true);
-
- tu_cs_emit_pkt7(cs, CP_WAIT_REG_MEM, 6);
- tu_cs_emit(cs, CP_WAIT_REG_MEM_0_FUNCTION(WRITE_EQ) |
- CP_WAIT_REG_MEM_0_POLL_MEMORY);
- tu_cs_emit_qw(cs, cmd->scratch_bo.iova);
- tu_cs_emit(cs, CP_WAIT_REG_MEM_3_REF(seqno));
- tu_cs_emit(cs, CP_WAIT_REG_MEM_4_MASK(~0));
- tu_cs_emit(cs, CP_WAIT_REG_MEM_5_DELAY_LOOP_CYCLES(16));
-
- seqno = tu6_emit_event_write(cmd, cs, CACHE_FLUSH_TS, true);
-
- tu_cs_emit_pkt7(cs, CP_WAIT_MEM_GTE, 4);
- tu_cs_emit(cs, CP_WAIT_MEM_GTE_0_RESERVED(0));
- tu_cs_emit_qw(cs, cmd->scratch_bo.iova);
- tu_cs_emit(cs, CP_WAIT_MEM_GTE_3_REF(seqno));
-}
-
static void
update_vsc_pipe(struct tu_cmd_buffer *cmd, struct tu_cs *cs)
{
@@ -1079,8 +1056,15 @@ tu6_emit_binning_pass(struct tu_cmd_buffer *cmd, struct tu_cs *cs)
tu_cs_emit_pkt7(cs, CP_EVENT_WRITE, 1);
tu_cs_emit(cs, UNK_2D);
- tu6_emit_event_write(cmd, cs, CACHE_INVALIDATE, false);
- tu6_cache_flush(cmd, cs);
+ /* This flush is probably required because the VSC, which produces the
+ * visibility stream, is a client of UCHE, whereas the CP needs to read the
+ * visibility stream (without caching) to do draw skipping. The
+ * WFI+WAIT_FOR_ME combination guarantees that the binning commands
+ * submitted are finished before reading the VSC regs (in
+ * emit_vsc_overflow_test) or the VSC_DATA buffer directly (implicitly as
+ * part of draws).
+ */
+ tu6_emit_event_write(cmd, cs, CACHE_FLUSH_TS, true);
tu_cs_emit_wfi(cs);
More information about the mesa-commit
mailing list