present: Round fake MSC computations intead of truncating

If the timer fired too early, we'd sometimes mis-compute the MSC for
fake vblanks. Rounding the computation to the nearest MSC fixes this nicely.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Keith Packard 2013-11-07 14:17:12 -08:00
parent da9997f89f
commit 4f3c37a1f1

View File

@ -42,7 +42,7 @@ present_fake_get_ust_msc(ScreenPtr screen, uint64_t *ust, uint64_t *msc)
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
*ust = GetTimeInMicros();
*msc = *ust / screen_priv->fake_interval;
*msc = (*ust + screen_priv->fake_interval / 2) / screen_priv->fake_interval;
return Success;
}