[HDR/Linux] Try to avoid texture creation for fullscreen video - optimize playback
Categories
(Core :: Graphics: WebRender, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox143 | --- | fixed |
People
(Reporter: stransky, Assigned: stransky)
References
(Blocks 1 open bug)
Details
Attachments
(1 external file, 3 obsolete files)
[HDR] Force direct video compositing for fullscreen only.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
Glenn,
is it possible to get info if RenderDMABUFTextureHost is composited or not? Could we get such info from RenderCompositorNative for instance? We may skip the texture creation in such case - for instance fullscreen playback.
Thanks.
Comment 2•1 year ago
|
||
I'm not quite sure what you mean by "is composited or not" - could you clarify / be a bit more specific what you want to determine?
| Assignee | ||
Comment 3•1 year ago
|
||
I want to get info if dmabuf surface from RenderDMABUFTextureHost is going to be propagated for direct composition as overlay/underlay as we discussed at Bug 1976233 or if that promotion failed for RenderDMABUFTextureHost.
Thanks.
Comment 4•1 year ago
|
||
It's not very easy to determine this until fairly late in the frame building process, since it depends on evaluating a number of conditions (such as clips, transforms, filters etc that affect the primitive to be promoted). When in the frame do you need to know if it will be directly composited? Would it be enough to know when we request / lock the texture pointer or is that too late?
| Assignee | ||
Comment 5•1 year ago
|
||
(In reply to Glenn Watson [:gw] from comment #4)
Would it be enough to know when we request / lock the texture pointer or is that too late?
Glenn, that's perfectly fine.
Comment 6•1 year ago
|
||
OK, it should be possible to pass some information along by extending the signature of the lock callback at [1].
I'm not sure exactly what information you require here, and it's probably a fair bit of convoluted plumbing, but we should have calculated everything we would need to know by the time this is called, I think.
[1] https://searchfox.org/mozilla-central/source/gfx/wr/webrender_api/src/image.rs#117
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 7•1 year ago
|
||
(In reply to Glenn Watson [:gw] from comment #6)
OK, it should be possible to pass some information along by extending the signature of the
lockcallback at [1].I'm not sure exactly what information you require here, and it's probably a fair bit of convoluted plumbing, but we should have calculated everything we would need to know by the time this is called, I think.
[1] https://searchfox.org/mozilla-central/source/gfx/wr/webrender_api/src/image.rs#117
Hello Glenn,
that would be useful. What I need is to put a flag (bool for instance) if the ExternalImage returned by lock is going to be directly put to screen (by underlay/overlay) or going to be blended to other layers.
That allows to skip texture creation as Wayland uses wl_buffers to put content on screen. That may help for fullscreen video/webgl playback for instance.
Thanks.
Comment 8•1 year ago
|
||
Comment 9•1 year ago
|
||
Could you apply the WIP patch locally and see if that works correctly for what you want?
| Assignee | ||
Comment 10•1 year ago
|
||
| Assignee | ||
Comment 11•1 year ago
|
||
Thanks Glenn, I updated the patch to take action. But deferred_resolve.is_composited is always false so it doesn't work as expected (even is the texture is actually directly composited).
Comment 12•1 year ago
|
||
Hmmm, the patch seems to work as expected for me, but it must do something different with the preferences you have enabled, perhaps. Could you give me steps to repro it (page URL, non-default prefs etc)?
| Assignee | ||
Comment 14•1 year ago
|
||
Hello Glenn,
tested latest trunk with the patch. Set gfx.wayland.hdr to true, restart, open any video clip (from disk for instance) or load clip YT.
is_composited is always false even if direct composition is used (a clip played from disk).
Thanks!
Updated•1 year ago
|
Comment 15•1 year ago
|
||
Comment 16•1 year ago
|
||
Could you try with the updated WIP [2] patch attached here? I think this should work now, however even if it does I'll probably need to think of a better way to plumb this information through, as it's quite convoluted and error-prone.
| Assignee | ||
Comment 18•1 year ago
|
||
Updated•1 year ago
|
| Assignee | ||
Comment 19•1 year ago
|
||
Attached complete patch which works for me.
Updated•1 year ago
|
Updated•1 year ago
|
Comment 20•1 year ago
|
||
Comment 21•1 year ago
|
||
| Assignee | ||
Comment 23•1 year ago
|
||
[task 2025-08-06T07:51:34.608+00:00] error[E0050]: method lock has 3 parameters but the declaration in trait lock has 4
| Assignee | ||
Comment 24•1 year ago
|
||
[task 2025-08-06T07:51:34.608+00:00] error[E0050]: method lock has 3 parameters but the declaration in trait lock has 4
[task 2025-08-06T07:51:34.608+00:00] --> webrender\src\renderer\mod.rs:6200:13
[task 2025-08-06T07:51:34.608+00:00] |
[task 2025-08-06T07:51:34.608+00:00] 6200 | fn lock(&mut self, key: ExternalImageId, channel_index: u8) -> ExternalImage {
[task 2025-08-06T07:51:34.608+00:00] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 4 parameters, found 3
[task 2025-08-06T07:51:34.608+00:00] |
[task 2025-08-06T07:51:34.608+00:00] = note: lock from trait: fn(&mut Self, ExternalImageId, u8, bool) -> ExternalImage<'_>
| Assignee | ||
Updated•1 year ago
|
Comment 25•1 year ago
|
||
Comment 26•1 year ago
|
||
| bugherder | ||
Comment 27•1 year ago
|
||
Is that resulting in an enhancement for the end user that we may mention into our release notes? Thanks.
| Assignee | ||
Comment 28•1 year ago
|
||
(In reply to Pascal Chevrel:pascalc from comment #27)
Is that resulting in an enhancement for the end user that we may mention into our release notes? Thanks.
It may save GPU resources when Linux/HDR is enabled (but not now).
Comment 29•1 year ago
|
||
OK, I am changing the bug to an engineering task bug then to fit our bug types nomenclature, thanks!
Updated•1 year ago
|
Updated•1 year ago
|
Description
•