From f1abf3713e54c92dc54483f0cb8e202da602d7cd Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Wed, 11 May 2022 20:14:27 -0500 Subject: xwayland: Rework i.MX GPU configuration variables The design for GPU configuration uses a single input variable for any SOC with GPU and then chooses which SOC to apply it to. A better model uses a single input variable varied on the SOC, then adds it for GPU. Signed-off-by: Tom Hochstein (cherry picked from commit 7a15ffa434ada5eb63a1ec3809b22955002f00c7) --- recipes-graphics/xwayland/xwayland_%.bbappend | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'recipes-graphics/xwayland') diff --git a/recipes-graphics/xwayland/xwayland_%.bbappend b/recipes-graphics/xwayland/xwayland_%.bbappend index c63212d0..5cc2db67 100644 --- a/recipes-graphics/xwayland/xwayland_%.bbappend +++ b/recipes-graphics/xwayland/xwayland_%.bbappend @@ -1,4 +1,4 @@ -IMX_OPENGL_PKGCONFIGS_REMOVE = "" -IMX_OPENGL_PKGCONFIGS_REMOVE:imxgpu = "glamor" -OPENGL_PKGCONFIGS:remove:mx6-nxp-bsp = "${IMX_OPENGL_PKGCONFIGS_REMOVE}" -OPENGL_PKGCONFIGS:remove:mx7-nxp-bsp = "${IMX_OPENGL_PKGCONFIGS_REMOVE}" +OPENGL_PKGCONFIGS:remove:imxgpu = "${OPENGL_PKGCONFIGS_REMOVE_IMXGPU}" +OPENGL_PKGCONFIGS_REMOVE_IMXGPU = "" +OPENGL_PKGCONFIGS_REMOVE_IMXGPU:mx6-nxp-bsp = "glamor" +OPENGL_PKGCONFIGS_REMOVE_IMXGPU:mx7-nxp-bsp = "glamor" -- cgit v1.2.3-54-g00ecf From b4fbbf154b1bcc59831bc4a24c3ab16382bb7aef Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Wed, 11 May 2022 20:28:59 -0500 Subject: xwayland: Drop GLX for i.MX GPU i.MX GPU drivers don't support GLX. Signed-off-by: Tom Hochstein (cherry picked from commit d9df3c4efa829288478d1c5bb90af938a3dfc30b) --- recipes-graphics/xwayland/xwayland_%.bbappend | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'recipes-graphics/xwayland') diff --git a/recipes-graphics/xwayland/xwayland_%.bbappend b/recipes-graphics/xwayland/xwayland_%.bbappend index 5cc2db67..9bf4f9bd 100644 --- a/recipes-graphics/xwayland/xwayland_%.bbappend +++ b/recipes-graphics/xwayland/xwayland_%.bbappend @@ -1,4 +1,5 @@ OPENGL_PKGCONFIGS:remove:imxgpu = "${OPENGL_PKGCONFIGS_REMOVE_IMXGPU}" OPENGL_PKGCONFIGS_REMOVE_IMXGPU = "" -OPENGL_PKGCONFIGS_REMOVE_IMXGPU:mx6-nxp-bsp = "glamor" -OPENGL_PKGCONFIGS_REMOVE_IMXGPU:mx7-nxp-bsp = "glamor" +OPENGL_PKGCONFIGS_REMOVE_IMXGPU:mx6-nxp-bsp = "glamor glx" +OPENGL_PKGCONFIGS_REMOVE_IMXGPU:mx7-nxp-bsp = "glamor glx" +OPENGL_PKGCONFIGS_REMOVE_IMXGPU:mx8-nxp-bsp = "glx" -- cgit v1.2.3-54-g00ecf From 3b96ac30dd55452cc2916a180e9914fe9dd1552c Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Wed, 11 May 2022 20:32:35 -0500 Subject: xwayland: Add patch to prefer GLES2 for glamor EGL Signed-off-by: Tom Hochstein (cherry picked from commit a4f772cab24996be79e6dfc26f0b7a3c740468ca) --- ...er-to-create-GLES2-context-for-glamor-EGL.patch | 31 ++++++++++++++++++++++ recipes-graphics/xwayland/xwayland_%.bbappend | 6 +++++ 2 files changed, 37 insertions(+) create mode 100644 recipes-graphics/xwayland/xwayland/0001-Prefer-to-create-GLES2-context-for-glamor-EGL.patch (limited to 'recipes-graphics/xwayland') diff --git a/recipes-graphics/xwayland/xwayland/0001-Prefer-to-create-GLES2-context-for-glamor-EGL.patch b/recipes-graphics/xwayland/xwayland/0001-Prefer-to-create-GLES2-context-for-glamor-EGL.patch new file mode 100644 index 00000000..c1e8ae11 --- /dev/null +++ b/recipes-graphics/xwayland/xwayland/0001-Prefer-to-create-GLES2-context-for-glamor-EGL.patch @@ -0,0 +1,31 @@ +From e75a4d7b4474529967490de6e75ae4f1b7128937 Mon Sep 17 00:00:00 2001 +From: Xianzhong +Date: Sat, 22 Jan 2022 17:57:59 +0800 +Subject: [PATCH 1/3] Prefer to create GLES2 context for glamor EGL + +created the initial patch for xwayland-21.1.2 + +Upstream-Status: Inappropriate [embedded specific] +Signed-off-by: Xianzhong +--- + hw/xwayland/xwayland-glamor-gbm.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c +index 12d820e44..8a89919be 100644 +--- a/hw/xwayland/xwayland-glamor-gbm.c ++++ b/hw/xwayland/xwayland-glamor-gbm.c +@@ -866,8 +866,8 @@ xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen) + goto error; + } + +- if (!xwl_glamor_try_big_gl_api(xwl_screen) && +- !xwl_glamor_try_gles_api(xwl_screen)) { ++ if (!xwl_glamor_try_gles_api(xwl_screen) && ++ !xwl_glamor_try_big_gl_api(xwl_screen)) { + ErrorF("Cannot use neither GL nor GLES2\n"); + goto error; + } +-- +2.17.1 + diff --git a/recipes-graphics/xwayland/xwayland_%.bbappend b/recipes-graphics/xwayland/xwayland_%.bbappend index 9bf4f9bd..211d07a2 100644 --- a/recipes-graphics/xwayland/xwayland_%.bbappend +++ b/recipes-graphics/xwayland/xwayland_%.bbappend @@ -1,3 +1,9 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI:append:imxgpu = " \ + file://0001-Prefer-to-create-GLES2-context-for-glamor-EGL.patch \ +" + OPENGL_PKGCONFIGS:remove:imxgpu = "${OPENGL_PKGCONFIGS_REMOVE_IMXGPU}" OPENGL_PKGCONFIGS_REMOVE_IMXGPU = "" OPENGL_PKGCONFIGS_REMOVE_IMXGPU:mx6-nxp-bsp = "glamor glx" -- cgit v1.2.3-54-g00ecf From 163dfbf76c881216473b32efe266c0e74a39b142 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 (cherry picked from commit 8a19c8c576ede98c41f45773c2376ad69389907b) --- ...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/xwayland') 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