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:
parent
da9997f89f
commit
4f3c37a1f1
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user