Closed Bug 1656533 Opened 4 years ago Closed 4 years ago

EGL partial damage only works with buffer age of 2

Categories

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

task

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: rmader, Assigned: jnicol)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Otherwise it falls back to full damage. If we still want to do partial damage in those cases, we'd probably need some kind of accumulated damage history for each buffer.

See also https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/316#note_279673

Blocks: wr-linux
Severity: -- → S3
Priority: -- → P3

From https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6132#note_598224:

The buffer age depends on how many buffers are being used, which IIRC is 3 on wayland and 4 on x11, so in the normal case (ie after the first round-robin through the buffers) the buffer age will always be 2 on wayland and 3 on x11.

Blocks: 1575765

Add a trait PartialPresentCompositor with a function get_buffer_age(),
and allow gecko to pass an implementation to webrender during
initialization. This allows webrender to query the age of the current
backbuffer during compositing.

Make webrender track the previous 2 frame's dirty rects, rather than
just the previous 1 frame's, allowing it to calculate the total damage
rect for buffer ages of up to 3. If the age is greater than 3, treat
the entire buffer as invalid. Also handle special cases of ages 0 and
1, 0 meaning the entire buffer is invalid, and 1 meaning the entire
buffer is valid. Make gecko stop requesting a full render for buffer
ages other than 2, as webrender can now handle these cases itself.

Assignee: nobody → jnicol
Status: NEW → ASSIGNED

Just gave this a try and it appears to bring the X11 EGL backend much closer to how thing look on Wayland, great!

Brilliant!

I did a wee bit of testing on Linux myself. For wayland gnome, with Firefox either native wayland or Xwayland, the buffer age seemed a fairly consistent 2. For X11 gnome, the buffer age seemed all over the place, sometimes 1, sometimes 2 or 3, sometimes numbers like 14. But the patch should handle those cases, and rendering looked correct to me.

I may be misremembering, actually. I can't remember how consistent XWayland was. I also tried Sway, with both XWayland and native Wayland, and IIRC the buffer age seemed fairly consistent for those.

Pushed by jnicol@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ed9075d9319b
Handle buffer ages other than 2 for EGL_EXT_buffer_age. r=sotaro,gw

Oh, whoops. Forgot to change integer literals to floats in the tests.

Flags: needinfo?(jnicol)
Pushed by jnicol@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5294a158e801
Handle buffer ages other than 2 for EGL_EXT_buffer_age. r=sotaro,gw
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
Regressions: 1677892
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: