[PATCH xserver] glamor: don't look for non-existing EGL_KHR_platform_base

Emil Velikov emil.l.velikov at gmail.com
Fri Oct 21 18:06:00 UTC 2016


From: Emil Velikov <emil.velikov at collabora.com>

The extensions does not exist in the registry, thus needs to know
they're using EGL 1.5 in order to determine the eglGetPlatformDisplay
function pointer is valid.

Thus brings us into some lovely circular dependency.

Since mesa won't be able (in the foreseeable future) to export the KHR
flavour of extensions (another way one could assume that EGL 1.5 is
available) just drop all the heuristics and use the
EGL_EXT_platform_base extension.

In practise (checked with the Mali driver) any EGL 1.5 driver will
advertise support for EGL_EXT_platform_base.

Cc: Adam Jackson <ajax at redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 glamor/glamor_egl.h | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/glamor/glamor_egl.h b/glamor/glamor_egl.h
index 147aae6..6b05f57 100644
--- a/glamor/glamor_egl.h
+++ b/glamor/glamor_egl.h
@@ -49,23 +49,20 @@
  * have yet. So you have to query for extensions no matter what. Fortunately
  * epoxy_has_egl_extension _does_ let you query for client extensions, so
  * we don't have to write our own extension string parsing.
+ *
+ * 4. There is no EGL_KHR_platform_base to complement the EXT one, thus one
+ * needs to know EGL 1.5 is supported in order to use the eglGetPlatformDisplay
+ * function pointer.
+ * We can workaround this (circular dependency) by probing for the EGL 1.5
+ * platform extensions (EGL_KHR_platform_gbm and friends) yet it doesn't seem
+ * like mesa will be able to adverise these (even though it can do EGL 1.5).
  */
 static inline EGLDisplay
 glamor_egl_get_display(EGLint type, void *native)
 {
     EGLDisplay dpy = NULL;
 
-    /* If we're EGL 1.5, the KHR extension will be there, try that */
-    if (epoxy_has_egl_extension(NULL, "EGL_KHR_platform_base")) {
-        PFNEGLGETPLATFORMDISPLAYPROC getPlatformDisplay =
-            (void *) eglGetProcAddress("eglGetPlatformDisplay");
-        if (getPlatformDisplay)
-            dpy = getPlatformDisplay(type, native, NULL);
-        if (dpy)
-            return dpy;
-    }
-
-    /* Okay, maybe the EXT extension works */
+    /* In practise any EGL 1.5 implementation would support the EXT extension */
     if (epoxy_has_egl_extension(NULL, "EGL_EXT_platform_base")) {
         PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplayEXT =
             (void *) eglGetProcAddress("eglGetPlatformDisplayEXT");
-- 
2.9.3



More information about the xorg-devel mailing list