From 93666ebe37a9c8d64b814c7af6b895f89ca5ff88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 21 Apr 2021 18:39:36 +0200 Subject: [PATCH] present: Remove create_event_id hook Each present_vblank_create caller generates and sets the ID afterwards. Acked-by: Olivier Fourdan --- present/present_priv.h | 5 ----- present/present_scmd.c | 15 +++++---------- present/present_vblank.c | 2 -- present/present_wnmd.c | 11 ++++------- 4 files changed, 9 insertions(+), 24 deletions(-) diff --git a/present/present_priv.h b/present/present_priv.h index c50462cef..5659c7e90 100644 --- a/present/present_priv.h +++ b/present/present_priv.h @@ -126,9 +126,6 @@ typedef int (*present_priv_pixmap_ptr)(WindowPtr window, present_notify_ptr notifies, int num_notifies); -typedef void (*present_priv_create_event_id_ptr)(present_window_priv_ptr window_priv, - present_vblank_ptr vblank); - typedef int (*present_priv_queue_vblank_ptr)(ScreenPtr screen, WindowPtr window, RRCrtcPtr crtc, @@ -175,7 +172,6 @@ struct present_screen_priv { present_priv_can_window_flip_ptr can_window_flip; present_priv_pixmap_ptr present_pixmap; - present_priv_create_event_id_ptr create_event_id; present_priv_queue_vblank_ptr queue_vblank; present_priv_flush_ptr flush; @@ -223,7 +219,6 @@ struct present_window_priv { struct xorg_list notifies; /* Used for window flips */ - uint64_t event_id; struct xorg_list exec_queue; struct xorg_list flip_queue; struct xorg_list idle_queue; diff --git a/present/present_scmd.c b/present/present_scmd.c index c55ae0990..cc21007e8 100644 --- a/present/present_scmd.c +++ b/present/present_scmd.c @@ -35,20 +35,14 @@ * */ -static uint64_t present_event_id; +static uint64_t present_scmd_event_id; + static struct xorg_list present_exec_queue; static struct xorg_list present_flip_queue; static void present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc); -static void -present_scmd_create_event_id(present_window_priv_ptr window_priv, - present_vblank_ptr vblank) -{ - vblank->event_id = ++present_event_id; -} - static inline PixmapPtr present_flip_pending_pixmap(ScreenPtr screen) { @@ -326,7 +320,7 @@ present_unflip(ScreenPtr screen) present_restore_screen_pixmap(screen); - screen_priv->unflip_event_id = ++present_event_id; + screen_priv->unflip_event_id = ++present_scmd_event_id; DebugPresent(("u %" PRIu64 "\n", screen_priv->unflip_event_id)); (*screen_priv->info->unflip) (screen, screen_priv->unflip_event_id); } @@ -745,6 +739,8 @@ present_scmd_pixmap(WindowPtr window, if (!vblank) return BadAlloc; + vblank->event_id = ++present_scmd_event_id; + if (vblank->flip && vblank->sync_flip) vblank->exec_msc--; @@ -818,7 +814,6 @@ present_scmd_init_mode_hooks(present_screen_priv_ptr screen_priv) screen_priv->can_window_flip = &present_scmd_can_window_flip; screen_priv->present_pixmap = &present_scmd_pixmap; - screen_priv->create_event_id = &present_scmd_create_event_id; screen_priv->queue_vblank = &present_queue_vblank; screen_priv->flush = &present_flush; diff --git a/present/present_vblank.c b/present/present_vblank.c index 6ab0d35f1..4401395d7 100644 --- a/present/present_vblank.c +++ b/present/present_vblank.c @@ -77,8 +77,6 @@ present_vblank_create(WindowPtr window, vblank->window = window; vblank->pixmap = pixmap; - screen_priv->create_event_id(window_priv, vblank); - if (pixmap) { vblank->kind = PresentCompleteKindPixmap; pixmap->refcnt++; diff --git a/present/present_wnmd.c b/present/present_wnmd.c index 9e70d83b3..27c3e8ac7 100644 --- a/present/present_wnmd.c +++ b/present/present_wnmd.c @@ -35,6 +35,8 @@ * */ +static uint64_t present_wnmd_event_id; + static void present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc); @@ -49,12 +51,6 @@ present_wnmd_queue_vblank(ScreenPtr screen, return (*screen_priv->wnmd_info->queue_vblank) (window, crtc, event_id, msc); } -static void -present_wnmd_create_event_id(present_window_priv_ptr window_priv, present_vblank_ptr vblank) -{ - vblank->event_id = ++window_priv->event_id; -} - static uint32_t present_wnmd_query_capabilities(present_screen_priv_ptr screen_priv) { @@ -631,6 +627,8 @@ present_wnmd_pixmap(WindowPtr window, if (!vblank) return BadAlloc; + vblank->event_id = ++present_wnmd_event_id; + /* WNMD presentations always complete (at least) one frame after they * are executed */ @@ -693,7 +691,6 @@ present_wnmd_init_mode_hooks(present_screen_priv_ptr screen_priv) screen_priv->check_flip_window = &present_wnmd_check_flip_window; screen_priv->present_pixmap = &present_wnmd_pixmap; - screen_priv->create_event_id = &present_wnmd_create_event_id; screen_priv->queue_vblank = &present_wnmd_queue_vblank; screen_priv->flush = &present_wnmd_flush; screen_priv->re_execute = &present_wnmd_re_execute;