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 693225 - Let Gnome Shell work on EGL and GLES2
Let Gnome Shell work on EGL and GLES2
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-02-05 19:13 UTC by Neil Roberts
Modified: 2013-02-06 08:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't try to use GLX if Cogl isn't using that Winsys (5.12 KB, patch)
2013-02-05 19:14 UTC, Neil Roberts
committed Details | Review

Description Neil Roberts 2013-02-05 19:13:33 UTC
Currently Gnome Shell requires Cogl to use the GLX winsys because it makes some direct GLX calls in order to set the swap event retrieval. If we make it determine whether Cogl is using GLX at run-time we can avoid this restriction and let Gnome Shell work with EGL. EGL is the future for the window system binding of GL so it'd be good to support it as it's not much hassle. This would also be a small step towards getting Gnome Shell to run directly on KMS which would be required for Wayland.

Presumably the swap event code could eventually be removed altogether if Gnome Shell starts using the CoglFrameCallback mechanism instead.

As Gnome Shell would no longer make any GL calls itself, it would no longer need to directly link against libGL. This also makes it possible to use Gnome Shell with GLES2.

A slight problem with this in practice is that currently the X11 EGL platform in Mesa internally calls XFixesQueryVersion using the latest version that libxcb supports. Currently that is only version 4. Calling that function resets what the X server thinks the client can support so then when mutter later tries to create a pointer barrier it will get a BadRequest error. I've posted a patch for xcb-proto to the mailing list to fix this. If you rebuild xcb-proto, libxcb and Mesa with this patch then Gnome Shell works fine under EGL.

http://lists.freedesktop.org/archives/xcb/2013-February/008131.html
Comment 1 Neil Roberts 2013-02-05 19:14:19 UTC
Created attachment 235251 [details] [review]
Don't try to use GLX if Cogl isn't using that Winsys

Instead of directly using symbols from GLX to check for the swap event
notification, the plugin now first verifies that the Cogl renderer is
actually using the GLX winsys and then indirectly fetches the pointers
for the GLX functions using cogl_get_proc_address. That way it will
continue to work if Cogl is using an EGL winsys.

Nothing in the Gnome Shell plugin now directly uses symbols from libGL
so we don't need to link to it. This helps to avoid problems linking
against two GL APIs when cogl is using a non-GL driver such as GLES2.
Comment 2 drago01 2013-02-05 20:35:51 UTC
Review of attachment 235251 [details] [review]:

Patch looks good. Did not test it on EGL though (and going by your comment it won't work yet without a fixed xcb-proto).
But given that it did not work before and it does not hurt GLX it is fine.
Comment 3 Neil Roberts 2013-02-06 00:42:19 UTC
Thanks for the feedback. I have pushed it to master:

http://git.gnome.org/browse/gnome-shell/commit/?id=b8a8edc513f015