summaryrefslogtreecommitdiff
path: root/linux-core/drm_fence.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-09-18 21:50:00 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-09-18 21:50:00 +0200
commitaac918e7c72a46a1b0f2329380e2d6b4196d04e4 (patch)
tree9af3298afd84ef1a37e0cf72813237f38148badc /linux-core/drm_fence.c
parentca1b15d645c74e20f638f5a09981bcf02f58caee (diff)
Fence handler fix
Diffstat (limited to 'linux-core/drm_fence.c')
-rw-r--r--linux-core/drm_fence.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/linux-core/drm_fence.c b/linux-core/drm_fence.c
index 41fe62a8..cb7aee09 100644
--- a/linux-core/drm_fence.c
+++ b/linux-core/drm_fence.c
@@ -31,6 +31,7 @@
#include "drmP.h"
+
/*
* Typically called by the IRQ handler.
*/
@@ -44,14 +45,20 @@ void drm_fence_handler(drm_device_t * dev, uint32_t sequence, uint32_t type)
drm_fence_driver_t *driver = dev->driver->fence_driver;
struct list_head *list, *prev;
drm_fence_object_t *fence;
+ int found = 0;
+
+ if (list_empty(&fm->ring))
+ return;
list_for_each_entry(fence, &fm->ring, ring) {
diff = (sequence - fence->sequence) & driver->sequence_mask;
- if (diff > driver->wrap_diff)
+ if (diff > driver->wrap_diff) {
+ found = 1;
break;
+ }
}
- list = fence->ring.prev;
+ list = (found) ? fence->ring.prev : fm->ring.prev;
prev = list->prev;
for (; list != &fm->ring; list = prev, prev = list->prev) {