summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2003-04-22 08:06:14 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2003-04-22 08:06:14 +0000
commitfc4fb6b51b50e37ff697e872b297b6460c3617af (patch)
tree739b00a33d36d431273ac6e1da133bad35e98629 /linux-core
parent46e06192a88834a97257d2be5ab3aa7c325a1cfe (diff)
remove DRM read, poll and write_string
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drmP.h6
-rw-r--r--linux-core/drm_context.c6
-rw-r--r--linux-core/drm_drv.c2
-rw-r--r--linux-core/drm_fops.c94
-rw-r--r--linux-core/i810_dma.c2
-rw-r--r--linux-core/i830_dma.c2
6 files changed, 0 insertions, 112 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index 7c7428ba2..8b701467c 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -697,13 +697,7 @@ extern int DRM(unlock)(struct inode *inode, struct file *filp,
extern int DRM(open_helper)(struct inode *inode, struct file *filp,
drm_device_t *dev);
extern int DRM(flush)(struct file *filp);
-extern int DRM(release_fuck)(struct inode *inode, struct file *filp);
extern int DRM(fasync)(int fd, struct file *filp, int on);
-extern ssize_t DRM(read)(struct file *filp, char *buf, size_t count,
- loff_t *off);
-extern int DRM(write_string)(drm_device_t *dev, const char *s);
-extern unsigned int DRM(poll)(struct file *filp,
- struct poll_table_struct *wait);
/* Mapping support (drm_vm.h) */
extern struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
diff --git a/linux-core/drm_context.c b/linux-core/drm_context.c
index 88b485ff2..fab0885b5 100644
--- a/linux-core/drm_context.c
+++ b/linux-core/drm_context.c
@@ -242,9 +242,6 @@ int DRM(context_switch)( drm_device_t *dev, int old, int new )
if ( DRM(flags) & DRM_FLAG_NOCTX ) {
DRM(context_switch_complete)( dev, new );
- } else {
- sprintf( buf, "C %d %d\n", old, new );
- DRM(write_string)( dev, buf );
}
return 0;
@@ -455,9 +452,6 @@ int DRM(context_switch)(drm_device_t *dev, int old, int new)
if (DRM(flags) & DRM_FLAG_NOCTX) {
DRM(context_switch_complete)(dev, new);
- } else {
- sprintf(buf, "C %d %d\n", old, new);
- DRM(write_string)(dev, buf);
}
atomic_dec(&q->use_count);
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index b2070d322..848a2f110 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -121,9 +121,7 @@ static struct file_operations DRM(fops) = { \
.release = DRM(release), \
.ioctl = DRM(ioctl), \
.mmap = DRM(mmap), \
- .read = DRM(read), \
.fasync = DRM(fasync), \
- .poll = DRM(poll), \
}
#endif
diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c
index 833409f09..3baac693b 100644
--- a/linux-core/drm_fops.c
+++ b/linux-core/drm_fops.c
@@ -114,97 +114,3 @@ int DRM(fasync)(int fd, struct file *filp, int on)
}
-/* The drm_read and drm_write_string code (especially that which manages
- the circular buffer), is based on Alessandro Rubini's LINUX DEVICE
- DRIVERS (Cambridge: O'Reilly, 1998), pages 111-113. */
-
-ssize_t DRM(read)(struct file *filp, char *buf, size_t count, loff_t *off)
-{
- drm_file_t *priv = filp->private_data;
- drm_device_t *dev = priv->dev;
- int left;
- int avail;
- int send;
- int cur;
-
- DRM_DEBUG("%p, %p\n", dev->buf_rp, dev->buf_wp);
-
- while (dev->buf_rp == dev->buf_wp) {
- DRM_DEBUG(" sleeping\n");
- if (filp->f_flags & O_NONBLOCK) {
- return -EAGAIN;
- }
- interruptible_sleep_on(&dev->buf_readers);
- if (signal_pending(current)) {
- DRM_DEBUG(" interrupted\n");
- return -ERESTARTSYS;
- }
- DRM_DEBUG(" awake\n");
- }
-
- left = (dev->buf_rp + DRM_BSZ - dev->buf_wp) % DRM_BSZ;
- avail = DRM_BSZ - left;
- send = DRM_MIN(avail, count);
-
- while (send) {
- if (dev->buf_wp > dev->buf_rp) {
- cur = DRM_MIN(send, dev->buf_wp - dev->buf_rp);
- } else {
- cur = DRM_MIN(send, dev->buf_end - dev->buf_rp);
- }
- if (copy_to_user(buf, dev->buf_rp, cur))
- return -EFAULT;
- dev->buf_rp += cur;
- if (dev->buf_rp == dev->buf_end) dev->buf_rp = dev->buf;
- send -= cur;
- }
-
- wake_up_interruptible(&dev->buf_writers);
- return DRM_MIN(avail, count);;
-}
-
-int DRM(write_string)(drm_device_t *dev, const char *s)
-{
- int left = (dev->buf_rp + DRM_BSZ - dev->buf_wp) % DRM_BSZ;
- int send = strlen(s);
- int count;
-
- DRM_DEBUG("%d left, %d to send (%p, %p)\n",
- left, send, dev->buf_rp, dev->buf_wp);
-
- if (left == 1 || dev->buf_wp != dev->buf_rp) {
- DRM_ERROR("Buffer not empty (%d left, wp = %p, rp = %p)\n",
- left,
- dev->buf_wp,
- dev->buf_rp);
- }
-
- while (send) {
- if (dev->buf_wp >= dev->buf_rp) {
- count = DRM_MIN(send, dev->buf_end - dev->buf_wp);
- if (count == left) --count; /* Leave a hole */
- } else {
- count = DRM_MIN(send, dev->buf_rp - dev->buf_wp - 1);
- }
- strncpy(dev->buf_wp, s, count);
- dev->buf_wp += count;
- if (dev->buf_wp == dev->buf_end) dev->buf_wp = dev->buf;
- send -= count;
- }
-
- if (dev->buf_async) kill_fasync(&dev->buf_async, SIGIO, POLL_IN);
-
- DRM_DEBUG("waking\n");
- wake_up_interruptible(&dev->buf_readers);
- return 0;
-}
-
-unsigned int DRM(poll)(struct file *filp, struct poll_table_struct *wait)
-{
- drm_file_t *priv = filp->private_data;
- drm_device_t *dev = priv->dev;
-
- poll_wait(filp, &dev->buf_readers, wait);
- if (dev->buf_wp != dev->buf_rp) return POLLIN | POLLRDNORM;
- return 0;
-}
diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c
index c06fd9151..a37271643 100644
--- a/linux-core/i810_dma.c
+++ b/linux-core/i810_dma.c
@@ -122,9 +122,7 @@ static struct file_operations i810_buffer_fops = {
.release = DRM(release),
.ioctl = DRM(ioctl),
.mmap = i810_mmap_buffers,
- .read = DRM(read),
.fasync = DRM(fasync),
- .poll = DRM(poll),
};
int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
diff --git a/linux-core/i830_dma.c b/linux-core/i830_dma.c
index b76d2b11e..df58e9900 100644
--- a/linux-core/i830_dma.c
+++ b/linux-core/i830_dma.c
@@ -130,9 +130,7 @@ static struct file_operations i830_buffer_fops = {
.release = DRM(release),
.ioctl = DRM(ioctl),
.mmap = i830_mmap_buffers,
- .read = DRM(read),
.fasync = DRM(fasync),
- .poll = DRM(poll),
};
int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma)