aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/zoran_device.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_device.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_device.c')
-rw-r--r--drivers/media/video/zoran_device.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/media/video/zoran_device.c b/drivers/media/video/zoran_device.c
index d9640ec4b9b0..ba2f4ed29483 100644
--- a/drivers/media/video/zoran_device.c
+++ b/drivers/media/video/zoran_device.c
@@ -620,11 +620,17 @@ zr36057_set_memgrab (struct zoran *zr,
620 int mode) 620 int mode)
621{ 621{
622 if (mode) { 622 if (mode) {
623 if (btread(ZR36057_VSSFGR) & 623 /* We only check SnapShot and not FrameGrab here. SnapShot==1
624 (ZR36057_VSSFGR_SnapShot | ZR36057_VSSFGR_FrameGrab)) 624 * means a capture is already in progress, but FrameGrab==1
625 * doesn't necessary mean that. It's more correct to say a 1
626 * to 0 transition indicates a capture completed. If a
627 * capture is pending when capturing is tuned off, FrameGrab
628 * will be stuck at 1 until capturing is turned back on.
629 */
630 if (btread(ZR36057_VSSFGR) & ZR36057_VSSFGR_SnapShot)
625 dprintk(1, 631 dprintk(1,
626 KERN_WARNING 632 KERN_WARNING
627 "%s: zr36057_set_memgrab(1) with SnapShot or FrameGrab on!?\n", 633 "%s: zr36057_set_memgrab(1) with SnapShot on!?\n",
628 ZR_DEVNAME(zr)); 634 ZR_DEVNAME(zr));
629 635
630 /* switch on VSync interrupts */ 636 /* switch on VSync interrupts */
@@ -641,11 +647,12 @@ zr36057_set_memgrab (struct zoran *zr,
641 647
642 zr->v4l_memgrab_active = 1; 648 zr->v4l_memgrab_active = 1;
643 } else { 649 } else {
644 zr->v4l_memgrab_active = 0;
645
646 /* switch off VSync interrupts */ 650 /* switch off VSync interrupts */
647 btand(~zr->card.vsync_int, ZR36057_ICR); // SW 651 btand(~zr->card.vsync_int, ZR36057_ICR); // SW
648 652
653 zr->v4l_memgrab_active = 0;
654 zr->v4l_grab_frame = NO_GRAB_ACTIVE;
655
649 /* reenable grabbing to screen if it was running */ 656 /* reenable grabbing to screen if it was running */
650 if (zr->v4l_overlay_active) { 657 if (zr->v4l_overlay_active) {
651 zr36057_overlay(zr, 1); 658 zr36057_overlay(zr, 1);