Closed Bug 1680759 Opened 4 years ago Closed 4 years ago

Turn on robustness for EGL on Linux

Categories

(Core :: Graphics, defect, P3)

Desktop
Linux
defect

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: aosmond, Assigned: aosmond)

References

Details

Attachments

(1 file)

We do it for GLX by default, but for EGL you need to opt in. See bug 1632698 for where this came up:

  1. Do we use robustness with EGL today? EGL contexts expect the CreateContextFlags::PREFER_ROBUSTNESS to be set in order to configure it so:

https://searchfox.org/mozilla-central/rev/6bb59b783b193f06d6744c5ccaac69a992e9ee7b/gfx/gl/GLContextProviderEGL.cpp#692

We don't appear to ask for it on the EGL path used by Android and Wayland:

https://searchfox.org/mozilla-central/rev/6bb59b783b193f06d6744c5ccaac69a992e9ee7b/gfx/webrender_bindings/RenderThread.cpp#1064
https://searchfox.org/mozilla-central/rev/6bb59b783b193f06d6744c5ccaac69a992e9ee7b/gfx/gl/GLContextProviderEGL.cpp#322

  1. We use NV_robustness_video_memory_purge with GLX but we don't appear to use it with EGL.

https://searchfox.org/mozilla-central/rev/6bb59b783b193f06d6744c5ccaac69a992e9ee7b/gfx/gl/GLContextProviderGLX.cpp#207

  1. When exploring enabling this on Ubuntu 20.04 / Mesa 20.0.8 / nouveau and i965 DRI drivers, I found that EXT_create_context_robustness always failed (RBAB and robustness config variants) and KHR_create_context would succeed (RBAB). Should we consider splitting this such that we try EXT first, KHR second? Or EXT/RBAB, KHR/RBAB, EXT/robustness, KHR/robustness, no robustness?

https://searchfox.org/mozilla-central/rev/6bb59b783b193f06d6744c5ccaac69a992e9ee7b/gfx/gl/GLContextProviderEGL.cpp#692

Mirroring discussion here:

(In reply to Sotaro Ikeda [:sotaro] from Bug 1632698 comment 14)

  1. We use NV_robustness_video_memory_purge with GLX but we don't appear to use it with EGL.

https://searchfox.org/mozilla-central/rev/6bb59b783b193f06d6744c5ccaac69a992e9ee7b/gfx/gl/GLContextProviderGLX.cpp#207

When Bug 1469496 added LOCAL_GL_PURGED_CONTEXT_RESET_NV handling, RenderCompositorEGL did not exit yet. If we want to handle context reset. It seems better to handle it also on EGL.

For example, chromium seems to handle it.

Flags: needinfo?(nical.bugzilla)

Another question to ask is, we don't seem to like RBAB with WebGL on EGL:

https://searchfox.org/mozilla-central/rev/6bb59b783b193f06d6744c5ccaac69a992e9ee7b/gfx/gl/GLContext.cpp#727

Nowhere else checks the flag. Does this affect modern Mesa versions (we limit WR to 18+ which was long after this was initially done)?

jnicol mentioned in the daily that we disable it for Android emulator and Adreno 630 devices, which I see here:

https://searchfox.org/mozilla-central/rev/6bb59b783b193f06d6744c5ccaac69a992e9ee7b/gfx/gl/GLContext.cpp#711
https://searchfox.org/mozilla-central/rev/6bb59b783b193f06d6744c5ccaac69a992e9ee7b/gfx/thebes/gfxPlatform.cpp#2869

See Also: → 1632698

We should probably just assume things work now (on linux) and validate it on Nightly for a train or two.

Flags: needinfo?(nical.bugzilla)
No longer blocks: wr-linux

This patch enables EGL robustness with WebRender. It also tries harder
to get RBAB, favouring KHR+RBAB over EXT-RBAB, as testing with Intel and
NVIDIA Mesa drivers on Ubuntu suggests we can get KHR+RBAB but not
EXT+RBAB. It also adds support for requesting NVIDIA specific resets via
EGL_NV_robustness_video_memory_purge.

Attachment #9199104 - Attachment description: Bug 1680759 - Enable EGL robustness with WebRender. → Bug 1680759 - Enable EGL robustness with WebRender on Linux.
Pushed by aosmond@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6d51e594756b
Enable EGL robustness with WebRender on Linux. r=jgilbert
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
Blocks: 1731172
See Also: → 1913548
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: