Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63176
b: refs/heads/master
c: 9896bbc
h: refs/heads/master
v: v3
  • Loading branch information
Trent Piepho authored and Mauro Carvalho Chehab committed Jul 30, 2007
1 parent af9e9ad commit 6e55090
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 603d6f2c8f9f3604f9c6c1f8903efc2df30a000f
refs/heads/master: 9896bbc1972e3a0595f06c23692a20150a789308
17 changes: 12 additions & 5 deletions trunk/drivers/media/video/zoran_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,11 +620,17 @@ zr36057_set_memgrab (struct zoran *zr,
int mode)
{
if (mode) {
if (btread(ZR36057_VSSFGR) &
(ZR36057_VSSFGR_SnapShot | ZR36057_VSSFGR_FrameGrab))
/* We only check SnapShot and not FrameGrab here. SnapShot==1
* means a capture is already in progress, but FrameGrab==1
* doesn't necessary mean that. It's more correct to say a 1
* to 0 transition indicates a capture completed. If a
* capture is pending when capturing is tuned off, FrameGrab
* will be stuck at 1 until capturing is turned back on.
*/
if (btread(ZR36057_VSSFGR) & ZR36057_VSSFGR_SnapShot)
dprintk(1,
KERN_WARNING
"%s: zr36057_set_memgrab(1) with SnapShot or FrameGrab on!?\n",
"%s: zr36057_set_memgrab(1) with SnapShot on!?\n",
ZR_DEVNAME(zr));

/* switch on VSync interrupts */
Expand All @@ -641,11 +647,12 @@ zr36057_set_memgrab (struct zoran *zr,

zr->v4l_memgrab_active = 1;
} else {
zr->v4l_memgrab_active = 0;

/* switch off VSync interrupts */
btand(~zr->card.vsync_int, ZR36057_ICR); // SW

zr->v4l_memgrab_active = 0;
zr->v4l_grab_frame = NO_GRAB_ACTIVE;

/* reenable grabbing to screen if it was running */
if (zr->v4l_overlay_active) {
zr36057_overlay(zr, 1);
Expand Down
15 changes: 14 additions & 1 deletion trunk/drivers/media/video/zoran_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1188,10 +1188,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 */
Expand Down Expand Up @@ -3456,8 +3460,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 =
Expand Down Expand Up @@ -4392,11 +4401,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;
Expand Down

0 comments on commit 6e55090

Please sign in to comment.