summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_mfbd.c
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-05-02 02:27:04 +0000
committerAlyssa Rosenzweig <[email protected]>2019-05-04 19:08:50 +0000
commit31f5a43bf0d01ea0cab54a05eadf6e6778fc570f (patch)
treefdb7a018d540d42f9dea42e2e87ace5f9ea75ca9 /src/gallium/drivers/panfrost/pan_mfbd.c
parentf8c7ffa07a2b938f99f656fbc4f7fe1baa9eeafe (diff)
panfrost: Support RGB565 FBOs
Signed-off-by: Alyssa Rosenzweig <[email protected]>
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) {