Module: Mesa
Branch: main
Commit: eb9da583d7faadc9c666961b6dc2b2d8ff2d6b22
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=eb9da583d7faadc9c666961b6dc2b2d8ff2d6b22

Author: Alyssa Rosenzweig <[email protected]>
Date:   Mon Feb 21 12:05:00 2022 -0500

asahi: Identify aux framebuffer data structure

Total guess at the name.

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15482>

---

 src/asahi/lib/cmdbuf.xml          |  9 +++++++++
 src/asahi/lib/decode.c            |  1 +
 src/gallium/drivers/asahi/magic.c | 12 ++++++------
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/asahi/lib/cmdbuf.xml b/src/asahi/lib/cmdbuf.xml
index 0eeb47ac2da..5cc0fc13810 100644
--- a/src/asahi/lib/cmdbuf.xml
+++ b/src/asahi/lib/cmdbuf.xml
@@ -547,6 +547,15 @@
     <field name="Percent" start="5:16" size="16" type="uint"/>
   </struct>
 
+  <struct name="IOGPU Aux Framebuffer" size="32">
+    <field name="Unk 0" start="0:0" size="32" default="0x4" type="hex"/>
+    <field name="Unk 1" start="2:0" size="16" default="0xc000" type="hex"/>
+    <field name="Z16 Unorm attachment" start="2:18" size="1" type="bool"/>
+    <field name="Width" start="4:0" size="32" type="uint"/>
+    <field name="Height" start="5:0" size="32" type="uint"/>
+    <field name="Pointer" start="6:0" size="64" type="address"/>
+  </struct>
+
   <struct name="IOGPU Clear Z/S" size="32">
     <!-- Encoded like the depth attachment -->
     <field name="Depth clear value" start="2:0" size="32" type="hex"/>
diff --git a/src/asahi/lib/decode.c b/src/asahi/lib/decode.c
index fa033c54850..f5773af66e9 100644
--- a/src/asahi/lib/decode.c
+++ b/src/asahi/lib/decode.c
@@ -443,6 +443,7 @@ agxdecode_cmdstream(unsigned cmdbuf_handle, unsigned 
map_handle, bool verbose)
    DUMP_UNPACKED(IOGPU_HEADER, cmd, "IOGPU Header\n");
    assert(cmd.attachment_offset_1 == cmd.attachment_offset_2);
 
+   DUMP_CL(IOGPU_AUX_FRAMEBUFFER, ((uint32_t *) cmdbuf->ptr.cpu) + 220, "Aux 
Framebuffer");
    DUMP_CL(IOGPU_CLEAR_Z_S, ((uint32_t *) cmdbuf->ptr.cpu) + 276, "Clear Z/S");
 
    uint32_t *attachments = (uint32_t *) ((uint8_t *) cmdbuf->ptr.cpu + 
cmd.attachment_offset_1);
diff --git a/src/gallium/drivers/asahi/magic.c 
b/src/gallium/drivers/asahi/magic.c
index 0452f2db064..a8c6caba573 100644
--- a/src/gallium/drivers/asahi/magic.c
+++ b/src/gallium/drivers/asahi/magic.c
@@ -89,12 +89,12 @@ demo_cmdbuf(uint64_t *buf, size_t size,
    map[168] = unk_buffer & 0xFFFFFFFF;
    map[169] = unk_buffer >> 32;
 
-   map[220] = 4;
-   map[222] = 0xc000;
-   map[224] = width;
-   map[225] = height;
-   map[226] = unk_buffer_2 & 0xFFFFFFFF;
-   map[227] = unk_buffer_2 >> 32;
+   agx_pack(map + 220, IOGPU_AUX_FRAMEBUFFER, cfg) {
+      cfg.width = width;
+      cfg.height = height;
+      cfg.z16_unorm_attachment = false;
+      cfg.pointer = unk_buffer_2;
+   }
 
    agx_pack(map + 276, IOGPU_CLEAR_Z_S, cfg) {
       cfg.depth_clear_value = fui(1.0); // 32-bit float

Reply via email to