freedreno: Clean up CP_DRAW_MULTI_INDIRECT definition
authorConnor Abbott <cwabbott0@gmail.com>
Mon, 20 Jul 2020 14:55:59 +0000 (16:55 +0200)
committerConnor Abbott <cwabbott0@gmail.com>
Fri, 24 Jul 2020 17:20:44 +0000 (19:20 +0200)
Depends on the envytools changes to make the "addvariant" magic work in
order to decode this correctly, and to be able to print the register
names directly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6007>

src/freedreno/registers/adreno_pm4.xml

index 5bdca471a2d617bc5e5d25d5ecc180ad9338aa16..b33625b7fc0e73f124acd7bca8eb809f04ad701c 100644 (file)
@@ -797,7 +797,7 @@ opcode: CP_LOAD_STATE4 (30) (4 dwords)
        </enum>
        <reg32 offset="0" name="0" type="vgt_draw_initiator_a4xx"/>
        <reg32 offset="1" name="1">
-               <bitfield name="OPCODE" low="0" high="3" type="a6xx_draw_indirect_opcode"/>
+               <bitfield name="OPCODE" low="0" high="3" type="a6xx_draw_indirect_opcode" addvariant="yes"/>
                <doc>
                DST_OFF same as in CP_LOAD_STATE6 - vec4 VS const at this offset will
                be updated for each draw to {draw_id, first_vertex, first_instance, 0}
@@ -805,20 +805,17 @@ opcode: CP_LOAD_STATE4 (30) (4 dwords)
                </doc>
                <bitfield name="DST_OFF" low="8" high="21" type="hex"/>
        </reg32>
-       <reg32 offset="2" name="2">
-               <bitfield name="DRAW_COUNT" low="0" high="31" type="hex"/>
-       </reg32>
-       <doc>for opcode 2: indirect address. for opcode 4: index address</doc>
-       <reg64 offset="3" name="ADDRESS_0" type="address"/>
-       <reg32 offset="5" name="5">
-               <doc>for opcode 2: stride. for opcode 4: max_indices</doc>
-               <bitfield name="PARAM_0" low="0" high="31" type="hex"/>
-       </reg32>
-       <doc>last 3 dwords only for opcode 4</doc>
-       <reg64 offset="6" name="INDIRECT" type="address"/>
-       <reg32 offset="8" name="8">
-               <bitfield name="STRIDE" low="0" high="31" type="hex"/>
-       </reg32>
+       <reg32 offset="2" name="DRAW_COUNT" type="uint"/>
+       <stripe varset="a6xx_draw_indirect_opcode" variants="INDIRECT_OP_NORMAL">
+               <reg64 offset="3" name="INDIRECT" type="address"/>
+               <reg32 offset="5" name="STRIDE" type="uint"/>
+       </stripe>
+       <stripe varset="a6xx_draw_indirect_opcode" variants="INDIRECT_OP_INDEXED">
+               <reg64 offset="3" name="INDEX" type="address"/>
+               <reg32 offset="5" name="MAX_INDICES" type="uint"/>
+               <reg64 offset="6" name="INDIRECT" type="address"/>
+               <reg32 offset="8" name="STRIDE" type="uint"/>
+       </stripe>
 </domain>
 
 <domain name="CP_SET_DRAW_STATE" width="32" varset="chip" variants="A4XX-">