summaryrefslogtreecommitdiff
path: root/present
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-11-07 14:17:12 -0800
committerKeith Packard <keithp@keithp.com>2013-11-20 13:12:22 -0800
commit4f3c37a1f17ffcfbbff71d217e1caad3d0148c90 (patch)
treefed0f04c04eb99638e7ccc8c4f089211b8870cbf /present
parentda9997f89f14ab619f244d5b2e80a423b028c789 (diff)
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>
Diffstat (limited to 'present')
-rw-r--r--present/present_fake.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/present/present_fake.c b/present/present_fake.c
index a67759254..e550e98f8 100644
--- a/present/present_fake.c
+++ b/present/present_fake.c
@@ -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;
}