Commit 206e59d2 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Replay SFBDs better

parent ee9bcae0
......@@ -153,31 +153,59 @@ struct mali_payload_fragment {
} __attribute__((packed));
//ASSERT_SIZEOF_TYPE(struct mali_payload_fragment, 12, 16);
/* TODO: Figure out what FBD means. Cafe didn't seem to know, my guess:
* FrameBuffer Descriptor
*
* XXX: naming convention note from chai, uga = unknown GPU address
*
* XXX: here cafe seems to define all of what look to be memory addresses as 64
* bit, which -supposedly- means that it follows the PAD_PTR format that the
* ioctls use, yet I remember them telling me that native GPU structs didn't do
* that? Figure out what's really going on here
/* FBD: Fragment B[unknown] D[escriptor?]
*/
struct mali_tentative_sfbd {
u32 unknown1;
u32 flags;
u64 shader_1;
u64 zero1;
u64 heap_free_address;
u32 unknown2; // 0xB8..
u32 unknown3; // 0x10..
u32 zero2;
u32 unknown4; // 0x00EF...
u32 zero3[4];
u32 weights[8];
u32 zero5[8];
u32 clear_color_1; // RGBA8888 from glClear, actually used by hardware
u32 clear_color_2; // always equal, but unclear function?
u32 clear_color_3; // always equal, but unclear function?
u32 clear_color_4; // always equal, but unclear function?
u32 zero6[12];
u32 unknown8; // 0x02000000
u32 unknown9; // 0x00000001
u64 unknown_address_1; /* Pointing towards... a zero buffer? */
u64 unknown_address_2;
u64 shader_3;
u64 shader_4;
/* More below this, maybe */
} __attribute__((packed));
struct mali_tentative_mfbd {
u64 blah; /* XXX: what the fuck is this? */
/* This GPU address is unknown, except for the fact there's something
* executable here... */
PAD_PTR(mali_ptr ugaT);
u64 ugaT;
u32 block1[10];
u32 unknown1;
u32 flags;
u8 block2[16];
PAD_PTR(mali_ptr heap_free_address);
PAD_PTR(mali_ptr unknown2);
u64 heap_free_address;
u64 unknown2;
u32 weights[MALI_FBD_HIERARCHY_WEIGHTS];
PAD_PTR(mali_ptr unknown_gpu_addressN);
u64 unknown_gpu_addressN;
u8 block3[88];
PAD_PTR(mali_ptr unknown_gpu_address);
u64 unknown_gpu_address;
u64 unknown3;
u8 block4[40];
} __attribute__((packed));
......
......@@ -432,6 +432,47 @@ void panwrap_decode_vertex_or_tiler_job(const struct mali_job_descriptor_header
panwrap_indent--;
}
static void panwrap_replay_sfbd(const struct panwrap_mapped_memory *mem, uint64_t gpu_va, int job_no)
{
const struct mali_tentative_sfbd *PANWRAP_PTR_VAR(s, mem, (mali_ptr) gpu_va);
panwrap_log("struct mali_tentative_sfbd fbd_%d = {\n", job_no);
panwrap_indent++;
panwrap_prop("unknown1 = 0x%" PRIx32, s->unknown1);
panwrap_prop("flags = 0x%" PRIx32, s->flags);
panwrap_prop("heap_free_address = 0x%" PRIx64, s->heap_free_address);
panwrap_prop("unknown2 = 0x%" PRIx32, s->unknown2);
panwrap_prop("unknown3 = 0x%" PRIx32, s->unknown3);
panwrap_prop("unknown4 = 0x%" PRIx32, s->unknown4);
panwrap_log(".weights = { ");
panwrap_indent++;
for (int i = 0; i < MALI_FBD_HIERARCHY_WEIGHTS; ++i)
panwrap_log_cont("0x%" PRIx32 ", ", s->weights[i]);
panwrap_indent--;
panwrap_log_cont("},\n");
panwrap_prop("clear_color_1 = 0x%" PRIx32, s->clear_color_1);
panwrap_prop("clear_color_2 = 0x%" PRIx32, s->clear_color_2);
panwrap_prop("clear_color_3 = 0x%" PRIx32, s->clear_color_3);
panwrap_prop("clear_color_4 = 0x%" PRIx32, s->clear_color_4);
panwrap_prop("unknown_address_1 = 0x%" PRIx64, s->unknown_address_1);
panwrap_prop("unknown_address_2 = 0x%" PRIx64, s->unknown_address_2);
panwrap_prop("shader_1 = 0x%" PRIx64, s->shader_1);
panwrap_prop("unknown8 = 0x%" PRIx32, s->unknown8);
panwrap_prop("unknown9 = 0x%" PRIx32, s->unknown9);
panwrap_prop("shader_3 = 0x%" PRIx64, s->shader_3);
panwrap_prop("shader_4 = 0x%" PRIx64, s->shader_4);
panwrap_indent--;
panwrap_log("};\n");
}
static void panwrap_replay_fragment_job(const struct panwrap_mapped_memory *mem,
mali_ptr payload, int job_no)
{
......@@ -449,6 +490,9 @@ static void panwrap_replay_fragment_job(const struct panwrap_mapped_memory *mem,
panwrap_indent--;
panwrap_log("};\n");
TOUCH(mem, payload, *s, "fragment", job_no);
if ((s->fbd & FBD_TYPE) == MALI_SFBD)
panwrap_replay_sfbd(fbd_map, s->fbd & FBD_MASK, job_no);
}
static void panwrap_decode_fragment_job(const struct panwrap_mapped_memory *mem,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment