present: Remove create_event_id hook

Each present_vblank_create caller generates and sets the ID afterwards.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
This commit is contained in:
Michel Dänzer 2021-04-21 18:39:36 +02:00 committed by Michel Dänzer
parent 44f705a5b6
commit 93666ebe37
4 changed files with 9 additions and 24 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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++;

View File

@ -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;