summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drmP.h1
-rw-r--r--linux-core/drm_fops.c16
-rw-r--r--linux-core/ffb_drv.c1
-rw-r--r--linux-core/i810_drv.c1
-rw-r--r--linux-core/i830_drv.c1
-rw-r--r--linux-core/i915_drv.c1
-rw-r--r--linux-core/mach64_drv.c1
-rw-r--r--linux-core/mga_drv.c1
-rw-r--r--linux-core/r128_drv.c1
-rw-r--r--linux-core/radeon_drv.c1
-rw-r--r--linux-core/savage_drv.c1
-rw-r--r--linux-core/sis_drv.c1
-rw-r--r--linux-core/tdfx_drv.c1
13 files changed, 28 insertions, 0 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index 583ead0f..8af9f359 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -749,6 +749,7 @@ extern int drm_open_helper(struct inode *inode, struct file *filp,
drm_device_t * dev);
extern int drm_fasync(int fd, struct file *filp, int on);
extern int drm_release(struct inode *inode, struct file *filp);
+unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
/* Mapping support (drm_vm.h) */
extern void drm_vm_open(struct vm_area_struct *vma);
diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c
index 0c62a1d0..54cebbcb 100644
--- a/linux-core/drm_fops.c
+++ b/linux-core/drm_fops.c
@@ -451,3 +451,19 @@ int drm_release(struct inode *inode, struct file *filp)
return retcode;
}
EXPORT_SYMBOL(drm_release);
+
+/** No-op. */
+/* This is to deal with older X servers that believe 0 means data is
+ * available which is not the correct return for a poll function.
+ * By alternating returns both interfaces are happy. This is fixed
+ * in newer X servers.
+ */
+unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait)
+{
+ static int flip;
+ if ((flip = !flip))
+ return (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM);
+ return 0;
+}
+EXPORT_SYMBOL(drm_poll);
+
diff --git a/linux-core/ffb_drv.c b/linux-core/ffb_drv.c
index c4a1a9fa..8122e95e 100644
--- a/linux-core/ffb_drv.c
+++ b/linux-core/ffb_drv.c
@@ -324,6 +324,7 @@ static struct drm_driver ffb_driver = {
.ioctl = drm_ioctl,
.mmap = drm_mmap,
.fasync = drm_fasync,
+ .poll = drm_poll,
.get_unmapped_area = ffb_get_unmapped_area,
},
};
diff --git a/linux-core/i810_drv.c b/linux-core/i810_drv.c
index bfeb35a8..6ffa167d 100644
--- a/linux-core/i810_drv.c
+++ b/linux-core/i810_drv.c
@@ -114,6 +114,7 @@ static struct drm_driver driver = {
.release = drm_release,
.ioctl = drm_ioctl,
.mmap = i810_mmap_buffers,
+ .poll = drm_poll,
.fasync = drm_fasync,
},
.pci_driver = {
diff --git a/linux-core/i830_drv.c b/linux-core/i830_drv.c
index e7c00a80..0846da6c 100644
--- a/linux-core/i830_drv.c
+++ b/linux-core/i830_drv.c
@@ -124,6 +124,7 @@ static struct drm_driver driver = {
.release = drm_release,
.ioctl = drm_ioctl,
.mmap = i830_mmap_buffers,
+ .poll = drm_poll,
.fasync = drm_fasync,
},
.pci_driver = {
diff --git a/linux-core/i915_drv.c b/linux-core/i915_drv.c
index 6cb27743..f0298e17 100644
--- a/linux-core/i915_drv.c
+++ b/linux-core/i915_drv.c
@@ -89,6 +89,7 @@ static struct drm_driver driver = {
.release = drm_release,
.ioctl = drm_ioctl,
.mmap = drm_mmap,
+ .poll = drm_poll,
.fasync = drm_fasync,
},
.pci_driver = {
diff --git a/linux-core/mach64_drv.c b/linux-core/mach64_drv.c
index e1be1fa8..3f736aa3 100644
--- a/linux-core/mach64_drv.c
+++ b/linux-core/mach64_drv.c
@@ -106,6 +106,7 @@ static struct drm_driver driver = {
.release = drm_release,
.ioctl = drm_ioctl,
.mmap = drm_mmap,
+ .poll = drm_poll,
.fasync = drm_fasync,
},
.pci_driver = {
diff --git a/linux-core/mga_drv.c b/linux-core/mga_drv.c
index 6e90e5dc..65e9d9c1 100644
--- a/linux-core/mga_drv.c
+++ b/linux-core/mga_drv.c
@@ -111,6 +111,7 @@ static struct drm_driver driver = {
.release = drm_release,
.ioctl = drm_ioctl,
.mmap = drm_mmap,
+ .poll = drm_poll,
.fasync = drm_fasync,
},
.pci_driver = {
diff --git a/linux-core/r128_drv.c b/linux-core/r128_drv.c
index 31ee1aaa..0a34625a 100644
--- a/linux-core/r128_drv.c
+++ b/linux-core/r128_drv.c
@@ -121,6 +121,7 @@ static struct drm_driver driver = {
.release = drm_release,
.ioctl = drm_ioctl,
.mmap = drm_mmap,
+ .poll = drm_poll,
.fasync = drm_fasync,
},
.pci_driver = {
diff --git a/linux-core/radeon_drv.c b/linux-core/radeon_drv.c
index dbf530f6..fbf6b23a 100644
--- a/linux-core/radeon_drv.c
+++ b/linux-core/radeon_drv.c
@@ -161,6 +161,7 @@ static struct drm_driver driver = {
.release = drm_release,
.ioctl = drm_ioctl,
.mmap = drm_mmap,
+ .poll = drm_poll,
.fasync = drm_fasync,
},
.pci_driver = {
diff --git a/linux-core/savage_drv.c b/linux-core/savage_drv.c
index ffec6e73..e8591689 100644
--- a/linux-core/savage_drv.c
+++ b/linux-core/savage_drv.c
@@ -299,6 +299,7 @@ static struct drm_driver driver = {
.release = drm_release,
.ioctl = drm_ioctl,
.mmap = drm_mmap,
+ .poll = drm_poll,
.fasync = drm_fasync,
},
.pci_driver = {
diff --git a/linux-core/sis_drv.c b/linux-core/sis_drv.c
index f5168473..a6300509 100644
--- a/linux-core/sis_drv.c
+++ b/linux-core/sis_drv.c
@@ -88,6 +88,7 @@ static struct drm_driver driver = {
.release = drm_release,
.ioctl = drm_ioctl,
.mmap = drm_mmap,
+ .poll = drm_poll,
.fasync = drm_fasync,
},
.pci_driver = {
diff --git a/linux-core/tdfx_drv.c b/linux-core/tdfx_drv.c
index 66d57284..9062cb0a 100644
--- a/linux-core/tdfx_drv.c
+++ b/linux-core/tdfx_drv.c
@@ -79,6 +79,7 @@ static struct drm_driver driver = {
.release = drm_release,
.ioctl = drm_ioctl,
.mmap = drm_mmap,
+ .poll = drm_poll,
.fasync = drm_fasync,
},
.pci_driver = {