diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-04 21:14:23 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-04 21:14:23 +0000 |
commit | 8052c3904a1ac0308846ac13534c4c76bb96d5dd (patch) | |
tree | 60cc3714f4d7f12a6e6bd930945bf1065b367a81 | |
parent | 112c61f6557c2337d5f1b25eb71d0dc9ada6ec89 (diff) |
sna: Drain the delayed timer after forcing a flush
The goal is to remove a spurious wakeup when we have no work outstanding
afterwards and so would end up prematurely disabling the timer.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 45050394..a51af188 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -8035,6 +8035,12 @@ static uint64_t read_timer(int fd) (void)ret; } +static void sna_accel_drain_timer(struct sna *sna, int id) +{ + if (sna->timer_active & (1<<id)) + read_timer(sna->timer[id]); +} + static void _sna_accel_disarm_timer(struct sna *sna, int id) { struct itimerspec to; @@ -8056,8 +8062,10 @@ static Bool sna_accel_do_flush(struct sna *sna) struct itimerspec to; struct sna_pixmap *priv; - if (sna->kgem.flush_now) + if (sna->kgem.flush_now) { + sna_accel_drain_timer(sna, FLUSH_TIMER); return TRUE; + } return_if_timer_active(FLUSH_TIMER); @@ -8136,6 +8144,7 @@ static void sna_accel_create_timers(struct sna *sna) } static Bool sna_accel_do_flush(struct sna *sna) { return sna_accel_scanout(sna) != NULL; } static Bool sna_accel_do_expire(struct sna *sna) { return sna->kgem.need_expire; } +static void sna_accel_drain_timer(struct sna *sna, int id) { } static void _sna_accel_disarm_timer(struct sna *sna, int id) { } #endif |