aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-graphics/xorg-xserver/xserver-xorg/0001-glamor-Fix-fbo-pixmap-format-with-GL_BGRA_EXT.patch
blob: 960bf3b50bedae0b4396439cc2b877a7e26ad3b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From c76f5d2c0a0dda534888025d7236465202884665 Mon Sep 17 00:00:00 2001
From: Xianzhong <xianzhong.li@nxp.com>
Date: Thu, 5 Aug 2021 16:57:43 +0800
Subject: [PATCH] glamor: Fix fbo pixmap format with GL_BGRA_EXT

Red and Blue channels are swizzled in GLES path,
Fix color inverse problem with ximagesink command:
gst-launch-1.0 videotestsrc pattern=6 num-buffers=1 ! video/x-raw,format=BGRx ! videoconvert ! ximagesink display=:0 -v

This fix requires GL_EXT_texture_format_BGRA8888 extention, not applicable for upstream.

Upstream-Status: Inappropriate

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
---
 glamor/glamor.c | 7 +++++++
 1 file changed, 7 insertions(+)

--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -586,10 +586,17 @@ glamor_setup_formats(ScreenPtr screen)
 
     if (glamor_priv->is_gles) {
         assert(X_BYTE_ORDER == X_LITTLE_ENDIAN);
+#if GL_EXT_texture_format_BGRA8888
+        glamor_add_format(screen, 24, PICT_x8r8g8b8,
+                          GL_BGRA_EXT, GL_BGRA_EXT, GL_UNSIGNED_BYTE, TRUE);
+        glamor_add_format(screen, 32, PICT_a8r8g8b8,
+                          GL_BGRA_EXT, GL_BGRA_EXT, GL_UNSIGNED_BYTE, TRUE);
+#else
         glamor_add_format(screen, 24, PICT_x8b8g8r8,
                           GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, TRUE);
         glamor_add_format(screen, 32, PICT_a8b8g8r8,
                           GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, TRUE);
+#endif
     } else {
         glamor_add_format(screen, 24, PICT_x8r8g8b8,
                           GL_RGBA, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, TRUE);