From 8a19c8c576ede98c41f45773c2376ad69389907b Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Wed, 11 May 2022 21:02:56 -0500 Subject: xwayland: Add patch to fix fbo pixmap on glamor Signed-off-by: Tom Hochstein --- ...or-Fix-fbo-pixmap-format-with-GL_BGRA_EXT.patch | 39 ++++++++++++++++++++++ recipes-graphics/xwayland/xwayland_%.bbappend | 1 + 2 files changed, 40 insertions(+) create mode 100644 recipes-graphics/xwayland/xwayland/0002-glamor-Fix-fbo-pixmap-format-with-GL_BGRA_EXT.patch (limited to 'recipes-graphics') diff --git a/recipes-graphics/xwayland/xwayland/0002-glamor-Fix-fbo-pixmap-format-with-GL_BGRA_EXT.patch b/recipes-graphics/xwayland/xwayland/0002-glamor-Fix-fbo-pixmap-format-with-GL_BGRA_EXT.patch new file mode 100644 index 00000000..1c6cf2ec --- /dev/null +++ b/recipes-graphics/xwayland/xwayland/0002-glamor-Fix-fbo-pixmap-format-with-GL_BGRA_EXT.patch @@ -0,0 +1,39 @@ +From 4508e54dae9d2884b2d6ccca13450b25d509cc9a Mon Sep 17 00:00:00 2001 +From: Xianzhong +Date: Thu, 5 Aug 2021 16:57:43 +0800 +Subject: [PATCH 3/3] 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 extension, not applicable for upstream. + +Upstream-Status: Inappropriate [embedded specific] +Signed-off-by: Xianzhong +--- + glamor/glamor.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +Index: xwayland-21.1.4/glamor/glamor.c +=================================================================== +--- xwayland-21.1.4.orig/glamor/glamor.c ++++ xwayland-21.1.4/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); diff --git a/recipes-graphics/xwayland/xwayland_%.bbappend b/recipes-graphics/xwayland/xwayland_%.bbappend index 211d07a2..69063121 100644 --- a/recipes-graphics/xwayland/xwayland_%.bbappend +++ b/recipes-graphics/xwayland/xwayland_%.bbappend @@ -2,6 +2,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" SRC_URI:append:imxgpu = " \ file://0001-Prefer-to-create-GLES2-context-for-glamor-EGL.patch \ + file://0002-glamor-Fix-fbo-pixmap-format-with-GL_BGRA_EXT.patch \ " OPENGL_PKGCONFIGS:remove:imxgpu = "${OPENGL_PKGCONFIGS_REMOVE_IMXGPU}" -- cgit v1.2.3-54-g00ecf