From 0755b6d3d5a13689f8fbebcc9c882ab079d3134c Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 21 Nov 2024 18:29:30 -0400 Subject: [PATCH] asahi: add XML for cdm stream link with return I don't know of any case of Apple's driver using this, but it seems to work. The stream link bit is identical to VDM so that was easy, the tricky part was the return but I bruteforced the encoding space and this is the (only) thing that worked. So add the XML. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/genxml/cmdbuf.xml | 6 ++++++ src/asahi/lib/decode.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/asahi/genxml/cmdbuf.xml b/src/asahi/genxml/cmdbuf.xml index d83a17cc343..85e5973ccbf 100644 --- a/src/asahi/genxml/cmdbuf.xml +++ b/src/asahi/genxml/cmdbuf.xml @@ -984,6 +984,7 @@ + @@ -1065,6 +1066,7 @@ + @@ -1072,6 +1074,10 @@ + + + + diff --git a/src/asahi/lib/decode.c b/src/asahi/lib/decode.c index cf44dc78e06..6ded648fbc0 100644 --- a/src/asahi/lib/decode.c +++ b/src/asahi/lib/decode.c @@ -569,7 +569,7 @@ agxdecode_cdm(struct agxdecode_ctx *ctx, const uint8_t *map, uint64_t *link, agx_unpack(agxdecode_dump_stream, map, CDM_STREAM_LINK, hdr); DUMP_UNPACKED(CDM_STREAM_LINK, hdr, "Stream Link\n"); *link = hdr.target_lo | (((uint64_t)hdr.target_hi) << 32); - return STATE_LINK; + return hdr.with_return ? STATE_CALL : STATE_LINK; } case AGX_CDM_BLOCK_TYPE_STREAM_TERMINATE: { @@ -577,6 +577,11 @@ agxdecode_cdm(struct agxdecode_ctx *ctx, const uint8_t *map, uint64_t *link, return STATE_DONE; } + case AGX_CDM_BLOCK_TYPE_STREAM_RETURN: { + DUMP_CL(CDM_STREAM_RETURN, map, "Stream Return"); + return STATE_RET; + } + case AGX_CDM_BLOCK_TYPE_BARRIER: { DUMP_CL(CDM_BARRIER, map, "Barrier"); return AGX_CDM_BARRIER_LENGTH;