c/multi: Overwrite stale scheduled frames

This commit is contained in:
Jakob Bornecrantz 2021-04-12 20:17:10 +01:00 committed by Jakob Bornecrantz
parent b0c9f2a1d9
commit c9c362e16a

View file

@ -431,6 +431,13 @@ wait_for_scheduled_free(struct multi_compositor *mc)
// Block here if the scheduled slot is not clear.
while (mc->scheduled.active) {
// Replace the scheduled frame if it's in the past.
uint64_t now_ns = os_monotonic_get_ns();
if (mc->scheduled.display_time_ns < now_ns) {
break;
}
os_mutex_unlock(&mc->slot_lock);
os_nanosleep(U_TIME_1MS_IN_NS);