Add a poll function that alternates between zero and normal poll return to
bring DRM into conformance with normal poll().main
parent
bbfe18e3bf
commit
5e8838fd11
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
Loading…
Reference in New Issue