From b69f6a06f8698c72c30465dbfa1cc91334551b03 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Thu, 27 Feb 2020 04:40:40 -0600 Subject: user/mesa: Fix behaviour on big endian systems --- user/mesa/big-endian-flipping.patch | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 user/mesa/big-endian-flipping.patch (limited to 'user/mesa/big-endian-flipping.patch') diff --git a/user/mesa/big-endian-flipping.patch b/user/mesa/big-endian-flipping.patch new file mode 100644 index 000000000..154a83108 --- /dev/null +++ b/user/mesa/big-endian-flipping.patch @@ -0,0 +1,37 @@ +From f1e0d76264491a8d8f99a0041b1a36cf9752fd28 Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" +Date: Thu, 27 Feb 2020 04:24:52 -0600 +Subject: [PATCH] mesa: Support flipping three-channel formats + +Test system: POWER9 ppc64 (BE) system with a Radeon R5 230. + +Before this commit, starting Xorg caused this message: +Assertion failed: !"Invalid array format" (../src/mesa/main/formats.c: _mesa_array_format_flip_channels: 421) + +After this commit, Xorg starts successfully. +--- + src/mesa/main/formats.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c +index 370859d37ca..2e7d5d7f05e 100644 +--- a/src/mesa/main/formats.c ++++ b/src/mesa/main/formats.c +@@ -419,6 +419,14 @@ _mesa_array_format_flip_channels(mesa_array_format format) + return format; + } + ++ if (num_channels == 3) { ++ static const uint8_t flip[6] = { 2, 1, 0, 3, 4, 5 }; ++ _mesa_array_format_set_swizzle(&format, ++ flip[swizzle[0]], flip[swizzle[1]], ++ flip[swizzle[2]], flip[swizzle[3]]); ++ return format; ++ } ++ + if (num_channels == 4) { + static const uint8_t flip[6] = { 3, 2, 1, 0, 4, 5 }; + _mesa_array_format_set_swizzle(&format, +-- +2.25.1 + -- cgit v1.2.3-70-g09d2