Closed Bug 1620076 Opened 5 years ago Closed 5 years ago

[WebRender] Linux partial present

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: jrmuizel, Assigned: val)

References

(Depends on 1 open bug, Blocks 3 open bugs)

Details

Attachments

(1 file)

This will make things better

Blocks: 1543478
Blocks: wr-linux
Priority: -- → P3

See also bug 1484812 for some pre-existing work on that. To make use of EGL_KHR_swap_buffers_with_damage on X11, we'll need to fix bug 788319 first however, which again depends on bug 1474281.

EGL requires the application to keep the front buffer fully consistent.
This means we have to draw the previous frame's damage as well.
(But we don't need to include it in the hint we're sending to the
system compositor via SwapBuffersWithDamage.)

Reassigned my webrender patch from bug 1484812 to here, since this is the bug for WR (please mention [WebRender] in the title!)

The patch works (on Wayland) but still has some condition that leads to leftover artifacts (some example cases: VAAPI video playback, some in-page popover things on some pages that happen on hover but not click..)

Summary: Linux partial present → [WebRender] Linux partial present
Summary: [WebRender] Linux partial present → [Wayland][WebRender] Linux partial present
Blocks: wayland

Created Bug 1625070 for partial present on X11.

Looks like D71139 (Bug 1611372) or something else that happened in the last ~month might've helped! From a quick attempt, I can't reproduce the artifacts.

Also, made the patch respect gfx::gfxVars::WebRenderMaxPartialPresentRects for a way to toggle it without rebuilding.

(In reply to greg v [:myfreeweb] from comment #5)

Looks like D71139 (Bug 1611372) or something else that happened in the last ~month might've helped! From a quick attempt, I can't reproduce the artifacts.

Also, made the patch respect gfx::gfxVars::WebRenderMaxPartialPresentRects for a way to toggle it without rebuilding.

Nice! Just gave it a try and after setting gfx.webrender.max-partial-present-rects to a value bigger than 0 I could verify on GS/Mutter that partial damage works (though WR seems to invalidate much more than the basic layer atm)! Couldn't spot any issues either, but also tried very long. More reasons for me to get going on bug 788319 so it works for X11, too :)

Jeff, do you think you could have a look into D61062? At least if it goes in the right direction?

Flags: needinfo?(jmuizelaar)
Assignee: nobody → greg
Status: NEW → ASSIGNED

I've redirected that request to Glenn and Sotaro.

Flags: needinfo?(jmuizelaar)

WR seems to invalidate much more than the basic layer atm

WR currently is hardcoded to merge all damage rects into one due to other platforms.

Also I might be forcing more frames to render than necessary, sometimes buffer age is 3 (wat??) and maybe it's fine to use the same method on these frames too.

Summary: [Wayland][WebRender] Linux partial present → [WebRender] Linux partial present
Flags: needinfo?(jgilbert)
Flags: needinfo?(jgilbert)

As this got accepted from Glen (in a comment) and Jeff - can we push it? :)

Minor bummer for the plan to use EGL_KHR_swap_buffers_with_damage on X11, too: it's not yet supported on X11 by mesa. Just opened a issue (1). I suppose driver support for partial damage will be a requirement to ship WR by default, at least when on battery. Maybe it's even a good marker - it will guarantee us a recent mesa version :)

Note: bug 1640048 implements a working X11 EGL implementation that, in combination with the patch from this bug, should bring us as far as we can get on X11 concerning compositor integration, i.e. partial damage and opaque regions. Everything more fancy will likely be Wayland only, see bug 1617498.

1: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3030

(In reply to Robert Mader [:rmader] from comment #11)

As this got accepted from Glen (in a comment) and Jeff - can we push it? :)

Yes, please set "Checkin needed" Tag at
https://phabricator.services.mozilla.com/differential/revision/edit/61062/

(In reply to Martin Stránský [:stransky] from comment #13)

Yes, please set "Checkin needed" Tag at
https://phabricator.services.mozilla.com/differential/revision/edit/61062/

Unfortunately I don't have the permissions for that - so waiting for Greg or somebody else (you?) to do it :)

I did it. I assume I can do that because I'm part of the "bmo-editbugs-team".

Maybe you should apply for editbugs permissions? https://bugzilla.mozilla.org/page.cgi?id=get_permissions.html

Blocks: 1625070

(In reply to Jan Alexander Steffens [:heftig] from comment #15)

I did it. I assume I can do that because I'm part of the "bmo-editbugs-team".

Maybe you should apply for editbugs permissions? https://bugzilla.mozilla.org/page.cgi?id=get_permissions.html

Thanks! And good point, just requested it :)

Pushed by malexandru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/90998e8e1bdd Partial compositing (damage) with EGL_EXT_buffer_age in WebRender r=jgilbert
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78

Thank at Greg and anybody involved! I just gave it a try and there's still one bit missing: in order to enable this, gfx.webrender.max-partial-present-rects has to get set to a non-default value (-1 or 64 or so). Is there anything blocking us from doing that? Sotaro, do you maybe know?

Flags: needinfo?(sotaro.ikeda.g)

(In reply to Robert Mader [:rmader] from comment #19)

I just gave it a try and there's still one bit missing: in order to enable this, gfx.webrender.max-partial-present-rects has to get set to a non-default value (-1 or 64 or so). Is there anything blocking us from doing that?

I wasn't 100% confident that it's artifact-free so I didn't touch the default :)

In particular, gfx.webrender.debug.profiler is not very usable for me with partial present on.

In normal operation, it's fine: I can't reliably reproduce artifacts with popovers in pages or the URL thing on hover anymore, it's like 99.9% good, but I've seen a little artifact maybe a couple times in a few days.

So far I haven't seen other issues than these two debug overlay bugs. If they don't indicate a severe problem, then it should be fine to enable partial present by default.

I'd like to track as many bugs concerning this as possible in bug 1640710 - i.e. all bugs that are not Wayland/X11 specific but can e.g. reproduced on Windows with DirectComposition disabled (Win 7/8).

(In reply to Robert Mader [:rmader] from comment #19)

Is there anything blocking us from doing that? Sotaro, do you maybe know?

Except the 2 bugs, I do not know another bugs. I seems OK to enable partial present.

Flags: needinfo?(sotaro.ikeda.g)

(In reply to Sotaro Ikeda [:sotaro] from comment #23)

(In reply to Robert Mader [:rmader] from comment #19)

Is there anything blocking us from doing that? Sotaro, do you maybe know?

Except the 2 bugs, I do not know another bugs. I seems OK to enable partial present.

https://bugzilla.mozilla.org/show_bug.cgi?id=1640858

Site node: we just fixed a quite bad bug in Mutter that made partial damage much less effective. So if you're running Mutter, the effect of enabling gfx.webrender.max-partial-present-rects should be much bigger (when looking at the whole system) after the upgrade to 3.36.4 or 3.38. This of course also affects the default software rendering, which has a quite optimized partial damage implementation.

See https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1326

Blocks: 1648799
Depends on: 1484812
Depends on: 1656533
No longer depends on: wr-non-os-compositor
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: