panfrost: Debitfieldize mali_uniform_buffer_meta
[mesa.git] / src / panfrost / pandecode / decode.c
index 7e46014f3fa0c52382ee640a5041a75c93a46000..0a75e66351fddc9691576de42d934782dd79a21a 100644 (file)
@@ -1783,15 +1783,15 @@ static void
 pandecode_uniform_buffers(mali_ptr pubufs, int ubufs_count, int job_no)
 {
         struct pandecode_mapped_memory *umem = pandecode_find_mapped_gpu_mem_containing(pubufs);
-        struct mali_uniform_buffer_meta *PANDECODE_PTR_VAR(ubufs, umem, pubufs);
+        uint64_t *PANDECODE_PTR_VAR(ubufs, umem, pubufs);
 
         for (int i = 0; i < ubufs_count; i++) {
-                unsigned size = (ubufs[i].size + 1) * 16;
-                mali_ptr addr = ubufs[i].ptr << 2;
+                unsigned size = (ubufs[i] & ((1 << 10) - 1)) * 16;
+                mali_ptr addr = (ubufs[i] >> 10) << 2;
 
                 pandecode_validate_buffer(addr, size);
 
-                char *ptr = pointer_as_memory_reference(ubufs[i].ptr << 2);
+                char *ptr = pointer_as_memory_reference(addr);
                 pandecode_log("ubuf_%d[%u] = %s;\n", i, size, ptr);
                 free(ptr);
         }
@@ -2819,8 +2819,6 @@ pandecode_fragment_job(const struct pandecode_mapped_memory *mem,
         return sizeof(*s);
 }
 
-static int job_descriptor_number = 0;
-
 /* Entrypoint to start tracing. jc_gpu_va is the GPU address for the first job
  * in the chain; later jobs are found by walking the chain. Bifrost is, well,
  * if it's bifrost or not. GPU ID is the more finegrained ID (at some point, we
@@ -2830,14 +2828,11 @@ static int job_descriptor_number = 0;
  * no faults, and only descends into the payload if there are faults. This is
  * useful for looking for faults without the overhead of invasive traces. */
 
-int
+void
 pandecode_jc(mali_ptr jc_gpu_va, bool bifrost, unsigned gpu_id, bool minimal)
 {
         struct mali_job_descriptor_header *h;
-
-        int start_number = 0;
-
-        bool first = true;
+        unsigned job_descriptor_number = 0;
 
         do {
                 struct pandecode_mapped_memory *mem =
@@ -2859,9 +2854,6 @@ pandecode_jc(mali_ptr jc_gpu_va, bool bifrost, unsigned gpu_id, bool minimal)
 
                 int job_no = job_descriptor_number++;
 
-                if (first)
-                        start_number = job_no;
-
                 /* If the job is good to go, skip it in minimal mode */
                 if (minimal && (h->exception_status == 0x0 || h->exception_status == 0x1))
                         continue;
@@ -2948,17 +2940,5 @@ pandecode_jc(mali_ptr jc_gpu_va, bool bifrost, unsigned gpu_id, bool minimal)
                 default:
                         break;
                 }
-
-                /* Handle linkage */
-
-                if (!first) {
-                        pandecode_log("((struct mali_job_descriptor_header *) (uintptr_t) job_%d_p)->", job_no - 1);
-                        pandecode_log_cont("next_job = job_%d_p;\n\n", job_no);
-                }
-
-                first = false;
-
         } while ((jc_gpu_va = h->next_job));
-
-        return start_number;
 }