summaryrefslogtreecommitdiff
path: root/present
diff options
context:
space:
mode:
authorRoman Gilg <subdiff@gmail.com>2018-03-13 16:00:50 +0100
committerAdam Jackson <ajax@redhat.com>2018-03-28 14:36:42 -0400
commita337949f99bc473ea0ae0af64736eae3d5b39399 (patch)
tree5f2310d2e2965cb918adae09ba2f281cf0343074 /present
parent66a5c0bccb222ad8b9b57b10490c3041e1b3f05e (diff)
present: Add cleanups for window flip mode
Make sure that vblanks and windows get cleaned up correctly in window flip mode. Signed-off-by: Roman Gilg <subdiff@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'present')
-rw-r--r--present/present_screen.c33
-rw-r--r--present/present_vblank.c2
2 files changed, 34 insertions, 1 deletions
diff --git a/present/present_screen.c b/present/present_screen.c
index b0cae0fd1..8ad14ad17 100644
--- a/present/present_screen.c
+++ b/present/present_screen.c
@@ -109,6 +109,32 @@ present_clear_window_flip(WindowPtr window)
}
}
+static void
+present_wnmd_clear_window_flip(WindowPtr window)
+{
+ present_window_priv_ptr window_priv = present_window_priv(window);
+ present_vblank_ptr vblank, tmp;
+
+ if (window_priv->flip_pending) {
+ present_wnmd_set_abort_flip(window);
+ window_priv->flip_pending->window = NULL;
+ }
+
+ xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->idle_queue, event_queue) {
+ present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence);
+ /* The pixmap will be destroyed by freeing the window resources. */
+ vblank->pixmap = NULL;
+ present_vblank_destroy(vblank);
+ }
+
+ vblank = window_priv->flip_active;
+ if (vblank) {
+ present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence);
+ present_vblank_destroy(vblank);
+ }
+ window_priv->flip_active = NULL;
+}
+
/*
* Hook the close window function to clean up our window private
*/
@@ -124,7 +150,12 @@ present_destroy_window(WindowPtr window)
present_clear_window_notifies(window);
present_free_events(window);
present_free_window_vblank(window);
- present_clear_window_flip(window);
+
+ if (screen_priv->wnmd_info)
+ present_wnmd_clear_window_flip(window);
+ else
+ present_clear_window_flip(window);
+
free(window_priv);
}
unwrap(screen_priv, screen, DestroyWindow);
diff --git a/present/present_vblank.c b/present/present_vblank.c
index 7662c4dd9..f93a1afa9 100644
--- a/present/present_vblank.c
+++ b/present/present_vblank.c
@@ -172,6 +172,8 @@ present_vblank_destroy(present_vblank_ptr vblank)
{
/* Remove vblank from window and screen lists */
xorg_list_del(&vblank->window_list);
+ /* Also make sure vblank is removed from event queue (wnmd) */
+ xorg_list_del(&vblank->event_queue);
DebugPresent(("\td %lld %p %8lld: %08lx -> %08lx\n",
vblank->event_id, vblank, vblank->target_msc,