In DRM style provide means for userspace to monitor availability
of events via the poll syscall.
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@nokia.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
return total;
}
+unsigned int pvr_poll(struct file *filp, struct poll_table_struct *wait)
+{
+ struct PVRSRV_FILE_PRIVATE_DATA *priv = filp->private_data;
+ unsigned int mask = 0;
+
+ poll_wait(filp, &priv->event_wait, wait);
+
+ if (!list_empty(&priv->event_list))
+ mask |= POLLIN | POLLRDNORM;
+
+ return mask;
+}
+
void pvr_release_events(struct PVRSRV_FILE_PRIVATE_DATA *priv)
{
struct pvr_pending_event *w;
#include "private_data.h"
#include <linux/list.h>
#include <linux/file.h>
+#include <linux/poll.h>
/*
* Header for events written back to userspace on the drm fd. The
ssize_t pvr_read(struct file *filp, char __user *buf, size_t count,
loff_t *off);
+unsigned int pvr_poll(struct file *filp, struct poll_table_struct *wait);
void pvr_release_events(struct PVRSRV_FILE_PRIVATE_DATA *priv);
#endif /* PVR_EVENTS_H */