Implement proper frame callback handling in NativeLayerWayland
Categories
(Core :: Graphics: WebRender, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox91 | --- | fixed |
People
(Reporter: rmader, Assigned: rmader)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 3 obsolete files)
Currently there are several frame callback related issues that can make the browser freeze, most importantly:
- trying to swap buffers for a tile that's not visible - the compositor may not have released the buffer, making the Wayland EGL platform block
WaylandVsyncSource
only working on theMozContainerWayland
surface, which may be hidden behind opaque tiles. ATM it also only covers to top-left pixel, increasing the likelihood of being hidden.gdk_wayland_window_[add|remove]_frame_callback_surface
only working on theMozContainerWayland
surface, making GDK freeze when it's hidden. This is particular visible in maximized/fullscreen mode.
To some degree we can work around these issues by disabling widget.wayland.opaque-region.enabled
and widget.wayland.vsync.enabled
, however they decrease performance massively and loosing monitor VSync, including rendering at monitor refresh rate, is obviously bad.
Fix all of these issues by properly managing frame callbacks for NativeLayerWayland
/ NativeLayerRootWayland
Assignee | ||
Comment 1•3 years ago
|
||
Analogous to D102835 we need to make GDK aware of opaque surfaces
so frame callbacks get emitted for these surfaces as well. Otherwise
GDK may get stuck waiting on callbacks when used on compositors
that don't emit callbacks for occluded surfaces (which is explicitly
encouraged by the Wayland spec).
GDK runs on the main thread, so we need to dispatch these action
to the main thread as well.
Assignee | ||
Comment 2•3 years ago
|
||
Make the vsync source request frame callbacks from opaque native
layers. This is necessary as opaque layers may occlude the
MozContainer surface, which is normally used for frame callbacks.
Wayland compositors may (and are encouraged to) optimize away
such callbacks, so we need to make sure to request frame callbacks
from actually visible surfaces.
Callbacks are requested for all opaque layers, but only the first
one with call back to the vsync source.
In order to get this right concerning multiple requested callbacks,
possibly being called from different threads etc., introduce a
callback abstraction, FrameCallbackObject
to make this simple
to handle for callers.
Depends on D115809
Depends on D115809
Assignee | ||
Comment 3•3 years ago
|
||
Assignee | ||
Comment 4•3 years ago
|
||
Do not reorder subsurfaces if not necessary and remove some dead
code.
Depends on D116026
Depends on D116026
Updated•3 years ago
|
Updated•3 years ago
|
Comment 5•3 years ago
|
||
Comment on attachment 9224863 [details]
WIP: Bug 1711244 - Cleanups and overhead reductions
Revision D116675 was moved to bug 1714326. Setting attachment 9224863 [details] to obsolete.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 6•3 years ago
|
||
Analogous to D102835 we need to make GDK aware of opaque surfaces
so frame callbacks get emitted for these surfaces as well. Otherwise
GDK may get stuck waiting on callbacks when used on compositors
that don't emit callbacks for occluded surfaces (which is explicitly
encouraged by the Wayland spec).
GDK runs on the main thread, so we need to dispatch these action
to the main thread as well.
Updated•3 years ago
|
Pushed by robert.mader@posteo.de: https://hg.mozilla.org/integration/autoland/rev/37aeebaea4bb Register native layers for GDK frame callbacks,
Comment 8•3 years ago
|
||
Backed out for clang bustages on NativeLayerWayland.cpp
Backout link: https://hg.mozilla.org/integration/autoland/rev/84a47330bc5a93cd38b8db63f288d2dbb9690869
Log link: https://treeherder.mozilla.org/logviewer?job_id=341647872&repo=autoland&lineNumber=7274
Assignee | ||
Comment 9•3 years ago
|
||
Fixed, thanks - a rebase error made things go to the wrong patch.
Assignee | ||
Comment 10•3 years ago
|
||
Analogous to D102835 we need to make GDK aware of opaque surfaces
so frame callbacks get emitted for these surfaces as well. Otherwise
GDK may get stuck waiting on callbacks when used on compositors
that don't emit callbacks for occluded surfaces (which is explicitly
encouraged by the Wayland spec).
GDK runs on the main thread, so we need to dispatch these action
to the main thread as well.
Updated•3 years ago
|
Comment 11•3 years ago
|
||
Pushed by robert.mader@posteo.de: https://hg.mozilla.org/integration/autoland/rev/0e9cc3978c38 Register native layers for GDK frame callbacks,
Comment 12•3 years ago
|
||
bugherder |
Assignee | ||
Updated•3 years ago
|
Comment 14•3 years ago
|
||
Pushed by robert.mader@posteo.de: https://hg.mozilla.org/integration/autoland/rev/3c74d415fafd Integrate NativeLayerWayland with WaylandVsyncSource, r=stransky,gfx-reviewers,jrmuizel
Comment 15•3 years ago
|
||
bugherder |
Description
•