summaryrefslogtreecommitdiff
path: root/linux/drm_fops.h
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2002-05-16 23:47:15 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2002-05-16 23:47:15 +0000
commit9e67da5626b683df58f2041fdb0f743eb4da7036 (patch)
tree899477e18e99e9b620e27961de58c0664b218825 /linux/drm_fops.h
parent3903e5ac94c07cf31f0bc24eff5011ef8cc7afba (diff)
Allow drm to build under 2.4 and 2.5(.14)
Diffstat (limited to 'linux/drm_fops.h')
-rw-r--r--linux/drm_fops.h14
1 files changed, 2 insertions, 12 deletions
diff --git a/linux/drm_fops.h b/linux/drm_fops.h
index 9c2135fe..3d4bffa5 100644
--- a/linux/drm_fops.h
+++ b/linux/drm_fops.h
@@ -38,7 +38,7 @@
int DRM(open_helper)(struct inode *inode, struct file *filp, drm_device_t *dev)
{
- kdev_t minor = MINOR(inode->i_rdev);
+ int minor = minor(inode->i_rdev);
drm_file_t *priv;
if (filp->f_flags & O_EXCL) return -EBUSY; /* No exclusive opens */
@@ -125,31 +125,21 @@ ssize_t DRM(read)(struct file *filp, char *buf, size_t count, loff_t *off)
int avail;
int send;
int cur;
- DECLARE_WAITQUEUE(wait, current);
DRM_DEBUG("%p, %p\n", dev->buf_rp, dev->buf_wp);
- add_wait_queue(&dev->buf_readers, &wait);
- set_current_state(TASK_INTERRUPTIBLE);
while (dev->buf_rp == dev->buf_wp) {
DRM_DEBUG(" sleeping\n");
if (filp->f_flags & O_NONBLOCK) {
- remove_wait_queue(&dev->buf_readers, &wait);
- set_current_state(TASK_RUNNING);
return -EAGAIN;
}
- schedule(); /* wait for dev->buf_readers */
+ interruptible_sleep_on(&dev->buf_readers);
if (signal_pending(current)) {
DRM_DEBUG(" interrupted\n");
- remove_wait_queue(&dev->buf_readers, &wait);
- set_current_state(TASK_RUNNING);
return -ERESTARTSYS;
}
DRM_DEBUG(" awake\n");
- set_current_state(TASK_INTERRUPTIBLE);
}
- remove_wait_queue(&dev->buf_readers, &wait);
- set_current_state(TASK_RUNNING);
left = (dev->buf_rp + DRM_BSZ - dev->buf_wp) % DRM_BSZ;
avail = DRM_BSZ - left;