Commit 6b2a7f2b authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Merge branch 'bifrost-replay-pt2' into 'develop'

Initial Bifrost decoding support

See merge request !16
parents a9ca7ce2 391f6c15
This diff is collapsed.
This diff is collapsed.
......@@ -136,7 +136,7 @@ void replay_memory_specific(struct panwrap_mapped_memory *pos, int offset, int l
for (uint32_t i = offset / sizeof(uint32_t); i < (offset + len) / sizeof(uint32_t); ++i) {
if (array[i])
panwrap_log("%s%s[%d] = %s;\n", pos->touched[i] ? "// " : "", pos->name, i, pointer_as_memory_reference(array[i]));
panwrap_log("%s%s[%d] = 0x%x;\n", pos->touched[i] ? "// " : "", pos->name, i, array[i]);
}
/* Touch what we have written */
......@@ -228,6 +228,9 @@ void panwrap_track_mmap(mali_ptr gpu_va, void *addr, size_t length,
list_del(&mem->node);
free(mem);
panwrap_msg("va %d mapped to %" PRIx64 "\n", mapped_mem->allocation_number,
mapped_mem->gpu_va);
/* Generate somewhat semantic name for the region */
snprintf(mapped_mem->name, sizeof(mapped_mem->name),
"%s_%d",
......
......@@ -25,17 +25,11 @@
* be integrated here as well in the near future, once an assembler is written
* for that platform. */
/* TODO: expose in meson so Lyude doesn't get annoyed at me for breaking
* Bifrost */
#define SHADER_MIDGARD
#ifdef SHADER_MIDGARD
/* Disassemble the shader itself. */
void
panwrap_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type)
panwrap_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type,
bool is_bifrost)
{
struct panwrap_mapped_memory *shaders = panwrap_find_mapped_gpu_mem_containing(shader_ptr);
ptrdiff_t offset = shader_ptr - shaders->gpu_va;
......@@ -43,7 +37,10 @@ panwrap_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type)
/* Disassemble it at trace time... */
panwrap_log("const char shader_src_%d[] = R\"(\n", shader_no);
DisassembleMidgard(shaders->addr + offset, shaders->length - offset);
if (is_bifrost)
DisassembleBifrost(shaders->addr + offset, shaders->length - offset);
else
DisassembleMidgard(shaders->addr + offset, shaders->length - offset);
panwrap_log(")\";\n\n");
/* ...but reassemble at runtime! */
......@@ -56,13 +53,3 @@ panwrap_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type)
type);
}
#else
void
panwrap_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type)
{
panwrap_msg("Shader decoding is not yet supported on non-Midgard platforms\n");
panwrap_msg("No disassembly performed for shader at " MALI_PTR_FMT, shader_ptr);
}
#endif
......@@ -22,6 +22,7 @@
#define SHADER_VERTEX JOB_TYPE_VERTEX
#define SHADER_FRAGMENT JOB_TYPE_TILER
void panwrap_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type);
void panwrap_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type,
bool is_bifrost);
#endif /* !PANWRAP_SHADER_H */
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