After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 772415 - Avoid calling eglGetDisplay
Avoid calling eglGetDisplay
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-10-04 16:54 UTC by Adam Jackson
Modified: 2016-10-10 18:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Use-egl-GetPlatformDisplayEXT-if-available.patch (2.84 KB, patch)
2016-10-04 16:54 UTC, Adam Jackson
none Details | Review
Fix some EGLDisplay abuse (1.78 KB, patch)
2016-10-10 18:14 UTC, Adam Jackson
accepted-commit_now Details | Review
Use eglGetPlatformDisplay{,EXT} if available (4.30 KB, patch)
2016-10-10 18:15 UTC, Adam Jackson
none Details | Review
Use eglGetPlatformDisplay{,EXT} if available (4.09 KB, patch)
2016-10-10 18:24 UTC, Adam Jackson
none Details | Review

Description Adam Jackson 2016-10-04 16:54:08 UTC
Created attachment 336909 [details] [review]
0001-Use-egl-GetPlatformDisplayEXT-if-available.patch

eglGetDisplay forces the implementation to guess what kind of display pointer it's been handled. Different libEGL will do different things, and in particular glvnd does something different than Mesa.

eglGetPlatformDisplayEXT lets us be explicit about the display type. Mesa has implemented this for over two years now (starting in 10.2).
Comment 1 Emmanuele Bassi (:ebassi) 2016-10-04 17:27:05 UTC
Review of attachment 336909 [details] [review]:

Looks good.
Comment 2 Daniel Stone 2016-10-05 09:13:07 UTC
Review of attachment 336909 [details] [review]:

::: gdk/wayland/gdkglcontext-wayland.c
@@ +286,3 @@
     return TRUE;
 
+  getPlatformDisplay = (PFNEGLGETPLATFORMDISPLAYEXTPROC) eglGetProcAddress ("eglGetPlatformDisplayEXT");

Surely this needs a guard to see if we have EGL_KHR_platform_base or are on EGL 1.5+, not just GetProcAddress ... ?
Comment 3 Adam Jackson 2016-10-10 18:14:44 UTC
Created attachment 337345 [details] [review]
Fix some EGLDisplay abuse

Just type correctness, no functional change
Comment 4 Adam Jackson 2016-10-10 18:15:45 UTC
Created attachment 337346 [details] [review]
Use eglGetPlatformDisplay{,EXT} if available

Adds some more paranoia and support for the egl 1.5 interface.
Comment 5 Daniel Stone 2016-10-10 18:17:16 UTC
Review of attachment 337345 [details] [review]:

lgtm
Comment 6 Matthias Clasen 2016-10-10 18:17:35 UTC
Attachment 337346 [details] pushed as 434ce02 - Use eglGetPlatformDisplay{,EXT} if available
Comment 7 Adam Jackson 2016-10-10 18:24:43 UTC
Created attachment 337347 [details] [review]
Use eglGetPlatformDisplay{,EXT} if available

Erk, previous one doesn't build, sorry.