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 <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18623>
This commit is contained in:
@@ -661,23 +661,29 @@
|
||||
<!-- Conditional branching and function calls may be supported, see the
|
||||
STREAM_LINK0 struct in mesa/src/imagination/csbgen/rogue_vdm.xml for a
|
||||
probable dfinition -->
|
||||
<struct name="Stream Link" size="8">
|
||||
<struct name="VDM Stream Link" size="8">
|
||||
<field name="Target hi" size="8" start="0" type="hex"/>
|
||||
<field name="Block Type" size="3" start="29" type="VDM Block Type" default="Stream Link"/>
|
||||
<field name="Target lo" size="32" start="32" type="hex"/>
|
||||
</struct>
|
||||
|
||||
<struct name="Stream Terminate" size="8">
|
||||
<struct name="VDM Stream Terminate" size="8">
|
||||
<field name="Block Type" size="3" start="29" type="VDM Block Type" default="Stream Terminate"/>
|
||||
</struct>
|
||||
|
||||
<!-- VDM commands end -->
|
||||
|
||||
<!-- CDM commands start -->
|
||||
<enum name="CDM Block Type">
|
||||
<value name="Compute Kernel" value="0"/>
|
||||
<value name="Stream Link" value="1"/>
|
||||
<value name="Stream Terminate" value="2"/>
|
||||
</enum>
|
||||
|
||||
<!--- Command to launch a direct compute kernel -->
|
||||
<struct name="Launch" size="36">
|
||||
<field name="Command" size="32" start="0:0" type="hex" default="0x1002"/>
|
||||
<field name="Unk 1" size="29" start="0:0" type="hex" default="0x1002"/>
|
||||
<field name="Block Type" size="3" start="29" type="CDM Block Type" default="Compute Kernel"/>
|
||||
<field name="Pipeline" size="32" start="1:0" type="address"/>
|
||||
<field name="Group count X" size="32" start="2:0" type="uint"/>
|
||||
<field name="Group count Y" size="32" start="3:0" type="uint"/>
|
||||
@@ -685,7 +691,17 @@
|
||||
<field name="Local size X" size="32" start="5:0" type="uint"/>
|
||||
<field name="Local size Y" size="32" start="6:0" type="uint"/>
|
||||
<field name="Local size Z" size="32" start="7:0" type="uint"/>
|
||||
<field name="Unk" size="32" start="8:0" type="hex" default="0x60000160"/>
|
||||
<field name="Unk 2" size="32" start="8:0" type="hex" default="0x60000160"/>
|
||||
</struct>
|
||||
|
||||
<struct name="CDM Stream Link" size="8">
|
||||
<field name="Target hi" size="8" start="0" type="hex"/>
|
||||
<field name="Block Type" size="3" start="29" type="CDM Block Type" default="Stream Link"/>
|
||||
<field name="Target lo" size="32" start="32" type="hex"/>
|
||||
</struct>
|
||||
|
||||
<struct name="CDM Stream Terminate" size="8">
|
||||
<field name="Block Type" size="3" start="29" type="CDM Block Type" default="Stream Terminate"/>
|
||||
</struct>
|
||||
|
||||
<!-- CDM commands end -->
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user