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>
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;
}