Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Improve presentation-time API #1919

Merged
merged 4 commits into from
Nov 21, 2019

Conversation

emersion
Copy link
Member

@emersion emersion commented Nov 16, 2019

The wlr_presentation_feedback struct now tracks presentation feedback
for multiple resources (but still a single surface content update). This
allows the compositor to properly send presentation events even when
there is more than one frame of latency or when it references a
surface's buffer.

Most of the time, compositors just display the surface's current buffer
on an output. Add an helper to make it easy to support presentation-time
in this case.

References: swaywm/sway#4572
Closes: #1917

cc @YaLTeR


Breaking change: instead of calling wlr_presentation_surface_sampled at render time and wlr_presentation_send_surface_presented at presentation time, most compositors now just need to call wlr_presentation_surface_sampled_on_output at render time. Compositors that call wlr_buffer_ref need to call wlr_presentation_surface_sampled when they ref the buffer, wlr_presentation_feedback_send_presented when this buffer has been presented for the first time and then wlr_presentation_feedback_destroy.

Sway PR: swaywm/sway#4731

@emersion emersion changed the title Improve presentation tracking Improve presentation-time API Nov 16, 2019
@emersion emersion added the breaking Breaking change in public API label Nov 16, 2019
This allows listeners to read the commit sequence number.
@emersion emersion force-pushed the improve-presentation-tracking branch from 83be692 to 55ca0fe Compare November 16, 2019 23:35
Backends not supporting presentation feedback call
wlr_output_send_present with a NULL event in their commit handler. Since
the commit hasn't been applied yet, commit_seq still has its old value.
We need to increment it.

An alternative would be to move commit_seq in wlr_output_state. This
would allow to have a pending and a current commit_seq.
wlr_output_send_present could take the pending commit_seq when called
with a NULL event.
@emersion emersion force-pushed the improve-presentation-tracking branch from 55ca0fe to 6030f30 Compare November 16, 2019 23:59
The wlr_presentation_feedback struct now tracks presentation feedback
for multiple resources (but still a single surface content update). This
allows the compositor to properly send presentation events even when
there is more than one frame of latency or when it references a
surface's buffer.
Most of the time, compositors just display the surface's current buffer
on an output. Add an helper to make it easy to support presentation-time
in this case.
@emersion emersion force-pushed the improve-presentation-tracking branch from 6030f30 to 34b3526 Compare November 17, 2019 09:34
@ddevault ddevault merged commit 2122e49 into swaywm:master Nov 21, 2019
@ddevault
Copy link
Contributor

Thanks!

g7 pushed a commit to droidian/phoc that referenced this pull request Mar 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking Breaking change in public API
Development

Successfully merging this pull request may close these issues.

Presentation feedback API doesn't identify the frame submission
3 participants