From f8c086b2145d1c9364e9b43ff4d796791d8af169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 7 May 2021 17:55:13 +0200 Subject: [PATCH] xwayland/present: Fold xwl_present_event_notify into its caller Can just call xwl_present_execute directly. This allows dropping the window member from struct xwl_present_window as well. Acked-by: Olivier Fourdan --- hw/xwayland/xwayland-present.c | 38 +++++----------------------------- hw/xwayland/xwayland-present.h | 1 - 2 files changed, 5 insertions(+), 34 deletions(-) diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c index 8cd3a169a..b199ac889 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c @@ -66,7 +66,6 @@ xwl_present_window_get_priv(WindowPtr window) if (!xwl_present_window) return NULL; - xwl_present_window->window = window; xwl_present_window->msc = 1; xwl_present_window->ust = GetTimeInMicros(); @@ -306,34 +305,6 @@ xwl_present_flip_notify_vblank(present_vblank_ptr vblank, uint64_t ust, uint64_t xwl_present_flip_try_ready(xwl_present_window); } -static void -xwl_present_event_notify(WindowPtr window, uint64_t event_id, uint64_t ust, uint64_t msc) -{ - struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); - present_window_priv_ptr window_priv = present_window_priv(window); - present_vblank_ptr vblank; - - if (!window_priv) - return; - if (!event_id) - return; - - DebugPresent(("\te %" PRIu64 " ust %" PRIu64 " msc %" PRIu64 "\n", event_id, ust, msc)); - xorg_list_for_each_entry(vblank, &xwl_present_window->exec_queue, event_queue) { - if (event_id == vblank->event_id) { - xwl_present_execute(vblank, ust, msc); - return; - } - } - xorg_list_for_each_entry(vblank, &xwl_present_window->flip_queue, event_queue) { - if (vblank->event_id == event_id) { - assert(vblank->queued); - xwl_present_execute(vblank, ust, msc); - return; - } - } -} - static void xwl_present_update_window_crtc(present_window_priv_ptr window_priv, RRCrtcPtr crtc, uint64_t new_msc) { @@ -440,10 +411,11 @@ xwl_present_msc_bump(struct xwl_present_window *xwl_present_window) list) { if (event->target_msc <= msc) { xorg_list_del(&event->list); - xwl_present_event_notify(xwl_present_window->window, - (uintptr_t)event, - xwl_present_window->ust, - msc); + + DebugPresent(("\te %" PRIu64 " ust %" PRIu64 " msc %" PRIu64 "\n", + event->vblank.event_id, xwl_present_window->ust, msc)); + + xwl_present_execute(&event->vblank, xwl_present_window->ust, msc); } } } diff --git a/hw/xwayland/xwayland-present.h b/hw/xwayland/xwayland-present.h index 98c2d0dfb..e3aaf933d 100644 --- a/hw/xwayland/xwayland-present.h +++ b/hw/xwayland/xwayland-present.h @@ -35,7 +35,6 @@ #ifdef GLAMOR_HAS_GBM struct xwl_present_window { - WindowPtr window; struct xorg_list frame_callback_list; uint64_t msc;