panfrost: Decode shader types in pantrace shader-db
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 23 Dec 2019 16:40:40 +0000 (11:40 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 24 Dec 2019 16:55:46 +0000 (16:55 +0000)
We see some COMPUTE jobs that were mistakenly identified as VERTEX.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/pandecode/decode.c

index 0b25e35473558f9c34848f664e87134ac96ced82..27245e39df45810d3a06e74550f440ba671d9ed0 100644 (file)
@@ -1825,6 +1825,18 @@ pandecode_scratchpad(uintptr_t pscratchpad, int job_no, char *suffix)
         pandecode_log("};\n");
 }
 
+static const char *
+shader_type_for_job(unsigned type)
+{
+        switch (type) {
+        case JOB_TYPE_VERTEX:  return "VERTEX";
+        case JOB_TYPE_TILER:   return "FRAGMENT";
+        case JOB_TYPE_COMPUTE: return "COMPUTE";
+        default:
+                               return "UNKNOWN";
+        }
+}
+
 static unsigned shader_id = 0;
 
 static struct midgard_disasm_stats
@@ -1877,7 +1889,7 @@ pandecode_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type,
                 "%u inst, %u bundles, %u quadwords, "
                 "%u registers, %u threads, 0 loops\n\n\n",
                 shader_id++,
-                (type == JOB_TYPE_TILER) ? "FRAGMENT" : "VERTEX",
+                shader_type_for_job(type),
                 stats.instruction_count, stats.bundle_count, stats.quadword_count,
                 stats.work_count, nr_threads);