Mesa (master): panfrost/decode: Identify "compute FBD"

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 20 14:49:18 UTC 2019


Module: Mesa
Branch: master
Commit: 0aa5d89acbc44a68320281000fcd2547505f76c6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0aa5d89acbc44a68320281000fcd2547505f76c6

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Wed Jun 19 08:41:51 2019 -0700

panfrost/decode: Identify "compute FBD"

There is fundamentally not a framebuffer associated with a compute job.
Allocate a new structure for it so we don't mess up graphics when
decoding.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>

---

 .../drivers/panfrost/include/panfrost-job.h        |  7 +++++++
 src/gallium/drivers/panfrost/pandecode/decode.c    | 22 ++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/src/gallium/drivers/panfrost/include/panfrost-job.h b/src/gallium/drivers/panfrost/include/panfrost-job.h
index 80ce66fa7e2..4b3c788e4e9 100644
--- a/src/gallium/drivers/panfrost/include/panfrost-job.h
+++ b/src/gallium/drivers/panfrost/include/panfrost-job.h
@@ -1406,6 +1406,13 @@ struct mali_single_framebuffer {
         /* More below this, maybe */
 } __attribute__((packed));
 
+/* On Midgard, this "framebuffer descriptor" is used for the framebuffer field
+ * of compute jobs. Superficially resembles a single framebuffer descriptor */
+
+struct mali_compute_fbd {
+        u32 unknown[64];
+} __attribute__((packed));
+
 /* Format bits for the render target flags */
 
 #define MALI_MFBD_FORMAT_MSAA 	  (1 << 1)
diff --git a/src/gallium/drivers/panfrost/pandecode/decode.c b/src/gallium/drivers/panfrost/pandecode/decode.c
index daa9d4736a6..61e0a0123e4 100644
--- a/src/gallium/drivers/panfrost/pandecode/decode.c
+++ b/src/gallium/drivers/panfrost/pandecode/decode.c
@@ -540,6 +540,26 @@ pandecode_replay_sfbd(uint64_t gpu_va, int job_no)
 }
 
 static void
+pandecode_compute_fbd(uint64_t gpu_va, int job_no)
+{
+        struct pandecode_mapped_memory *mem = pandecode_find_mapped_gpu_mem_containing(gpu_va);
+        const struct mali_compute_fbd *PANDECODE_PTR_VAR(s, mem, (mali_ptr) gpu_va);
+
+        pandecode_log("struct mali_compute_fbd framebuffer_%d = {\n", job_no);
+        pandecode_indent++;
+
+        pandecode_log(".unknown = {");
+
+        for (int i = 0; i < sizeof(s->unknown) / sizeof(s->unknown[0]); ++i)
+                printf("%X, ", s->unknown[i]);
+
+        pandecode_log("},\n");
+
+        pandecode_indent--;
+        printf("},\n");
+}
+
+static void
 pandecode_replay_swizzle(unsigned swizzle)
 {
 	pandecode_prop("swizzle = %s | (%s << 3) | (%s << 6) | (%s << 9)",
@@ -1275,6 +1295,8 @@ pandecode_replay_vertex_tiler_postfix_pre(const struct mali_vertex_tiler_postfix
                 pandecode_replay_scratchpad(p->framebuffer & ~FBD_TYPE, job_no, suffix);
         else if (p->framebuffer & MALI_MFBD)
                 pandecode_replay_mfbd_bfr((u64) ((uintptr_t) p->framebuffer) & FBD_MASK, job_no, false);
+        else if (job_type == JOB_TYPE_COMPUTE)
+                pandecode_compute_fbd((u64) (uintptr_t) p->framebuffer, job_no);
         else
                 pandecode_replay_sfbd((u64) (uintptr_t) p->framebuffer, job_no);
 




More information about the mesa-commit mailing list