mirror of https://gitlab.freedesktop.org/mesa/mesa
asahi: Add XML for the attachment structure
We need a lot more control over these magic structures to get Z/S attachments working correctly. This is an early start. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
This commit is contained in:
parent
8d79fdea81
commit
8e3f81ccc4
|
@ -458,4 +458,23 @@
|
|||
<field name="Local size Z" size="32" start="7:0" type="uint"/>
|
||||
<field name="Unk" size="32" start="8:0" type="hex" default="0x60000160"/>
|
||||
</struct>
|
||||
|
||||
<!--- The rest of this file is likely software defined by macOS kernel -->
|
||||
<enum name="IOGPU Attachment Type">
|
||||
<value name="Colour" value="0xA"/>
|
||||
<value name="Depth" value="0xC"/>
|
||||
</enum>
|
||||
|
||||
<struct name="IOGPU Attachment" size="24">
|
||||
<field name="Unk 0" start="0:0" size="16" default="0x100" type="hex"/>
|
||||
<field name="Address" start="0:16" size="48" type="address"/>
|
||||
<field name="Type" start="2:16" size="16" type="IOGPU Attachment Type"/>
|
||||
<field name="Unk 1" start="3:0" size="32" type="hex"/>
|
||||
<field name="Unk 2" start="4:0" size="3" type="hex"/>
|
||||
<field name="Bytes per pixel" start="4:3" size="5" type="uint"/>
|
||||
<field name="Unk 3" start="4:16" size="4" type="hex" default="0xC"/>
|
||||
<!-- Percent of total attachment space used for this attachment, expressed
|
||||
in a decimal percentage [0, 100] <field name="Percent" start="5:16" -->
|
||||
<field name="Percent" start="5:16" size="16" type="uint"/>
|
||||
</struct>
|
||||
</agxml>
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
#include "agx_state.h"
|
||||
#include "magic.h"
|
||||
|
||||
/* magic code lifted from ./demo ... a lot more reveng needed */
|
||||
/* The structures managed in this file appear to be software defined (either in
|
||||
* the macOS kernel driver or in the AGX firmware) */
|
||||
|
||||
struct cmdbuf {
|
||||
uint32_t *map;
|
||||
|
@ -229,13 +230,16 @@ demo_cmdbuf(uint64_t *buf, size_t size,
|
|||
EMIT32(cmdbuf, 0x1); // number of attachments (includes depth/stencil) stored to
|
||||
|
||||
/* A single attachment follows, depth/stencil have their own attachments */
|
||||
{
|
||||
EMIT64(cmdbuf, 0x100 | (rt0 << 16));
|
||||
EMIT32(cmdbuf, 0xa0000);
|
||||
EMIT32(cmdbuf, 0x4c000000); // 80000000 also observed, and 8c000 and.. offset into the tilebuffer I imagine
|
||||
EMIT32(cmdbuf, 0x0c001d); // C0020 also observed
|
||||
EMIT32(cmdbuf, 0x640000);
|
||||
agx_pack((cmdbuf->map + cmdbuf->offset), IOGPU_ATTACHMENT, cfg) {
|
||||
cfg.address = rt0;
|
||||
cfg.type = AGX_IOGPU_ATTACHMENT_TYPE_COLOUR;
|
||||
cfg.unk_1 = 0x4c000000;
|
||||
cfg.unk_2 = 0x5;
|
||||
cfg.bytes_per_pixel = 3;
|
||||
cfg.percent = 100;
|
||||
}
|
||||
|
||||
cmdbuf->offset += (AGX_IOGPU_ATTACHMENT_LENGTH / 4);
|
||||
}
|
||||
|
||||
static struct agx_map_header
|
||||
|
|
Loading…
Reference in New Issue