aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/present/present.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/present/present.c')
-rw-r--r--xorg-server/present/present.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/xorg-server/present/present.c b/xorg-server/present/present.c
index 3aea0d7c6..f488e21cc 100644
--- a/xorg-server/present/present.c
+++ b/xorg-server/present/present.c
@@ -291,14 +291,18 @@ present_window_to_crtc_msc(WindowPtr window, RRCrtcPtr crtc, uint64_t window_msc
if (crtc != window_priv->crtc) {
uint64_t old_ust, old_msc;
- /* The old CRTC may have been turned off, in which case
- * we'll just use whatever previous MSC we'd seen from this CRTC
- */
+ if (window_priv->crtc == PresentCrtcNeverSet) {
+ window_priv->msc_offset = 0;
+ } else {
+ /* The old CRTC may have been turned off, in which case
+ * we'll just use whatever previous MSC we'd seen from this CRTC
+ */
- if (present_get_ust_msc(window->drawable.pScreen, window_priv->crtc, &old_ust, &old_msc) != Success)
- old_msc = window_priv->msc;
+ if (present_get_ust_msc(window->drawable.pScreen, window_priv->crtc, &old_ust, &old_msc) != Success)
+ old_msc = window_priv->msc;
- window_priv->msc_offset += new_msc - old_msc;
+ window_priv->msc_offset += new_msc - old_msc;
+ }
window_priv->crtc = crtc;
}
@@ -395,7 +399,8 @@ present_set_abort_flip(ScreenPtr screen)
present_set_tree_pixmap(screen_priv->flip_window,
(*screen->GetScreenPixmap)(screen));
- present_set_tree_pixmap(screen->root, (*screen->GetScreenPixmap)(screen));
+ if (screen->root)
+ present_set_tree_pixmap(screen->root, (*screen->GetScreenPixmap)(screen));
screen_priv->flip_pending->abort_flip = TRUE;
}
@@ -725,7 +730,7 @@ present_pixmap(WindowPtr window,
if (!pixmap)
target_crtc = window_priv->crtc;
- if (!target_crtc)
+ if (!target_crtc || target_crtc == PresentCrtcNeverSet)
target_crtc = present_get_crtc(window);
}