xserver: Branch 'master' - 2 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jan 10 21:38:53 UTC 2019


 glamor/glamor_egl.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit cc05c01925755310f027c61daa29648a10155f96
Author: Rohan Garg <rohan at garg.io>
Date:   Thu Dec 13 19:15:01 2018 +0100

    glamor/glamor_egl.c: EGL_NATIVE_PIXMAP_KHR do not require contexts
    
    From https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_image_pixmap.txt
    
     * If <target> is EGL_NATIVE_PIXMAP_KHR, and <ctx> is not EGL_NO_CONTEXT,
       the error EGL_BAD_PARAMETER is generated.
    
    Fixes: a5321ea4 ("Allow to create textured pixmaps from gbm_bo without using gem names")

diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 0f4edb5a3..69844d4e2 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -233,7 +233,7 @@ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap,
     glamor_make_current(glamor_priv);
 
     image = eglCreateImageKHR(glamor_egl->display,
-                              glamor_egl->context,
+                              EGL_NO_CONTEXT,
                               EGL_NATIVE_PIXMAP_KHR, bo, NULL);
     if (image == EGL_NO_IMAGE_KHR) {
         glamor_set_pixmap_type(pixmap, GLAMOR_DRM_ONLY);
commit 88dd4cea51f7e461cb4859c06bfe641890caa97b
Author: Rohan Garg <rohan at garg.io>
Date:   Thu Dec 13 17:46:27 2018 +0100

    glamor/egl: Drop a implicit depends on EGL_KHR_no_config_context
    
    Not all platforms provide EGL_KHR_no_config_context, this ensures
    that eglCreateContext works on such platforms by querying for
    a config.

diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index ca7ea8c98..0f4edb5a3 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -905,6 +905,8 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
 {
     struct glamor_egl_screen_private *glamor_egl;
     const GLubyte *renderer;
+    EGLConfig egl_config;
+    int n;
 
     glamor_egl = calloc(sizeof(*glamor_egl), 1);
     if (glamor_egl == NULL)
@@ -983,8 +985,14 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
             goto error;
         }
 
+        if (!eglChooseConfig(glamor_egl->display, NULL, &egl_config, 1, &n)) {
+            xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+                       "glamor: No acceptable EGL configs found\n");
+            goto error;
+        }
+
         glamor_egl->context = eglCreateContext(glamor_egl->display,
-                                               NULL, EGL_NO_CONTEXT,
+                                               egl_config, EGL_NO_CONTEXT,
                                                config_attribs);
     }
     if (glamor_egl->context == EGL_NO_CONTEXT) {


More information about the xorg-commit mailing list