diff --git a/present/present_scmd.c b/present/present_scmd.c index cdbacec90..d47f2dba7 100644 --- a/present/present_scmd.c +++ b/present/present_scmd.c @@ -222,30 +222,6 @@ present_queue_vblank(ScreenPtr screen, return ret; } -static void -present_scmd_update_window_crtc(WindowPtr window, RRCrtcPtr crtc, uint64_t new_msc) -{ - present_window_priv_ptr window_priv = present_get_window_priv(window, TRUE); - uint64_t old_ust, old_msc; - - /* Crtc unchanged, no offset. */ - if (crtc == window_priv->crtc) - return; - - /* No crtc earlier to offset against, just set the crtc first time. */ - if (window_priv->crtc == PresentCrtcNeverSet) { - window_priv->crtc = crtc; - return; - } - - /* Crtc may have been turned off, 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; - - window_priv->msc_offset += new_msc - old_msc; - window_priv->crtc = crtc; -} - /* * When the wait fence or previous flip is completed, it's time * to re-try the request @@ -636,6 +612,30 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) present_execute_post(vblank, ust, crtc_msc); } +static void +present_scmd_update_window_crtc(WindowPtr window, RRCrtcPtr crtc, uint64_t new_msc) +{ + present_window_priv_ptr window_priv = present_get_window_priv(window, TRUE); + uint64_t old_ust, old_msc; + + /* Crtc unchanged, no offset. */ + if (crtc == window_priv->crtc) + return; + + /* No crtc earlier to offset against, just set the crtc. */ + if (window_priv->crtc == PresentCrtcNeverSet) { + window_priv->crtc = crtc; + return; + } + + /* Crtc may have been turned off, 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; + + window_priv->msc_offset += new_msc - old_msc; + window_priv->crtc = crtc; +} + static int present_scmd_pixmap(WindowPtr window, PixmapPtr pixmap,