From: Connor Abbott Date: Fri, 20 Dec 2019 14:16:54 +0000 (+0100) Subject: freedreno: Document CP_COND_REG_EXEC more X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3cf1d6b8db1287bf5e8647dfef21a58ff01750c1;p=mesa.git freedreno: Document CP_COND_REG_EXEC more The vulkan blob uses the RENDER_MODE mode to condition a blit on the render mode in traces of a dEQP triangle test. Reviewed-by: Rob Clark Tested-by: Marge Bot Part-of: --- diff --git a/src/freedreno/registers/adreno_pm4.xml b/src/freedreno/registers/adreno_pm4.xml index 643d2b01b4c..3a1a0343767 100644 --- a/src/freedreno/registers/adreno_pm4.xml +++ b/src/freedreno/registers/adreno_pm4.xml @@ -1446,9 +1446,36 @@ opcode: CP_LOAD_STATE4 (30) (4 dwords) + + + + + + + + - + + + + + + + + + + + + + + + diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index c18a0bd2438..f5f3f8739f0 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -702,8 +702,8 @@ tu6_emit_tile_select(struct tu_cmd_buffer *cmd, A6XX_CP_REG_TEST_0_WAIT_FOR_ME); tu_cs_emit_pkt7(cs, CP_COND_REG_EXEC, 2); - tu_cs_emit(cs, 0x10000000); - tu_cs_emit(cs, 11); /* conditionally execute next 11 dwords */ + tu_cs_emit(cs, CP_COND_REG_EXEC_0_MODE(PRED_TEST)); + tu_cs_emit(cs, CP_COND_REG_EXEC_1_DWORDS(11)); /* if (no overflow) */ { tu_cs_emit_pkt7(cs, CP_SET_BIN_DATA5, 7); @@ -1174,8 +1174,8 @@ emit_vsc_overflow_test(struct tu_cmd_buffer *cmd, struct tu_cs *cs) A6XX_CP_REG_TEST_0_WAIT_FOR_ME); tu_cs_emit_pkt7(cs, CP_COND_REG_EXEC, 2); - tu_cs_emit(cs, 0x10000000); - tu_cs_emit(cs, 7); /* conditionally execute next 7 dwords */ + tu_cs_emit(cs, CP_COND_REG_EXEC_0_MODE(PRED_TEST)); + tu_cs_emit(cs, CP_COND_REG_EXEC_1_DWORDS(7)); /* if (b0 set) */ { /* diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c b/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c index e8f0992f310..74052baa5e1 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c @@ -462,8 +462,8 @@ emit_vsc_overflow_test(struct fd_batch *batch) A6XX_CP_REG_TEST_0_WAIT_FOR_ME); OUT_PKT7(ring, CP_COND_REG_EXEC, 2); - OUT_RING(ring, 0x10000000); - OUT_RING(ring, 7); /* conditionally execute next 7 dwords */ + OUT_RING(ring, CP_COND_REG_EXEC_0_MODE(PRED_TEST)); + OUT_RING(ring, CP_COND_REG_EXEC_1_DWORDS(7)); /* if (b0 set) */ { /* @@ -569,8 +569,8 @@ emit_conditional_ib(struct fd_batch *batch, struct fd_tile *tile, A6XX_CP_REG_TEST_0_WAIT_FOR_ME); OUT_PKT7(ring, CP_COND_REG_EXEC, 2); - OUT_RING(ring, 0x10000000); - OUT_RING(ring, 4 * count); /* conditionally execute next 4*count dwords */ + OUT_RING(ring, CP_COND_REG_EXEC_0_MODE(PRED_TEST)); + OUT_RING(ring, CP_COND_REG_EXEC_1_DWORDS(4 * count)); for (unsigned i = 0; i < count; i++) { uint32_t dwords; @@ -857,8 +857,8 @@ fd6_emit_tile_prep(struct fd_batch *batch, struct fd_tile *tile) A6XX_CP_REG_TEST_0_WAIT_FOR_ME); OUT_PKT7(ring, CP_COND_REG_EXEC, 2); - OUT_RING(ring, 0x10000000); - OUT_RING(ring, 11); /* conditionally execute next 11 dwords */ + OUT_RING(ring, CP_COND_REG_EXEC_0_MODE(PRED_TEST)); + OUT_RING(ring, CP_COND_REG_EXEC_1_DWORDS(11)); /* if (no overflow) */ { OUT_PKT7(ring, CP_SET_BIN_DATA5, 7); @@ -1333,8 +1333,8 @@ fd6_emit_tile_gmem2mem(struct fd_batch *batch, struct fd_tile *tile) A6XX_CP_REG_TEST_0_WAIT_FOR_ME); OUT_PKT7(ring, CP_COND_REG_EXEC, 2); - OUT_RING(ring, 0x10000000); - OUT_RING(ring, 2); /* conditionally execute next 2 dwords */ + OUT_RING(ring, CP_COND_REG_EXEC_0_MODE(PRED_TEST)); + OUT_RING(ring, CP_COND_REG_EXEC_1_DWORDS(2)); /* if (no overflow) */ { OUT_PKT7(ring, CP_SET_MARKER, 1);