From a8a8108e459977ec8b334e517abd67e1b264337e Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Thu, 19 Apr 2007 23:25:14 +0200 Subject: Avoid a fence timeout problem when a signal is pending. --- linux-core/drm_fence.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'linux-core/drm_fence.c') diff --git a/linux-core/drm_fence.c b/linux-core/drm_fence.c index be075bb3..441e7631 100644 --- a/linux-core/drm_fence.c +++ b/linux-core/drm_fence.c @@ -295,17 +295,21 @@ static int drm_fence_lazy_wait(drm_device_t *dev, { drm_fence_manager_t *fm = &dev->fm; drm_fence_class_manager_t *fc = &fm->class[fence->class]; - + int signaled; unsigned long _end = jiffies + 3*DRM_HZ; int ret = 0; do { DRM_WAIT_ON(ret, fc->fence_queue, 3 * DRM_HZ, - fence_signaled(dev, fence, mask, 1)); + (signaled = fence_signaled(dev, fence, mask, 1))); + if (signaled) + return 0; if (time_after_eq(jiffies, _end)) break; } while (ret == -EINTR && ignore_signals); - if (time_after_eq(jiffies, _end) && (ret != 0)) + if (fence_signaled(dev, fence, mask, 0)) + return 0; + if (time_after_eq(jiffies, _end)) ret = -EBUSY; if (ret) { if (ret == -EBUSY) { -- cgit v1.2.3 From af3ffcd822e562b02fe0671e7e88d9c5a6225658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 20 Apr 2007 18:06:31 -0400 Subject: Initialize rwlock using rwlock_init to appease lockdep validator. --- linux-core/drm_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core/drm_fence.c') diff --git a/linux-core/drm_fence.c b/linux-core/drm_fence.c index 441e7631..088c50d6 100644 --- a/linux-core/drm_fence.c +++ b/linux-core/drm_fence.c @@ -499,7 +499,7 @@ void drm_fence_manager_init(drm_device_t * dev) int i; - fm->lock = RW_LOCK_UNLOCKED; + rwlock_init(&fm->lock); write_lock(&fm->lock); fm->initialized = 0; if (!fed) -- cgit v1.2.3