summaryrefslogtreecommitdiff
path: root/glamor
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2016-10-21 19:06:00 +0100
committerAdam Jackson <ajax@redhat.com>2016-10-25 13:04:48 -0400
commit7fc96fb02dade4a86f2fc038f3cf5f2d9c0cda00 (patch)
treeacf5496c98b49ef4096b35be8dcc7a99160c1cec /glamor
parent5dcb0666b82f5ab00f3d22e86f05ac14b0d5341e (diff)
glamor: don't look for non-existing EGL_KHR_platform_base
The extension 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 extension (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. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'glamor')
-rw-r--r--glamor/glamor_egl.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/glamor/glamor_egl.h b/glamor/glamor_egl.h
index 147aae620..6b05f576f 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");