summaryrefslogtreecommitdiff
path: root/linux-core/drm_fops.c
diff options
context:
space:
mode:
authorJon Smirl <jonsmirl@yahoo.com>2004-10-13 16:40:53 +0000
committerJon Smirl <jonsmirl@yahoo.com>2004-10-13 16:40:53 +0000
commit5e8838fd115879174567c4c2db8ad25331619994 (patch)
tree5876cfe88d4fb9fe996f9f767f97bae13c2cb953 /linux-core/drm_fops.c
parentbbfe18e3bf7b45543c9f59f7363c1ed5b6bca719 (diff)
Add a poll function that alternates between zero and normal poll return to
bring DRM into conformance with normal poll().
Diffstat (limited to 'linux-core/drm_fops.c')
-rw-r--r--linux-core/drm_fops.c16
1 files changed, 16 insertions, 0 deletions
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);
+