present: Idle vblanks any time in window mode

With the newly introduced separate API method for idling a presented Pixmap in
window mode we can simplify the logic by allowing calls to it at any point in
time.

This is done by setting the flip_idler flag if the Pixmap was idled before
being presented.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
This commit is contained in:
Roman Gilg 2020-07-12 13:42:31 +02:00
parent 932c6baca2
commit ab880b8b9e
2 changed files with 9 additions and 4 deletions

View File

@ -191,8 +191,9 @@ xwl_present_buffer_release(void *data)
return;
}
present_wnmd_idle_notify(event->xwl_present_window->window, event->event_id);
if (!event->pending) {
present_wnmd_idle_notify(event->xwl_present_window->window, event->event_id);
xwl_present_free_event(event);
}
}
@ -215,7 +216,6 @@ xwl_present_msc_bump(struct xwl_present_window *xwl_present_window)
if (!event->pixmap) {
/* If the buffer was already released, clean up now */
present_wnmd_idle_notify(xwl_present_window->window, event->event_id);
xwl_present_free_event(event);
} else {
xorg_list_add(&event->list, &xwl_present_window->release_list);
@ -291,8 +291,6 @@ xwl_present_sync_callback(void *data,
xwl_present_window->ust, xwl_present_window->msc);
if (!event->pixmap) {
/* If the buffer was already released, send the event now again */
present_wnmd_idle_notify(xwl_present_window->window, event->event_id);
xwl_present_free_event(event);
}
}

View File

@ -257,6 +257,13 @@ present_wnmd_idle_notify(WindowPtr window, uint64_t event_id)
return;
}
}
xorg_list_for_each_entry(vblank, &window_priv->flip_queue, event_queue) {
if (vblank->event_id == event_id) {
vblank->flip_idler = TRUE;
return;
}
}
}
static Bool