From: Dave Airlie Date: Tue, 19 Apr 2005 00:31:16 +0000 (+0000) Subject: Revert last commit, it affect via things X-Git-Tag: libdrm-1_0_0~78 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b0c461c8e374d7e92e5013a03fc6096595a74700;p=platform%2Fupstream%2Flibdrm.git Revert last commit, it affect via things --- diff --git a/linux-core/drm_os_linux.h b/linux-core/drm_os_linux.h index 5d5d6e0..1ed1cca 100644 --- a/linux-core/drm_os_linux.h +++ b/linux-core/drm_os_linux.h @@ -5,7 +5,6 @@ #include /* For task queue support */ #include -#include /** File pointer type */ #define DRMFILE struct file * @@ -146,12 +145,26 @@ do { \ #define DRM_WAIT_ON( ret, queue, timeout, condition ) \ do { \ - long __ret; \ - __ret = wait_event_interruptible_timeout(queue, condition, timeout); \ - if (__ret == 0) \ - ret = -EBUSY; \ - else if (__ret == -ERESTARTSYS) \ - ret = -EINTR; \ + DECLARE_WAITQUEUE(entry, current); \ + unsigned long end = jiffies + (timeout); \ + add_wait_queue(&(queue), &entry); \ + \ + for (;;) { \ + __set_current_state(TASK_INTERRUPTIBLE); \ + if (condition) \ + break; \ + if (time_after_eq(jiffies, end)) { \ + ret = -EBUSY; \ + break; \ + } \ + schedule_timeout((HZ/100 > 1) ? HZ/100 : 1); \ + if (signal_pending(current)) { \ + ret = -EINTR; \ + break; \ + } \ + } \ + __set_current_state(TASK_RUNNING); \ + remove_wait_queue(&(queue), &entry); \ } while (0) #define DRM_WAKEUP( queue ) wake_up_interruptible( queue )