|
|
|
@ -64,8 +64,6 @@
|
|
|
|
|
DUMP_CL(T, cl, __VA_ARGS__); \
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FILE *pandecode_dump_stream;
|
|
|
|
|
|
|
|
|
|
/* Semantic logging type.
|
|
|
|
|
*
|
|
|
|
|
* Raw: for raw messages to be printed as is.
|
|
|
|
@ -82,7 +80,7 @@ enum pandecode_log_type {
|
|
|
|
|
#define pandecode_log(...) pandecode_log_typed(PANDECODE_RAW, __VA_ARGS__)
|
|
|
|
|
#define pandecode_msg(...) pandecode_log_typed(PANDECODE_MESSAGE, __VA_ARGS__)
|
|
|
|
|
|
|
|
|
|
unsigned pandecode_indent = 0;
|
|
|
|
|
static unsigned pandecode_indent = 0;
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
pandecode_make_indent(void)
|
|
|
|
@ -154,6 +152,7 @@ pandecode_validate_buffer(mali_ptr addr, size_t sz)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if PAN_ARCH <= 5
|
|
|
|
|
/* Midgard's tiler descriptor is embedded within the
|
|
|
|
|
* larger FBD */
|
|
|
|
|
|
|
|
|
@ -162,8 +161,8 @@ pandecode_midgard_tiler_descriptor(
|
|
|
|
|
const struct mali_midgard_tiler_packed *tp,
|
|
|
|
|
const struct mali_midgard_tiler_weights_packed *wp)
|
|
|
|
|
{
|
|
|
|
|
pan_unpack(tp, MIDGARD_TILER, t);
|
|
|
|
|
DUMP_UNPACKED(MIDGARD_TILER, t, "Tiler:\n");
|
|
|
|
|
pan_unpack(tp, TILER_CONTEXT, t);
|
|
|
|
|
DUMP_UNPACKED(TILER_CONTEXT, t, "Tiler:\n");
|
|
|
|
|
|
|
|
|
|
/* We've never seen weights used in practice, but they exist */
|
|
|
|
|
pan_unpack(wp, MIDGARD_TILER_WEIGHTS, w);
|
|
|
|
@ -181,6 +180,7 @@ pandecode_midgard_tiler_descriptor(
|
|
|
|
|
if (nonzero_weights)
|
|
|
|
|
DUMP_UNPACKED(MIDGARD_TILER_WEIGHTS, w, "Tiler Weights:\n");
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Information about the framebuffer passed back for
|
|
|
|
|
* additional analysis */
|
|
|
|
@ -192,6 +192,7 @@ struct pandecode_fbd {
|
|
|
|
|
bool has_extra;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#if PAN_ARCH <= 5
|
|
|
|
|
static struct pandecode_fbd
|
|
|
|
|
pandecode_sfbd(uint64_t gpu_va, int job_no, bool is_fragment, unsigned gpu_id)
|
|
|
|
|
{
|
|
|
|
@ -226,6 +227,7 @@ pandecode_sfbd(uint64_t gpu_va, int job_no, bool is_fragment, unsigned gpu_id)
|
|
|
|
|
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
pandecode_local_storage(uint64_t gpu_va, int job_no)
|
|
|
|
@ -236,7 +238,7 @@ pandecode_local_storage(uint64_t gpu_va, int job_no)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
pandecode_render_target(uint64_t gpu_va, unsigned job_no, bool is_bifrost, unsigned gpu_id,
|
|
|
|
|
pandecode_render_target(uint64_t gpu_va, unsigned job_no, unsigned gpu_id,
|
|
|
|
|
const struct MALI_MULTI_TARGET_FRAMEBUFFER_PARAMETERS *fb)
|
|
|
|
|
{
|
|
|
|
|
pandecode_log("Color Render Targets:\n");
|
|
|
|
@ -254,6 +256,7 @@ pandecode_render_target(uint64_t gpu_va, unsigned job_no, bool is_bifrost, unsig
|
|
|
|
|
pandecode_log("\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if PAN_ARCH >= 6
|
|
|
|
|
static void
|
|
|
|
|
pandecode_sample_locations(const void *fb, int job_no)
|
|
|
|
|
{
|
|
|
|
@ -271,14 +274,15 @@ pandecode_sample_locations(const void *fb, int job_no)
|
|
|
|
|
samples[2 * i + 1] - 128);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
pandecode_dcd(const struct MALI_DRAW *p,
|
|
|
|
|
int job_no, enum mali_job_type job_type,
|
|
|
|
|
char *suffix, bool is_bifrost, unsigned gpu_id);
|
|
|
|
|
char *suffix, unsigned gpu_id);
|
|
|
|
|
|
|
|
|
|
static struct pandecode_fbd
|
|
|
|
|
pandecode_mfbd_bfr(uint64_t gpu_va, int job_no, bool is_fragment, bool is_bifrost, unsigned gpu_id)
|
|
|
|
|
pandecode_mfbd_bfr(uint64_t gpu_va, int job_no, bool is_fragment, unsigned gpu_id)
|
|
|
|
|
{
|
|
|
|
|
struct pandecode_mapped_memory *mem = pandecode_find_mapped_gpu_mem_containing(gpu_va);
|
|
|
|
|
const void *PANDECODE_PTR_VAR(fb, mem, (mali_ptr) gpu_va);
|
|
|
|
@ -286,11 +290,11 @@ pandecode_mfbd_bfr(uint64_t gpu_va, int job_no, bool is_fragment, bool is_bifros
|
|
|
|
|
|
|
|
|
|
struct pandecode_fbd info;
|
|
|
|
|
|
|
|
|
|
if (is_bifrost) {
|
|
|
|
|
#if PAN_ARCH >= 6
|
|
|
|
|
pandecode_sample_locations(fb, job_no);
|
|
|
|
|
|
|
|
|
|
pan_section_unpack(fb, MULTI_TARGET_FRAMEBUFFER, BIFROST_PARAMETERS, bparams);
|
|
|
|
|
unsigned dcd_size = pan_size(DRAW) + pan_size(DRAW_PADDING);
|
|
|
|
|
unsigned dcd_size = pan_size(DRAW);
|
|
|
|
|
struct pandecode_mapped_memory *dcdmem =
|
|
|
|
|
pandecode_find_mapped_gpu_mem_containing(bparams.frame_shader_dcds);
|
|
|
|
|
|
|
|
|
@ -298,46 +302,44 @@ pandecode_mfbd_bfr(uint64_t gpu_va, int job_no, bool is_fragment, bool is_bifros
|
|
|
|
|
const void *PANDECODE_PTR_VAR(dcd, dcdmem, bparams.frame_shader_dcds + (0 * dcd_size));
|
|
|
|
|
pan_unpack(dcd, DRAW, draw);
|
|
|
|
|
pandecode_log("Pre frame 0:\n");
|
|
|
|
|
pandecode_dcd(&draw, job_no, MALI_JOB_TYPE_FRAGMENT, "", true, gpu_id);
|
|
|
|
|
pandecode_dcd(&draw, job_no, MALI_JOB_TYPE_FRAGMENT, "", gpu_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bparams.pre_frame_1 != MALI_PRE_POST_FRAME_SHADER_MODE_NEVER) {
|
|
|
|
|
const void *PANDECODE_PTR_VAR(dcd, dcdmem, bparams.frame_shader_dcds + (1 * dcd_size));
|
|
|
|
|
pan_unpack(dcd, DRAW, draw);
|
|
|
|
|
pandecode_log("Pre frame 1:\n");
|
|
|
|
|
pandecode_dcd(&draw, job_no, MALI_JOB_TYPE_FRAGMENT, "", true, gpu_id);
|
|
|
|
|
pandecode_dcd(&draw, job_no, MALI_JOB_TYPE_FRAGMENT, "", gpu_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bparams.post_frame != MALI_PRE_POST_FRAME_SHADER_MODE_NEVER) {
|
|
|
|
|
const void *PANDECODE_PTR_VAR(dcd, dcdmem, bparams.frame_shader_dcds + (2 * dcd_size));
|
|
|
|
|
pan_unpack(dcd, DRAW, draw);
|
|
|
|
|
pandecode_log("Post frame:\n");
|
|
|
|
|
pandecode_dcd(&draw, job_no, MALI_JOB_TYPE_FRAGMENT, "", true, gpu_id);
|
|
|
|
|
}
|
|
|
|
|
pandecode_dcd(&draw, job_no, MALI_JOB_TYPE_FRAGMENT, "", gpu_id);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
pandecode_log("Multi-Target Framebuffer:\n");
|
|
|
|
|
pandecode_indent++;
|
|
|
|
|
|
|
|
|
|
if (is_bifrost) {
|
|
|
|
|
DUMP_SECTION(MULTI_TARGET_FRAMEBUFFER, BIFROST_PARAMETERS, fb, "Bifrost Params:\n");
|
|
|
|
|
} else {
|
|
|
|
|
#if PAN_ARCH <= 5
|
|
|
|
|
DUMP_SECTION(MULTI_TARGET_FRAMEBUFFER, LOCAL_STORAGE, fb, "Local Storage:\n");
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
info.width = params.width;
|
|
|
|
|
info.height = params.height;
|
|
|
|
|
info.rt_count = params.render_target_count;
|
|
|
|
|
DUMP_UNPACKED(MULTI_TARGET_FRAMEBUFFER_PARAMETERS, params, "Parameters:\n");
|
|
|
|
|
|
|
|
|
|
if (is_bifrost) {
|
|
|
|
|
#if PAN_ARCH >= 6
|
|
|
|
|
DUMP_SECTION(MULTI_TARGET_FRAMEBUFFER, BIFROST_TILER_POINTER, fb, "Tiler Pointer");
|
|
|
|
|
pan_section_unpack(fb, MULTI_TARGET_FRAMEBUFFER, BIFROST_PADDING, padding);
|
|
|
|
|
} else {
|
|
|
|
|
#else
|
|
|
|
|
const void *t = pan_section_ptr(fb, MULTI_TARGET_FRAMEBUFFER, TILER);
|
|
|
|
|
const void *w = pan_section_ptr(fb, MULTI_TARGET_FRAMEBUFFER, TILER_WEIGHTS);
|
|
|
|
|
pandecode_midgard_tiler_descriptor(t, w);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
pandecode_indent--;
|
|
|
|
|
pandecode_log("\n");
|
|
|
|
@ -357,7 +359,7 @@ pandecode_mfbd_bfr(uint64_t gpu_va, int job_no, bool is_fragment, bool is_bifros
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (is_fragment)
|
|
|
|
|
pandecode_render_target(gpu_va, job_no, is_bifrost, gpu_id, ¶ms);
|
|
|
|
|
pandecode_render_target(gpu_va, job_no, gpu_id, ¶ms);
|
|
|
|
|
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
@ -407,6 +409,7 @@ pandecode_attributes(const struct pandecode_mapped_memory *mem,
|
|
|
|
|
pandecode_log("\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if PAN_ARCH >= 6
|
|
|
|
|
/* Decodes a Bifrost blend constant. See the notes in bifrost_blend_rt */
|
|
|
|
|
|
|
|
|
|
static mali_ptr
|
|
|
|
@ -419,7 +422,7 @@ pandecode_bifrost_blend(void *descs, int job_no, int rt_no, mali_ptr frag_shader
|
|
|
|
|
|
|
|
|
|
return (frag_shader & 0xFFFFFFFF00000000ULL) | b.bifrost.internal.shader.pc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
static mali_ptr
|
|
|
|
|
pandecode_midgard_blend_mrt(void *descs, int job_no, int rt_no)
|
|
|
|
|
{
|
|
|
|
@ -427,6 +430,7 @@ pandecode_midgard_blend_mrt(void *descs, int job_no, int rt_no)
|
|
|
|
|
DUMP_UNPACKED(BLEND, b, "Blend RT %d:\n", rt_no);
|
|
|
|
|
return b.midgard.blend_shader ? (b.midgard.shader_pc & ~0xf) : 0;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
static unsigned
|
|
|
|
|
pandecode_attribute_meta(int count, mali_ptr attribute, bool varying)
|
|
|
|
@ -553,7 +557,7 @@ static unsigned shader_id = 0;
|
|
|
|
|
|
|
|
|
|
static struct midgard_disasm_stats
|
|
|
|
|
pandecode_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type,
|
|
|
|
|
bool is_bifrost, unsigned gpu_id)
|
|
|
|
|
unsigned gpu_id)
|
|
|
|
|
{
|
|
|
|
|
struct pandecode_mapped_memory *mem = pandecode_find_mapped_gpu_mem_containing(shader_ptr);
|
|
|
|
|
uint8_t *PANDECODE_PTR_VAR(code, mem, shader_ptr);
|
|
|
|
@ -568,7 +572,7 @@ pandecode_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type,
|
|
|
|
|
|
|
|
|
|
struct midgard_disasm_stats stats;
|
|
|
|
|
|
|
|
|
|
if (is_bifrost) {
|
|
|
|
|
#if PAN_ARCH >= 6
|
|
|
|
|
disassemble_bifrost(pandecode_dump_stream, code, sz, true);
|
|
|
|
|
|
|
|
|
|
/* TODO: Extend stats to Bifrost */
|
|
|
|
@ -584,10 +588,10 @@ pandecode_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type,
|
|
|
|
|
stats.bundle_count = 0;
|
|
|
|
|
stats.quadword_count = 0;
|
|
|
|
|
stats.helper_invocations = false;
|
|
|
|
|
} else {
|
|
|
|
|
#else
|
|
|
|
|
stats = disassemble_midgard(pandecode_dump_stream,
|
|
|
|
|
code, sz, gpu_id, true);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
unsigned nr_threads =
|
|
|
|
|
(stats.work_count <= 4) ? 4 :
|
|
|
|
@ -663,34 +667,35 @@ pandecode_texture_payload(mali_ptr payload,
|
|
|
|
|
pandecode_log("},\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if PAN_ARCH <= 5
|
|
|
|
|
static void
|
|
|
|
|
pandecode_texture(mali_ptr u,
|
|
|
|
|
struct pandecode_mapped_memory *tmem,
|
|
|
|
|
unsigned job_no, unsigned tex)
|
|
|
|
|
{
|
|
|
|
|
struct pandecode_mapped_memory *mapped_mem = pandecode_find_mapped_gpu_mem_containing(u);
|
|
|
|
|
const uint8_t *cl = pandecode_fetch_gpu_mem(mapped_mem, u, pan_size(MIDGARD_TEXTURE));
|
|
|
|
|
const uint8_t *cl = pandecode_fetch_gpu_mem(mapped_mem, u, pan_size(TEXTURE));
|
|
|
|
|
|
|
|
|
|
pan_unpack(cl, MIDGARD_TEXTURE, temp);
|
|
|
|
|
DUMP_UNPACKED(MIDGARD_TEXTURE, temp, "Texture:\n")
|
|
|
|
|
pan_unpack(cl, TEXTURE, temp);
|
|
|
|
|
DUMP_UNPACKED(TEXTURE, temp, "Texture:\n")
|
|
|
|
|
|
|
|
|
|
pandecode_indent++;
|
|
|
|
|
unsigned nr_samples = temp.dimension == MALI_TEXTURE_DIMENSION_3D ?
|
|
|
|
|
1 : temp.sample_count;
|
|
|
|
|
pandecode_texture_payload(u + pan_size(MIDGARD_TEXTURE),
|
|
|
|
|
pandecode_texture_payload(u + pan_size(TEXTURE),
|
|
|
|
|
temp.dimension, temp.texel_ordering, temp.manual_stride,
|
|
|
|
|
temp.levels, nr_samples, temp.array_size, mapped_mem);
|
|
|
|
|
pandecode_indent--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
static void
|
|
|
|
|
pandecode_bifrost_texture(
|
|
|
|
|
const void *cl,
|
|
|
|
|
unsigned job_no,
|
|
|
|
|
unsigned tex)
|
|
|
|
|
{
|
|
|
|
|
pan_unpack(cl, BIFROST_TEXTURE, temp);
|
|
|
|
|
DUMP_UNPACKED(BIFROST_TEXTURE, temp, "Texture:\n")
|
|
|
|
|
pan_unpack(cl, TEXTURE, temp);
|
|
|
|
|
DUMP_UNPACKED(TEXTURE, temp, "Texture:\n")
|
|
|
|
|
|
|
|
|
|
struct pandecode_mapped_memory *tmem = pandecode_find_mapped_gpu_mem_containing(temp.surfaces);
|
|
|
|
|
unsigned nr_samples = temp.dimension == MALI_TEXTURE_DIMENSION_3D ?
|
|
|
|
@ -700,13 +705,14 @@ pandecode_bifrost_texture(
|
|
|
|
|
true, temp.levels, nr_samples, temp.array_size, tmem);
|
|
|
|
|
pandecode_indent--;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
pandecode_blend_shader_disassemble(mali_ptr shader, int job_no, int job_type,
|
|
|
|
|
bool is_bifrost, unsigned gpu_id)
|
|
|
|
|
unsigned gpu_id)
|
|
|
|
|
{
|
|
|
|
|
struct midgard_disasm_stats stats =
|
|
|
|
|
pandecode_shader_disassemble(shader, job_no, job_type, is_bifrost, gpu_id);
|
|
|
|
|
pandecode_shader_disassemble(shader, job_no, job_type, gpu_id);
|
|
|
|
|
|
|
|
|
|
bool has_texture = (stats.texture_count > 0);
|
|
|
|
|
bool has_sampler = (stats.sampler_count > 0);
|
|
|
|
@ -726,7 +732,7 @@ pandecode_blend_shader_disassemble(mali_ptr shader, int job_no, int job_type,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
pandecode_textures(mali_ptr textures, unsigned texture_count, int job_no, bool is_bifrost)
|
|
|
|
|
pandecode_textures(mali_ptr textures, unsigned texture_count, int job_no)
|
|
|
|
|
{
|
|
|
|
|
struct pandecode_mapped_memory *mmem = pandecode_find_mapped_gpu_mem_containing(textures);
|
|
|
|
|
|
|
|
|
@ -736,17 +742,18 @@ pandecode_textures(mali_ptr textures, unsigned texture_count, int job_no, bool i
|
|
|
|
|
pandecode_log("Textures %"PRIx64"_%d:\n", textures, job_no);
|
|
|
|
|
pandecode_indent++;
|
|
|
|
|
|
|
|
|
|
if (is_bifrost) {
|
|
|
|
|
const void *cl = pandecode_fetch_gpu_mem(mmem,
|
|
|
|
|
textures, pan_size(BIFROST_TEXTURE) *
|
|
|
|
|
#if PAN_ARCH >= 6
|
|
|
|
|
const void *cl =
|
|
|
|
|
pandecode_fetch_gpu_mem(mmem,
|
|
|
|
|
textures,
|
|
|
|
|
pan_size(TEXTURE) *
|
|
|
|
|
texture_count);
|
|
|
|
|
|
|
|
|
|
for (unsigned tex = 0; tex < texture_count; ++tex) {
|
|
|
|
|
pandecode_bifrost_texture(cl +
|
|
|
|
|
pan_size(BIFROST_TEXTURE) * tex,
|
|
|
|
|
pandecode_bifrost_texture(cl + pan_size(TEXTURE) * tex,
|
|
|
|
|
job_no, tex);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
#else
|
|
|
|
|
mali_ptr *PANDECODE_PTR_VAR(u, mmem, textures);
|
|
|
|
|
|
|
|
|
|
for (int tex = 0; tex < texture_count; ++tex) {
|
|
|
|
@ -763,24 +770,19 @@ pandecode_textures(mali_ptr textures, unsigned texture_count, int job_no, bool i
|
|
|
|
|
if (tmem)
|
|
|
|
|
pandecode_texture(*u, tmem, job_no, tex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
pandecode_indent--;
|
|
|
|
|
pandecode_log("\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
pandecode_samplers(mali_ptr samplers, unsigned sampler_count, int job_no, bool is_bifrost)
|
|
|
|
|
pandecode_samplers(mali_ptr samplers, unsigned sampler_count, int job_no)
|
|
|
|
|
{
|
|
|
|
|
pandecode_log("Samplers %"PRIx64"_%d:\n", samplers, job_no);
|
|
|
|
|
pandecode_indent++;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < sampler_count; ++i) {
|
|
|
|
|
if (is_bifrost) {
|
|
|
|
|
DUMP_ADDR(BIFROST_SAMPLER, samplers + (pan_size(BIFROST_SAMPLER) * i), "Sampler %d:\n", i);
|
|
|
|
|
} else {
|
|
|
|
|
DUMP_ADDR(MIDGARD_SAMPLER, samplers + (pan_size(MIDGARD_SAMPLER) * i), "Sampler %d:\n", i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < sampler_count; ++i)
|
|
|
|
|
DUMP_ADDR(SAMPLER, samplers + (pan_size(SAMPLER) * i), "Sampler %d:\n", i);
|
|
|
|
|
|
|
|
|
|
pandecode_indent--;
|
|
|
|
|
pandecode_log("\n");
|
|
|
|
@ -789,24 +791,26 @@ pandecode_samplers(mali_ptr samplers, unsigned sampler_count, int job_no, bool i
|
|
|
|
|
static void
|
|
|
|
|
pandecode_dcd(const struct MALI_DRAW *p,
|
|
|
|
|
int job_no, enum mali_job_type job_type,
|
|
|
|
|
char *suffix, bool is_bifrost, unsigned gpu_id)
|
|
|
|
|
char *suffix, unsigned gpu_id)
|
|
|
|
|
{
|
|
|
|
|
struct pandecode_mapped_memory *attr_mem;
|
|
|
|
|
|
|
|
|
|
bool idvs = (job_type == MALI_JOB_TYPE_INDEXED_VERTEX);
|
|
|
|
|
|
|
|
|
|
struct pandecode_fbd fbd_info = {
|
|
|
|
|
/* Default for Bifrost */
|
|
|
|
|
.rt_count = 1
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if ((job_type != MALI_JOB_TYPE_TILER) || is_bifrost)
|
|
|
|
|
pandecode_local_storage(p->fbd & ~1, job_no);
|
|
|
|
|
#if PAN_ARCH >= 6
|
|
|
|
|
pandecode_local_storage(p->thread_storage & ~1, job_no);
|
|
|
|
|
#else
|
|
|
|
|
if (job_type != MALI_JOB_TYPE_TILER)
|
|
|
|
|
pandecode_local_storage(p->thread_storage & ~1, job_no);
|
|
|
|
|
else if (p->fbd & MALI_FBD_TAG_IS_MFBD)
|
|
|
|
|
fbd_info = pandecode_mfbd_bfr((u64) ((uintptr_t) p->fbd) & ~MALI_FBD_TAG_MASK,
|
|
|
|
|
job_no, false, false, gpu_id);
|
|
|
|
|
job_no, false, gpu_id);
|
|
|
|
|
else
|
|
|
|
|
fbd_info = pandecode_sfbd((u64) (uintptr_t) p->fbd, job_no, false, gpu_id);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
int varying_count = 0, attribute_count = 0, uniform_count = 0, uniform_buffer_count = 0;
|
|
|
|
|
int texture_count = 0, sampler_count = 0;
|
|
|
|
@ -818,10 +822,14 @@ pandecode_dcd(const struct MALI_DRAW *p,
|
|
|
|
|
pan_unpack(cl, RENDERER_STATE, state);
|
|
|
|
|
|
|
|
|
|
if (state.shader.shader & ~0xF)
|
|
|
|
|
pandecode_shader_disassemble(state.shader.shader & ~0xF, job_no, job_type, is_bifrost, gpu_id);
|
|
|
|
|
pandecode_shader_disassemble(state.shader.shader & ~0xF, job_no, job_type, gpu_id);
|
|
|
|
|
|
|
|
|
|
#if PAN_ARCH >= 6
|
|
|
|
|
bool idvs = (job_type == MALI_JOB_TYPE_INDEXED_VERTEX);
|
|
|
|
|
|
|
|
|
|
if (idvs && state.secondary_shader)
|
|
|
|
|
pandecode_shader_disassemble(state.secondary_shader, job_no, job_type, is_bifrost, gpu_id);
|
|
|
|
|
pandecode_shader_disassemble(state.secondary_shader, job_no, job_type, gpu_id);
|
|
|
|
|
#endif
|
|
|
|
|
DUMP_UNPACKED(RENDERER_STATE, state, "State:\n");
|
|
|
|
|
pandecode_indent++;
|
|
|
|
|
|
|
|
|
@ -832,19 +840,19 @@ pandecode_dcd(const struct MALI_DRAW *p,
|
|
|
|
|
sampler_count = state.shader.sampler_count;
|
|
|
|
|
uniform_buffer_count = state.properties.uniform_buffer_count;
|
|
|
|
|
|
|
|
|
|
if (is_bifrost)
|
|
|
|
|
#if PAN_ARCH >= 6
|
|
|
|
|
uniform_count = state.preload.uniform_count;
|
|
|
|
|
else
|
|
|
|
|
#else
|
|
|
|
|
uniform_count = state.properties.midgard.uniform_count;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (is_bifrost)
|
|
|
|
|
#if PAN_ARCH >= 6
|
|
|
|
|
DUMP_UNPACKED(PRELOAD, state.preload, "Preload:\n");
|
|
|
|
|
|
|
|
|
|
if (!is_bifrost) {
|
|
|
|
|
#else
|
|
|
|
|
mali_ptr shader = state.sfbd_blend_shader & ~0xF;
|
|
|
|
|
if (state.multisample_misc.sfbd_blend_shader && shader)
|
|
|
|
|
pandecode_blend_shader_disassemble(shader, job_no, job_type, false, gpu_id);
|
|
|
|
|
}
|
|
|
|
|
pandecode_blend_shader_disassemble(shader, job_no, job_type, gpu_id);
|
|
|
|
|
#endif
|
|
|
|
|
pandecode_indent--;
|
|
|
|
|
pandecode_log("\n");
|
|
|
|
|
|
|
|
|
@ -852,21 +860,21 @@ pandecode_dcd(const struct MALI_DRAW *p,
|
|
|
|
|
* per-RT descriptors */
|
|
|
|
|
|
|
|
|
|
if ((job_type == MALI_JOB_TYPE_TILER || job_type == MALI_JOB_TYPE_FRAGMENT) &&
|
|
|
|
|
(is_bifrost || p->fbd & MALI_FBD_TAG_IS_MFBD)) {
|
|
|
|
|
(PAN_ARCH >= 6 || p->thread_storage & MALI_FBD_TAG_IS_MFBD)) {
|
|
|
|
|
void* blend_base = ((void *) cl) + pan_size(RENDERER_STATE);
|
|
|
|
|
|
|
|
|
|
for (unsigned i = 0; i < fbd_info.rt_count; i++) {
|
|
|
|
|
mali_ptr shader = 0;
|
|
|
|
|
|
|
|
|
|
if (is_bifrost)
|
|
|
|
|
#if PAN_ARCH >= 6
|
|
|
|
|
shader = pandecode_bifrost_blend(blend_base, job_no, i,
|
|
|
|
|
state.shader.shader);
|
|
|
|
|
else
|
|
|
|
|
#else
|
|
|
|
|
shader = pandecode_midgard_blend_mrt(blend_base, job_no, i);
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
if (shader & ~0xF)
|
|
|
|
|
pandecode_blend_shader_disassemble(shader, job_no, job_type,
|
|
|
|
|
is_bifrost, gpu_id);
|
|
|
|
|
gpu_id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
@ -916,38 +924,10 @@ pandecode_dcd(const struct MALI_DRAW *p,
|
|
|
|
|
pandecode_msg("XXX: Uniforms referenced but not specified\n");
|
|
|
|
|
|
|
|
|
|
if (p->textures)
|
|
|
|
|
pandecode_textures(p->textures, texture_count, job_no, is_bifrost);
|
|
|
|
|
pandecode_textures(p->textures, texture_count, job_no);
|
|
|
|
|
|
|
|
|
|
if (p->samplers)
|
|
|
|
|
pandecode_samplers(p->samplers, sampler_count, job_no, is_bifrost);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
pandecode_bifrost_tiler_heap(mali_ptr gpu_va, int job_no)
|
|
|
|
|
{
|
|
|
|
|
struct pandecode_mapped_memory *mem = pandecode_find_mapped_gpu_mem_containing(gpu_va);
|
|
|
|
|
pan_unpack(PANDECODE_PTR(mem, gpu_va, void), BIFROST_TILER_HEAP, h);
|
|
|
|
|
DUMP_UNPACKED(BIFROST_TILER_HEAP, h, "Bifrost Tiler Heap:\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
pandecode_bifrost_tiler(mali_ptr gpu_va, int job_no)
|
|
|
|
|
{
|
|
|
|
|
struct pandecode_mapped_memory *mem = pandecode_find_mapped_gpu_mem_containing(gpu_va);
|
|
|
|
|
pan_unpack(PANDECODE_PTR(mem, gpu_va, void), BIFROST_TILER, t);
|
|
|
|
|
|
|
|
|
|
pandecode_bifrost_tiler_heap(t.heap, job_no);
|
|
|
|
|
|
|
|
|
|
DUMP_UNPACKED(BIFROST_TILER, t, "Bifrost Tiler:\n");
|
|
|
|
|
pandecode_indent++;
|
|
|
|
|
if (t.hierarchy_mask != 0xa &&
|
|
|
|
|
t.hierarchy_mask != 0x14 &&
|
|
|
|
|
t.hierarchy_mask != 0x28 &&
|
|
|
|
|
t.hierarchy_mask != 0x50 &&
|
|
|
|
|
t.hierarchy_mask != 0xa0)
|
|
|
|
|
pandecode_msg("XXX: Unexpected hierarchy_mask (not 0xa, 0x14, 0x28, 0x50 or 0xa0)!");
|
|
|
|
|
|
|
|
|
|
pandecode_indent--;
|
|
|
|
|
pandecode_samplers(p->samplers, sampler_count, job_no);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
@ -963,12 +943,11 @@ pandecode_primitive_size(const void *s, bool constant)
|
|
|
|
|
static void
|
|
|
|
|
pandecode_vertex_compute_geometry_job(const struct MALI_JOB_HEADER *h,
|
|
|
|
|
const struct pandecode_mapped_memory *mem,
|
|
|
|
|
mali_ptr job, int job_no, bool is_bifrost,
|
|
|
|
|
unsigned gpu_id)
|
|
|
|
|
mali_ptr job, int job_no, unsigned gpu_id)
|
|
|
|
|
{
|
|
|
|
|
struct mali_compute_job_packed *PANDECODE_PTR_VAR(p, mem, job);
|
|
|
|
|
pan_section_unpack(p, COMPUTE_JOB, DRAW, draw);
|
|
|
|
|
pandecode_dcd(&draw, job_no, h->type, "", is_bifrost, gpu_id);
|
|
|
|
|
pandecode_dcd(&draw, job_no, h->type, "", gpu_id);
|
|
|
|
|
|
|
|
|
|
pandecode_log("Vertex Job Payload:\n");
|
|
|
|
|
pandecode_indent++;
|
|
|
|
@ -979,22 +958,50 @@ pandecode_vertex_compute_geometry_job(const struct MALI_JOB_HEADER *h,
|
|
|
|
|
pandecode_log("\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if PAN_ARCH >= 6
|
|
|
|
|
static void
|
|
|
|
|
pandecode_bifrost_tiler_heap(mali_ptr gpu_va, int job_no)
|
|
|
|
|
{
|
|
|
|
|
struct pandecode_mapped_memory *mem = pandecode_find_mapped_gpu_mem_containing(gpu_va);
|
|
|
|
|
pan_unpack(PANDECODE_PTR(mem, gpu_va, void), TILER_HEAP, h);
|
|
|
|
|
DUMP_UNPACKED(TILER_HEAP, h, "Bifrost Tiler Heap:\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
pandecode_bifrost_tiler(mali_ptr gpu_va, int job_no)
|
|
|
|
|
{
|
|
|
|
|
struct pandecode_mapped_memory *mem = pandecode_find_mapped_gpu_mem_containing(gpu_va);
|
|
|
|
|
pan_unpack(PANDECODE_PTR(mem, gpu_va, void), TILER_CONTEXT, t);
|
|
|
|
|
|
|
|
|
|
pandecode_bifrost_tiler_heap(t.heap, job_no);
|
|
|
|
|
|
|
|
|
|
DUMP_UNPACKED(TILER_CONTEXT, t, "Bifrost Tiler:\n");
|
|
|
|
|
pandecode_indent++;
|
|
|
|
|
if (t.hierarchy_mask != 0xa &&
|
|
|
|
|
t.hierarchy_mask != 0x14 &&
|
|
|
|
|
t.hierarchy_mask != 0x28 &&
|
|
|
|
|
t.hierarchy_mask != 0x50 &&
|
|
|
|
|
t.hierarchy_mask != 0xa0)
|
|
|
|
|
pandecode_msg("XXX: Unexpected hierarchy_mask (not 0xa, 0x14, 0x28, 0x50 or 0xa0)!");
|
|
|
|
|
|
|
|
|
|
pandecode_indent--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
pandecode_indexed_vertex_job(const struct MALI_JOB_HEADER *h,
|
|
|
|
|
const struct pandecode_mapped_memory *mem,
|
|
|
|
|
mali_ptr job, int job_no, bool is_bifrost,
|
|
|
|
|
unsigned gpu_id)
|
|
|
|
|
mali_ptr job, int job_no, unsigned gpu_id)
|
|
|
|
|
{
|
|
|
|
|
struct mali_bifrost_indexed_vertex_job_packed *PANDECODE_PTR_VAR(p, mem, job);
|
|
|
|
|
|
|
|
|
|
pandecode_log("Vertex:\n");
|
|
|
|
|
pan_section_unpack(p, BIFROST_INDEXED_VERTEX_JOB, VERTEX_DRAW, vert_draw);
|
|
|
|
|
pandecode_dcd(&vert_draw, job_no, h->type, "", is_bifrost, gpu_id);
|
|
|
|
|
pandecode_dcd(&vert_draw, job_no, h->type, "", gpu_id);
|
|
|
|
|
DUMP_UNPACKED(DRAW, vert_draw, "Vertex Draw:\n");
|
|
|
|
|
|
|
|
|
|
pandecode_log("Fragment:\n");
|
|
|
|
|
pan_section_unpack(p, BIFROST_INDEXED_VERTEX_JOB, FRAGMENT_DRAW, frag_draw);
|
|
|
|
|
pandecode_dcd(&frag_draw, job_no, MALI_JOB_TYPE_FRAGMENT, "", is_bifrost, gpu_id);
|
|
|
|
|
pandecode_dcd(&frag_draw, job_no, MALI_JOB_TYPE_FRAGMENT, "", gpu_id);
|
|
|
|
|
DUMP_UNPACKED(DRAW, frag_draw, "Fragment Draw:\n");
|
|
|
|
|
|
|
|
|
|
pan_section_unpack(p, BIFROST_INDEXED_VERTEX_JOB, TILER, tiler_ptr);
|
|
|
|
@ -1020,68 +1027,73 @@ pandecode_tiler_job_bfr(const struct MALI_JOB_HEADER *h,
|
|
|
|
|
mali_ptr job, int job_no, unsigned gpu_id)
|
|
|
|
|
{
|
|
|
|
|
struct mali_bifrost_tiler_job_packed *PANDECODE_PTR_VAR(p, mem, job);
|
|
|
|
|
pan_section_unpack(p, BIFROST_TILER_JOB, DRAW, draw);
|
|
|
|
|
pan_section_unpack(p, BIFROST_TILER_JOB, TILER, tiler_ptr);
|
|
|
|
|
pandecode_dcd(&draw, job_no, h->type, "", true, gpu_id);
|
|
|
|
|
pan_section_unpack(p, TILER_JOB, DRAW, draw);
|
|
|
|
|
pan_section_unpack(p, TILER_JOB, TILER, tiler_ptr);
|
|
|
|
|
pandecode_dcd(&draw, job_no, h->type, "", gpu_id);
|
|
|
|
|
|
|
|
|
|
pandecode_log("Tiler Job Payload:\n");
|
|
|
|
|
pandecode_indent++;
|
|
|
|
|
pandecode_bifrost_tiler(tiler_ptr.address, job_no);
|
|
|
|
|
|
|
|
|
|
pandecode_invocation(pan_section_ptr(p, BIFROST_TILER_JOB, INVOCATION));
|
|
|
|
|
pandecode_primitive(pan_section_ptr(p, BIFROST_TILER_JOB, PRIMITIVE));
|
|
|
|
|
pandecode_invocation(pan_section_ptr(p, TILER_JOB, INVOCATION));
|
|
|
|
|
pandecode_primitive(pan_section_ptr(p, TILER_JOB, PRIMITIVE));
|
|
|
|
|
|
|
|
|
|
/* TODO: gl_PointSize on Bifrost */
|
|
|
|
|
pandecode_primitive_size(pan_section_ptr(p, BIFROST_TILER_JOB, PRIMITIVE_SIZE), true);
|
|
|
|
|
pan_section_unpack(p, BIFROST_TILER_JOB, PADDING, padding);
|
|
|
|
|
pandecode_primitive_size(pan_section_ptr(p, TILER_JOB, PRIMITIVE_SIZE), true);
|
|
|
|
|
pan_section_unpack(p, TILER_JOB, PADDING, padding);
|
|
|
|
|
DUMP_UNPACKED(DRAW, draw, "Draw:\n");
|
|
|
|
|
pandecode_indent--;
|
|
|
|
|
pandecode_log("\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
static void
|
|
|
|
|
pandecode_tiler_job_mdg(const struct MALI_JOB_HEADER *h,
|
|
|
|
|
const struct pandecode_mapped_memory *mem,
|
|
|
|
|
mali_ptr job, int job_no, unsigned gpu_id)
|
|
|
|
|
{
|
|
|
|
|
struct mali_midgard_tiler_job_packed *PANDECODE_PTR_VAR(p, mem, job);
|
|
|
|
|
pan_section_unpack(p, MIDGARD_TILER_JOB, DRAW, draw);
|
|
|
|
|
pandecode_dcd(&draw, job_no, h->type, "", false, gpu_id);
|
|
|
|
|
pan_section_unpack(p, TILER_JOB, DRAW, draw);
|
|
|
|
|
pandecode_dcd(&draw, job_no, h->type, "", gpu_id);
|
|
|
|
|
|
|
|
|
|
pandecode_log("Tiler Job Payload:\n");
|
|
|
|
|
pandecode_indent++;
|
|
|
|
|
pandecode_invocation(pan_section_ptr(p, MIDGARD_TILER_JOB, INVOCATION));
|
|
|
|
|
pandecode_primitive(pan_section_ptr(p, MIDGARD_TILER_JOB, PRIMITIVE));
|
|
|
|
|
pandecode_invocation(pan_section_ptr(p, TILER_JOB, INVOCATION));
|
|
|
|
|
pandecode_primitive(pan_section_ptr(p, TILER_JOB, PRIMITIVE));
|
|
|
|
|
DUMP_UNPACKED(DRAW, draw, "Draw:\n");
|
|
|
|
|
|
|
|
|
|
pan_section_unpack(p, MIDGARD_TILER_JOB, PRIMITIVE, primitive);
|
|
|
|
|
pandecode_primitive_size(pan_section_ptr(p, MIDGARD_TILER_JOB, PRIMITIVE_SIZE),
|
|
|
|
|
pan_section_unpack(p, TILER_JOB, PRIMITIVE, primitive);
|
|
|
|
|
pandecode_primitive_size(pan_section_ptr(p, TILER_JOB, PRIMITIVE_SIZE),
|
|
|
|
|
primitive.point_size_array_format == MALI_POINT_SIZE_ARRAY_FORMAT_NONE);
|
|
|
|
|
pandecode_indent--;
|
|
|
|
|
pandecode_log("\n");
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
pandecode_fragment_job(const struct pandecode_mapped_memory *mem,
|
|
|
|
|
mali_ptr job, int job_no,
|
|
|
|
|
bool is_bifrost, unsigned gpu_id)
|
|
|
|
|
mali_ptr job, int job_no, unsigned gpu_id)
|
|
|
|
|
{
|
|
|
|
|
struct mali_fragment_job_packed *PANDECODE_PTR_VAR(p, mem, job);
|
|
|
|
|
pan_section_unpack(p, FRAGMENT_JOB, PAYLOAD, s);
|
|
|
|
|
|
|
|
|
|
bool is_mfbd = s.framebuffer & MALI_FBD_TAG_IS_MFBD;
|
|
|
|
|
|
|
|
|
|
if (!is_mfbd && is_bifrost)
|
|
|
|
|
if (!is_mfbd && PAN_ARCH >= 6)
|
|
|
|
|
pandecode_msg("XXX: Bifrost fragment must use MFBD\n");
|
|
|
|
|
|
|
|
|
|
struct pandecode_fbd info;
|
|
|
|
|
|
|
|
|
|
#if PAN_ARCH >= 6
|
|
|
|
|
info = pandecode_mfbd_bfr(s.framebuffer & ~MALI_FBD_TAG_MASK, job_no,
|
|
|
|
|
true, gpu_id);
|
|
|
|
|
#else
|
|
|
|
|
if (is_mfbd)
|
|
|
|
|
info = pandecode_mfbd_bfr(s.framebuffer & ~MALI_FBD_TAG_MASK, job_no,
|
|
|
|
|
true, is_bifrost, gpu_id);
|
|
|
|
|
true, gpu_id);
|
|
|
|
|
else
|
|
|
|
|
info = pandecode_sfbd(s.framebuffer & ~MALI_FBD_TAG_MASK, job_no,
|
|
|
|
|
true, gpu_id);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Compute the tag for the tagged pointer. This contains the type of
|
|
|
|
|
* FBD (MFBD/SFBD), and in the case of an MFBD, information about which
|
|
|
|
@ -1136,7 +1148,7 @@ pandecode_cache_flush_job(const struct pandecode_mapped_memory *mem,
|
|
|
|
|
* are model-specific even within a particular architecture. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
pandecode_jc(mali_ptr jc_gpu_va, bool bifrost, unsigned gpu_id)
|
|
|
|
|
GENX(pandecode_jc)(mali_ptr jc_gpu_va, unsigned gpu_id)
|
|
|
|
|
{
|
|
|
|
|
pandecode_dump_file_open();
|
|
|
|
|
|
|
|
|
@ -1166,25 +1178,26 @@ pandecode_jc(mali_ptr jc_gpu_va, bool bifrost, unsigned gpu_id)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MALI_JOB_TYPE_TILER:
|
|
|
|
|
if (bifrost)
|
|
|
|
|
#if PAN_ARCH >= 6
|
|
|
|
|
pandecode_tiler_job_bfr(&h, mem, jc_gpu_va, job_no, gpu_id);
|
|
|
|
|
else
|
|
|
|
|
#else
|
|
|
|
|
pandecode_tiler_job_mdg(&h, mem, jc_gpu_va, job_no, gpu_id);
|
|
|
|
|
#endif
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MALI_JOB_TYPE_VERTEX:
|
|
|
|
|
case MALI_JOB_TYPE_COMPUTE:
|
|
|
|
|
pandecode_vertex_compute_geometry_job(&h, mem, jc_gpu_va, job_no,
|
|
|
|
|
bifrost, gpu_id);
|
|
|
|
|
pandecode_vertex_compute_geometry_job(&h, mem, jc_gpu_va, job_no, gpu_id);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
#if PAN_ARCH >= 6
|
|
|
|
|
case MALI_JOB_TYPE_INDEXED_VERTEX:
|
|
|
|
|
pandecode_indexed_vertex_job(&h, mem, jc_gpu_va, job_no,
|
|
|
|
|
bifrost, gpu_id);
|
|
|
|
|
pandecode_indexed_vertex_job(&h, mem, jc_gpu_va, job_no, gpu_id);
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
case MALI_JOB_TYPE_FRAGMENT:
|
|
|
|
|
pandecode_fragment_job(mem, jc_gpu_va, job_no, bifrost, gpu_id);
|
|
|
|
|
pandecode_fragment_job(mem, jc_gpu_va, job_no, gpu_id);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
@ -1197,7 +1210,7 @@ pandecode_jc(mali_ptr jc_gpu_va, bool bifrost, unsigned gpu_id)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
pandecode_abort_on_fault(mali_ptr jc_gpu_va)
|
|
|
|
|
GENX(pandecode_abort_on_fault)(mali_ptr jc_gpu_va)
|
|
|
|
|
{
|
|
|
|
|
mali_ptr next_job = 0;
|
|
|
|
|
|
|
|
|
|