Commit d3c1b223 authored by Roman Gilg's avatar Roman Gilg

present: Move scmd-update-window-crtc function

Move the code portion down. That way it is at a similar position as in
the window mode file.
Signed-off-by: Roman Gilg's avatarRoman Gilg <subdiff@gmail.com>
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <michel.daenzer@amd.com>
parent 8c2dcc5f
......@@ -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,
......
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