summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-04-07 14:14:15 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-04-07 14:17:01 +0100
commitd4818c74b19e8c75729573c75350dd9ee587d217 (patch)
tree84a1a47a509d62b27c6479287638c23bd3b35f8d
parent74b755fe0a786d330d121c435d274e2418003581 (diff)
sna/present: Clamp to maximum timer delay
Timers can only be set for a maximum of int32_t milliseconds into the future. Respect that - if we need more, we'll just requeue! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_present.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sna/sna_present.c b/src/sna/sna_present.c
index 6e1beaee..e69aef20 100644
--- a/src/sna/sna_present.c
+++ b/src/sna/sna_present.c
@@ -164,7 +164,7 @@ static uint32_t msc_to_delay(xf86CrtcPtr crtc, uint64_t target)
DBG(("%s: sleep %d frames, %llu ms\n", __FUNCTION__,
(int)(target - swap->msc), (long long)delay));
assert(delay >= 0);
- return delay;
+ return MIN(delay, INT32_MAX);
}
static CARD32 sna_fake_vblank_handler(OsTimerPtr timer, CARD32 now, void *data)