Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve presentation-time API #1919

Merged
merged 4 commits into from Nov 21, 2019

Conversation

@emersion
Copy link
Member

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 label Nov 16, 2019
This allows listeners to read the commit sequence number.
@emersion emersion force-pushed the emersion:improve-presentation-tracking branch from 83be692 to 55ca0fe Nov 16, 2019
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 emersion:improve-presentation-tracking branch from 55ca0fe to 6030f30 Nov 16, 2019
types/wlr_presentation_time.c Outdated Show resolved Hide resolved
emersion added 2 commits 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.
@emersion emersion force-pushed the emersion:improve-presentation-tracking branch from 6030f30 to 34b3526 Nov 17, 2019
@ddevault ddevault merged commit 2122e49 into swaywm:master Nov 21, 2019
3 checks passed
3 checks passed
builds.sr.ht: alpine.yml builds.sr.ht job completed successfully
Details
builds.sr.ht: archlinux.yml builds.sr.ht job completed successfully
Details
builds.sr.ht: freebsd.yml builds.sr.ht job completed successfully
Details
@ddevault

This comment has been minimized.

Copy link
Member

ddevault commented Nov 21, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.