Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 103754a0 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mauro Carvalho Chehab
Browse files

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: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent a484dd9b
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -779,7 +779,10 @@ 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 &&
	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,