Closed Bug 2093090 Opened 4 days ago Closed 4 days ago

Compositing stalls waiting for remote textures from canvases that were destroyed or lost their context

Categories

(Core :: Graphics, defect)

defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: aosmond, Assigned: aosmond)

References

(Blocks 1 open bug)

Details

Attachments

(3 external files)

RemoteTextureMap keeps waiting for remote texture owners that will never provide the texture being waited on.

  1. It cannot tell an owner that has not been registered yet from one that was already unregistered. A texture that reaches the compositor after its owner went away (for example, a canvas destroyed right after presenting a frame) is waited on as if the owner were about to appear. WaitForRemoteTextureOwner and WaitRemoteTextureReady then block the compositor thread for the full owner timeout (10 seconds). The compositor thread is shared, so compositing stalls for every window, not just the one with the canvas.

  2. Pending ready checks for an owner whose context was lost, or whose unregistration was deferred until its last transaction, are not woken. They wait until the owner is finally unregistered or the check times out, even though no more textures are coming. The image host stays stuck on its pending textures meanwhile.

Proposed fix:

  • Remember whether each owner named by a live RemoteTextureHostWrapper was registered (bounded by the wrappers), and do not wait for textures nothing can use any more.
  • Wake pending ready checks when an owner loses its context or defers its unregistration.
  • Add RemoteTextureMap gtests for these cases.

Bug 1888931 is the same stall after a GPU process restart, where the new RemoteTextureMap has never seen the old owner. That case is not covered here.

Blocks: 2093091

RemoteTextureMap could not tell an owner that had not been registered yet
from one that had already been unregistered, so a texture arriving after
its owner went away waited for the full timeout on the compositor thread.
Remember whether each owner named by a live RemoteTextureHostWrapper was
registered, which bounds the state by the wrappers, and don't wait for
textures that no wrapper can use any more.

Ready checks waiting for a texture from an owner whose context was lost,
or whose unregistration was deferred until its last transaction, were
left waiting until the owner was unregistered or the check timed out,
even though no more textures were coming.

Pushed by aosmond@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f2ba912aa5d7 https://hg.mozilla.org/integration/autoland/rev/d8bf3df5dd6e Part 1. Don't wait for remote texture owners that have been unregistered. r=gfx-reviewers,lsalzman https://github.com/mozilla-firefox/firefox/commit/cc4febe78ddc https://hg.mozilla.org/integration/autoland/rev/8de6bbf913a6 Part 2. Wake remote texture ready checks when a texture owner will not push again. r=gfx-reviewers,lsalzman https://github.com/mozilla-firefox/firefox/commit/0fe6b50df375 https://hg.mozilla.org/integration/autoland/rev/2a8201a4437d Part 3. Add RemoteTextureMap gtests for owners that are gone or will not push again. r=gfx-reviewers,lsalzman
Pushed by pstanciu@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/3ed7043dd351 https://hg.mozilla.org/integration/autoland/rev/db64d3cf88f0 Revert "Bug 2093090 - Part 3. Add RemoteTextureMap gtests for owners that are gone or will not push again. r=gfx-reviewers,lsalzman" for causing build bustages @ TestRemoteTextureMap.cpp
Flags: needinfo?(aosmond)
Pushed by aosmond@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/340c6c79ba2b https://hg.mozilla.org/integration/autoland/rev/94762f2e800e Part 1. Don't wait for remote texture owners that have been unregistered. r=gfx-reviewers,lsalzman https://github.com/mozilla-firefox/firefox/commit/4d222f0c59ba https://hg.mozilla.org/integration/autoland/rev/88f9895fb075 Part 2. Wake remote texture ready checks when a texture owner will not push again. r=gfx-reviewers,lsalzman https://github.com/mozilla-firefox/firefox/commit/d7161e35da77 https://hg.mozilla.org/integration/autoland/rev/4211a1ce1da2 Part 3. Add RemoteTextureMap gtests for owners that are gone or will not push again. r=gfx-reviewers,lsalzman
Status: ASSIGNED → RESOLVED
Closed: 4 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: