DUMP_ADDR(LOCAL_STORAGE, p->thread_storage & ~1, "Local Storage:\n");
#endif
} else {
-#if PAN_ARCH <= 5
+#if PAN_ARCH == 5
+ /* On v5 only, the actual framebuffer pointer is tagged with extra
+ * metadata that we validate but do not print.
+ */
+ pan_unpack(&p->fbd, FRAMEBUFFER_POINTER, ptr);
+
+ if (!ptr.type || ptr.zs_crc_extension_present ||
+ ptr.render_target_count != 1) {
+
+ fprintf(pandecode_dump_stream,
+ "Unexpected framebuffer pointer settings");
+ }
+
+ GENX(pandecode_fbd)(ptr.pointer, false, gpu_id);
+#elif PAN_ARCH == 4
GENX(pandecode_fbd)(p->fbd, false, gpu_id);
#endif
}
pandecode_indent--;
pandecode_log("\n");
- /* MRT blend fields are used whenever MFBD is used, with
- * per-RT descriptors */
-
+ /* MRT blend fields are used on v5+. Technically, they are optional on v5
+ * for backwards compatibility but we don't care about that.
+ */
#if PAN_ARCH >= 5
if ((job_type == MALI_JOB_TYPE_TILER ||
job_type == MALI_JOB_TYPE_FRAGMENT) &&
- (PAN_ARCH >= 6 || p->thread_storage & MALI_FBD_TAG_IS_MFBD)) {
+ PAN_ARCH >= 5) {
void *blend_base = ((void *)cl) + pan_size(RENDERER_STATE);
for (unsigned i = 0; i < fbd_info.rt_count; i++) {
struct mali_fragment_job_packed *PANDECODE_PTR_VAR(p, job);
pan_section_unpack(p, FRAGMENT_JOB, PAYLOAD, s);
- UNUSED struct pandecode_fbd info =
- GENX(pandecode_fbd)(s.framebuffer, true, gpu_id);
+ uint64_t fbd_pointer;
#if PAN_ARCH >= 5
- unsigned expected_tag = 0;
-
- /* Compute the tag for the tagged pointer. This contains the type of
- * FBD (MFBD/SFBD), and in the case of an MFBD, information about which
- * additional structures follow the MFBD header (an extra payload or
- * not, as well as a count of render targets) */
-
- expected_tag = MALI_FBD_TAG_IS_MFBD;
- if (info.has_extra)
- expected_tag |= MALI_FBD_TAG_HAS_ZS_RT;
-
- expected_tag |= MALI_FBD_TAG_IS_MFBD | (MALI_POSITIVE(info.rt_count) << 2);
+ /* On v5 and newer, the actual framebuffer pointer is tagged with extra
+ * metadata that we need to disregard.
+ */
+ pan_unpack(&s.framebuffer, FRAMEBUFFER_POINTER, ptr);
+ fbd_pointer = ptr.pointer;
+#else
+ /* On v4, the framebuffer pointer is untagged. */
+ fbd_pointer = s.framebuffer;
#endif
- DUMP_UNPACKED(FRAGMENT_JOB_PAYLOAD, s, "Fragment Job Payload:\n");
+ UNUSED struct pandecode_fbd info =
+ GENX(pandecode_fbd)(fbd_pointer, true, gpu_id);
#if PAN_ARCH >= 5
- /* The FBD is a tagged pointer */
-
- unsigned tag = (s.framebuffer & MALI_FBD_TAG_MASK);
-
- if (tag != expected_tag)
- pandecode_log("// XXX: expected FBD tag %X but got %X\n", expected_tag,
- tag);
+ if (!ptr.type || ptr.zs_crc_extension_present != info.has_extra ||
+ ptr.render_target_count != info.rt_count) {
+ pandecode_log("invalid FBD tag\n");
+ }
#endif
+ DUMP_UNPACKED(FRAGMENT_JOB_PAYLOAD, s, "Fragment Job Payload:\n");
+
pandecode_log("\n");
}
const struct pan_fb_info *fb, const struct pan_tls_info *tls,
const struct pan_tiler_context *tiler_ctx, void *out)
{
- unsigned tags = MALI_FBD_TAG_IS_MFBD;
void *fbd = out;
void *rtd = out + pan_size(FRAMEBUFFER);
if (has_zs_crc_ext) {
pan_emit_zs_crc_ext(fb, crc_rt, out + pan_size(FRAMEBUFFER));
rtd += pan_size(ZS_CRC_EXTENSION);
- tags |= MALI_FBD_TAG_HAS_ZS_RT;
}
unsigned rt_count = MAX2(fb->rt_count, 1);
if (i != crc_rt)
*(fb->rts[i].crc_valid) = false;
}
- tags |= MALI_POSITIVE(MAX2(fb->rt_count, 1)) << 2;
- return tags;
+ uint64_t tag = 0;
+ pan_pack(&tag, FRAMEBUFFER_POINTER, cfg) {
+ cfg.zs_crc_extension_present = has_zs_crc_ext;
+ cfg.render_target_count = MAX2(fb->rt_count, 1);
+ }
+ return tag;
}
#else /* PAN_ARCH == 4 */
unsigned