diff options
author | Francisco Jerez <currojerez@riseup.net> | 2010-11-25 10:37:17 -0500 |
---|---|---|
committer | Francisco Jerez <currojerez@riseup.net> | 2010-12-07 21:00:33 -0500 |
commit | 395a31ec7ed9b02c5412f4405acbd6fceacca0fc (patch) | |
tree | 4c423c5a98aa6b361bb6b6022d0d03f3c6e71438 | |
parent | a3d487ea5463a9c091b7f9b836b860cf3d82e641 (diff) |
drm/nouveau: Spin for a bit in nouveau_fence_wait() before yielding the CPU.
Sleeping doesn't pay off for very short delays in comparison with the
minimum granularity of schedule_timeout().
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_fence.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c index 2579fc69d182..abfeff19488e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.c +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c | |||
@@ -218,6 +218,7 @@ int | |||
218 | __nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr) | 218 | __nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr) |
219 | { | 219 | { |
220 | unsigned long timeout = jiffies + (3 * DRM_HZ); | 220 | unsigned long timeout = jiffies + (3 * DRM_HZ); |
221 | unsigned long sleep_time = jiffies + 1; | ||
221 | int ret = 0; | 222 | int ret = 0; |
222 | 223 | ||
223 | while (1) { | 224 | while (1) { |
@@ -231,7 +232,7 @@ __nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr) | |||
231 | 232 | ||
232 | __set_current_state(intr ? TASK_INTERRUPTIBLE | 233 | __set_current_state(intr ? TASK_INTERRUPTIBLE |
233 | : TASK_UNINTERRUPTIBLE); | 234 | : TASK_UNINTERRUPTIBLE); |
234 | if (lazy) | 235 | if (lazy && time_after_eq(jiffies, sleep_time)) |
235 | schedule_timeout(1); | 236 | schedule_timeout(1); |
236 | 237 | ||
237 | if (intr && signal_pending(current)) { | 238 | if (intr && signal_pending(current)) { |