From 1ebd5c4a9ccc28bae910438efd7c44d1584061e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 29 Jul 2016 19:08:12 +0900 Subject: [PATCH xserver] present: Call set_abort_flip / restore_screen_pixmap in clear_window_flip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We were asserting that these were called before from other places, but that isn't always the case, e.g. during server shutdown. --- present/present.c | 4 ++-- present/present_priv.h | 6 ++++++ present/present_screen.c | 6 ++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/present/present.c b/present/present.c index 5fde846..1391234 100644 --- a/present/present.c +++ b/present/present.c @@ -417,7 +417,7 @@ present_set_tree_pixmap(WindowPtr window, TraverseTree(window, present_set_tree_pixmap_visit, &visit); } -static void +void present_restore_screen_pixmap(ScreenPtr screen) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); @@ -450,7 +450,7 @@ present_restore_screen_pixmap(ScreenPtr screen) present_set_tree_pixmap(screen->root, NULL, screen_pixmap); } -static void +void present_set_abort_flip(ScreenPtr screen) { present_screen_priv_ptr screen_priv = present_screen_priv(screen); diff --git a/present/present_priv.h b/present/present_priv.h index 0d16cfa..dfb4bde 100644 --- a/present/present_priv.h +++ b/present/present_priv.h @@ -187,6 +187,12 @@ void present_flip_destroy(ScreenPtr screen); void +present_restore_screen_pixmap(ScreenPtr screen); + +void +present_set_abort_flip(ScreenPtr screen); + +void present_check_flip_window(WindowPtr window); RRCrtcPtr diff --git a/present/present_screen.c b/present/present_screen.c index 2f91ac7..9d03c8a 100644 --- a/present/present_screen.c +++ b/present/present_screen.c @@ -92,11 +92,13 @@ present_clear_window_flip(WindowPtr window) present_vblank_ptr flip_pending = screen_priv->flip_pending; if (flip_pending && flip_pending->window == window) { - assert (flip_pending->abort_flip); + present_set_abort_flip(screen); flip_pending->window = NULL; } - if (screen_priv->flip_window == window) + if (screen_priv->flip_window == window) { + present_restore_screen_pixmap(screen); screen_priv->flip_window = NULL; + } } /* -- 2.8.1