|
@@ -553,8 +553,6 @@ static int vidioc_s_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *f
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- mutex_lock(&dev->lock);
|
|
|
|
-
|
|
|
|
/* ok, accept it */
|
|
/* ok, accept it */
|
|
vv->ov_fb = *fb;
|
|
vv->ov_fb = *fb;
|
|
vv->ov_fmt = fmt;
|
|
vv->ov_fmt = fmt;
|
|
@@ -563,8 +561,6 @@ static int vidioc_s_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *f
|
|
vv->ov_fb.fmt.bytesperline = vv->ov_fb.fmt.width * fmt->depth / 8;
|
|
vv->ov_fb.fmt.bytesperline = vv->ov_fb.fmt.width * fmt->depth / 8;
|
|
DEB_D(("setting bytesperline to %d\n", vv->ov_fb.fmt.bytesperline));
|
|
DEB_D(("setting bytesperline to %d\n", vv->ov_fb.fmt.bytesperline));
|
|
}
|
|
}
|
|
-
|
|
|
|
- mutex_unlock(&dev->lock);
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -649,8 +645,6 @@ static int vidioc_s_ctrl(struct file *file, void *fh, struct v4l2_control *c)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
- mutex_lock(&dev->lock);
|
|
|
|
-
|
|
|
|
switch (ctrl->type) {
|
|
switch (ctrl->type) {
|
|
case V4L2_CTRL_TYPE_BOOLEAN:
|
|
case V4L2_CTRL_TYPE_BOOLEAN:
|
|
case V4L2_CTRL_TYPE_MENU:
|
|
case V4L2_CTRL_TYPE_MENU:
|
|
@@ -693,7 +687,6 @@ static int vidioc_s_ctrl(struct file *file, void *fh, struct v4l2_control *c)
|
|
/* fixme: we can support changing VFLIP and HFLIP here... */
|
|
/* fixme: we can support changing VFLIP and HFLIP here... */
|
|
if (IS_CAPTURE_ACTIVE(fh) != 0) {
|
|
if (IS_CAPTURE_ACTIVE(fh) != 0) {
|
|
DEB_D(("V4L2_CID_HFLIP while active capture.\n"));
|
|
DEB_D(("V4L2_CID_HFLIP while active capture.\n"));
|
|
- mutex_unlock(&dev->lock);
|
|
|
|
return -EBUSY;
|
|
return -EBUSY;
|
|
}
|
|
}
|
|
vv->hflip = c->value;
|
|
vv->hflip = c->value;
|
|
@@ -701,16 +694,13 @@ static int vidioc_s_ctrl(struct file *file, void *fh, struct v4l2_control *c)
|
|
case V4L2_CID_VFLIP:
|
|
case V4L2_CID_VFLIP:
|
|
if (IS_CAPTURE_ACTIVE(fh) != 0) {
|
|
if (IS_CAPTURE_ACTIVE(fh) != 0) {
|
|
DEB_D(("V4L2_CID_VFLIP while active capture.\n"));
|
|
DEB_D(("V4L2_CID_VFLIP while active capture.\n"));
|
|
- mutex_unlock(&dev->lock);
|
|
|
|
return -EBUSY;
|
|
return -EBUSY;
|
|
}
|
|
}
|
|
vv->vflip = c->value;
|
|
vv->vflip = c->value;
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
- mutex_unlock(&dev->lock);
|
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
- mutex_unlock(&dev->lock);
|
|
|
|
|
|
|
|
if (IS_OVERLAY_ACTIVE(fh) != 0) {
|
|
if (IS_OVERLAY_ACTIVE(fh) != 0) {
|
|
saa7146_stop_preview(fh);
|
|
saa7146_stop_preview(fh);
|
|
@@ -902,22 +892,18 @@ static int vidioc_s_fmt_vid_overlay(struct file *file, void *__fh, struct v4l2_f
|
|
err = vidioc_try_fmt_vid_overlay(file, fh, f);
|
|
err = vidioc_try_fmt_vid_overlay(file, fh, f);
|
|
if (0 != err)
|
|
if (0 != err)
|
|
return err;
|
|
return err;
|
|
- mutex_lock(&dev->lock);
|
|
|
|
fh->ov.win = f->fmt.win;
|
|
fh->ov.win = f->fmt.win;
|
|
fh->ov.nclips = f->fmt.win.clipcount;
|
|
fh->ov.nclips = f->fmt.win.clipcount;
|
|
if (fh->ov.nclips > 16)
|
|
if (fh->ov.nclips > 16)
|
|
fh->ov.nclips = 16;
|
|
fh->ov.nclips = 16;
|
|
if (copy_from_user(fh->ov.clips, f->fmt.win.clips,
|
|
if (copy_from_user(fh->ov.clips, f->fmt.win.clips,
|
|
sizeof(struct v4l2_clip) * fh->ov.nclips)) {
|
|
sizeof(struct v4l2_clip) * fh->ov.nclips)) {
|
|
- mutex_unlock(&dev->lock);
|
|
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
}
|
|
}
|
|
|
|
|
|
/* fh->ov.fh is used to indicate that we have valid overlay informations, too */
|
|
/* fh->ov.fh is used to indicate that we have valid overlay informations, too */
|
|
fh->ov.fh = fh;
|
|
fh->ov.fh = fh;
|
|
|
|
|
|
- mutex_unlock(&dev->lock);
|
|
|
|
-
|
|
|
|
/* check if our current overlay is active */
|
|
/* check if our current overlay is active */
|
|
if (IS_OVERLAY_ACTIVE(fh) != 0) {
|
|
if (IS_OVERLAY_ACTIVE(fh) != 0) {
|
|
saa7146_stop_preview(fh);
|
|
saa7146_stop_preview(fh);
|
|
@@ -976,8 +962,6 @@ static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- mutex_lock(&dev->lock);
|
|
|
|
-
|
|
|
|
for (i = 0; i < dev->ext_vv_data->num_stds; i++)
|
|
for (i = 0; i < dev->ext_vv_data->num_stds; i++)
|
|
if (*id & dev->ext_vv_data->stds[i].id)
|
|
if (*id & dev->ext_vv_data->stds[i].id)
|
|
break;
|
|
break;
|
|
@@ -988,8 +972,6 @@ static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id)
|
|
found = 1;
|
|
found = 1;
|
|
}
|
|
}
|
|
|
|
|
|
- mutex_unlock(&dev->lock);
|
|
|
|
-
|
|
|
|
if (vv->ov_suspend != NULL) {
|
|
if (vv->ov_suspend != NULL) {
|
|
saa7146_start_preview(vv->ov_suspend);
|
|
saa7146_start_preview(vv->ov_suspend);
|
|
vv->ov_suspend = NULL;
|
|
vv->ov_suspend = NULL;
|
|
@@ -1354,7 +1336,7 @@ static int video_open(struct saa7146_dev *dev, struct file *file)
|
|
V4L2_BUF_TYPE_VIDEO_CAPTURE,
|
|
V4L2_BUF_TYPE_VIDEO_CAPTURE,
|
|
V4L2_FIELD_INTERLACED,
|
|
V4L2_FIELD_INTERLACED,
|
|
sizeof(struct saa7146_buf),
|
|
sizeof(struct saa7146_buf),
|
|
- file, NULL);
|
|
|
|
|
|
+ file, &dev->v4l2_lock);
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|