Closed Bug 1774026 Opened 2 years ago Closed 2 years ago

Un-make the EGLSurface current before destroying it in RenderCompositorEGL/OGLSWGL

Categories

(Core :: Graphics: WebRender, task)

task

Tracking

()

RESOLVED FIXED
103 Branch
Tracking Status
firefox103 --- fixed

People

(Reporter: jnicol, Assigned: jnicol)

References

Details

Attachments

(1 file)

Perhaps bug 1772839 is because the when one compositor is paused the egl surface is still current, so does not get destroyed and detached from the Android Surface. Then when the next compositor is resumed we fail to create the new surface.

Just wild speculation, but worth a try.

This is a purely speculative attempt to fix bug 1772839. The theory
being perhaps that due to the EGL Surface being current,
eglDestroySurface does not detach it from the Android Surface. This
would cause the subsequent eglCreateWindowSurface to fail as the
Android Surface is still attached.

For the record this is what we used to do with layers: CompositorOGL::Pause called GLContextProviderEGL::ReleaseSurface(), which called eglMakeCurrent(EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT).

But then again, we also used to silently ignore the error when we couldn't create a surface, so it's possible the root cause of bug 1772839 has existed for years.

Pushed by jnicol@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ad0d465dcf91
Make EGL Surface non-current before destroying. r=gfx-reviewers,aosmond
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch

It's definitely too early to tell definitively whether this has worked, but there's been no crashes on nightly in the 24h since it shipped. Let's uplift to beta.

Comment on attachment 9281039 [details]
Bug 1774026 - Make EGL Surface non-current before destroying. r?#gfx-reviewers

Beta/Release Uplift Approval Request

  • User impact if declined: Crashes for some Android 9 users. Not entirely confident this will fix it but it seems worthwhile trying.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Obviously drivers can have bugs, but there should be no problem calling eglMakeCurrent(NO_SURFACE) before we call eglDestroySurface. - we must call eglMakeCurrent again prior to rendering anything anyway.

This is also what we used to do when using the old layers compositor.

  • String changes made/needed:
  • Is Android affected?: Yes
Attachment #9281039 - Flags: approval-mozilla-beta?

Comment on attachment 9281039 [details]
Bug 1774026 - Make EGL Surface non-current before destroying. r?#gfx-reviewers

A couple crashes have come in on nightly since this patch landed, so it doesn't appear to have worked.

Attachment #9281039 - Flags: approval-mozilla-beta?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: