present: fix msc offset calculation in screen mode

Instead of getting the current msc value from the window crtc,
which not exist take the last saved msc value saved in
the window_priv struct

Signed-off-by: Łukasz Spintzyk <lukasz.spintzyk@synaptics.com>
This commit is contained in:
Łukasz Spintzyk
2020-09-18 14:31:34 +02:00
committed by Povilas Kanapickas
parent 908deb0895
commit d2dce22b67
7 changed files with 52 additions and 10 deletions

View File

@@ -634,8 +634,9 @@ present_scmd_update_window_crtc(WindowPtr window, RRCrtcPtr crtc, uint64_t new_m
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)
/* Crtc may have been turned off or be destroyed, just use whatever previous MSC we'd seen from this CRTC. */
if (!RRCrtcExists(window->drawable.pScreen, window_priv->crtc) ||
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;