From 495ec596640e26b6995c93eedc922d2702ad64ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Mon, 10 May 2021 19:04:07 +0200 Subject: [PATCH] xwayland/present: Drop pending member from struct xwl_present_event We are handling two cases here: the active flip or the pending flip. For the pending flip (event->pending == TRUE), we called xwl_present_release_pixmap. For the active flip (event->pending == FALSE), we called xwl_present_release_event. However, xwl_present_flip_notify_vblank already unhooked event->vblank.event_queue. So this was effectively the same as calling xwl_present_release_pixmap. Acked-by: Olivier Fourdan --- hw/xwayland/xwayland-present.c | 10 +--------- hw/xwayland/xwayland-present.h | 2 -- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c index 07f1ed5e9..e1e83dee9 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c @@ -373,10 +373,7 @@ xwl_present_buffer_release(void *data) 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); + xwl_present_release_pixmap(event); return; } @@ -395,8 +392,6 @@ xwl_present_msc_bump(struct xwl_present_window *xwl_present_window) 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(flip_pending, xwl_present_window->ust, msc); if (!event->pixmap) { @@ -460,8 +455,6 @@ xwl_present_sync_callback(void *data, wl_callback_destroy(xwl_present_window->sync_callback); xwl_present_window->sync_callback = NULL; - event->pending = FALSE; - xwl_present_flip_notify_vblank(&event->vblank, xwl_present_window->ust, xwl_present_window->msc); } @@ -698,7 +691,6 @@ xwl_present_flip(WindowPtr present_window, event->pixmap = pixmap; event->target_msc = target_msc; - event->pending = TRUE; 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 545fbb586..da24abab5 100644 --- a/hw/xwayland/xwayland-present.h +++ b/hw/xwayland/xwayland-present.h @@ -55,8 +55,6 @@ struct xwl_present_event { present_vblank_rec vblank; uint64_t target_msc; - Bool pending; - PixmapPtr pixmap; };