* - TODO: Anything else?
*/
+/* Flags field: note, these are guesses */
+
+#define MALI_EXTRA_PRESENT (0x400)
+#define MALI_EXTRA_AFBC (0x20)
+#define MALI_EXTRA_AFBC_ZS (0x10)
+#define MALI_EXTRA_ZS (0x4)
+
struct bifrost_fb_extra {
mali_ptr checksum;
/* Each tile has an 8 byte checksum, so the stride is "width in tiles * 8" */
u32 checksum_stride;
- u32 unk;
+ u32 flags;
union {
/* Note: AFBC is only allowed for 24/8 combined depth/stencil. */
ctx->fragment_mfbd.unk3 |= MALI_MFBD_EXTRA;
+ ctx->fragment_extra.flags =
+ MALI_EXTRA_PRESENT |
+ MALI_EXTRA_AFBC |
+ MALI_EXTRA_AFBC_ZS |
+ MALI_EXTRA_ZS |
+ 0x1; /* unknown */
+
ctx->fragment_extra.ds_afbc.depth_stencil_afbc_metadata = rsrc->bo->afbc_slab.gpu;
ctx->fragment_extra.ds_afbc.depth_stencil_afbc_stride = 0;
ctx->fragment_extra.ds_afbc.zero1 = 0x10009;
ctx->fragment_extra.ds_afbc.padding = 0x1000;
- ctx->fragment_extra.unk = 0x435; /* General 0x400 in all unks. 0x5 for depth/stencil. 0x10 for AFBC encoded depth stencil. Unclear where the 0x20 is from */
-
ctx->fragment_mfbd.unk3 |= MALI_MFBD_DEPTH_WRITE;
}
}
if (job->clear & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)) {
/* Setup combined 24/8 depth/stencil */
ctx->fragment_mfbd.unk3 |= MALI_MFBD_EXTRA;
- ctx->fragment_extra.unk = 0x405;
+ ctx->fragment_extra.flags = 0x405;
ctx->fragment_extra.ds_linear.depth = ctx->depth_stencil_buffer.gpu;
ctx->fragment_extra.ds_linear.depth_stride = ctx->pipe_framebuffer.width * 4;
}
int stride = util_format_get_stride(rsrc->base.format, rsrc->base.width0);
ctx->fragment_mfbd.unk3 |= MALI_MFBD_EXTRA;
- ctx->fragment_extra.unk |= 0x420;
+ ctx->fragment_extra.flags |= MALI_EXTRA_PRESENT;
ctx->fragment_extra.checksum_stride = rsrc->bo->checksum_stride;
ctx->fragment_extra.checksum = rsrc->bo->gpu[0] + stride * rsrc->base.height0;
}
};
#undef FLAG_INFO
+#define FLAG_INFO(flag) { MALI_EXTRA_##flag, "MALI_EXTRA_" #flag }
+static const struct pandecode_flag_info mfbd_extra_flag_info[] = {
+ FLAG_INFO(PRESENT),
+ FLAG_INFO(AFBC),
+ FLAG_INFO(ZS),
+ {}
+};
+#undef FLAG_INFO
+
extern char *replace_fragment;
extern char *replace_vertex;
if (fbx->checksum_stride)
pandecode_prop("checksum_stride = %d", fbx->checksum_stride);
- pandecode_prop("unk = 0x%x", fbx->unk);
+ pandecode_log(".flags = ");
+ pandecode_log_decoded_flags(mfbd_extra_flag_info, fbx->flags);
+ pandecode_log_cont(",\n");
- /* TODO figure out if this is actually the right way to
- * determine whether AFBC is enabled
- */
- if (fbx->unk & 0x10) {
+ if (fbx->flags & MALI_EXTRA_AFBC_ZS) {
pandecode_log(".ds_afbc = {\n");
pandecode_indent++;