diff options
author | Michel Dänzer <mdaenzer@redhat.com> | 2021-05-07 12:34:49 +0200 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2021-07-09 16:17:44 +0200 |
commit | b2a06e0700fa48c1e77fc687e6af39a4bb7c2ceb (patch) | |
tree | 04873311e833d05bab937658ccad5dbfc65f4d14 /hw | |
parent | fc53e3c536b5a338c595b5724c7d0b4734e45871 (diff) |
xwayland/present: Drop sync_flip member of struct xwl_present_window
The same information can be determined from the flip queue.
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xwayland/xwayland-present.c | 14 | ||||
-rw-r--r-- | hw/xwayland/xwayland-present.h | 1 |
2 files changed, 7 insertions, 8 deletions
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c index 0e61e855e..4aef3c5c8 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c @@ -122,7 +122,9 @@ xwl_present_get_pending_flip(struct xwl_present_window *xwl_present_window) static inline Bool xwl_present_has_pending_events(struct xwl_present_window *xwl_present_window) { - return !!xwl_present_window->sync_flip || + present_vblank_ptr flip_pending = xwl_present_get_pending_flip(xwl_present_window); + + return (flip_pending && flip_pending->sync_flip) || !xorg_list_is_empty(&xwl_present_window->wait_list); } @@ -442,17 +444,17 @@ xwl_present_buffer_release(void *data) static void xwl_present_msc_bump(struct xwl_present_window *xwl_present_window) { + present_vblank_ptr flip_pending = xwl_present_get_pending_flip(xwl_present_window); uint64_t msc = ++xwl_present_window->msc; struct xwl_present_event *event, *tmp; xwl_present_window->ust = GetTimeInMicros(); - event = xwl_present_window->sync_flip; - xwl_present_window->sync_flip = NULL; - if (event) { + if (flip_pending && flip_pending->sync_flip) { + event = xwl_present_event_from_id((uintptr_t)flip_pending); event->pending = FALSE; - xwl_present_flip_notify_vblank(&event->vblank, xwl_present_window->ust, msc); + xwl_present_flip_notify_vblank(flip_pending, xwl_present_window->ust, msc); if (!event->pixmap) { /* If the buffer was already released, clean up now */ @@ -757,8 +759,6 @@ xwl_present_flip(WindowPtr present_window, event->pending = TRUE; xorg_list_init(&event->list); - if (sync_flip) - xwl_present_window->sync_flip = event; xwl_pixmap_set_buffer_release_cb(pixmap, xwl_present_buffer_release, event); diff --git a/hw/xwayland/xwayland-present.h b/hw/xwayland/xwayland-present.h index 8c6a14575..98c2d0dfb 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 { - struct xwl_present_event *sync_flip; WindowPtr window; struct xorg_list frame_callback_list; |