panfrost: Identify "Base vertex offset" signedness
authorAlyssa Rosenzweig <alyssa@collabora.com>
Tue, 14 Mar 2023 01:22:20 +0000 (21:22 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 14 Mar 2023 23:10:00 +0000 (23:10 +0000)
This is signed, not unsigned. We were already passing negatives and silently
relying on 2's complement and C to do the right thing. But that's silly. We
should just, actually do the right thing.

Found while struggling to debug primitive-restart-draw-mode.

v2: Update the other architectures too, including a decode_csf.c change for the
v10 incarnation of this v4-era field.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net> [v1]
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>

src/panfrost/lib/genxml/decode_csf.c
src/panfrost/lib/genxml/v10.xml
src/panfrost/lib/genxml/v4.xml
src/panfrost/lib/genxml/v5.xml
src/panfrost/lib/genxml/v6.xml
src/panfrost/lib/genxml/v7.xml
src/panfrost/lib/genxml/v9.xml

index 8afcf85..b3a2719 100644 (file)
@@ -208,7 +208,7 @@ pandecode_run_idvs(FILE *fp, struct queue_ctx *ctx, struct MALI_CEU_RUN_IDVS *I)
    if (tiler_flags.index_type)
       pandecode_log("Index offset: %u\n", cs_get_u32(ctx, 35));
 
-   pandecode_log("Vertex offset: %u\n", cs_get_u32(ctx, 36));
+   pandecode_log("Vertex offset: %d\n", cs_get_u32(ctx, 36));
    pandecode_log("Instance offset: %u\n", cs_get_u32(ctx, 37));
    pandecode_log("Tiler DCD flags2: %X\n", cs_get_u32(ctx, 38));
 
index cf878e1..a51c8ee 100644 (file)
     <field name="Layer index enable" size="1" start="0:20" type="bool"/>
     <field name="Scissor array enable" size="1" start="0:21" type="bool"/>
 
-    <field name="Base vertex offset" size="32" start="1:0" type="uint"/>
+    <field name="Base vertex offset" size="32" start="1:0" type="int"/>
     <field name="Instance offset" size="32" start="2:0" type="uint"/>
     <field name="Index count" size="32" start="3:0" type="uint"/>
   </struct>
index aecba87..8591549 100644 (file)
     <field name="High Depth Cull" size="1" start="0:17" type="bool" default="true"/>
     <field name="Primitive restart" size="2" start="0:19" type="Primitive Restart"/>
     <field name="Job Task Split" size="6" start="0:26" type="uint"/>
-    <field name="Base vertex offset" size="32" start="1:0" type="uint"/>
+    <field name="Base vertex offset" size="32" start="1:0" type="int"/>
     <field name="Primitive Restart Index" size="32" start="2:0" type="uint"/>
     <field name="Index count" size="32" start="3:0" type="uint" modifier="minus(1)"/>
     <field name="Indices" size="64" start="4:0" type="address"/>
index 01c28ce..b658a53 100644 (file)
     <field name="High Depth Cull" size="1" start="0:17" type="bool" default="true"/>
     <field name="Primitive restart" size="2" start="0:19" type="Primitive Restart"/>
     <field name="Job Task Split" size="6" start="0:26" type="uint"/>
-    <field name="Base vertex offset" size="32" start="1:0" type="uint"/>
+    <field name="Base vertex offset" size="32" start="1:0" type="int"/>
     <field name="Primitive Restart Index" size="32" start="2:0" type="uint"/>
     <field name="Index count" size="32" start="3:0" type="uint" modifier="minus(1)"/>
     <field name="Indices" size="64" start="4:0" type="address"/>
index 22c4d05..ae7412c 100644 (file)
     <field name="Secondary Shader" size="1" start="0:18" type="bool"/>
     <field name="Primitive restart" size="2" start="0:19" type="Primitive Restart"/>
     <field name="Job Task Split" size="6" start="0:26" type="uint"/>
-    <field name="Base vertex offset" size="32" start="1:0" type="uint"/>
+    <field name="Base vertex offset" size="32" start="1:0" type="int"/>
     <field name="Primitive Restart Index" size="32" start="2:0" type="uint"/>
     <field name="Index count" size="32" start="3:0" type="uint" modifier="minus(1)"/>
     <field name="Indices" size="64" start="4:0" type="address"/>
index ba1a93d..fe01f67 100644 (file)
     <field name="Secondary Shader" size="1" start="0:18" type="bool"/>
     <field name="Primitive restart" size="2" start="0:19" type="Primitive Restart"/>
     <field name="Job Task Split" size="6" start="0:26" type="uint"/>
-    <field name="Base vertex offset" size="32" start="1:0" type="uint"/>
+    <field name="Base vertex offset" size="32" start="1:0" type="int"/>
     <field name="Primitive Restart Index" size="32" start="2:0" type="uint"/>
     <field name="Index count" size="32" start="3:0" type="uint" modifier="minus(1)"/>
     <field name="Indices" size="64" start="4:0" type="address"/>
index 229d4b5..6be7d1c 100644 (file)
     <field name="Layer index enable" size="1" start="0:20" type="bool"/>
     <field name="Scissor array enable" size="1" start="0:21" type="bool"/>
 
-    <field name="Base vertex offset" size="32" start="1:0" type="uint"/>
+    <field name="Base vertex offset" size="32" start="1:0" type="int"/>
     <field name="Instance offset" size="32" start="2:0" type="uint"/>
     <field name="Index count" size="32" start="3:0" type="uint"/>
   </struct>