[Wayland] Make WaylandBuffer release more robust
Categories
(Core :: Widget: Gtk, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox137 | --- | fixed |
People
(Reporter: stransky, Assigned: stransky)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 2 obsolete files)
We need to make WaylandBuffer release more robust. It means:
- Take lock for WaylandBuffer internal changes
- Keep reference to WaylandSurface until WaylandBuffer is removed
- Keep attached/detached state as an additional flag
- Sync wl_buffer delete in case it's still attached to wl_surface
That ensures we don't release live buffers. Some of the work here is implemeneted at Bug 1743631.
Assignee | ||
Updated•29 days ago
|
Assignee | ||
Updated•29 days ago
|
Assignee | ||
Updated•29 days ago
|
Assignee | ||
Comment 2•26 days ago
|
||
Split WaylandBuffer attached state to two components:
- Attached to WaylandSurface is tracked by mAttachedToSurface direct reference to WaylandSurface.
- Attached to Wayland compositor (i.e. used by GPU) is tracked mIsAttachedToCompositor boolean flag.
Also change how wl_buffer is detached/deleted:
- BufferDetachedCallbackHandler() only clear mIsAttachedToCompositor flag while WaylandBuffer is still valid.
- BufferDeletedCallbackHandler() is used to clear wl_buffer when WaylandSurface is unmapped/deleted.
Such change ensures we keep references to WaylandSurface/WaylandBuffer pair even if WaylandBuffer is not recently used by GPU
and prevents early WaylandBuffer object delete.
Also add mutex tracking / debugging code to WaylandBuffer.
Updated•26 days ago
|
Assignee | ||
Comment 3•26 days ago
|
||
Allow to call AttachLocked() repeatedly for the same WaylandBuffer, it's used by widget code. Hold recently attached buffer by mAttachedBuffer
and all tracked buffers (attached but not released by compositor yet) at mTrackedBuffers.
It ensures we reference all buffers used by WaylandCompositor.
Assignee | ||
Updated•25 days ago
|
Comment 5•21 days ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2606acece21a
https://hg.mozilla.org/mozilla-central/rev/cd369e4db2ee
Comment 6•18 days ago
|
||
Backed out for causing Bug 1943732 and Bug 1943736
Assignee | ||
Comment 7•18 days ago
|
||
Thanks, will rework it.
Updated•17 days ago
|
Updated•17 days ago
|
Assignee | ||
Updated•17 days ago
|
Assignee | ||
Comment 8•17 days ago
|
||
WaylandBuffer detach/release can happen on various thread and races with WaylandSurface access to WaylandBuffer.
To ensure WaylandSurface/WaylandBuffer consistent state, manage WaylandBuffer via. WaylandSurface only.
Register all async callbacks to WaylandSurface and use WaylandSurfaceLock to access WaylandBuffer.
Assignee | ||
Comment 9•17 days ago
|
||
Comment 10•11 days ago
|
||
Comment 11•10 days ago
|
||
Backed out for causing failures at WaylandBuffer.cpp.
Backout link: https://hg.mozilla.org/integration/autoland/rev/00e77cc7ff4e9b3d3f86bef00fcbce137f152de0
Failure log: https://treeherder.mozilla.org/logviewer?job_id=493238699&repo=autoland&lineNumber=5790
Comment 13•10 days ago
|
||
Comment 14•9 days ago
|
||
bugherder |
Description
•