Closed Bug 1720375 Opened 1 year ago Closed 11 months ago

Restructure surface pool into a buffer pool

Categories

(Core :: Graphics: WebRender, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
92 Branch
Tracking Status
firefox92 --- fixed

People

(Reporter: rmader, Assigned: rmader)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Up until now SurfacePoolWayland was a pool of actual wl_surfaces, as before bug 1718569 we had no direct access to wl_buffers when using EGL. However, the way SurfacePoolCA manages native surfaces is closer to what in Wayland terminology would be a buffer pool: buffers are heavy-weight and expansive to allocate, while wl_surface objects are cheap to recreate.

So instead of having a pool of surfaces, each of them having it's own pool of buffers, make wl_surfaces part of tiles and make SurfacePoolWayland manage wl_buffers (in the form of SHM- or DMABuf buffers). This will not only allow us to share buffers more efficiently but also simplify our tile management logic.
Most importantly, we'll need to reorder wl_surfaces less often and less complex (no place_below the parent surface) and can also drop reattaching subsurfaces to compositors. Especially the former will likely decrease CPU time in compositors.

Severity: -- → N/A
Priority: -- → P3

Note: Sorry in advance that this patch is so big. Unfortunately
splitting it up would create lots of redundant changes.
This should be the last big refactoring for the Wayland compositor
backend for now.

Up until now SurfacePoolWayland was a pool of actual wl_surfaces,
as before bug 1718569 we had no direct access to wl_buffers when
using EGL. However, the way SurfacePoolCA manages native surfaces
is closer to what in Wayland terminology would be a buffer pool:
buffers are heavy-weight and expansive to allocate, while
wl_surface objects are cheap to recreate.

So instead of having a pool of surfaces, each of them having its
own pool of buffers, make wl_surfaces part of tiles and make
SurfacePoolWayland manage wl_buffers (in the form of SHM- or
DMABuf buffers). This will not only allow us to share buffers more
efficiently but also simplify our tile management logic.
Most importantly, we'll need to reorder wl_surfaces less often and
less complex (no place_below the parent surface) and can also drop
reattaching subsurfaces to compositors. Especially the former will
likely decrease CPU time in compositors.

Assignee: nobody → robert.mader
Status: NEW → ASSIGNED
Blocks: 1723012
Attachment #9231384 - Attachment description: WIP: Bug 1720375 - Restructure surface pool into a buffer pool → Bug 1720375 - Restructure surface pool into a buffer pool,r=#gfx-reviewers,stransky

Latest try: https://treeherder.mozilla.org/jobs?repo=try&revision=c6f9b505266ed0387f460bf5e23b39d53685fbd5&selectedTaskRun=CBc6k_TMTOC_2H2PKXmAyg.0

Did some more intense testing and it looks very solid now, i.e. ready to go.

Pushed by robert.mader@posteo.de:
https://hg.mozilla.org/integration/autoland/rev/e38576ce6c5c
Restructure surface pool into a buffer pool,r=stransky,gfx-reviewers,lsalzman
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 92 Branch
Duplicate of this bug: 1720850
Regressions: 1729613
You need to log in before you can comment on or make changes to this bug.