panfrost: Decode AFBC flag bits
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5293>
diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c
index 8c42a57..f9bfa19 100644
--- a/src/panfrost/pandecode/decode.c
+++ b/src/panfrost/pandecode/decode.c
@@ -248,6 +248,13 @@
};
#undef FLAG_INFO
+#define FLAG_INFO(flag) { MALI_AFBC_##flag, "MALI_AFBC_" #flag }
+static const struct pandecode_flag_info afbc_fmt_flag_info[] = {
+ FLAG_INFO(YTR),
+ {}
+};
+#undef FLAG_INFO
+
#define FLAG_INFO(flag) { MALI_EXTRA_##flag, "MALI_EXTRA_" #flag }
static const struct pandecode_flag_info mfbd_extra_flag_hi_info[] = {
FLAG_INFO(PRESENT),
@@ -1056,15 +1063,18 @@
free(a);
pandecode_prop("stride = %d", rt->afbc.stride);
- pandecode_prop("unk = 0x%" PRIx32, rt->afbc.unk);
+
+ pandecode_log(".flags = ");
+ pandecode_log_decoded_flags(afbc_fmt_flag_info, rt->afbc.flags);
+ pandecode_log_cont(",\n");
pandecode_indent--;
pandecode_log("},\n");
- } else if (rt->afbc.metadata || rt->afbc.stride || rt->afbc.unk) {
+ } else if (rt->afbc.metadata || rt->afbc.stride || rt->afbc.flags) {
pandecode_msg("XXX: AFBC disabled but AFBC field set (0x%lX, 0x%x, 0x%x)\n",
rt->afbc.metadata,
rt->afbc.stride,
- rt->afbc.unk);
+ rt->afbc.flags);
}
MEMORY_PROP(rt, framebuffer);
@@ -1234,12 +1244,13 @@
fbx->ds_afbc.depth_stencil_afbc_stride);
MEMORY_PROP_DIR(fbx->ds_afbc, depth_stencil);
- if (fbx->ds_afbc.zero1 || fbx->ds_afbc.padding) {
+ pandecode_log(".flags = ");
+ pandecode_log_decoded_flags(afbc_fmt_flag_info, fbx->ds_afbc.flags);
+ pandecode_log_cont(",\n");
+
+ if (fbx->ds_afbc.padding) {
pandecode_msg("XXX: Depth/stencil AFBC zeros tripped\n");
- pandecode_prop("zero1 = 0x%" PRIx32,
- fbx->ds_afbc.zero1);
- pandecode_prop("padding = 0x%" PRIx64,
- fbx->ds_afbc.padding);
+ pandecode_prop("padding = 0x%" PRIx64, fbx->ds_afbc.padding);
}
pandecode_indent--;