From d3c1b223cec2b475c4f1661d7e5dc5238d08d8f6 Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Mon, 27 May 2019 22:58:49 +0200 Subject: [PATCH] present: Move scmd-update-window-crtc function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the code portion down. That way it is at a similar position as in the window mode file. Signed-off-by: Roman Gilg Reviewed-by: Michel Dänzer --- present/present_scmd.c | 48 +++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) 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,