summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc5/vc5_program.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-10-30 10:13:52 -0700
committerEric Anholt <[email protected]>2017-10-30 13:31:32 -0700
commit828299d1bd3f98179cd82939d25d919f2022541e (patch)
tree02943e92d76d0dc2e61679b0a1715fc13180704a /src/gallium/drivers/vc5/vc5_program.c
parent9e5df1897c8782a7d1bfbc11fa4bef47177db404 (diff)
broadcom/vc5: Don't do r/b channel swapping on 565.
The HW's format actually matches the gallium format.
Diffstat (limited to 'src/gallium/drivers/vc5/vc5_program.c')
-rw-r--r--src/gallium/drivers/vc5/vc5_program.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc5/vc5_program.c b/src/gallium/drivers/vc5/vc5_program.c
index 37173ae58d5..7463709aa5c 100644
--- a/src/gallium/drivers/vc5/vc5_program.c
+++ b/src/gallium/drivers/vc5/vc5_program.c
@@ -371,8 +371,14 @@ vc5_update_compiled_fs(struct vc5_context *vc5, uint8_t prim_mode)
const struct util_format_description *desc =
util_format_description(cbuf->format);
- if (desc->swizzle[0] == PIPE_SWIZZLE_Z)
+ /* For BGRA8 formats (DRI window system default format), we
+ * need to swap R and B, since the HW's format is RGBA8.
+ */
+ if (desc->swizzle[0] == PIPE_SWIZZLE_Z &&
+ cbuf->format != PIPE_FORMAT_B5G6R5_UNORM) {
key->swap_color_rb |= 1 << i;
+ }
+
if (desc->channel[0].type == UTIL_FORMAT_TYPE_FLOAT &&
desc->channel[0].size == 32) {
key->f32_color_rb |= 1 << i;