summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/zoran_driver.c
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-07-17 14:29:45 -0700
committerTrent Piepho <xyzzy@speakeasy.org>2007-07-17 14:29:45 -0700
commit673be99d573553c9d6360e2c8b0184a480158c16 (patch)
treea2680d9b42abd6c38c685a90343b36fcdb03c5c3 /linux/drivers/media/video/zoran_driver.c
parentb7faeafd9f3af3a7bfa99fce5a82d961669388cc (diff)
downloadmediapointer-dvb-s2-673be99d573553c9d6360e2c8b0184a480158c16.tar.gz
mediapointer-dvb-s2-673be99d573553c9d6360e2c8b0184a480158c16.tar.bz2
zr36067: Turn off raw capture properly
From: Trent Piepho <xyzzy@speakeasy.org> When raw capture was turned off, the current capturing frame (v4l_grab_frame) wasn't reset to NO_GRAB_ACTIVE. If capture was turned back on, the driver would think this frame was currently being captured, and wait for it to complete before starting a new frame. The hardware on the other hand would not be actively capturing a frame. The result was the driver would wait forever for v4l_grab_frame to be captured. Some calls to zr36057_set_memgrab(0) were missing spin-locks, which have been added. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Acked-by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
Diffstat (limited to 'linux/drivers/media/video/zoran_driver.c')
-rw-r--r--linux/drivers/media/video/zoran_driver.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/linux/drivers/media/video/zoran_driver.c b/linux/drivers/media/video/zoran_driver.c
index 70a118f23..6e598a3c5 100644
--- a/linux/drivers/media/video/zoran_driver.c
+++ b/linux/drivers/media/video/zoran_driver.c
@@ -1245,10 +1245,14 @@ zoran_close_end_session (struct file *file)
/* v4l capture */
if (fh->v4l_buffers.active != ZORAN_FREE) {
+ long flags;
+
+ spin_lock_irqsave(&zr->spinlock, flags);
zr36057_set_memgrab(zr, 0);
zr->v4l_buffers.allocated = 0;
zr->v4l_buffers.active = fh->v4l_buffers.active =
ZORAN_FREE;
+ spin_unlock_irqrestore(&zr->spinlock, flags);
}
/* v4l buffers */
@@ -3513,8 +3517,13 @@ zoran_do_ioctl (struct inode *inode,
goto strmoff_unlock_and_return;
/* unload capture */
- if (zr->v4l_memgrab_active)
+ if (zr->v4l_memgrab_active) {
+ long flags;
+
+ spin_lock_irqsave(&zr->spinlock, flags);
zr36057_set_memgrab(zr, 0);
+ spin_unlock_irqrestore(&zr->spinlock, flags);
+ }
for (i = 0; i < fh->v4l_buffers.num_buffers; i++)
zr->v4l_buffers.buffer[i].state =
@@ -4449,11 +4458,15 @@ zoran_vm_close (struct vm_area_struct *vma)
mutex_lock(&zr->resource_lock);
if (fh->v4l_buffers.active != ZORAN_FREE) {
+ long flags;
+
+ spin_lock_irqsave(&zr->spinlock, flags);
zr36057_set_memgrab(zr, 0);
zr->v4l_buffers.allocated = 0;
zr->v4l_buffers.active =
fh->v4l_buffers.active =
ZORAN_FREE;
+ spin_unlock_irqrestore(&zr->spinlock, flags);
}
//v4l_fbuffer_free(file);
fh->v4l_buffers.allocated = 0;