From c35a716b02921e2fcae5fe89295a99c6dd5dec8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 16 Apr 2021 18:45:39 +0200 Subject: [PATCH] present: Fold wnmd_init_mode_hooks into wnmd_screen_init Preparation for moving WNMD code to hw/xwayland. No functional change intended. Acked-by: Olivier Fourdan --- present/present_priv.h | 6 ------ present/present_wnmd.c | 40 +++++++++++++++++++--------------------- 2 files changed, 19 insertions(+), 27 deletions(-) diff --git a/present/present_priv.h b/present/present_priv.h index 6d0588b1e..811250b09 100644 --- a/present/present_priv.h +++ b/present/present_priv.h @@ -481,10 +481,4 @@ present_vblank_scrap(present_vblank_ptr vblank); void present_vblank_destroy(present_vblank_ptr vblank); -/* - * present_wnmd.c - */ -void -present_wnmd_init_mode_hooks(present_screen_priv_ptr screen_priv); - #endif /* _PRESENT_PRIV_H_ */ diff --git a/present/present_wnmd.c b/present/present_wnmd.c index ea8aa3123..061698209 100644 --- a/present/present_wnmd.c +++ b/present/present_wnmd.c @@ -708,9 +708,26 @@ present_wnmd_flush(WindowPtr window) (*screen_priv->wnmd_info->flush) (window); } -void -present_wnmd_init_mode_hooks(present_screen_priv_ptr screen_priv) +/* + * Initialize a screen for use with present in window flip mode (wnmd) + */ +int +present_wnmd_screen_init(ScreenPtr screen, present_wnmd_info_ptr info) { + present_screen_priv_ptr screen_priv; + + if (!present_screen_register_priv_keys()) + return FALSE; + + if (present_screen_priv(screen)) + return TRUE; + + screen_priv = present_screen_priv_init(screen); + if (!screen_priv) + return FALSE; + + screen_priv->wnmd_info = info; + screen_priv->query_capabilities = &present_wnmd_query_capabilities; screen_priv->get_crtc = &present_wnmd_get_crtc; @@ -724,25 +741,6 @@ present_wnmd_init_mode_hooks(present_screen_priv_ptr screen_priv) screen_priv->re_execute = &present_wnmd_re_execute; screen_priv->abort_vblank = &present_wnmd_abort_vblank; -} - -/* - * Initialize a screen for use with present in window flip mode (wnmd) - */ -int -present_wnmd_screen_init(ScreenPtr screen, present_wnmd_info_ptr info) -{ - if (!present_screen_register_priv_keys()) - return FALSE; - - if (!present_screen_priv(screen)) { - present_screen_priv_ptr screen_priv = present_screen_priv_init(screen); - if (!screen_priv) - return FALSE; - - screen_priv->wnmd_info = info; - present_wnmd_init_mode_hooks(screen_priv); - } return TRUE; }