summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-09 23:36:56 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-09 23:51:02 +0000
commiteb3e04d960cd749adf696ba15c501a17cd1a184e (patch)
treed1be2535b0d3d8c17e34f3216b684577c1e236dd
parent1c202cc0746541b541d0af22eab5c9798d229a69 (diff)
sna: Fallback to ordinary monotonic clock if coarse is not supported
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index b6a5626a..e4d6ffb6 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -8513,11 +8513,16 @@ static void sna_accel_create_timers(struct sna *sna)
{
int id;
+ /* XXX Can we replace this with OSTimer provided by dix? */
+
#ifdef CLOCK_MONOTONIC_COARSE
for (id = 0; id < NUM_FINE_TIMERS; id++)
sna->timer[id] = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
- for (; id < NUM_TIMERS; id++)
+ for (; id < NUM_TIMERS; id++) {
sna->timer[id] = timerfd_create(CLOCK_MONOTONIC_COARSE, TFD_NONBLOCK);
+ if (sna->timer[id] == -1)
+ sna->timer[id] = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
+ }
#else
for (id = 0; id < NUM_TIMERS; id++)
sna->timer[id] = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);