summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <mdaenzer@redhat.com>2021-05-07 12:56:30 +0200
committerMichel Dänzer <michel@daenzer.net>2021-07-09 16:17:55 +0200
commit4503c8d9ea7df5bda470501e638a730d91d718c9 (patch)
tree01cda13a4fd9377c0fafd6881d99b3e567516158
parentb2a06e0700fa48c1e77fc687e6af39a4bb7c2ceb (diff)
xwayland/present: Fold xwl_present_idle_notify into its caller
Allows simplification by avoiding indirection. Acked-by: Olivier Fourdan <ofourdan@redhat.com>
-rw-r--r--hw/xwayland/xwayland-present.c47
1 files changed, 14 insertions, 33 deletions
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 4aef3c5c8..07d9d23bb 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -343,33 +343,6 @@ xwl_present_event_notify(WindowPtr window, uint64_t event_id, uint64_t ust, uint
}
static void
-xwl_present_idle_notify(WindowPtr window, uint64_t event_id)
-{
- struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window);
- present_vblank_ptr vblank;
-
- if (xwl_present_window->flip_active && xwl_present_window->flip_active->event_id == event_id) {
- /* Active flip is allowed to become idle directly when it becomes unactive again. */
- xwl_present_window->flip_active->flip_idler = TRUE;
- return;
- }
-
- xorg_list_for_each_entry(vblank, &xwl_present_window->idle_queue, event_queue) {
- if (vblank->event_id == event_id) {
- xwl_present_free_idle_vblank(vblank);
- return;
- }
- }
-
- xorg_list_for_each_entry(vblank, &xwl_present_window->flip_queue, event_queue) {
- if (vblank->event_id == event_id) {
- vblank->flip_idler = TRUE;
- return;
- }
- }
-}
-
-static void
xwl_present_update_window_crtc(present_window_priv_ptr window_priv, RRCrtcPtr crtc, uint64_t new_msc)
{
/* Crtc unchanged, no offset. */
@@ -427,18 +400,26 @@ xwl_present_cleanup(WindowPtr window)
static void
xwl_present_buffer_release(void *data)
{
+ struct xwl_present_window *xwl_present_window;
struct xwl_present_event *event = data;
if (!event)
return;
- if (event->pending)
- xwl_present_release_pixmap(event);
- else
- xwl_present_release_event(event);
+ xwl_present_window = xwl_present_window_priv(event->vblank.window);
+ if (xwl_present_window->flip_active == &event->vblank ||
+ xwl_present_get_pending_flip(xwl_present_window) == &event->vblank) {
+ event->vblank.flip_idler = TRUE;
+
+ if (event->pending)
+ xwl_present_release_pixmap(event);
+ else
+ xwl_present_release_event(event);
+
+ return;
+ }
- /* event/vblank memory will be freed in xwl_present_free_idle_vblank */
- xwl_present_idle_notify(event->vblank.window, (uintptr_t)event);
+ xwl_present_free_idle_vblank(&event->vblank);
}
static void