}
static struct pandecode_fbd
-pandecode_mfbd_bfr(uint64_t gpu_va, int job_no, bool is_fragment, bool is_compute)
+pandecode_mfbd_bfr(uint64_t gpu_va, int job_no, bool is_fragment, bool is_compute, bool is_bifrost)
{
struct pandecode_mapped_memory *mem = pandecode_find_mapped_gpu_mem_containing(gpu_va);
const struct mali_framebuffer *PANDECODE_PTR_VAR(fb, mem, (mali_ptr) gpu_va);
struct pandecode_fbd info;
+
+ if (is_bifrost && fb->msaa.sample_locations) {
+ /* The blob stores all possible sample locations in a single buffer
+ * allocated on startup, and just switches the pointer when switching
+ * MSAA state. For now, we just put the data into the cmdstream, but we
+ * should do something like what the blob does with a real driver.
+ *
+ * There seem to be 32 slots for sample locations, followed by another
+ * 16. The second 16 is just the center location followed by 15 zeros
+ * in all the cases I've identified (maybe shader vs. depth/color
+ * samples?).
+ */
+
+ struct pandecode_mapped_memory *smem = pandecode_find_mapped_gpu_mem_containing(fb->msaa.sample_locations);
+
+ const u16 *PANDECODE_PTR_VAR(samples, smem, fb->msaa.sample_locations);
+
+ pandecode_log("uint16_t sample_locations_%d[] = {\n", job_no);
+ pandecode_indent++;
+
+ for (int i = 0; i < 32 + 16; i++) {
+ pandecode_log("%d, %d,\n", samples[2 * i], samples[2 * i + 1]);
+ }
+
+ pandecode_indent--;
+ pandecode_log("};\n");
+ }
pandecode_log("struct mali_framebuffer framebuffer_%"PRIx64"_%d = {\n", gpu_va, job_no);
pandecode_indent++;
- pandecode_log(".shared_memory = {\n");
- pandecode_indent++;
- pandecode_shared_memory(&fb->shared_memory, is_compute);
- pandecode_indent--;
- pandecode_log("},\n");
+ if (is_bifrost) {
+ pandecode_log(".msaa = {\n");
+ pandecode_indent++;
+
+ if (fb->msaa.sample_locations)
+ pandecode_prop("sample_locations = sample_locations_%d", job_no);
+ else
+ pandecode_msg("XXX: sample_locations missing\n");
+
+ if (fb->msaa.zero1 || fb->msaa.zero2 || fb->msaa.zero4) {
+ pandecode_msg("XXX: multisampling zero tripped\n");
+ pandecode_prop("zero1 = %" PRIx64, fb->msaa.zero1);
+ pandecode_prop("zero2 = %" PRIx64, fb->msaa.zero2);
+ pandecode_prop("zero4 = %" PRIx64, fb->msaa.zero4);
+ }
+
+ pandecode_indent--;
+ pandecode_log("},\n");
+ } else {
+ pandecode_log(".shared_memory = {\n");
+ pandecode_indent++;
+ pandecode_shared_memory(&fb->shared_memory, is_compute);
+ pandecode_indent--;
+ pandecode_log("},\n");
+ }
info.width = fb->width1 + 1;
info.height = fb->height1 + 1;
pandecode_log_cont("\t/* %X %/\n", p->shared_memory & 1);
pandecode_compute_fbd(p->shared_memory & ~1, job_no);
} else if (p->shared_memory & MALI_MFBD)
- fbd_info = pandecode_mfbd_bfr((u64) ((uintptr_t) p->shared_memory) & FBD_MASK, job_no, false, job_type == JOB_TYPE_COMPUTE);
+ fbd_info = pandecode_mfbd_bfr((u64) ((uintptr_t) p->shared_memory) & FBD_MASK, job_no, false, job_type == JOB_TYPE_COMPUTE, false);
else if (job_type == JOB_TYPE_COMPUTE)
pandecode_compute_fbd((u64) (uintptr_t) p->shared_memory, job_no);
else
struct pandecode_fbd info;
if (is_mfbd)
- info = pandecode_mfbd_bfr(s->framebuffer & FBD_MASK, job_no, true, false);
+ info = pandecode_mfbd_bfr(s->framebuffer & FBD_MASK, job_no, true, false, is_bifrost);
else
info = pandecode_sfbd(s->framebuffer & FBD_MASK, job_no, true, gpu_id);