pan/decode: Fix awkward syntax
[mesa.git] / src / panfrost / lib / decode.c
index c6e23b1eda91caca6c17261f3798dba38e080ae2..cbc4cd1093462b89e4cf3501494f4b21ccc60fda 100644 (file)
@@ -487,14 +487,6 @@ pandecode_shared_memory(const struct mali_shared_memory *desc, bool is_compute)
         MEMORY_PROP(desc, scratchpad);
         MEMORY_PROP(desc, shared_memory);
         MEMORY_PROP(desc, unknown1);
-
-        if (desc->scratchpad) {
-                struct pandecode_mapped_memory *smem =
-                        pandecode_find_mapped_gpu_mem_containing(desc->scratchpad);
-
-                pandecode_msg("scratchpad size %u\n", smem->length);
-        }
-
 }
 
 static struct pandecode_fbd
@@ -1218,13 +1210,12 @@ pandecode_midgard_blend_mrt(void *descs, int job_no, int rt_no)
  */
 
 static int
-pandecode_attribute_meta(int job_no, int count, const struct mali_vertex_tiler_postfix *v, bool varying, char *suffix)
+pandecode_attribute_meta(int count, mali_ptr attribute, bool varying, char *suffix)
 {
         const char *prefix = varying ? "Varying" : "Attribute";
-        mali_ptr p = varying ? v->varying_meta : v->attribute_meta;
 
-        for (int i = 0; i < count; ++i, p += MALI_ATTRIBUTE_LENGTH)
-                DUMP_ADDR(prefix, ATTRIBUTE, p, 1);
+        for (int i = 0; i < count; ++i, attribute += MALI_ATTRIBUTE_LENGTH)
+                DUMP_ADDR(prefix, ATTRIBUTE, attribute, 1);
 
         return count;
 }
@@ -1348,8 +1339,7 @@ shader_type_for_job(unsigned type)
         case MALI_JOB_TYPE_VERTEX:  return "VERTEX";
         case MALI_JOB_TYPE_TILER:   return "FRAGMENT";
         case MALI_JOB_TYPE_COMPUTE: return "COMPUTE";
-        default:
-                               return "UNKNOWN";
+        default: return "UNKNOWN";
         }
 }
 
@@ -1395,26 +1385,18 @@ pandecode_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type,
                                 MESA_SHADER_FRAGMENT : MESA_SHADER_VERTEX);
         }
 
-        /* Print shader-db stats. Skip COMPUTE jobs since they are used for
-         * driver-internal purposes with the blob and interfere */
-
-        bool should_shaderdb = type != MALI_JOB_TYPE_COMPUTE;
-
-        if (should_shaderdb) {
-                unsigned nr_threads =
-                        (stats.work_count <= 4) ? 4 :
-                        (stats.work_count <= 8) ? 2 :
-                        1;
-
-                pandecode_log_cont("shader%d - MESA_SHADER_%s shader: "
-                        "%u inst, %u bundles, %u quadwords, "
-                        "%u registers, %u threads, 0 loops, 0:0 spills:fills\n\n\n",
-                        shader_id++,
-                        shader_type_for_job(type),
-                        stats.instruction_count, stats.bundle_count, stats.quadword_count,
-                        stats.work_count, nr_threads);
-        }
+        unsigned nr_threads =
+                (stats.work_count <= 4) ? 4 :
+                (stats.work_count <= 8) ? 2 :
+                1;
 
+        pandecode_log_cont("shader%d - MESA_SHADER_%s shader: "
+                "%u inst, %u bundles, %u quadwords, "
+                "%u registers, %u threads, 0 loops, 0:0 spills:fills\n\n\n",
+                shader_id++,
+                shader_type_for_job(type),
+                stats.instruction_count, stats.bundle_count, stats.quadword_count,
+                stats.work_count, nr_threads);
 
         return stats;
 }
@@ -1762,7 +1744,7 @@ pandecode_vertex_tiler_postfix_pre(
         unsigned max_attr_index = 0;
 
         if (p->attribute_meta)
-                max_attr_index = pandecode_attribute_meta(job_no, attribute_count, p, false, suffix);
+                max_attr_index = pandecode_attribute_meta(attribute_count, p->attribute_meta, false, suffix);
 
         if (p->attributes) {
                 attr_mem = pandecode_find_mapped_gpu_mem_containing(p->attributes);
@@ -1774,7 +1756,7 @@ pandecode_vertex_tiler_postfix_pre(
          * since the GPU will write to it itself */
 
         if (p->varying_meta) {
-                varying_count = pandecode_attribute_meta(job_no, varying_count, p, true, suffix);
+                varying_count = pandecode_attribute_meta(varying_count, p->varying_meta, true, suffix);
         }
 
         if (p->varyings) {
@@ -1969,30 +1951,6 @@ pandecode_primitive_size(union midgard_primitive_size u, bool constant)
         pandecode_log("},\n");
 }
 
-static void
-pandecode_tiler_only_bfr(const struct bifrost_tiler_only *t, int job_no)
-{
-        pandecode_log_cont("{\n");
-        pandecode_indent++;
-
-        /* TODO: gl_PointSize on Bifrost */
-        pandecode_primitive_size(t->primitive_size, true);
-
-        if (t->zero1 || t->zero2 || t->zero3 || t->zero4 || t->zero5
-            || t->zero6) {
-                pandecode_msg("XXX: tiler only zero tripped\n");
-                pandecode_prop("zero1 = 0x%" PRIx64, t->zero1);
-                pandecode_prop("zero2 = 0x%" PRIx64, t->zero2);
-                pandecode_prop("zero3 = 0x%" PRIx64, t->zero3);
-                pandecode_prop("zero4 = 0x%" PRIx64, t->zero4);
-                pandecode_prop("zero5 = 0x%" PRIx64, t->zero5);
-                pandecode_prop("zero6 = 0x%" PRIx64, t->zero6);
-        }
-
-        pandecode_indent--;
-        pandecode_log("},\n");
-}
-
 static int
 pandecode_vertex_job_bfr(const struct mali_job_descriptor_header *h,
                                 const struct pandecode_mapped_memory *mem,
@@ -2022,15 +1980,26 @@ pandecode_tiler_job_bfr(const struct mali_job_descriptor_header *h,
         struct bifrost_payload_tiler *PANDECODE_PTR_VAR(t, mem, payload);
 
         pandecode_vertex_tiler_postfix_pre(&t->postfix, job_no, h->job_type, "", true, gpu_id);
-        pandecode_tiler_meta(t->tiler.tiler_meta, job_no);
+        pandecode_tiler_meta(t->tiler_meta, job_no);
 
         pandecode_log("struct bifrost_payload_tiler payload_%"PRIx64"_%d = {\n", payload, job_no);
         pandecode_indent++;
 
         pandecode_vertex_tiler_prefix(&t->prefix, job_no, false);
 
-        pandecode_log(".tiler = ");
-        pandecode_tiler_only_bfr(&t->tiler, job_no);
+        /* TODO: gl_PointSize on Bifrost */
+        pandecode_primitive_size(t->primitive_size, true);
+
+        if (t->zero1 || t->zero2 || t->zero3 || t->zero4 || t->zero5
+            || t->zero6) {
+                pandecode_msg("XXX: tiler only zero tripped\n");
+                pandecode_prop("zero1 = 0x%" PRIx64, t->zero1);
+                pandecode_prop("zero2 = 0x%" PRIx64, t->zero2);
+                pandecode_prop("zero3 = 0x%" PRIx64, t->zero3);
+                pandecode_prop("zero4 = 0x%" PRIx64, t->zero4);
+                pandecode_prop("zero5 = 0x%" PRIx64, t->zero5);
+                pandecode_prop("zero6 = 0x%" PRIx64, t->zero6);
+        }
 
         pandecode_vertex_tiler_postfix(&t->postfix, job_no, true);