mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
Make app pacing more robust to variable composition->display times.
If the last returned display time shifts backwards slightly with respect to the last sampled display time from the compositor, the next predicted display time will not move forward by one frame. Adding half the display period to the comparison makes the pacing robust to this case.
This commit is contained in:
parent
170fe0e5d9
commit
703baa94fe
|
@ -199,8 +199,10 @@ predict_display_time(const struct pacing_app *pa, uint64_t now_ns, uint64_t peri
|
|||
// Start from the last time that the driver displayed something.
|
||||
uint64_t val = last_sample_displayed(pa);
|
||||
|
||||
// Return a time after the last returned display time.
|
||||
while (val <= last_return_predicted_display(pa)) {
|
||||
// Return a time after the last returned display time. Add half the
|
||||
// display period to the comparison for robustness when the last display
|
||||
// time shifts slightly with respect to the last sample.
|
||||
while (val <= last_return_predicted_display(pa) + (period_ns / 2)) {
|
||||
val += period_ns;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue