summaryrefslogtreecommitdiff
path: root/present
diff options
context:
space:
mode:
authorMichel Dänzer <mdaenzer@redhat.com>2021-04-16 18:45:39 +0200
committerMichel Dänzer <michel@daenzer.net>2021-07-09 16:11:11 +0200
commitc35a716b02921e2fcae5fe89295a99c6dd5dec8c (patch)
tree6592a15eabd03493c50332dc3fbaa513d78a07fd /present
parent10bdd87fe49cbd9b4c4b584024d663b928d3f1be (diff)
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 <ofourdan@redhat.com>
Diffstat (limited to 'present')
-rw-r--r--present/present_priv.h6
-rw-r--r--present/present_wnmd.c40
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;
}