freedreno/registers: teach gen_header.py about a3xx_regid
authorRob Clark <robdclark@chromium.org>
Sat, 15 Feb 2020 23:06:44 +0000 (15:06 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 18 Feb 2020 20:52:42 +0000 (20:52 +0000)
This is a builtin type (treated as uint, but with special type-aware
decoding) in envytools/cffdump.  Lets teach gen_header.py about it and
drop the enum hack in the xml so I don't have to keep deleting the enum
when I sync the xml back to the freedreno envytools tree.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3833>

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

index 7c078a091cdfb90d530c465784eaf01ebb34906a..9d0a240c2430a1741d0573b88f44ba39f1cac39c 100644 (file)
@@ -280,10 +280,6 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd">
        Common between A3xx and A4xx:
  -->
 
-<enum name="a3xx_regid">
-  <value name="REGID_UNUSED" value="0xfc"/>
-</enum>
-
 <enum name="a3xx_rop_code">
        <value name="ROP_CLEAR"         value="0"/>
        <value name="ROP_NOR"           value="1"/>
index 887656fd5d8034416f9aa796df117c385cb255ea..7e3bcd4f7d8a1089ba738da6d1751bee8f29dcb8 100644 (file)
@@ -39,7 +39,7 @@ class Field(object):
                self.shr = shr
                self.type = type
 
-               builtin_types = [ None, "boolean", "uint", "hex", "int", "fixed", "ufixed", "float", "address", "waddress" ]
+               builtin_types = [ None, "a3xx_regid", "boolean", "uint", "hex", "int", "fixed", "ufixed", "float", "address", "waddress" ]
 
                if low < 0 or low > 31:
                        raise parser.error("low attribute out of range: %d" % low)
@@ -61,7 +61,7 @@ class Field(object):
                elif self.type == "boolean":
                        type = "bool"
                        val = var_name
-               elif self.type == "uint" or self.type == "hex":
+               elif self.type == "uint" or self.type == "hex" or self.type == "a3xx_regid":
                        type = "uint32_t"
                        val = var_name
                elif self.type == "int":