From e51565c30fda1628f056d953979c9508845594f0 Mon Sep 17 00:00:00 2001 From: Vinay Varma Date: Mon, 7 Aug 2023 13:14:05 +0800 Subject: [PATCH] media: imx219: fix change format when crop/compose has changed Signed-off-by: Vinay Varma --- drivers/media/i2c/imx219.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index bd37bee48e98c2..0672c2a3f421f8 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #define IMX219_REG_VALUE_08BIT 1 @@ -964,7 +965,10 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, fmt->pad); *framefmt = fmt->format; } else if (imx219->mode != mode || - imx219->fmt.code != fmt->format.code) { + imx219->fmt.code != fmt->format.code || + !v4l2_rect_equal(&imx219->crop, &mode->crop) || + imx219->compose.height != mode->height || + imx219->compose.width != mode->width) { struct v4l2_rect curr_compose = imx219->compose; imx219->mode = mode;