Add a poll function that alternates between zero and normal poll return to

bring DRM into conformance with normal poll().
main
Jon Smirl 2004-10-13 16:40:53 +00:00
parent bbfe18e3bf
commit 5e8838fd11
13 changed files with 28 additions and 0 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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,
},
};

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {