summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Gilg <subdiff@gmail.com>2020-07-12 13:42:31 +0200
committerRoman Gilg <subdiff@gmail.com>2020-07-22 11:10:17 +0200
commitab880b8b9e8d67a05fcb085097c94bbddf7dcb95 (patch)
tree9d02a53441d2855072801552de443fac9c6bc958
parent932c6baca274f57beab51cd0dff1f7fa934e0ed0 (diff)
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>
-rw-r--r--hw/xwayland/xwayland-present.c6
-rw-r--r--present/present_wnmd.c7
2 files changed, 9 insertions, 4 deletions
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 4d148257b..7ef57e1f5 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -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);
}
}
diff --git a/present/present_wnmd.c b/present/present_wnmd.c
index 2cb3f7523..37f1f84f6 100644
--- a/present/present_wnmd.c
+++ b/present/present_wnmd.c
@@ -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