asahi: Identify line stride in texture/RT XML
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sun, 30 May 2021 22:01:43 +0000 (03:31 +0530)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Jun 2021 01:31:02 +0000 (01:31 +0000)
The off-by-four is concerning.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11086>

src/asahi/lib/cmdbuf.xml
src/gallium/drivers/asahi/agx_state.c

index c1a9feb..09773c0 100644 (file)
     <field name="Flip vertical" size="1" start="54" type="bool" default="false"/>
     <field name="Unk 55" size="9" start="55" type="hex"/>
     <field name="Buffer" size="36" start="64" type="address" modifier="shr(4)"/>
-    <field name="Unk 100" size="28" start="100" type="hex"/>
+    <!-- Off by 4? -->
+    <field name="Stride" size="24" start="104" type="hex" prefix="AGX_RT_STRIDE">
+      <value name="Tiled" value="0x100000"/>
+    </field>
   </struct>
 
   <!-- Payloads follow, right-shifted by 4 because of course -->
     <field name="Unk 1" size="36" start="66" type="hex" modifier="shr(4)"/>
     <field name="Compression" size="2" start="106" type="hex"/> <!-- 0 for 64x64 tiling -->
     <field name="sRGB" size="1" start="108" type="bool"/>
-    <field name="Unk 2" size="19" start="109" type="hex"/>
+    <field name="Unk 2" size="1" start="109" type="bool"/>
+    <field name="Stride" size="18" start="110" type="hex" modifier="shr(4)"/>
   </struct>
 
   <enum name="Wrap">
index b3ce4b8..46d44b3 100644 (file)
@@ -343,7 +343,8 @@ agx_create_sampler_view(struct pipe_context *pctx,
       cfg.height = texture->height0;
       cfg.srgb = (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB);
       cfg.unk_1 = rsrc->bo->ptr.gpu;
-      cfg.unk_2 = 0x20000;
+      cfg.unk_2 = false;
+      cfg.stride = AGX_RT_STRIDE_TILED;
    }
 
    /* Initialize base object */
@@ -579,7 +580,7 @@ agx_set_framebuffer_state(struct pipe_context *pctx,
          cfg.width = state->width;
          cfg.height = state->height;
          cfg.buffer = tex->bo->ptr.gpu;
-         cfg.unk_100 = 0x1000000;
+         cfg.stride = AGX_RT_STRIDE_TILED;
       };
    }
 }