mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 13:20:14 +01:00
panfrost: Prepare pandecode to per-gen XML
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12935>
This commit is contained in:
parent
502b942944
commit
de13fdc251
7 changed files with 284 additions and 218 deletions
|
|
@ -643,10 +643,10 @@ panfrost_batch_submit_ioctl(struct panfrost_batch *batch,
|
||||||
INT64_MAX, 0, NULL);
|
INT64_MAX, 0, NULL);
|
||||||
|
|
||||||
if (dev->debug & PAN_DBG_TRACE)
|
if (dev->debug & PAN_DBG_TRACE)
|
||||||
pandecode_jc(submit.jc, pan_is_bifrost(dev), dev->gpu_id);
|
pandecode_jc(submit.jc, dev->gpu_id);
|
||||||
|
|
||||||
if (dev->debug & PAN_DBG_SYNC)
|
if (dev->debug & PAN_DBG_SYNC)
|
||||||
pandecode_abort_on_fault(submit.jc);
|
pandecode_abort_on_fault(submit.jc, dev->gpu_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,6 @@
|
||||||
DUMP_CL(T, cl, __VA_ARGS__); \
|
DUMP_CL(T, cl, __VA_ARGS__); \
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *pandecode_dump_stream;
|
|
||||||
|
|
||||||
/* Semantic logging type.
|
/* Semantic logging type.
|
||||||
*
|
*
|
||||||
* Raw: for raw messages to be printed as is.
|
* 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_log(...) pandecode_log_typed(PANDECODE_RAW, __VA_ARGS__)
|
||||||
#define pandecode_msg(...) pandecode_log_typed(PANDECODE_MESSAGE, __VA_ARGS__)
|
#define pandecode_msg(...) pandecode_log_typed(PANDECODE_MESSAGE, __VA_ARGS__)
|
||||||
|
|
||||||
unsigned pandecode_indent = 0;
|
static unsigned pandecode_indent = 0;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pandecode_make_indent(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
|
/* Midgard's tiler descriptor is embedded within the
|
||||||
* larger FBD */
|
* larger FBD */
|
||||||
|
|
||||||
|
|
@ -162,8 +161,8 @@ pandecode_midgard_tiler_descriptor(
|
||||||
const struct mali_midgard_tiler_packed *tp,
|
const struct mali_midgard_tiler_packed *tp,
|
||||||
const struct mali_midgard_tiler_weights_packed *wp)
|
const struct mali_midgard_tiler_weights_packed *wp)
|
||||||
{
|
{
|
||||||
pan_unpack(tp, MIDGARD_TILER, t);
|
pan_unpack(tp, TILER_CONTEXT, t);
|
||||||
DUMP_UNPACKED(MIDGARD_TILER, t, "Tiler:\n");
|
DUMP_UNPACKED(TILER_CONTEXT, t, "Tiler:\n");
|
||||||
|
|
||||||
/* We've never seen weights used in practice, but they exist */
|
/* We've never seen weights used in practice, but they exist */
|
||||||
pan_unpack(wp, MIDGARD_TILER_WEIGHTS, w);
|
pan_unpack(wp, MIDGARD_TILER_WEIGHTS, w);
|
||||||
|
|
@ -181,6 +180,7 @@ pandecode_midgard_tiler_descriptor(
|
||||||
if (nonzero_weights)
|
if (nonzero_weights)
|
||||||
DUMP_UNPACKED(MIDGARD_TILER_WEIGHTS, w, "Tiler Weights:\n");
|
DUMP_UNPACKED(MIDGARD_TILER_WEIGHTS, w, "Tiler Weights:\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Information about the framebuffer passed back for
|
/* Information about the framebuffer passed back for
|
||||||
* additional analysis */
|
* additional analysis */
|
||||||
|
|
@ -192,6 +192,7 @@ struct pandecode_fbd {
|
||||||
bool has_extra;
|
bool has_extra;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if PAN_ARCH <= 5
|
||||||
static struct pandecode_fbd
|
static struct pandecode_fbd
|
||||||
pandecode_sfbd(uint64_t gpu_va, int job_no, bool is_fragment, unsigned gpu_id)
|
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;
|
return info;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pandecode_local_storage(uint64_t gpu_va, int job_no)
|
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
|
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)
|
const struct MALI_MULTI_TARGET_FRAMEBUFFER_PARAMETERS *fb)
|
||||||
{
|
{
|
||||||
pandecode_log("Color Render Targets:\n");
|
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");
|
pandecode_log("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PAN_ARCH >= 6
|
||||||
static void
|
static void
|
||||||
pandecode_sample_locations(const void *fb, int job_no)
|
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);
|
samples[2 * i + 1] - 128);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pandecode_dcd(const struct MALI_DRAW *p,
|
pandecode_dcd(const struct MALI_DRAW *p,
|
||||||
int job_no, enum mali_job_type job_type,
|
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
|
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);
|
struct pandecode_mapped_memory *mem = pandecode_find_mapped_gpu_mem_containing(gpu_va);
|
||||||
const void *PANDECODE_PTR_VAR(fb, mem, (mali_ptr) gpu_va);
|
const void *PANDECODE_PTR_VAR(fb, mem, (mali_ptr) gpu_va);
|
||||||
|
|
@ -286,58 +290,56 @@ pandecode_mfbd_bfr(uint64_t gpu_va, int job_no, bool is_fragment, bool is_bifros
|
||||||
|
|
||||||
struct pandecode_fbd info;
|
struct pandecode_fbd info;
|
||||||
|
|
||||||
if (is_bifrost) {
|
#if PAN_ARCH >= 6
|
||||||
pandecode_sample_locations(fb, job_no);
|
pandecode_sample_locations(fb, job_no);
|
||||||
|
|
||||||
pan_section_unpack(fb, MULTI_TARGET_FRAMEBUFFER, BIFROST_PARAMETERS, bparams);
|
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 =
|
struct pandecode_mapped_memory *dcdmem =
|
||||||
pandecode_find_mapped_gpu_mem_containing(bparams.frame_shader_dcds);
|
pandecode_find_mapped_gpu_mem_containing(bparams.frame_shader_dcds);
|
||||||
|
|
||||||
if (bparams.pre_frame_0 != MALI_PRE_POST_FRAME_SHADER_MODE_NEVER) {
|
if (bparams.pre_frame_0 != MALI_PRE_POST_FRAME_SHADER_MODE_NEVER) {
|
||||||
const void *PANDECODE_PTR_VAR(dcd, dcdmem, bparams.frame_shader_dcds + (0 * dcd_size));
|
const void *PANDECODE_PTR_VAR(dcd, dcdmem, bparams.frame_shader_dcds + (0 * dcd_size));
|
||||||
pan_unpack(dcd, DRAW, draw);
|
pan_unpack(dcd, DRAW, draw);
|
||||||
pandecode_log("Pre frame 0:\n");
|
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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, "", 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, "", gpu_id);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
pandecode_log("Multi-Target Framebuffer:\n");
|
pandecode_log("Multi-Target Framebuffer:\n");
|
||||||
pandecode_indent++;
|
pandecode_indent++;
|
||||||
|
|
||||||
if (is_bifrost) {
|
#if PAN_ARCH <= 5
|
||||||
DUMP_SECTION(MULTI_TARGET_FRAMEBUFFER, BIFROST_PARAMETERS, fb, "Bifrost Params:\n");
|
DUMP_SECTION(MULTI_TARGET_FRAMEBUFFER, LOCAL_STORAGE, fb, "Local Storage:\n");
|
||||||
} else {
|
#endif
|
||||||
DUMP_SECTION(MULTI_TARGET_FRAMEBUFFER, LOCAL_STORAGE, fb, "Local Storage:\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
info.width = params.width;
|
info.width = params.width;
|
||||||
info.height = params.height;
|
info.height = params.height;
|
||||||
info.rt_count = params.render_target_count;
|
info.rt_count = params.render_target_count;
|
||||||
DUMP_UNPACKED(MULTI_TARGET_FRAMEBUFFER_PARAMETERS, params, "Parameters:\n");
|
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");
|
DUMP_SECTION(MULTI_TARGET_FRAMEBUFFER, BIFROST_TILER_POINTER, fb, "Tiler Pointer");
|
||||||
pan_section_unpack(fb, MULTI_TARGET_FRAMEBUFFER, BIFROST_PADDING, padding);
|
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 *t = pan_section_ptr(fb, MULTI_TARGET_FRAMEBUFFER, TILER);
|
||||||
const void *w = pan_section_ptr(fb, MULTI_TARGET_FRAMEBUFFER, TILER_WEIGHTS);
|
const void *w = pan_section_ptr(fb, MULTI_TARGET_FRAMEBUFFER, TILER_WEIGHTS);
|
||||||
pandecode_midgard_tiler_descriptor(t, w);
|
pandecode_midgard_tiler_descriptor(t, w);
|
||||||
}
|
#endif
|
||||||
|
|
||||||
pandecode_indent--;
|
pandecode_indent--;
|
||||||
pandecode_log("\n");
|
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)
|
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;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
@ -407,6 +409,7 @@ pandecode_attributes(const struct pandecode_mapped_memory *mem,
|
||||||
pandecode_log("\n");
|
pandecode_log("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PAN_ARCH >= 6
|
||||||
/* Decodes a Bifrost blend constant. See the notes in bifrost_blend_rt */
|
/* Decodes a Bifrost blend constant. See the notes in bifrost_blend_rt */
|
||||||
|
|
||||||
static mali_ptr
|
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;
|
return (frag_shader & 0xFFFFFFFF00000000ULL) | b.bifrost.internal.shader.pc;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
static mali_ptr
|
static mali_ptr
|
||||||
pandecode_midgard_blend_mrt(void *descs, int job_no, int rt_no)
|
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);
|
DUMP_UNPACKED(BLEND, b, "Blend RT %d:\n", rt_no);
|
||||||
return b.midgard.blend_shader ? (b.midgard.shader_pc & ~0xf) : 0;
|
return b.midgard.blend_shader ? (b.midgard.shader_pc & ~0xf) : 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static unsigned
|
static unsigned
|
||||||
pandecode_attribute_meta(int count, mali_ptr attribute, bool varying)
|
pandecode_attribute_meta(int count, mali_ptr attribute, bool varying)
|
||||||
|
|
@ -553,7 +557,7 @@ static unsigned shader_id = 0;
|
||||||
|
|
||||||
static struct midgard_disasm_stats
|
static struct midgard_disasm_stats
|
||||||
pandecode_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type,
|
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);
|
struct pandecode_mapped_memory *mem = pandecode_find_mapped_gpu_mem_containing(shader_ptr);
|
||||||
uint8_t *PANDECODE_PTR_VAR(code, mem, shader_ptr);
|
uint8_t *PANDECODE_PTR_VAR(code, mem, shader_ptr);
|
||||||
|
|
@ -568,26 +572,26 @@ pandecode_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type,
|
||||||
|
|
||||||
struct midgard_disasm_stats stats;
|
struct midgard_disasm_stats stats;
|
||||||
|
|
||||||
if (is_bifrost) {
|
#if PAN_ARCH >= 6
|
||||||
disassemble_bifrost(pandecode_dump_stream, code, sz, true);
|
disassemble_bifrost(pandecode_dump_stream, code, sz, true);
|
||||||
|
|
||||||
/* TODO: Extend stats to Bifrost */
|
/* TODO: Extend stats to Bifrost */
|
||||||
stats.texture_count = -128;
|
stats.texture_count = -128;
|
||||||
stats.sampler_count = -128;
|
stats.sampler_count = -128;
|
||||||
stats.attribute_count = -128;
|
stats.attribute_count = -128;
|
||||||
stats.varying_count = -128;
|
stats.varying_count = -128;
|
||||||
stats.uniform_count = -128;
|
stats.uniform_count = -128;
|
||||||
stats.uniform_buffer_count = -128;
|
stats.uniform_buffer_count = -128;
|
||||||
stats.work_count = -128;
|
stats.work_count = -128;
|
||||||
|
|
||||||
stats.instruction_count = 0;
|
stats.instruction_count = 0;
|
||||||
stats.bundle_count = 0;
|
stats.bundle_count = 0;
|
||||||
stats.quadword_count = 0;
|
stats.quadword_count = 0;
|
||||||
stats.helper_invocations = false;
|
stats.helper_invocations = false;
|
||||||
} else {
|
#else
|
||||||
stats = disassemble_midgard(pandecode_dump_stream,
|
stats = disassemble_midgard(pandecode_dump_stream,
|
||||||
code, sz, gpu_id, true);
|
code, sz, gpu_id, true);
|
||||||
}
|
#endif
|
||||||
|
|
||||||
unsigned nr_threads =
|
unsigned nr_threads =
|
||||||
(stats.work_count <= 4) ? 4 :
|
(stats.work_count <= 4) ? 4 :
|
||||||
|
|
@ -663,34 +667,35 @@ pandecode_texture_payload(mali_ptr payload,
|
||||||
pandecode_log("},\n");
|
pandecode_log("},\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PAN_ARCH <= 5
|
||||||
static void
|
static void
|
||||||
pandecode_texture(mali_ptr u,
|
pandecode_texture(mali_ptr u,
|
||||||
struct pandecode_mapped_memory *tmem,
|
struct pandecode_mapped_memory *tmem,
|
||||||
unsigned job_no, unsigned tex)
|
unsigned job_no, unsigned tex)
|
||||||
{
|
{
|
||||||
struct pandecode_mapped_memory *mapped_mem = pandecode_find_mapped_gpu_mem_containing(u);
|
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);
|
pan_unpack(cl, TEXTURE, temp);
|
||||||
DUMP_UNPACKED(MIDGARD_TEXTURE, temp, "Texture:\n")
|
DUMP_UNPACKED(TEXTURE, temp, "Texture:\n")
|
||||||
|
|
||||||
pandecode_indent++;
|
pandecode_indent++;
|
||||||
unsigned nr_samples = temp.dimension == MALI_TEXTURE_DIMENSION_3D ?
|
unsigned nr_samples = temp.dimension == MALI_TEXTURE_DIMENSION_3D ?
|
||||||
1 : temp.sample_count;
|
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.dimension, temp.texel_ordering, temp.manual_stride,
|
||||||
temp.levels, nr_samples, temp.array_size, mapped_mem);
|
temp.levels, nr_samples, temp.array_size, mapped_mem);
|
||||||
pandecode_indent--;
|
pandecode_indent--;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
static void
|
static void
|
||||||
pandecode_bifrost_texture(
|
pandecode_bifrost_texture(
|
||||||
const void *cl,
|
const void *cl,
|
||||||
unsigned job_no,
|
unsigned job_no,
|
||||||
unsigned tex)
|
unsigned tex)
|
||||||
{
|
{
|
||||||
pan_unpack(cl, BIFROST_TEXTURE, temp);
|
pan_unpack(cl, TEXTURE, temp);
|
||||||
DUMP_UNPACKED(BIFROST_TEXTURE, temp, "Texture:\n")
|
DUMP_UNPACKED(TEXTURE, temp, "Texture:\n")
|
||||||
|
|
||||||
struct pandecode_mapped_memory *tmem = pandecode_find_mapped_gpu_mem_containing(temp.surfaces);
|
struct pandecode_mapped_memory *tmem = pandecode_find_mapped_gpu_mem_containing(temp.surfaces);
|
||||||
unsigned nr_samples = temp.dimension == MALI_TEXTURE_DIMENSION_3D ?
|
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);
|
true, temp.levels, nr_samples, temp.array_size, tmem);
|
||||||
pandecode_indent--;
|
pandecode_indent--;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pandecode_blend_shader_disassemble(mali_ptr shader, int job_no, int job_type,
|
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 =
|
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_texture = (stats.texture_count > 0);
|
||||||
bool has_sampler = (stats.sampler_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
|
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);
|
struct pandecode_mapped_memory *mmem = pandecode_find_mapped_gpu_mem_containing(textures);
|
||||||
|
|
||||||
|
|
@ -736,51 +742,47 @@ pandecode_textures(mali_ptr textures, unsigned texture_count, int job_no, bool i
|
||||||
pandecode_log("Textures %"PRIx64"_%d:\n", textures, job_no);
|
pandecode_log("Textures %"PRIx64"_%d:\n", textures, job_no);
|
||||||
pandecode_indent++;
|
pandecode_indent++;
|
||||||
|
|
||||||
if (is_bifrost) {
|
#if PAN_ARCH >= 6
|
||||||
const void *cl = pandecode_fetch_gpu_mem(mmem,
|
const void *cl =
|
||||||
textures, pan_size(BIFROST_TEXTURE) *
|
pandecode_fetch_gpu_mem(mmem,
|
||||||
texture_count);
|
textures,
|
||||||
|
pan_size(TEXTURE) *
|
||||||
|
texture_count);
|
||||||
|
|
||||||
for (unsigned tex = 0; tex < texture_count; ++tex) {
|
for (unsigned tex = 0; tex < texture_count; ++tex) {
|
||||||
pandecode_bifrost_texture(cl +
|
pandecode_bifrost_texture(cl + pan_size(TEXTURE) * tex,
|
||||||
pan_size(BIFROST_TEXTURE) * tex,
|
job_no, tex);
|
||||||
job_no, tex);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
mali_ptr *PANDECODE_PTR_VAR(u, mmem, textures);
|
|
||||||
|
|
||||||
for (int tex = 0; tex < texture_count; ++tex) {
|
|
||||||
mali_ptr *PANDECODE_PTR_VAR(u, mmem, textures + tex * sizeof(mali_ptr));
|
|
||||||
char *a = pointer_as_memory_reference(*u);
|
|
||||||
pandecode_log("%s,\n", a);
|
|
||||||
free(a);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Now, finally, descend down into the texture descriptor */
|
|
||||||
for (unsigned tex = 0; tex < texture_count; ++tex) {
|
|
||||||
mali_ptr *PANDECODE_PTR_VAR(u, mmem, textures + tex * sizeof(mali_ptr));
|
|
||||||
struct pandecode_mapped_memory *tmem = pandecode_find_mapped_gpu_mem_containing(*u);
|
|
||||||
if (tmem)
|
|
||||||
pandecode_texture(*u, tmem, job_no, tex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
mali_ptr *PANDECODE_PTR_VAR(u, mmem, textures);
|
||||||
|
|
||||||
|
for (int tex = 0; tex < texture_count; ++tex) {
|
||||||
|
mali_ptr *PANDECODE_PTR_VAR(u, mmem, textures + tex * sizeof(mali_ptr));
|
||||||
|
char *a = pointer_as_memory_reference(*u);
|
||||||
|
pandecode_log("%s,\n", a);
|
||||||
|
free(a);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Now, finally, descend down into the texture descriptor */
|
||||||
|
for (unsigned tex = 0; tex < texture_count; ++tex) {
|
||||||
|
mali_ptr *PANDECODE_PTR_VAR(u, mmem, textures + tex * sizeof(mali_ptr));
|
||||||
|
struct pandecode_mapped_memory *tmem = pandecode_find_mapped_gpu_mem_containing(*u);
|
||||||
|
if (tmem)
|
||||||
|
pandecode_texture(*u, tmem, job_no, tex);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
pandecode_indent--;
|
pandecode_indent--;
|
||||||
pandecode_log("\n");
|
pandecode_log("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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_log("Samplers %"PRIx64"_%d:\n", samplers, job_no);
|
||||||
pandecode_indent++;
|
pandecode_indent++;
|
||||||
|
|
||||||
for (int i = 0; i < sampler_count; ++i) {
|
for (int i = 0; i < sampler_count; ++i)
|
||||||
if (is_bifrost) {
|
DUMP_ADDR(SAMPLER, samplers + (pan_size(SAMPLER) * i), "Sampler %d:\n", i);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pandecode_indent--;
|
pandecode_indent--;
|
||||||
pandecode_log("\n");
|
pandecode_log("\n");
|
||||||
|
|
@ -789,24 +791,26 @@ pandecode_samplers(mali_ptr samplers, unsigned sampler_count, int job_no, bool i
|
||||||
static void
|
static void
|
||||||
pandecode_dcd(const struct MALI_DRAW *p,
|
pandecode_dcd(const struct MALI_DRAW *p,
|
||||||
int job_no, enum mali_job_type job_type,
|
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;
|
struct pandecode_mapped_memory *attr_mem;
|
||||||
|
|
||||||
bool idvs = (job_type == MALI_JOB_TYPE_INDEXED_VERTEX);
|
|
||||||
|
|
||||||
struct pandecode_fbd fbd_info = {
|
struct pandecode_fbd fbd_info = {
|
||||||
/* Default for Bifrost */
|
/* Default for Bifrost */
|
||||||
.rt_count = 1
|
.rt_count = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((job_type != MALI_JOB_TYPE_TILER) || is_bifrost)
|
#if PAN_ARCH >= 6
|
||||||
pandecode_local_storage(p->fbd & ~1, job_no);
|
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)
|
else if (p->fbd & MALI_FBD_TAG_IS_MFBD)
|
||||||
fbd_info = pandecode_mfbd_bfr((u64) ((uintptr_t) p->fbd) & ~MALI_FBD_TAG_MASK,
|
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
|
else
|
||||||
fbd_info = pandecode_sfbd((u64) (uintptr_t) p->fbd, job_no, false, gpu_id);
|
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 varying_count = 0, attribute_count = 0, uniform_count = 0, uniform_buffer_count = 0;
|
||||||
int texture_count = 0, sampler_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);
|
pan_unpack(cl, RENDERER_STATE, state);
|
||||||
|
|
||||||
if (state.shader.shader & ~0xF)
|
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)
|
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");
|
DUMP_UNPACKED(RENDERER_STATE, state, "State:\n");
|
||||||
pandecode_indent++;
|
pandecode_indent++;
|
||||||
|
|
||||||
|
|
@ -832,19 +840,19 @@ pandecode_dcd(const struct MALI_DRAW *p,
|
||||||
sampler_count = state.shader.sampler_count;
|
sampler_count = state.shader.sampler_count;
|
||||||
uniform_buffer_count = state.properties.uniform_buffer_count;
|
uniform_buffer_count = state.properties.uniform_buffer_count;
|
||||||
|
|
||||||
if (is_bifrost)
|
#if PAN_ARCH >= 6
|
||||||
uniform_count = state.preload.uniform_count;
|
uniform_count = state.preload.uniform_count;
|
||||||
else
|
#else
|
||||||
uniform_count = state.properties.midgard.uniform_count;
|
uniform_count = state.properties.midgard.uniform_count;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (is_bifrost)
|
#if PAN_ARCH >= 6
|
||||||
DUMP_UNPACKED(PRELOAD, state.preload, "Preload:\n");
|
DUMP_UNPACKED(PRELOAD, state.preload, "Preload:\n");
|
||||||
|
#else
|
||||||
if (!is_bifrost) {
|
mali_ptr shader = state.sfbd_blend_shader & ~0xF;
|
||||||
mali_ptr shader = state.sfbd_blend_shader & ~0xF;
|
if (state.multisample_misc.sfbd_blend_shader && shader)
|
||||||
if (state.multisample_misc.sfbd_blend_shader && shader)
|
pandecode_blend_shader_disassemble(shader, job_no, job_type, gpu_id);
|
||||||
pandecode_blend_shader_disassemble(shader, job_no, job_type, false, gpu_id);
|
#endif
|
||||||
}
|
|
||||||
pandecode_indent--;
|
pandecode_indent--;
|
||||||
pandecode_log("\n");
|
pandecode_log("\n");
|
||||||
|
|
||||||
|
|
@ -852,21 +860,21 @@ pandecode_dcd(const struct MALI_DRAW *p,
|
||||||
* per-RT descriptors */
|
* per-RT descriptors */
|
||||||
|
|
||||||
if ((job_type == MALI_JOB_TYPE_TILER || job_type == MALI_JOB_TYPE_FRAGMENT) &&
|
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);
|
void* blend_base = ((void *) cl) + pan_size(RENDERER_STATE);
|
||||||
|
|
||||||
for (unsigned i = 0; i < fbd_info.rt_count; i++) {
|
for (unsigned i = 0; i < fbd_info.rt_count; i++) {
|
||||||
mali_ptr shader = 0;
|
mali_ptr shader = 0;
|
||||||
|
|
||||||
if (is_bifrost)
|
#if PAN_ARCH >= 6
|
||||||
shader = pandecode_bifrost_blend(blend_base, job_no, i,
|
shader = pandecode_bifrost_blend(blend_base, job_no, i,
|
||||||
state.shader.shader);
|
state.shader.shader);
|
||||||
else
|
#else
|
||||||
shader = pandecode_midgard_blend_mrt(blend_base, job_no, i);
|
shader = pandecode_midgard_blend_mrt(blend_base, job_no, i);
|
||||||
|
#endif
|
||||||
if (shader & ~0xF)
|
if (shader & ~0xF)
|
||||||
pandecode_blend_shader_disassemble(shader, job_no, job_type,
|
pandecode_blend_shader_disassemble(shader, job_no, job_type,
|
||||||
is_bifrost, gpu_id);
|
gpu_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
|
@ -916,38 +924,10 @@ pandecode_dcd(const struct MALI_DRAW *p,
|
||||||
pandecode_msg("XXX: Uniforms referenced but not specified\n");
|
pandecode_msg("XXX: Uniforms referenced but not specified\n");
|
||||||
|
|
||||||
if (p->textures)
|
if (p->textures)
|
||||||
pandecode_textures(p->textures, texture_count, job_no, is_bifrost);
|
pandecode_textures(p->textures, texture_count, job_no);
|
||||||
|
|
||||||
if (p->samplers)
|
if (p->samplers)
|
||||||
pandecode_samplers(p->samplers, sampler_count, job_no, is_bifrost);
|
pandecode_samplers(p->samplers, sampler_count, job_no);
|
||||||
}
|
|
||||||
|
|
||||||
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--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -963,12 +943,11 @@ pandecode_primitive_size(const void *s, bool constant)
|
||||||
static void
|
static void
|
||||||
pandecode_vertex_compute_geometry_job(const struct MALI_JOB_HEADER *h,
|
pandecode_vertex_compute_geometry_job(const struct MALI_JOB_HEADER *h,
|
||||||
const struct pandecode_mapped_memory *mem,
|
const struct pandecode_mapped_memory *mem,
|
||||||
mali_ptr job, int job_no, bool is_bifrost,
|
mali_ptr job, int job_no, unsigned gpu_id)
|
||||||
unsigned gpu_id)
|
|
||||||
{
|
{
|
||||||
struct mali_compute_job_packed *PANDECODE_PTR_VAR(p, mem, job);
|
struct mali_compute_job_packed *PANDECODE_PTR_VAR(p, mem, job);
|
||||||
pan_section_unpack(p, COMPUTE_JOB, DRAW, draw);
|
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_log("Vertex Job Payload:\n");
|
||||||
pandecode_indent++;
|
pandecode_indent++;
|
||||||
|
|
@ -979,22 +958,50 @@ pandecode_vertex_compute_geometry_job(const struct MALI_JOB_HEADER *h,
|
||||||
pandecode_log("\n");
|
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
|
static void
|
||||||
pandecode_indexed_vertex_job(const struct MALI_JOB_HEADER *h,
|
pandecode_indexed_vertex_job(const struct MALI_JOB_HEADER *h,
|
||||||
const struct pandecode_mapped_memory *mem,
|
const struct pandecode_mapped_memory *mem,
|
||||||
mali_ptr job, int job_no, bool is_bifrost,
|
mali_ptr job, int job_no, unsigned gpu_id)
|
||||||
unsigned gpu_id)
|
|
||||||
{
|
{
|
||||||
struct mali_bifrost_indexed_vertex_job_packed *PANDECODE_PTR_VAR(p, mem, job);
|
struct mali_bifrost_indexed_vertex_job_packed *PANDECODE_PTR_VAR(p, mem, job);
|
||||||
|
|
||||||
pandecode_log("Vertex:\n");
|
pandecode_log("Vertex:\n");
|
||||||
pan_section_unpack(p, BIFROST_INDEXED_VERTEX_JOB, VERTEX_DRAW, vert_draw);
|
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");
|
DUMP_UNPACKED(DRAW, vert_draw, "Vertex Draw:\n");
|
||||||
|
|
||||||
pandecode_log("Fragment:\n");
|
pandecode_log("Fragment:\n");
|
||||||
pan_section_unpack(p, BIFROST_INDEXED_VERTEX_JOB, FRAGMENT_DRAW, frag_draw);
|
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");
|
DUMP_UNPACKED(DRAW, frag_draw, "Fragment Draw:\n");
|
||||||
|
|
||||||
pan_section_unpack(p, BIFROST_INDEXED_VERTEX_JOB, TILER, tiler_ptr);
|
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)
|
mali_ptr job, int job_no, unsigned gpu_id)
|
||||||
{
|
{
|
||||||
struct mali_bifrost_tiler_job_packed *PANDECODE_PTR_VAR(p, mem, job);
|
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, TILER_JOB, DRAW, draw);
|
||||||
pan_section_unpack(p, BIFROST_TILER_JOB, TILER, tiler_ptr);
|
pan_section_unpack(p, TILER_JOB, TILER, tiler_ptr);
|
||||||
pandecode_dcd(&draw, job_no, h->type, "", true, gpu_id);
|
pandecode_dcd(&draw, job_no, h->type, "", gpu_id);
|
||||||
|
|
||||||
pandecode_log("Tiler Job Payload:\n");
|
pandecode_log("Tiler Job Payload:\n");
|
||||||
pandecode_indent++;
|
pandecode_indent++;
|
||||||
pandecode_bifrost_tiler(tiler_ptr.address, job_no);
|
pandecode_bifrost_tiler(tiler_ptr.address, job_no);
|
||||||
|
|
||||||
pandecode_invocation(pan_section_ptr(p, BIFROST_TILER_JOB, INVOCATION));
|
pandecode_invocation(pan_section_ptr(p, TILER_JOB, INVOCATION));
|
||||||
pandecode_primitive(pan_section_ptr(p, BIFROST_TILER_JOB, PRIMITIVE));
|
pandecode_primitive(pan_section_ptr(p, TILER_JOB, PRIMITIVE));
|
||||||
|
|
||||||
/* TODO: gl_PointSize on Bifrost */
|
/* TODO: gl_PointSize on Bifrost */
|
||||||
pandecode_primitive_size(pan_section_ptr(p, BIFROST_TILER_JOB, PRIMITIVE_SIZE), true);
|
pandecode_primitive_size(pan_section_ptr(p, TILER_JOB, PRIMITIVE_SIZE), true);
|
||||||
pan_section_unpack(p, BIFROST_TILER_JOB, PADDING, padding);
|
pan_section_unpack(p, TILER_JOB, PADDING, padding);
|
||||||
DUMP_UNPACKED(DRAW, draw, "Draw:\n");
|
DUMP_UNPACKED(DRAW, draw, "Draw:\n");
|
||||||
pandecode_indent--;
|
pandecode_indent--;
|
||||||
pandecode_log("\n");
|
pandecode_log("\n");
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
static void
|
static void
|
||||||
pandecode_tiler_job_mdg(const struct MALI_JOB_HEADER *h,
|
pandecode_tiler_job_mdg(const struct MALI_JOB_HEADER *h,
|
||||||
const struct pandecode_mapped_memory *mem,
|
const struct pandecode_mapped_memory *mem,
|
||||||
mali_ptr job, int job_no, unsigned gpu_id)
|
mali_ptr job, int job_no, unsigned gpu_id)
|
||||||
{
|
{
|
||||||
struct mali_midgard_tiler_job_packed *PANDECODE_PTR_VAR(p, mem, job);
|
struct mali_midgard_tiler_job_packed *PANDECODE_PTR_VAR(p, mem, job);
|
||||||
pan_section_unpack(p, MIDGARD_TILER_JOB, DRAW, draw);
|
pan_section_unpack(p, TILER_JOB, DRAW, draw);
|
||||||
pandecode_dcd(&draw, job_no, h->type, "", false, gpu_id);
|
pandecode_dcd(&draw, job_no, h->type, "", gpu_id);
|
||||||
|
|
||||||
pandecode_log("Tiler Job Payload:\n");
|
pandecode_log("Tiler Job Payload:\n");
|
||||||
pandecode_indent++;
|
pandecode_indent++;
|
||||||
pandecode_invocation(pan_section_ptr(p, MIDGARD_TILER_JOB, INVOCATION));
|
pandecode_invocation(pan_section_ptr(p, TILER_JOB, INVOCATION));
|
||||||
pandecode_primitive(pan_section_ptr(p, MIDGARD_TILER_JOB, PRIMITIVE));
|
pandecode_primitive(pan_section_ptr(p, TILER_JOB, PRIMITIVE));
|
||||||
DUMP_UNPACKED(DRAW, draw, "Draw:\n");
|
DUMP_UNPACKED(DRAW, draw, "Draw:\n");
|
||||||
|
|
||||||
pan_section_unpack(p, MIDGARD_TILER_JOB, PRIMITIVE, primitive);
|
pan_section_unpack(p, TILER_JOB, PRIMITIVE, primitive);
|
||||||
pandecode_primitive_size(pan_section_ptr(p, MIDGARD_TILER_JOB, PRIMITIVE_SIZE),
|
pandecode_primitive_size(pan_section_ptr(p, TILER_JOB, PRIMITIVE_SIZE),
|
||||||
primitive.point_size_array_format == MALI_POINT_SIZE_ARRAY_FORMAT_NONE);
|
primitive.point_size_array_format == MALI_POINT_SIZE_ARRAY_FORMAT_NONE);
|
||||||
pandecode_indent--;
|
pandecode_indent--;
|
||||||
pandecode_log("\n");
|
pandecode_log("\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pandecode_fragment_job(const struct pandecode_mapped_memory *mem,
|
pandecode_fragment_job(const struct pandecode_mapped_memory *mem,
|
||||||
mali_ptr job, int job_no,
|
mali_ptr job, int job_no, unsigned gpu_id)
|
||||||
bool is_bifrost, unsigned gpu_id)
|
|
||||||
{
|
{
|
||||||
struct mali_fragment_job_packed *PANDECODE_PTR_VAR(p, mem, job);
|
struct mali_fragment_job_packed *PANDECODE_PTR_VAR(p, mem, job);
|
||||||
pan_section_unpack(p, FRAGMENT_JOB, PAYLOAD, s);
|
pan_section_unpack(p, FRAGMENT_JOB, PAYLOAD, s);
|
||||||
|
|
||||||
bool is_mfbd = s.framebuffer & MALI_FBD_TAG_IS_MFBD;
|
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");
|
pandecode_msg("XXX: Bifrost fragment must use MFBD\n");
|
||||||
|
|
||||||
struct pandecode_fbd info;
|
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)
|
if (is_mfbd)
|
||||||
info = pandecode_mfbd_bfr(s.framebuffer & ~MALI_FBD_TAG_MASK, job_no,
|
info = pandecode_mfbd_bfr(s.framebuffer & ~MALI_FBD_TAG_MASK, job_no,
|
||||||
true, is_bifrost, gpu_id);
|
true, gpu_id);
|
||||||
else
|
else
|
||||||
info = pandecode_sfbd(s.framebuffer & ~MALI_FBD_TAG_MASK, job_no,
|
info = pandecode_sfbd(s.framebuffer & ~MALI_FBD_TAG_MASK, job_no,
|
||||||
true, gpu_id);
|
true, gpu_id);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Compute the tag for the tagged pointer. This contains the type of
|
/* 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
|
* 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. */
|
* are model-specific even within a particular architecture. */
|
||||||
|
|
||||||
void
|
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();
|
pandecode_dump_file_open();
|
||||||
|
|
||||||
|
|
@ -1166,25 +1178,26 @@ pandecode_jc(mali_ptr jc_gpu_va, bool bifrost, unsigned gpu_id)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MALI_JOB_TYPE_TILER:
|
case MALI_JOB_TYPE_TILER:
|
||||||
if (bifrost)
|
#if PAN_ARCH >= 6
|
||||||
pandecode_tiler_job_bfr(&h, mem, jc_gpu_va, job_no, gpu_id);
|
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);
|
pandecode_tiler_job_mdg(&h, mem, jc_gpu_va, job_no, gpu_id);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MALI_JOB_TYPE_VERTEX:
|
case MALI_JOB_TYPE_VERTEX:
|
||||||
case MALI_JOB_TYPE_COMPUTE:
|
case MALI_JOB_TYPE_COMPUTE:
|
||||||
pandecode_vertex_compute_geometry_job(&h, mem, jc_gpu_va, job_no,
|
pandecode_vertex_compute_geometry_job(&h, mem, jc_gpu_va, job_no, gpu_id);
|
||||||
bifrost, gpu_id);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if PAN_ARCH >= 6
|
||||||
case MALI_JOB_TYPE_INDEXED_VERTEX:
|
case MALI_JOB_TYPE_INDEXED_VERTEX:
|
||||||
pandecode_indexed_vertex_job(&h, mem, jc_gpu_va, job_no,
|
pandecode_indexed_vertex_job(&h, mem, jc_gpu_va, job_no, gpu_id);
|
||||||
bifrost, gpu_id);
|
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case MALI_JOB_TYPE_FRAGMENT:
|
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;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
@ -1197,7 +1210,7 @@ pandecode_jc(mali_ptr jc_gpu_va, bool bifrost, unsigned gpu_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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;
|
mali_ptr next_job = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@
|
||||||
#ifndef __PAN_DECODE_H__
|
#ifndef __PAN_DECODE_H__
|
||||||
#define __PAN_DECODE_H__
|
#define __PAN_DECODE_H__
|
||||||
|
|
||||||
|
#include "gen_macros.h"
|
||||||
|
|
||||||
#include "wrap.h"
|
#include "wrap.h"
|
||||||
|
|
||||||
extern FILE *pandecode_dump_stream;
|
extern FILE *pandecode_dump_stream;
|
||||||
|
|
@ -81,4 +83,9 @@ __pandecode_fetch_gpu_mem(const struct pandecode_mapped_memory *mem,
|
||||||
name = __pandecode_fetch_gpu_mem(mem, gpu_va, sizeof(*name), \
|
name = __pandecode_fetch_gpu_mem(mem, gpu_va, sizeof(*name), \
|
||||||
__LINE__, __FILE__)
|
__LINE__, __FILE__)
|
||||||
|
|
||||||
|
#ifdef PAN_ARCH
|
||||||
|
void GENX(pandecode_jc)(mali_ptr jc_gpu_va, unsigned gpu_id);
|
||||||
|
void GENX(pandecode_abort_on_fault)(mali_ptr jc_gpu_va);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __MMAP_TRACE_H__ */
|
#endif /* __MMAP_TRACE_H__ */
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@
|
||||||
#include "util/u_dynarray.h"
|
#include "util/u_dynarray.h"
|
||||||
#include "util/hash_table.h"
|
#include "util/hash_table.h"
|
||||||
|
|
||||||
|
FILE *pandecode_dump_stream;
|
||||||
|
|
||||||
/* Memory handling */
|
/* Memory handling */
|
||||||
|
|
||||||
static struct hash_table_u64 *mmap_table;
|
static struct hash_table_u64 *mmap_table;
|
||||||
|
|
@ -218,3 +220,37 @@ pandecode_close(void)
|
||||||
util_dynarray_fini(&ro_mappings);
|
util_dynarray_fini(&ro_mappings);
|
||||||
pandecode_dump_file_close();
|
pandecode_dump_file_close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pandecode_abort_on_fault_v4(mali_ptr jc_gpu_va);
|
||||||
|
void pandecode_abort_on_fault_v5(mali_ptr jc_gpu_va);
|
||||||
|
void pandecode_abort_on_fault_v6(mali_ptr jc_gpu_va);
|
||||||
|
void pandecode_abort_on_fault_v7(mali_ptr jc_gpu_va);
|
||||||
|
|
||||||
|
void
|
||||||
|
pandecode_abort_on_fault(mali_ptr jc_gpu_va, unsigned gpu_id)
|
||||||
|
{
|
||||||
|
switch (pan_arch(gpu_id)) {
|
||||||
|
case 4: pandecode_abort_on_fault_v4(jc_gpu_va); return;
|
||||||
|
case 5: pandecode_abort_on_fault_v5(jc_gpu_va); return;
|
||||||
|
case 6: pandecode_abort_on_fault_v6(jc_gpu_va); return;
|
||||||
|
case 7: pandecode_abort_on_fault_v7(jc_gpu_va); return;
|
||||||
|
default: unreachable("Unsupported architecture");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void pandecode_jc_v4(mali_ptr jc_gpu_va, unsigned gpu_id);
|
||||||
|
void pandecode_jc_v5(mali_ptr jc_gpu_va, unsigned gpu_id);
|
||||||
|
void pandecode_jc_v6(mali_ptr jc_gpu_va, unsigned gpu_id);
|
||||||
|
void pandecode_jc_v7(mali_ptr jc_gpu_va, unsigned gpu_id);
|
||||||
|
|
||||||
|
void
|
||||||
|
pandecode_jc(mali_ptr jc_gpu_va, unsigned gpu_id)
|
||||||
|
{
|
||||||
|
switch (pan_arch(gpu_id)) {
|
||||||
|
case 4: pandecode_jc_v4(jc_gpu_va, gpu_id); return;
|
||||||
|
case 5: pandecode_jc_v5(jc_gpu_va, gpu_id); return;
|
||||||
|
case 6: pandecode_jc_v6(jc_gpu_va, gpu_id); return;
|
||||||
|
case 7: pandecode_jc_v7(jc_gpu_va, gpu_id); return;
|
||||||
|
default: unreachable("Unsupported architecture");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ foreach ver : pixel_format_versions
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
libpanfrost_per_arch = []
|
libpanfrost_per_arch = []
|
||||||
|
libpanfrost_decode_per_arch = []
|
||||||
|
|
||||||
foreach ver : ['4', '5', '6', '7']
|
foreach ver : ['4', '5', '6', '7']
|
||||||
libpanfrost_per_arch += static_library(
|
libpanfrost_per_arch += static_library(
|
||||||
|
|
@ -65,6 +66,16 @@ foreach ver : ['4', '5', '6', '7']
|
||||||
gnu_symbol_visibility : 'hidden',
|
gnu_symbol_visibility : 'hidden',
|
||||||
dependencies : [dep_libdrm, idep_pan_packers, idep_nir],
|
dependencies : [dep_libdrm, idep_pan_packers, idep_nir],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
libpanfrost_decode_per_arch += static_library(
|
||||||
|
'pandecode-arch-v' + ver,
|
||||||
|
['decode.c', pan_packers],
|
||||||
|
include_directories : [inc_include, inc_src, inc_panfrost],
|
||||||
|
dependencies : [dep_libdrm, idep_pan_packers, idep_nir],
|
||||||
|
c_args : [no_override_init_args, '-DPAN_ARCH=' + ver],
|
||||||
|
gnu_symbol_visibility : 'hidden',
|
||||||
|
build_by_default : false,
|
||||||
|
)
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
libpanfrost_lib_files = files(
|
libpanfrost_lib_files = files(
|
||||||
|
|
@ -85,11 +96,6 @@ libpanfrost_lib_files = files(
|
||||||
'pan_util.c',
|
'pan_util.c',
|
||||||
)
|
)
|
||||||
|
|
||||||
libpanfrost_decode_files = files(
|
|
||||||
'decode_common.c',
|
|
||||||
'decode.c',
|
|
||||||
)
|
|
||||||
|
|
||||||
libpanfrost_lib = static_library(
|
libpanfrost_lib = static_library(
|
||||||
'panfrost_lib',
|
'panfrost_lib',
|
||||||
[libpanfrost_lib_files, pan_packers],
|
[libpanfrost_lib_files, pan_packers],
|
||||||
|
|
@ -103,12 +109,16 @@ libpanfrost_lib = static_library(
|
||||||
|
|
||||||
libpanfrost_decode = static_library(
|
libpanfrost_decode = static_library(
|
||||||
'panfrost_decode',
|
'panfrost_decode',
|
||||||
[libpanfrost_decode_files, pan_packers],
|
[
|
||||||
|
'decode_common.c',
|
||||||
|
pan_packers
|
||||||
|
],
|
||||||
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost],
|
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost],
|
||||||
dependencies : idep_mesautil,
|
dependencies : idep_mesautil,
|
||||||
c_args : [no_override_init_args],
|
c_args : [no_override_init_args],
|
||||||
gnu_symbol_visibility : 'hidden',
|
gnu_symbol_visibility : 'hidden',
|
||||||
build_by_default : false,
|
build_by_default : false,
|
||||||
|
link_with: [libpanfrost_decode_per_arch],
|
||||||
)
|
)
|
||||||
|
|
||||||
libpanfrost_dep = declare_dependency(
|
libpanfrost_dep = declare_dependency(
|
||||||
|
|
|
||||||
|
|
@ -53,9 +53,9 @@ pandecode_inject_mmap(uint64_t gpu_va, void *cpu, unsigned sz, const char *name)
|
||||||
|
|
||||||
void pandecode_inject_free(uint64_t gpu_va, unsigned sz);
|
void pandecode_inject_free(uint64_t gpu_va, unsigned sz);
|
||||||
|
|
||||||
void pandecode_jc(uint64_t jc_gpu_va, bool bifrost, unsigned gpu_id);
|
void pandecode_jc(uint64_t jc_gpu_va, unsigned gpu_id);
|
||||||
|
|
||||||
void
|
void
|
||||||
pandecode_abort_on_fault(uint64_t jc_gpu_va);
|
pandecode_abort_on_fault(uint64_t jc_gpu_va, unsigned gpu_id);
|
||||||
|
|
||||||
#endif /* __MMAP_TRACE_H__ */
|
#endif /* __MMAP_TRACE_H__ */
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ panvk_queue_submit_batch(struct panvk_queue *queue,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug & PANVK_DEBUG_TRACE)
|
if (debug & PANVK_DEBUG_TRACE)
|
||||||
pandecode_jc(batch->scoreboard.first_job, PAN_ARCH >= 6, pdev->gpu_id);
|
GENX(pandecode_jc)(batch->scoreboard.first_job, pdev->gpu_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (batch->fragment_job) {
|
if (batch->fragment_job) {
|
||||||
|
|
@ -113,7 +113,7 @@ panvk_queue_submit_batch(struct panvk_queue *queue,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug & PANVK_DEBUG_TRACE)
|
if (debug & PANVK_DEBUG_TRACE)
|
||||||
pandecode_jc(batch->fragment_job, PAN_ARCH >= 6, pdev->gpu_id);
|
GENX(pandecode_jc)(batch->fragment_job, pdev->gpu_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug & PANVK_DEBUG_TRACE)
|
if (debug & PANVK_DEBUG_TRACE)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue