diff options
Diffstat (limited to 'drivers/media/video/zoran_driver.c')
-rw-r--r-- | drivers/media/video/zoran_driver.c | 15 |
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; |