Mesa (main): asahi: Identify attachment length field

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 6 13:55:48 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Date:   Mon Jul  5 20:14:22 2021 -0400

asahi: Identify attachment length field

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

---

 src/asahi/lib/cmdbuf.xml          | 2 +-
 src/gallium/drivers/asahi/magic.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/asahi/lib/cmdbuf.xml b/src/asahi/lib/cmdbuf.xml
index 0d4a9a71596..8dee43da472 100644
--- a/src/asahi/lib/cmdbuf.xml
+++ b/src/asahi/lib/cmdbuf.xml
@@ -473,7 +473,7 @@
     <field name="Total size" start="1:0" size="32" type="uint"/>
     <field name="Unk 2" start="2:0" size="32" default="0x7" type="hex"/>
     <field name="Attachment offset 1" start="8:0" size="32" type="uint"/>
-    <field name="Unk 3" start="9:0" size="32" default="0x18" type="hex"/>
+    <field name="Attachment length" start="9:0" size="32" type="uint"/>
     <field name="Attachment offset 2" start="10:0" size="32" type="uint"/>
     <field name="Unknown offset" start="11:0" size="32" type="uint"/>
     <field name="Unk 4" start="12:0" size="32" default="0x30" type="hex"/>
diff --git a/src/gallium/drivers/asahi/magic.c b/src/gallium/drivers/asahi/magic.c
index 9d588013957..3cc9efa7b9a 100644
--- a/src/gallium/drivers/asahi/magic.c
+++ b/src/gallium/drivers/asahi/magic.c
@@ -202,10 +202,11 @@ demo_cmdbuf(uint64_t *buf, size_t size,
    EMIT_ZERO_WORDS(cmdbuf, 12);
 
    unsigned offset_attachments = (cmdbuf->offset * 4);
+   unsigned nr_attachments = 1;
    EMIT32(cmdbuf, 0); // 0x758
    EMIT32(cmdbuf, 0);
    EMIT32(cmdbuf, 0);
-   EMIT32(cmdbuf, 0x1); // number of attachments (includes depth/stencil) stored to
+   EMIT32(cmdbuf, nr_attachments);
 
    /* A single attachment follows, depth/stencil have their own attachments */
    agx_pack((cmdbuf->map + cmdbuf->offset), IOGPU_ATTACHMENT, cfg) {
@@ -225,6 +226,7 @@ demo_cmdbuf(uint64_t *buf, size_t size,
       cfg.total_size = total_size;
       cfg.attachment_offset_1 = offset_attachments;
       cfg.attachment_offset_2 = offset_attachments;
+      cfg.attachment_length = nr_attachments * AGX_IOGPU_ATTACHMENT_LENGTH;
       cfg.unknown_offset = offset_unk;
       cfg.encoder = encoder_ptr;
    }



More information about the mesa-commit mailing list