The patch number 11230 was added via Janne Grunau <[email protected]>
to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel
If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List <[email protected]>
------
From: Janne Grunau <[email protected]>
hdpvr: return immediately from hdpvr_poll if data is available
simplifies check for available data with hdpvr_get_next_buffer
Priority: normal
Signed-off-by: Janne Grunau <[email protected]>
---
linux/drivers/media/video/hdpvr/hdpvr-video.c | 22 +++++++-----------
1 file changed, 9 insertions(+), 13 deletions(-)
diff -r 513c90084f6f -r 0b8aca6edeb3
linux/drivers/media/video/hdpvr/hdpvr-video.c
--- a/linux/drivers/media/video/hdpvr/hdpvr-video.c Thu Mar 26 18:40:55
2009 +0100
+++ b/linux/drivers/media/video/hdpvr/hdpvr-video.c Thu Mar 26 18:32:54
2009 +0100
@@ -479,6 +479,7 @@ err:
static unsigned int hdpvr_poll(struct file *filp, poll_table *wait)
{
+ struct hdpvr_buffer *buf = NULL;
struct hdpvr_fh *fh = (struct hdpvr_fh *)filp->private_data;
struct hdpvr_device *dev = fh->dev;
unsigned int mask = 0;
@@ -499,19 +500,14 @@ static unsigned int hdpvr_poll(struct fi
}
mutex_unlock(&dev->io_mutex);
- poll_wait(filp, &dev->wait_data, wait);
-
- mutex_lock(&dev->io_mutex);
- if (!list_empty(&dev->rec_buff_list)) {
-
- struct hdpvr_buffer *buf = list_entry(dev->rec_buff_list.next,
- struct hdpvr_buffer,
- buff_list);
-
- if (buf->status == BUFSTAT_READY)
- mask |= POLLIN | POLLRDNORM;
- }
- mutex_unlock(&dev->io_mutex);
+ buf = hdpvr_get_next_buffer(dev);
+ /* only wait if no data is available */
+ if (!buf || buf->status != BUFSTAT_READY) {
+ poll_wait(filp, &dev->wait_data, wait);
+ buf = hdpvr_get_next_buffer(dev);
+ }
+ if (buf && buf->status == BUFSTAT_READY)
+ mask |= POLLIN | POLLRDNORM;
return mask;
}
---
Patch is available at:
http://linuxtv.org/hg/v4l-dvb/rev/0b8aca6edeb315b0bacbedd3140f84a5822844e7
_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits