aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/soc_camera.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index a22fcd0ff8ba..21a8aa586da5 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -517,8 +517,8 @@ static int soc_camera_s_fmt_vid_cap(struct file *file, void *priv,
517 517
518 mutex_lock(&icf->vb_vidq.vb_lock); 518 mutex_lock(&icf->vb_vidq.vb_lock);
519 519
520 if (videobuf_queue_is_busy(&icf->vb_vidq)) { 520 if (icf->vb_vidq.bufs[0]) {
521 dev_err(&icd->dev, "S_FMT denied: queue busy\n"); 521 dev_err(&icd->dev, "S_FMT denied: queue initialised\n");
522 ret = -EBUSY; 522 ret = -EBUSY;
523 goto unlock; 523 goto unlock;
524 } 524 }
@@ -768,6 +768,15 @@ static int soc_camera_s_crop(struct file *file, void *fh,
768 /* Cropping is allowed during a running capture, guard consistency */ 768 /* Cropping is allowed during a running capture, guard consistency */
769 mutex_lock(&icf->vb_vidq.vb_lock); 769 mutex_lock(&icf->vb_vidq.vb_lock);
770 770
771 /* Prohibit window size change with initialised buffers */
772 if (icf->vb_vidq.bufs[0] && (rect.width != icd->rect_current.width ||
773 rect.height != icd->rect_current.height)) {
774 dev_err(&icd->dev,
775 "S_CROP denied: queue initialised and sizes differ\n");
776 ret = -EBUSY;
777 goto unlock;
778 }
779
771 if (rect.width > icd->rect_max.width) 780 if (rect.width > icd->rect_max.width)
772 rect.width = icd->rect_max.width; 781 rect.width = icd->rect_max.width;
773 782
@@ -792,6 +801,7 @@ static int soc_camera_s_crop(struct file *file, void *fh,
792 if (!ret) 801 if (!ret)
793 icd->rect_current = rect; 802 icd->rect_current = rect;
794 803
804unlock:
795 mutex_unlock(&icf->vb_vidq.vb_lock); 805 mutex_unlock(&icf->vb_vidq.vb_lock);
796 806
797 return ret; 807 return ret;