From 4e8a586fd3327f5b0e444a52fb05158b1058ee47 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 12 Sep 2022 22:22:56 -0400 Subject: [PATCH] asahi: Identify CDM block types Same enum as PowerVR CDM, annoyingly different from the VDM block types. Split out the stream link / terminate structs (both observed with Metal for copious amounts of compute), in preparation for decoding "properly". Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/lib/cmdbuf.xml | 24 ++++++++++++++++++++---- src/asahi/lib/decode.c | 6 +++--- src/gallium/drivers/asahi/agx_state.c | 2 +- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/asahi/lib/cmdbuf.xml b/src/asahi/lib/cmdbuf.xml index b459a1ec4a3..66aaa381e59 100644 --- a/src/asahi/lib/cmdbuf.xml +++ b/src/asahi/lib/cmdbuf.xml @@ -661,23 +661,29 @@ - + - + + + + + + - + + @@ -685,7 +691,17 @@ - + + + + + + + + + + + diff --git a/src/asahi/lib/decode.c b/src/asahi/lib/decode.c index ce84ea0d6e3..728f3a72cf0 100644 --- a/src/asahi/lib/decode.c +++ b/src/asahi/lib/decode.c @@ -550,14 +550,14 @@ agxdecode_cmd(const uint8_t *map, uint64_t *link, bool verbose) } case AGX_VDM_BLOCK_TYPE_STREAM_LINK: { - agx_unpack(agxdecode_dump_stream, map, STREAM_LINK, hdr); - DUMP_UNPACKED(STREAM_LINK, hdr, "Stream Link\n"); + agx_unpack(agxdecode_dump_stream, map, VDM_STREAM_LINK, hdr); + DUMP_UNPACKED(VDM_STREAM_LINK, hdr, "Stream Link\n"); *link = hdr.target_lo | (((uint64_t) hdr.target_hi) << 32); return STATE_LINK; } case AGX_VDM_BLOCK_TYPE_STREAM_TERMINATE: { - DUMP_CL(STREAM_TERMINATE, map, "Stream Terminate"); + DUMP_CL(VDM_STREAM_TERMINATE, map, "Stream Terminate"); return STATE_DONE; } diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index c887c8577ae..ffeb4edc346 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -1792,7 +1792,7 @@ agx_ensure_cmdbuf_has_space(struct agx_batch *batch, size_t space) struct agx_ptr T = agx_pool_alloc_aligned(&batch->pool, size, 256); /* Jump from the old command buffer to the new command buffer */ - agx_pack(batch->encoder_current, STREAM_LINK, cfg) { + agx_pack(batch->encoder_current, VDM_STREAM_LINK, cfg) { cfg.target_lo = T.gpu & BITFIELD_MASK(32); cfg.target_hi = T.gpu >> 32; }