Skip to content

Commit

Permalink
V4L/DVB: soc-camera: prohibit S_CROP, if internal G_CROP has failed
Browse files Browse the repository at this point in the history
There is no sense in trying to set cropping if we cannot get current one
from the host driver.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Aug 9, 2010
1 parent a484dd9 commit 103754a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/media/video/soc_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,9 +779,12 @@ static int soc_camera_s_crop(struct file *file, void *fh,
ret = ici->ops->get_crop(icd, &current_crop);

/* Prohibit window size change with initialised buffers */
if (icf->vb_vidq.bufs[0] && !ret &&
(a->c.width != current_crop.c.width ||
a->c.height != current_crop.c.height)) {
if (ret < 0) {
dev_err(&icd->dev,
"S_CROP denied: getting current crop failed\n");
} else if (icf->vb_vidq.bufs[0] &&
(a->c.width != current_crop.c.width ||
a->c.height != current_crop.c.height)) {
dev_err(&icd->dev,
"S_CROP denied: queue initialised and sizes differ\n");
ret = -EBUSY;
Expand Down

0 comments on commit 103754a

Please sign in to comment.