diff options
author | Tom Hochstein <tom.hochstein@nxp.com> | 2021-03-31 08:46:26 -0500 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2021-04-13 17:30:43 -0300 |
commit | f6be622c2662745d2dbc9a02035ce7f2c3817316 (patch) | |
tree | 327ade52f39146f409e3736a33f7f832f72a08a5 | |
parent | d18d01dd93a78ae07997131a4273e66cbc801740 (diff) | |
download | meta-freescale-f6be622c2662745d2dbc9a02035ce7f2c3817316.tar.gz |
xserver-xorg: Enable glamor for i.MX 8
Enable glamor (the default) so legacy x11 apps will get GPU
acceleration.
Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
4 files changed, 116 insertions, 1 deletions
diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0001-MGS-5186-Per-Specification-EGL_NATIVE_PIXMAP_KHR-req.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0001-MGS-5186-Per-Specification-EGL_NATIVE_PIXMAP_KHR-req.patch new file mode 100644 index 00000000..6f232589 --- /dev/null +++ b/recipes-graphics/xorg-xserver/xserver-xorg/0001-MGS-5186-Per-Specification-EGL_NATIVE_PIXMAP_KHR-req.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From ed3c55fa6260ad125a32f9ac67f9e44a9bce7cf1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Prabhu Sundararaj <prabhu.sundararaj@nxp.com> | ||
3 | Date: Mon, 11 May 2020 19:12:51 -0500 | ||
4 | Subject: [PATCH] MGS-5186 Per Specification EGL_NATIVE_PIXMAP_KHR requires | ||
5 | EGL_NO_CONTEXT | ||
6 | |||
7 | https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_image_pixmap.txt | ||
8 | |||
9 | Per Specification EGL_NATIVE_PIXMAP_KHR requires EGL_NO_CONTEXT. | ||
10 | So passing context will result in error. | ||
11 | |||
12 | Upstream-Status: Pending | ||
13 | Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@nxp.com> | ||
14 | --- | ||
15 | hw/xwayland/xwayland-glamor-gbm.c | 2 +- | ||
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
17 | |||
18 | Index: xorg-server-1.20.8/hw/xwayland/xwayland-glamor-gbm.c | ||
19 | =================================================================== | ||
20 | --- xorg-server-1.20.8.orig/hw/xwayland/xwayland-glamor-gbm.c | ||
21 | +++ xorg-server-1.20.8/hw/xwayland/xwayland-glamor-gbm.c | ||
22 | @@ -167,7 +167,7 @@ xwl_glamor_gbm_create_pixmap_for_bo(Scre | ||
23 | xwl_pixmap->bo = bo; | ||
24 | xwl_pixmap->buffer = NULL; | ||
25 | xwl_pixmap->image = eglCreateImageKHR(xwl_screen->egl_display, | ||
26 | - xwl_screen->egl_context, | ||
27 | + EGL_NO_CONTEXT, | ||
28 | EGL_NATIVE_PIXMAP_KHR, | ||
29 | xwl_pixmap->bo, NULL); | ||
30 | if (xwl_pixmap->image == EGL_NO_IMAGE_KHR) | ||
diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0001-glamor-glamor_egl.c-EGL_NATIVE_PIXMAP_KHR-do-not-req.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0001-glamor-glamor_egl.c-EGL_NATIVE_PIXMAP_KHR-do-not-req.patch new file mode 100644 index 00000000..c8f1ae73 --- /dev/null +++ b/recipes-graphics/xorg-xserver/xserver-xorg/0001-glamor-glamor_egl.c-EGL_NATIVE_PIXMAP_KHR-do-not-req.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From cc05c01925755310f027c61daa29648a10155f96 Mon Sep 17 00:00:00 2001 | ||
2 | From: Rohan Garg <rohan@garg.io> | ||
3 | Date: Thu, 13 Dec 2018 19:15:01 +0100 | ||
4 | Subject: [PATCH] glamor/glamor_egl.c: EGL_NATIVE_PIXMAP_KHR do not require | ||
5 | contexts | ||
6 | |||
7 | From https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_image_pixmap.txt | ||
8 | |||
9 | * If <target> is EGL_NATIVE_PIXMAP_KHR, and <ctx> is not EGL_NO_CONTEXT, | ||
10 | the error EGL_BAD_PARAMETER is generated. | ||
11 | |||
12 | Fixes: a5321ea4 ("Allow to create textured pixmaps from gbm_bo without using gem names") | ||
13 | --- | ||
14 | glamor/glamor_egl.c | 2 +- | ||
15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
16 | |||
17 | Upstream-Status: Backport [cc05c01925755310f027c61daa29648a10155f96] | ||
18 | |||
19 | diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c | ||
20 | index 0f4edb5a3..69844d4e2 100644 | ||
21 | --- a/glamor/glamor_egl.c | ||
22 | +++ b/glamor/glamor_egl.c | ||
23 | @@ -233,7 +233,7 @@ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, | ||
24 | glamor_make_current(glamor_priv); | ||
25 | |||
26 | image = eglCreateImageKHR(glamor_egl->display, | ||
27 | - glamor_egl->context, | ||
28 | + EGL_NO_CONTEXT, | ||
29 | EGL_NATIVE_PIXMAP_KHR, bo, NULL); | ||
30 | if (image == EGL_NO_IMAGE_KHR) { | ||
31 | glamor_set_pixmap_type(pixmap, GLAMOR_DRM_ONLY); | ||
32 | -- | ||
33 | 2.17.1 | ||
34 | |||
diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0001-prefer-to-use-GLES2-for-glamor-EGL-config.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0001-prefer-to-use-GLES2-for-glamor-EGL-config.patch new file mode 100644 index 00000000..6e140eaa --- /dev/null +++ b/recipes-graphics/xorg-xserver/xserver-xorg/0001-prefer-to-use-GLES2-for-glamor-EGL-config.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From a99ff39b3b6095a16977fbb13b2b453a7359850f Mon Sep 17 00:00:00 2001 | ||
2 | From: Xianzhong <xianzhong.li@nxp.com> | ||
3 | Date: Mon, 11 Jan 2021 11:53:29 +0800 | ||
4 | Subject: [PATCH] prefer to use GLES2 for glamor EGL config | ||
5 | |||
6 | created the initial patch for xorg/xserver 1.20.8 | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | Signed-off-by: Xianzhong <xianzhong.li@nxp.com> | ||
10 | --- | ||
11 | hw/xwayland/xwayland-glamor-gbm.c | 13 ++++--------- | ||
12 | 1 file changed, 4 insertions(+), 9 deletions(-) | ||
13 | |||
14 | diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c | ||
15 | index dce782fc3..1fdf45490 100644 | ||
16 | --- a/hw/xwayland/xwayland-glamor-gbm.c | ||
17 | +++ b/hw/xwayland/xwayland-glamor-gbm.c | ||
18 | @@ -912,13 +912,8 @@ xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen) | ||
19 | struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); | ||
20 | EGLint major, minor; | ||
21 | Bool egl_initialized = FALSE; | ||
22 | - static const EGLint config_attribs_core[] = { | ||
23 | - EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR, | ||
24 | - EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR, | ||
25 | - EGL_CONTEXT_MAJOR_VERSION_KHR, | ||
26 | - GLAMOR_GL_CORE_VER_MAJOR, | ||
27 | - EGL_CONTEXT_MINOR_VERSION_KHR, | ||
28 | - GLAMOR_GL_CORE_VER_MINOR, | ||
29 | + static const EGLint config_attribs_gles2[] = { | ||
30 | + EGL_CONTEXT_CLIENT_VERSION, 2, | ||
31 | EGL_NONE | ||
32 | }; | ||
33 | const GLubyte *renderer; | ||
34 | @@ -947,10 +942,10 @@ xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen) | ||
35 | goto error; | ||
36 | } | ||
37 | |||
38 | - eglBindAPI(EGL_OPENGL_API); | ||
39 | + eglBindAPI(EGL_OPENGL_ES_API); | ||
40 | |||
41 | xwl_screen->egl_context = eglCreateContext( | ||
42 | - xwl_screen->egl_display, NULL, EGL_NO_CONTEXT, config_attribs_core); | ||
43 | + xwl_screen->egl_display, NULL, EGL_NO_CONTEXT, config_attribs_gles2); | ||
44 | if (xwl_screen->egl_context == EGL_NO_CONTEXT) { | ||
45 | xwl_screen->egl_context = eglCreateContext( | ||
46 | xwl_screen->egl_display, NULL, EGL_NO_CONTEXT, NULL); | ||
47 | -- | ||
48 | 2.17.1 | ||
49 | |||
diff --git a/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend b/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend index 9eb149f0..a828e518 100644 --- a/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend +++ b/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend | |||
@@ -1,6 +1,9 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" | 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" |
2 | SRC_URI_append_imxgpu = " \ | 2 | SRC_URI_append_imxgpu = " \ |
3 | file://0003-Remove-check-for-useSIGIO-option.patch \ | 3 | file://0003-Remove-check-for-useSIGIO-option.patch \ |
4 | file://0001-MGS-5186-Per-Specification-EGL_NATIVE_PIXMAP_KHR-req.patch \ | ||
5 | file://0001-glamor-glamor_egl.c-EGL_NATIVE_PIXMAP_KHR-do-not-req.patch \ | ||
6 | file://0001-prefer-to-use-GLES2-for-glamor-EGL-config.patch \ | ||
4 | file://0001-hw-xwayland-Makefile.am-fix-build-without-glx.patch \ | 7 | file://0001-hw-xwayland-Makefile.am-fix-build-without-glx.patch \ |
5 | " | 8 | " |
6 | 9 | ||
@@ -8,5 +11,4 @@ IMX_OPENGL_PKGCONFIGS_REMOVE = "" | |||
8 | IMX_OPENGL_PKGCONFIGS_REMOVE_imxgpu = "glamor" | 11 | IMX_OPENGL_PKGCONFIGS_REMOVE_imxgpu = "glamor" |
9 | OPENGL_PKGCONFIGS_remove_mx6 = "${IMX_OPENGL_PKGCONFIGS_REMOVE}" | 12 | OPENGL_PKGCONFIGS_remove_mx6 = "${IMX_OPENGL_PKGCONFIGS_REMOVE}" |
10 | OPENGL_PKGCONFIGS_remove_mx7 = "${IMX_OPENGL_PKGCONFIGS_REMOVE}" | 13 | OPENGL_PKGCONFIGS_remove_mx7 = "${IMX_OPENGL_PKGCONFIGS_REMOVE}" |
11 | OPENGL_PKGCONFIGS_remove_mx8 = "${IMX_OPENGL_PKGCONFIGS_REMOVE}" | ||
12 | OPENGL_PKGCONFIGS_remove_imxdrm = "dri glx" | 14 | OPENGL_PKGCONFIGS_remove_imxdrm = "dri glx" |