summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_mfbd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_mfbd.c')
-rw-r--r--src/gallium/drivers/panfrost/pan_mfbd.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c
index 25286c32da5..6986992012f 100644
--- a/src/gallium/drivers/panfrost/pan_mfbd.c
+++ b/src/gallium/drivers/panfrost/pan_mfbd.c
@@ -36,7 +36,7 @@ panfrost_mfbd_format(struct pipe_surface *surf)
const struct util_format_description *desc =
util_format_description(surf->texture->format);
- /* Fill in accordingly */
+ /* Fill in accordingly, defaulting to RGBA8888 (UNORM) */
struct mali_rt_format fmt = {
.unk1 = 0x4000000,
@@ -47,6 +47,14 @@ panfrost_mfbd_format(struct pipe_surface *surf)
.unk4 = 0x8
};
+ /* Set flags for alternative formats */
+
+ if (surf->texture->format == PIPE_FORMAT_B5G6R5_UNORM) {
+ fmt.unk1 = 0x14000000;
+ fmt.nr_channels = MALI_POSITIVE(2);
+ fmt.flags |= 0x1;
+ }
+
return fmt;
}
@@ -95,7 +103,6 @@ panfrost_mfbd_set_cbuf(
stride = -stride;
}
- /* MFBD specifies stride in tiles */
rt->framebuffer = framebuffer;
rt->framebuffer_stride = stride / 16;
} else if (rsrc->bo->layout == PAN_AFBC) {