[HDR] Recycle wl_buffers if possible for direct composition
Categories
(Core :: Graphics: WebRender, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox140 | --- | fixed |
People
(Reporter: stransky, Assigned: stransky)
References
(Blocks 1 open bug)
Details
Attachments
(6 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
[HDR] Recycle wl_buffers if possible for video playback to save GPU cycles.
| Assignee | ||
Updated•11 months ago
|
Thanks for working on this issue. Here are the stacktraces which may related to firefox requesting compositor to create/delete wl_buffer on every video frame.
https://gist.github.com/alen6516/14fc0d0add2c926e0fe855836492d152
| Assignee | ||
Comment 2•11 months ago
|
||
I think we may extend it to all dmabuf based wl_buffers used by native compositor.
| Assignee | ||
Comment 3•10 months ago
|
||
Add mPID to hold origin of DMABufSurface creation.
Updated•10 months ago
|
| Assignee | ||
Comment 4•10 months ago
|
||
If DMABufSurface are recycled we don't want to create/delete wl_buffer for recycled frames as it eats GPU/power resources.
Instead store wl_buffers for DMABuf surfaces and re-use them if possible.
The behaviour is inspired by MPV which does the same.
| Assignee | ||
Comment 5•10 months ago
|
||
When recycled WaylandBuffer is detached/deleted, don't call wl_buffer_add_listener() as it throws protocol error but only update
WaylandBuffer reference by wl_proxy_set_user_data().
| Assignee | ||
Comment 6•10 months ago
|
||
We want to recycle dmabuf surfaces and wl_buffers for decoded video frames so we need to make sure we always
use the same smabuf surface for particular ffmpeg frame.
Add mFFMPEGSurfaceID filed do VideoFrameSurface to keep track of assigned FFmpeg frame and also invalidate
all frames when video frames are flushed.
Add mHoldByFFmpeg wich ensured we don't reuse VideoFrameSurface untill is returned by genco rendering process
(with IsUsedByRenderer()).
Implement unified VideoFramePool<LIBAV_VER>::GetTargetVideoFrameSurface() method to get new VideoFrameSurface according to
requested configuration.
| Assignee | ||
Comment 7•10 months ago
|
||
During seek FFmpeg may allocate new dmabuf frames so we need to remove ffmpeg ID's and allocate new surfaces.
| Assignee | ||
Comment 8•10 months ago
|
||
WaylandBufferDMABUFHolder stores wl_buffer for external dmabuf surface and allows us to use existing wl_buffer for dmabuf surface instead of creating
a new one. That saves GPU resources and GPU power (MPV does the same).
In this patch add WaylandBufferDMABUFHolder to NativeLayerRootWayland and cache wl_buffers there for surfaces which can be recycled.
| Assignee | ||
Updated•10 months ago
|
Comment 10•10 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/06ec04c554f6
https://hg.mozilla.org/mozilla-central/rev/cff7e5dc3e0c
https://hg.mozilla.org/mozilla-central/rev/60eadd491fbd
https://hg.mozilla.org/mozilla-central/rev/9ea1e7698e4c
https://hg.mozilla.org/mozilla-central/rev/ad4fbdad7b5e
https://hg.mozilla.org/mozilla-central/rev/f62a9f8d52f0
Updated•10 months ago
|
Description
•