diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-04-25 19:17:22 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-04-26 01:38:15 -0400 |
commit | 6d1d1cc97b8b24e9f7842de13f4b00393392c990 (patch) | |
tree | 0131b2513c29a79a86e971c1395ed23cf3e8b654 /drivers/gpu/drm/nouveau/core | |
parent | 10caad339c458df47e5a9e16e148087fcde98fec (diff) |
drm/nouveau/timer: allow alarms to be cancelled
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/timer/nv04.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/timer/nv04.c b/drivers/gpu/drm/nouveau/core/subdev/timer/nv04.c index 8e1bae4f12e8..9469b8275675 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/timer/nv04.c +++ b/drivers/gpu/drm/nouveau/core/subdev/timer/nv04.c | |||
@@ -96,11 +96,16 @@ nv04_timer_alarm(struct nouveau_timer *ptimer, u64 time, | |||
96 | 96 | ||
97 | /* append new alarm to list, in soonest-alarm-first order */ | 97 | /* append new alarm to list, in soonest-alarm-first order */ |
98 | spin_lock_irqsave(&priv->lock, flags); | 98 | spin_lock_irqsave(&priv->lock, flags); |
99 | list_for_each_entry(list, &priv->alarms, head) { | 99 | if (!time) { |
100 | if (list->timestamp > alarm->timestamp) | 100 | if (!list_empty(&alarm->head)) |
101 | break; | 101 | list_del(&alarm->head); |
102 | } else { | ||
103 | list_for_each_entry(list, &priv->alarms, head) { | ||
104 | if (list->timestamp > alarm->timestamp) | ||
105 | break; | ||
106 | } | ||
107 | list_add_tail(&alarm->head, &list->head); | ||
102 | } | 108 | } |
103 | list_add_tail(&alarm->head, &list->head); | ||
104 | spin_unlock_irqrestore(&priv->lock, flags); | 109 | spin_unlock_irqrestore(&priv->lock, flags); |
105 | 110 | ||
106 | /* process pending alarms */ | 111 | /* process pending alarms */ |