Commit a337949f authored by Roman Gilg's avatar Roman Gilg Committed by Adam Jackson
Browse files

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's avatarRoman Gilg <subdiff@gmail.com>
Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
parent 66a5c0bc
......@@ -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);
......
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment