diff options
author | Daryll Strauss <daryll@users.sourceforge.net> | 2000-01-12 21:47:44 +0000 |
---|---|---|
committer | Daryll Strauss <daryll@users.sourceforge.net> | 2000-01-12 21:47:44 +0000 |
commit | aa724a52b9e3b5fa6a768629e2d403288432b7a8 (patch) | |
tree | 4942f6c4db16416111f46b0c9b88216e36dfbd22 | |
parent | e83ae7576bca0dc248a03c8031b0cce37956aac4 (diff) |
Add a drm_poll function to the tdfx driver. This fixes the problem with
3.9.17 where the server hangs when the mouse is first moved.
-rw-r--r-- | linux-core/drmP.h | 7 | ||||
-rw-r--r-- | linux-core/tdfx_drv.c | 3 | ||||
-rw-r--r-- | linux/drmP.h | 7 | ||||
-rw-r--r-- | linux/fops.c | 11 | ||||
-rw-r--r-- | linux/tdfx_drv.c | 3 |
5 files changed, 26 insertions, 5 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h index e01cf28b..0d5f7b8f 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -25,7 +25,7 @@ * DEALINGS IN THE SOFTWARE. * * $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v 1.58 1999/08/30 13:05:00 faith Exp $ - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v 1.2 1999/12/14 01:33:56 robin Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v 1.1 1999/09/25 14:37:59 dawes Exp $ * */ @@ -49,6 +49,10 @@ #ifdef CONFIG_MTRR #include <asm/mtrr.h> #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0) +#include <asm/spinlock.h> +#include <linux/poll.h> +#endif #include "drm.h" #define DRM_DEBUG_CODE 2 /* Include debugging code (if > 1, then @@ -478,6 +482,7 @@ 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 (vm.c) */ #if LINUX_VERSION_CODE < 0x020317 diff --git a/linux-core/tdfx_drv.c b/linux-core/tdfx_drv.c index 31924254..769d7adf 100644 --- a/linux-core/tdfx_drv.c +++ b/linux-core/tdfx_drv.c @@ -25,7 +25,7 @@ * DEALINGS IN THE SOFTWARE. * * $PI$ - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c,v 1.1 1999/12/14 01:49:22 robin Exp $ + * $XFree86$ * */ @@ -53,6 +53,7 @@ static struct file_operations tdfx_fops = { mmap: drm_mmap, read: drm_read, fasync: drm_fasync, + poll: drm_poll }; static struct miscdevice tdfx_misc = { diff --git a/linux/drmP.h b/linux/drmP.h index e01cf28b..0d5f7b8f 100644 --- a/linux/drmP.h +++ b/linux/drmP.h @@ -25,7 +25,7 @@ * DEALINGS IN THE SOFTWARE. * * $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v 1.58 1999/08/30 13:05:00 faith Exp $ - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v 1.2 1999/12/14 01:33:56 robin Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v 1.1 1999/09/25 14:37:59 dawes Exp $ * */ @@ -49,6 +49,10 @@ #ifdef CONFIG_MTRR #include <asm/mtrr.h> #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0) +#include <asm/spinlock.h> +#include <linux/poll.h> +#endif #include "drm.h" #define DRM_DEBUG_CODE 2 /* Include debugging code (if > 1, then @@ -478,6 +482,7 @@ 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 (vm.c) */ #if LINUX_VERSION_CODE < 0x020317 diff --git a/linux/fops.c b/linux/fops.c index 39bfdbb8..0bdf2135 100644 --- a/linux/fops.c +++ b/linux/fops.c @@ -25,7 +25,7 @@ * DEALINGS IN THE SOFTWARE. * * $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/fops.c,v 1.3 1999/08/20 15:36:45 faith Exp $ - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/fops.c,v 1.2 1999/12/14 01:33:56 robin Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/fops.c,v 1.1 1999/09/25 14:37:59 dawes Exp $ * */ @@ -221,3 +221,12 @@ int drm_write_string(drm_device_t *dev, const char *s) 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/tdfx_drv.c b/linux/tdfx_drv.c index 31924254..769d7adf 100644 --- a/linux/tdfx_drv.c +++ b/linux/tdfx_drv.c @@ -25,7 +25,7 @@ * DEALINGS IN THE SOFTWARE. * * $PI$ - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/tdfx_drv.c,v 1.1 1999/12/14 01:49:22 robin Exp $ + * $XFree86$ * */ @@ -53,6 +53,7 @@ static struct file_operations tdfx_fops = { mmap: drm_mmap, read: drm_read, fasync: drm_fasync, + poll: drm_poll }; static struct miscdevice tdfx_misc = { |