diff options
author | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2007-04-19 23:25:14 +0200 |
---|---|---|
committer | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2007-04-20 15:57:41 +0200 |
commit | a8a8108e459977ec8b334e517abd67e1b264337e (patch) | |
tree | e69760f0f545a3298380ae3aa41349bf0265e00d /linux-core | |
parent | 1ce9c092314ddf005cdadc6937e36d4dc59788ce (diff) |
Avoid a fence timeout problem when a signal is pending.
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/drm_fence.c | 10 |
1 files changed, 7 insertions, 3 deletions
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) { |