freedreno: Add INDIRECT_COUNT CP_DRAW_INDIRECT_MULTI variants
authorConnor Abbott <cwabbott0@gmail.com>
Tue, 21 Jul 2020 08:48:16 +0000 (10:48 +0200)
committerConnor Abbott <cwabbott0@gmail.com>
Fri, 24 Jul 2020 17:20:44 +0000 (19:20 +0200)
These have an indirect count which is loaded from an iova, and the
minimum is taken between the indirect and direct counts. Note, I also
had to fix gen_header.py to deal with the extra-long names we get.

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

src/freedreno/registers/adreno_pm4.xml
src/freedreno/registers/gen_header.py

index b33625b7fc0e73f124acd7bca8eb809f04ad701c..f16793be5e443e7d166595ef3a39c1e48d1c1b45 100644 (file)
@@ -794,6 +794,8 @@ opcode: CP_LOAD_STATE4 (30) (4 dwords)
        <enum name="a6xx_draw_indirect_opcode">
                <value name="INDIRECT_OP_NORMAL"  value="0x2"/>
                <value name="INDIRECT_OP_INDEXED" value="0x4"/>
+               <value name="INDIRECT_OP_INDIRECT_COUNT" value="0x6"/>
+               <value name="INDIRECT_OP_INDIRECT_COUNT_INDEXED" value="0x7"/>
        </enum>
        <reg32 offset="0" name="0" type="vgt_draw_initiator_a4xx"/>
        <reg32 offset="1" name="1">
@@ -816,6 +818,18 @@ opcode: CP_LOAD_STATE4 (30) (4 dwords)
                <reg64 offset="6" name="INDIRECT" type="address"/>
                <reg32 offset="8" name="STRIDE" type="uint"/>
        </stripe>
+       <stripe varset="a6xx_draw_indirect_opcode" variants="INDIRECT_OP_INDIRECT_COUNT">
+               <reg64 offset="3" name="INDIRECT" type="address"/>
+               <reg64 offset="5" name="INDIRECT_COUNT" type="address"/>
+               <reg32 offset="7" name="STRIDE" type="uint"/>
+       </stripe>
+       <stripe varset="a6xx_draw_indirect_opcode" variants="INDIRECT_OP_INDIRECT_COUNT_INDEXED">
+               <reg64 offset="3" name="INDEX" type="address"/>
+               <reg32 offset="5" name="MAX_INDICES" type="uint"/>
+               <reg64 offset="6" name="INDIRECT" type="address"/>
+               <reg64 offset="8" name="INDIRECT_COUNT" type="address"/>
+               <reg32 offset="10" name="STRIDE" type="uint"/>
+       </stripe>
 </domain>
 
 <domain name="CP_SET_DRAW_STATE" width="32" varset="chip" variants="A4XX-">
index 7e3bcd4f7d8a1089ba738da6d1751bee8f29dcb8..b8fa8cc0caa1ea3482bd72482af9f21b473effff 100644 (file)
@@ -93,7 +93,7 @@ class Field(object):
 
 def tab_to(name, value):
        tab_count = (68 - (len(name) & ~7)) // 8
-       if tab_count == 0:
+       if tab_count <= 0:
                tab_count = 1
        print(name + ('\t' * tab_count) + value)