mirror of
https://github.com/torvalds/linux
synced 2024-09-21 19:47:35 +00:00
V4L/DVB: soc-camera: prohibit S_CROP, if internal G_CROP has failed
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>
This commit is contained in:
parent
a484dd9b77
commit
103754a052
|
@ -779,9 +779,12 @@ static int soc_camera_s_crop(struct file *file, void *fh,
|
||||||
ret = ici->ops->get_crop(icd, ¤t_crop);
|
ret = ici->ops->get_crop(icd, ¤t_crop);
|
||||||
|
|
||||||
/* Prohibit window size change with initialised buffers */
|
/* Prohibit window size change with initialised buffers */
|
||||||
if (icf->vb_vidq.bufs[0] && !ret &&
|
if (ret < 0) {
|
||||||
(a->c.width != current_crop.c.width ||
|
dev_err(&icd->dev,
|
||||||
a->c.height != current_crop.c.height)) {
|
"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,
|
dev_err(&icd->dev,
|
||||||
"S_CROP denied: queue initialised and sizes differ\n");
|
"S_CROP denied: queue initialised and sizes differ\n");
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
|
|
Loading…
Reference in a new issue