From 5e8838fd115879174567c4c2db8ad25331619994 Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Wed, 13 Oct 2004 16:40:53 +0000 Subject: Add a poll function that alternates between zero and normal poll return to bring DRM into conformance with normal poll(). --- linux-core/drm_fops.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'linux-core/drm_fops.c') 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); + -- cgit v1.2.3