<!-- I *think* this existed at least as far back as a4xx -->
<domain name="CP_COND_REG_EXEC" width="32">
+ <enum name="compare_mode">
+ <!-- use the predicate bit set by CP_REG_TEST -->
+ <value value="1" name="PRED_TEST"/>
+ <!-- compare two registers directly for equality -->
+ <value value="2" name="REG_COMPARE"/>
+ <!-- test if certain render modes are set via CP_SET_MARKER -->
+ <value value="3" name="RENDER_MODE" variants="A6XX-"/>
+ </enum>
<reg32 offset="0" name="0">
- <bitfield name="UNK28" pos="28" type="boolean"/>
+ <bitfield name="REG0" low="0" high="17" type="hex"/>
+
+ <!--
+ Note: these bits have the same meaning, and use the same
+ internal mechanism as the bits in CP_SET_DRAW_STATE.
+ When RENDER_MODE is selected, they're used as
+ a bitmask of which modes pass the test.
+ -->
+
+ <!-- RM6_BINNING -->
+ <bitfield name="BINNING" pos="20" variants="A6XX-" type="boolean"/>
+ <!-- all others -->
+ <bitfield name="GMEM" pos="21" variants="A6XX-" type="boolean"/>
+ <!-- RM6_BYPASS -->
+ <bitfield name="SYSMEM" pos="22" variants="A6XX-" type="boolean"/>
+
+ <bitfield name="MODE" low="28" high="31" type="compare_mode"/>
</reg32>
+
+ <!-- in REG_COMPARE mode, there's an extra DWORD here with REG1 -->
+
<reg32 offset="1" name="1">
<bitfield name="DWORDS" low="0" high="31" type="uint"/>
</reg32>
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);
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) */ {
/*
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) */ {
/*
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;
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);
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);