aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/zoran_driver.c
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-07-17 17:29:45 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-30 15:26:26 -0400
commit9896bbc1972e3a0595f06c23692a20150a789308 (patch)
tree1dc4b82182251bc747c8f40b3a791607124c39dd /drivers/media/video/zoran_driver.c
parent603d6f2c8f9f3604f9c6c1f8903efc2df30a000f (diff)
V4L/DVB (5891): zr36067: Turn off raw capture properly
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/zoran_driver.c')
-rw-r--r--drivers/media/video/zoran_driver.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c
index ec9ae6c61bd5..72a037b75d63 100644
--- a/drivers/media/video/zoran_driver.c
+++ b/drivers/media/video/zoran_driver.c
@@ -1188,10 +1188,14 @@ zoran_close_end_session (struct file *file)
1188 1188
1189 /* v4l capture */ 1189 /* v4l capture */
1190 if (fh->v4l_buffers.active != ZORAN_FREE) { 1190 if (fh->v4l_buffers.active != ZORAN_FREE) {
1191 long flags;
1192
1193 spin_lock_irqsave(&zr->spinlock, flags);
1191 zr36057_set_memgrab(zr, 0); 1194 zr36057_set_memgrab(zr, 0);
1192 zr->v4l_buffers.allocated = 0; 1195 zr->v4l_buffers.allocated = 0;
1193 zr->v4l_buffers.active = fh->v4l_buffers.active = 1196 zr->v4l_buffers.active = fh->v4l_buffers.active =
1194 ZORAN_FREE; 1197 ZORAN_FREE;
1198 spin_unlock_irqrestore(&zr->spinlock, flags);
1195 } 1199 }
1196 1200
1197 /* v4l buffers */ 1201 /* v4l buffers */
@@ -3456,8 +3460,13 @@ zoran_do_ioctl (struct inode *inode,
3456 goto strmoff_unlock_and_return; 3460 goto strmoff_unlock_and_return;
3457 3461
3458 /* unload capture */ 3462 /* unload capture */
3459 if (zr->v4l_memgrab_active) 3463 if (zr->v4l_memgrab_active) {
3464 long flags;
3465
3466 spin_lock_irqsave(&zr->spinlock, flags);
3460 zr36057_set_memgrab(zr, 0); 3467 zr36057_set_memgrab(zr, 0);
3468 spin_unlock_irqrestore(&zr->spinlock, flags);
3469 }
3461 3470
3462 for (i = 0; i < fh->v4l_buffers.num_buffers; i++) 3471 for (i = 0; i < fh->v4l_buffers.num_buffers; i++)
3463 zr->v4l_buffers.buffer[i].state = 3472 zr->v4l_buffers.buffer[i].state =
@@ -4392,11 +4401,15 @@ zoran_vm_close (struct vm_area_struct *vma)
4392 mutex_lock(&zr->resource_lock); 4401 mutex_lock(&zr->resource_lock);
4393 4402
4394 if (fh->v4l_buffers.active != ZORAN_FREE) { 4403 if (fh->v4l_buffers.active != ZORAN_FREE) {
4404 long flags;
4405
4406 spin_lock_irqsave(&zr->spinlock, flags);
4395 zr36057_set_memgrab(zr, 0); 4407 zr36057_set_memgrab(zr, 0);
4396 zr->v4l_buffers.allocated = 0; 4408 zr->v4l_buffers.allocated = 0;
4397 zr->v4l_buffers.active = 4409 zr->v4l_buffers.active =
4398 fh->v4l_buffers.active = 4410 fh->v4l_buffers.active =
4399 ZORAN_FREE; 4411 ZORAN_FREE;
4412 spin_unlock_irqrestore(&zr->spinlock, flags);
4400 } 4413 }
4401 //v4l_fbuffer_free(file); 4414 //v4l_fbuffer_free(file);
4402 fh->v4l_buffers.allocated = 0; 4415 fh->v4l_buffers.allocated = 0;