summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-08-14 09:19:54 -0700
committerAlyssa Rosenzweig <[email protected]>2019-08-14 10:31:09 -0700
commitc4a4f3db5a4c8676798855e131c360cdf0e4a6bc (patch)
treefbd3db5061816ecc140a8986565fbdf8e86cbacc
parent5f0f9e1333385bd59a92b3a4dc72c4f9593eca68 (diff)
pan/midgard: Prefix blobber-db output for grepping
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r--src/panfrost/midgard/disassemble.c6
-rw-r--r--src/panfrost/midgard/disassemble.h2
-rw-r--r--src/panfrost/midgard/midgard_compile.c2
-rw-r--r--src/panfrost/pandecode/decode.c10
4 files changed, 14 insertions, 6 deletions
diff --git a/src/panfrost/midgard/disassemble.c b/src/panfrost/midgard/disassemble.c
index 382b4af7cbf..1092fcf7374 100644
--- a/src/panfrost/midgard/disassemble.c
+++ b/src/panfrost/midgard/disassemble.c
@@ -1308,7 +1308,7 @@ print_texture_word(uint32_t *word, unsigned tabs)
}
void
-disassemble_midgard(uint8_t *code, size_t size, bool stats, unsigned nr_registers)
+disassemble_midgard(uint8_t *code, size_t size, bool stats, unsigned nr_registers, const char *prefix)
{
uint32_t *words = (uint32_t *) code;
unsigned num_words = size / 4;
@@ -1400,10 +1400,10 @@ disassemble_midgard(uint8_t *code, size_t size, bool stats, unsigned nr_register
(nr_registers <= 8) ? 2 :
1;
- printf("%s shader: "
+ printf("%s"
"%u inst, %u bundles, %u quadwords, "
"%u registers, %u threads, 0 loops\n",
- "FRAGMENT", /* TODO */
+ prefix,
nr_ins, nr_bundles, nr_quadwords,
nr_registers, nr_threads);
diff --git a/src/panfrost/midgard/disassemble.h b/src/panfrost/midgard/disassemble.h
index 7ccee2649c6..ca578b7d3aa 100644
--- a/src/panfrost/midgard/disassemble.h
+++ b/src/panfrost/midgard/disassemble.h
@@ -1,2 +1,2 @@
#include <stddef.h>
-void disassemble_midgard(uint8_t *code, size_t size, bool stats, unsigned regs);
+void disassemble_midgard(uint8_t *code, size_t size, bool stats, unsigned regs, const char *prefix);
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index e348ac05234..91e257db187 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -2741,7 +2741,7 @@ midgard_compile_shader_nir(struct midgard_screen *screen, nir_shader *nir, midga
program->tls_size = ctx->tls_size;
if (midgard_debug & MIDGARD_DBG_SHADERS)
- disassemble_midgard(program->compiled.data, program->compiled.size, false, 0);
+ disassemble_midgard(program->compiled.data, program->compiled.size, false, 0, "");
if (midgard_debug & MIDGARD_DBG_SHADERDB) {
unsigned nr_bundles = 0, nr_ins = 0, nr_quadwords = 0;
diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c
index b49044cec2b..771383ce866 100644
--- a/src/panfrost/pandecode/decode.c
+++ b/src/panfrost/pandecode/decode.c
@@ -1428,6 +1428,8 @@ pandecode_scratchpad(uintptr_t pscratchpad, int job_no, char *suffix)
pandecode_log("};\n");
}
+static unsigned shader_id = 0;
+
static void
pandecode_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type,
bool is_bifrost, unsigned nr_regs)
@@ -1443,10 +1445,16 @@ pandecode_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type,
printf("\n\n");
+ char prefix[512];
+
+ snprintf(prefix, sizeof(prefix) - 1, "shader%d - %s shader: ",
+ shader_id++,
+ (type == JOB_TYPE_TILER) ? "FRAGMENT" : "VERTEX");
+
if (is_bifrost) {
disassemble_bifrost(code, sz, false);
} else {
- disassemble_midgard(code, sz, true, nr_regs);
+ disassemble_midgard(code, sz, true, nr_regs, prefix);
}
printf("\n\n");