Closed Bug 1556301 Opened 5 years ago Closed 4 years ago

[Wayland] Make sure we don't need Xdisplay when Wayland backend is active

Categories

(Core :: Widget: Gtk, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla73
Tracking Status
firefox69 --- wontfix
firefox73 --- fixed

People

(Reporter: stransky, Assigned: val)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

Make sure we don't open X11 display connection during startup to check/test GL or anything else.

USE_GLX_TEST is set when we build on X11 so glxtest.cpp is used. Also GfxInfoX11.cpp may be involved here.

Firefox 68.0b13 under ChromeOS v76.0.3809.38 has no access to X11; ChromeOS uses Wayland exclusively. Firefox does not use the available EGL accelerated graphics and cannot enable WebGL. Firefox was tested by installing in crostini and by installing directly using ChromeOS' developer mode, crosh, and GTK3 from Chromebrew (https://skycocker.github.io/chromebrew/). about:support's Graphics Description field reports "GLXtest process failed (exited with status 1): Unable to open a connection to the X server" and Window Protocol (added via bug 1554550) reports "x11" even though no X server is running (perhaps the Window Protocol error is a side effect of GLXtest failing?). Perhaps a native Wayland equivalent of GLXtest would help to resolve these issues.

I've been trying to look at this for a little while but I'm a beginner so I haven't gotten very far.

Interesting bits are here:
https://hg.mozilla.org/mozilla-central/file/tip/toolkit/xre/glxtest.cpp
https://gitlab.freedesktop.org/mesa/mesa/raw/master/docs/specs/EGL_MESA_query_driver.txt

I've been attempting to skip all the GLX code in glxtest.cpp if getenv("MOZ_ENABLE_WAYLAND"), adding a hook to eglGetDisplayDriverConfig and calling fatal_error(driConfig) in get_egl_status() just to see if the XML driver config from this function contains the information necessary to replace the GLX code with EGL equivalents. However, I get an EGL_BAD_MATCH in eglCreateContext during eglInitialize() before my code even runs into my "test"...

I believe this is caused by one of the explanations discussed here: https://community.nxp.com/thread/351905

My suspicion is that an EGL context is not being shared to the glxtest thread.

Question 1: is eglGetDisplayDriverConfig useful at all in this situation?

Question 2: can this function safely be used instead of running the glxtest thread when running natively in wayland by using the display found by gdk_display_get_default() in main thread, which might already have an EGL context initialized?

Thanks!

P.S.: I probably should have installed piglit and run the egl_mesa_query_driver test to find out Question 1 instead...

This allows GfxInfoX11 to get GLES3 and Mesa version from Wayland-EGL, which
allows automatic enablement of acceleration to work without Xwayland.

This also fixes bug 1578598 - WebRender did not work correctly
without this GL version information.

Assignee: nobody → greg
Status: NEW → ASSIGNED

Greg, I see you have two submitted patches in phabricator. If you want the patch checked in to mozilla-central (and nightly) you need to set "Check-in needed" flag at phabricator for the particular patch.

Flags: needinfo?(greg)

(In reply to Martin Stránský [:stransky] from comment #5)

Greg, I see you have two submitted patches in phabricator. If you want the patch checked in to mozilla-central (and nightly) you need to set "Check-in needed" flag at phabricator for the particular patch.

There's only one patch for this bug, I only have more patches for other bugs.

Where is this flag? I don't see it in the edit form or the actions in the comment form, "flag for later" is something else… maybe it's a thing only accessible to committers?

Flags: needinfo?(greg)

(In reply to greg v [:myfreeweb] from comment #6)

(In reply to Martin Stránský [:stransky] from comment #5)

Greg, I see you have two submitted patches in phabricator. If you want the patch checked in to mozilla-central (and nightly) you need to set "Check-in needed" flag at phabricator for the particular patch.

There's only one patch for this bug, I only have more patches for other bugs.

Where is this flag? I don't see it in the edit form or the actions in the comment form, "flag for later" is something else… maybe it's a thing only accessible to committers?

It's a tag. Go to an actual patch at phabricator, select "Edit revision" (it's https://phabricator.services.mozilla.com/differential/revision/edit/57474/ for this one), go to "Tags" field below and type "check" there. You may see "Check-in needed" tag offering so select it and save the change.

Flags: needinfo?(greg)

oh okay, done

Flags: needinfo?(greg)
Pushed by nerli@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/29c31254a273
Wayland-EGL/GLES support in glxtest r=stransky,aosmond
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
Regressions: 1606941
You need to log in before you can comment on or make changes to this bug.