if (is_bifrost) {
rt->format.unk4 = 0x1;
} else {
- rt->format.block = MALI_BLOCK_LINEAR;
+ rt->format.block = MALI_BLOCK_FORMAT_LINEAR;
}
rt->framebuffer = base;
if (is_bifrost) {
rt->format.unk3 |= 0x8;
} else {
- rt->format.block = MALI_BLOCK_TILED;
+ rt->format.block = MALI_BLOCK_FORMAT_TILED;
}
rt->framebuffer = base;
rt->framebuffer_stride = stride;
rt->layer_stride = layer_stride;
} else if (drm_is_afbc(rsrc->modifier)) {
- rt->format.block = MALI_BLOCK_AFBC;
+ rt->format.block = MALI_BLOCK_FORMAT_AFBC;
unsigned header_size = rsrc->slices[level].header_size;
fbx->flags_hi |= MALI_EXTRA_PRESENT;
fbx->flags_lo |= MALI_EXTRA_ZS | 0x1; /* unknown */
- fbx->zs_block = MALI_BLOCK_AFBC;
+ fbx->zs_block = MALI_BLOCK_FORMAT_AFBC;
fbx->ds_afbc.depth_stencil = base + header_size;
fbx->ds_afbc.depth_stencil_afbc_metadata = base;
fbx->ds_linear.depth = base;
if (rsrc->modifier == DRM_FORMAT_MOD_LINEAR) {
- fbx->zs_block = MALI_BLOCK_LINEAR;
+ fbx->zs_block = MALI_BLOCK_FORMAT_LINEAR;
fbx->ds_linear.depth_stride = stride / 16;
fbx->ds_linear.depth_layer_stride = layer_stride;
} else {
if (is_bifrost) {
- fbx->zs_block = MALI_BLOCK_UNKNOWN;
+ /* XXX: Bifrost fields are different here */
+ fbx->zs_block = 1;
fbx->flags_hi |= 0x440;
fbx->flags_lo |= 0x1;
} else {
- fbx->zs_block = MALI_BLOCK_TILED;
+ fbx->zs_block = MALI_BLOCK_FORMAT_TILED;
}
fbx->ds_linear.depth_stride = stride;
fb->stride = stride;
if (rsrc->modifier == DRM_FORMAT_MOD_LINEAR)
- fb->format.block = MALI_BLOCK_LINEAR;
+ fb->format.block = MALI_BLOCK_FORMAT_LINEAR;
else if (rsrc->modifier == DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED) {
- fb->format.block = MALI_BLOCK_TILED;
+ fb->format.block = MALI_BLOCK_FORMAT_TILED;
fb->stride *= 16;
} else {
fprintf(stderr, "Invalid render modifier\n");
u32 weights[8];
};
-enum mali_block_format {
- MALI_BLOCK_TILED = 0x0,
- MALI_BLOCK_UNKNOWN = 0x1,
- MALI_BLOCK_LINEAR = 0x2,
- MALI_BLOCK_AFBC = 0x3,
-};
-
struct mali_sfbd_format {
/* 0x1 */
unsigned unk1 : 6;
}
}
-#define DEFINE_CASE(name) case MALI_BLOCK_## name: return "MALI_BLOCK_" #name
-static char *
-pandecode_block_format(enum mali_block_format fmt)
-{
- switch (fmt) {
- DEFINE_CASE(TILED);
- DEFINE_CASE(UNKNOWN);
- DEFINE_CASE(LINEAR);
- DEFINE_CASE(AFBC);
-
- default:
- unreachable("Invalid case");
- }
-}
-#undef DEFINE_CASE
-
#define DEFINE_CASE(name) case MALI_EXCEPTION_ACCESS_## name: return ""#name
static char *
pandecode_exception_access(unsigned access)
pandecode_log_decoded_flags(sfbd_unk2_info, format.unk2);
pandecode_log_cont(",\n");
- pandecode_prop("block = %s", pandecode_block_format(format.block));
+ pandecode_prop("block = %s", mali_block_format_as_str(format.block));
pandecode_prop("unk3 = 0x%" PRIx32, format.unk3);
pandecode_prop("unk3 = 0x%" PRIx32, format.unk3);
pandecode_prop("unk4 = 0x%" PRIx32, format.unk4);
- pandecode_prop("block = %s", pandecode_block_format(format.block));
+ pandecode_prop("block = %s", mali_block_format_as_str(format.block));
/* TODO: Map formats so we can check swizzles and print nicely */
pandecode_log("swizzle");
pandecode_rt_format(rt->format);
- if (rt->format.block == MALI_BLOCK_AFBC) {
+ if (rt->format.block == MALI_BLOCK_FORMAT_AFBC) {
pandecode_log(".afbc = {\n");
pandecode_indent++;
pandecode_log_decoded_flags(mfbd_extra_flag_lo_info, fbx->flags_lo);
pandecode_log_cont(",\n");
- pandecode_prop("zs_block = %s", pandecode_block_format(fbx->zs_block));
+ pandecode_prop("zs_block = %s", mali_block_format_as_str(fbx->zs_block));
pandecode_prop("zs_samples = MALI_POSITIVE(%u)", fbx->zs_samples + 1);
- if (fbx->zs_block == MALI_BLOCK_AFBC) {
+ if (fbx->zs_block == MALI_BLOCK_FORMAT_AFBC) {
pandecode_log(".ds_afbc = {\n");
pandecode_indent++;
<value name="Always" value="7"/>
</enum>
+ <enum name="Block Format">
+ <!--- 16x16 block u-interleaved -->
+ <value name="Tiled" value="0"/>
+ <value name="Linear" value="2"/>
+ <value name="AFBC" value="3"/>
+ </enum>
+
<enum name="Mipmap Mode">
<value name="Nearest" value="0"/>
<value name="None" value="1"/>