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 772421 - Use eglGetPlatformDisplayEXT
Use eglGetPlatformDisplayEXT
Status: RESOLVED OBSOLETE
Product: gnome-session
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-10-04 17:17 UTC by Adam Jackson
Modified: 2021-06-14 18:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-check-accelerated-gles-Use-eglGetPlatformDisplayEXT.patch (1.50 KB, patch)
2016-10-04 17:17 UTC, Adam Jackson
none Details | Review
0001-check-accelerated-gles-Use-eglGetPlatformDisplayEXT.patch (1.68 KB, patch)
2016-10-04 17:18 UTC, Adam Jackson
none Details | Review
Use eglGetPlatformDisplay{,EXT} if available (2.19 KB, patch)
2016-10-11 18:45 UTC, Adam Jackson
reviewed Details | Review

Description Adam Jackson 2016-10-04 17:17:16 UTC
Created attachment 336914 [details] [review]
0001-check-accelerated-gles-Use-eglGetPlatformDisplayEXT.patch

Don't force libEGL to guess what kind of display we're handing it.
Comment 1 Adam Jackson 2016-10-04 17:18:39 UTC
Created attachment 336915 [details] [review]
0001-check-accelerated-gles-Use-eglGetPlatformDisplayEXT.patch

Whoops, missed a #include.
Comment 2 Cosimo Cecchi 2016-10-10 23:11:31 UTC
Review of attachment 336915 [details] [review]:

Looks good to me.
Comment 3 Adam Jackson 2016-10-11 18:45:48 UTC
Created attachment 337457 [details] [review]
Use eglGetPlatformDisplay{,EXT} if available

A bit more paranoid about checking for extensions, and willing to use the EXT version if the KHR version is not available.

Note that I don't have a gnome account, I can't commit this myself.
Comment 4 Ray Strode [halfline] 2016-10-12 14:40:12 UTC
Review of attachment 337457 [details] [review]:

Hey thanks. This looks mostly fine, and i'm okay with this going in as is, but if you want to do extra credit, here's some suggestions… If you don't like my suggestions, or aren't feeling motivated enough to do them, let me know and I'll just push what you did.

::: tools/gnome-session-check-accelerated-gles-helper.c
@@ +42,3 @@
 #ifdef GDK_WINDOWING_X11
+static EGLDisplay
+get_display (void *native)

function name should be somethink like get_egl_display_for_x_display, and the argument should be Display *x_display, not void *native.

@@ +47,3 @@
+    const char *client_exts = eglQueryString (NULL, EGL_EXTENSIONS);
+
+    if (g_strstr_len (client_exts, -1, "EGL_KHR_platform_base")) {

I don't think using g_strstr_len with a -1 literal ever really makes sense. Just use strstr instead.

@@ +49,3 @@
+    if (g_strstr_len (client_exts, -1, "EGL_KHR_platform_base")) {
+	PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display =
+	    (void *) eglGetProcAddress ("eglGetPlatformDisplay");

it's a little yucky to cast function pointers to (void*), but hey, dlsym does it so whatever.

I do think (PFNEGLGETPLATFORMDISPLAYEXTPROC) instead of (void*) would be cleaner (but more wordy)

@@ +68,3 @@
+	    return dpy;
+    }
+

So there's two chunks of duplicated code, you could condense it into a loop.
Comment 5 Bjørn Lie 2018-04-07 21:55:41 UTC
Hi

I see this has been shipped as a downstream patch in Fedora for ~2 years
Is this patch something that should go in as is since it's been stalled here for so long?
Comment 6 André Klapper 2021-06-14 18:21:59 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version of gnome-session, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gnome-session/-/issues/

Thank you for your understanding and your help.