Re: [PATCH v2 01/25] media: i2c: imx283: Report correct V4L2_SEL_TGT_CROP

From: Jai Luthra

Date: Mon Feb 16 2026 - 09:40:31 EST


Quoting Kieran Bingham (2026-02-13 19:31:40)
> From: Stefan Klug <stefan.klug@xxxxxxxxxxxxxxxx>
>
> The target crop rectangle is initialized with the crop of the default
> sensor mode. This is incorrect when a different sensor mode gets
> selected. Fix that by updating the crop rectangle when changing the
> sensor mode.
>
> Cc: stable@xxxxxxxxxxxxxxx # v6.10-rc1-70-gccb4eb4496fa
> Fixes: ccb4eb4496fa ("media: i2c: Add imx283 camera sensor driver")
> Reviewed-by: Kieran Bingham <kieran.bingham@xxxxxxxxxxxxxxxx>
> Tested-by: Kieran Bingham <kieran.bingham@xxxxxxxxxxxxxxxx>
> Signed-off-by: Stefan Klug <stefan.klug@xxxxxxxxxxxxxxxx>

Reviewed-by: Jai Luthra <jai.luthra@xxxxxxxxxxxxxxxx>

> ---
> drivers/media/i2c/imx283.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/media/i2c/imx283.c b/drivers/media/i2c/imx283.c
> index 8ab63ad8f385..e5c04d259625 100644
> --- a/drivers/media/i2c/imx283.c
> +++ b/drivers/media/i2c/imx283.c
> @@ -956,6 +956,7 @@ static int imx283_set_pad_format(struct v4l2_subdev *sd,
> struct v4l2_subdev_state *sd_state,
> struct v4l2_subdev_format *fmt)
> {
> + struct v4l2_rect *crop;
> struct v4l2_mbus_framefmt *format;
> const struct imx283_mode *mode;
> struct imx283 *imx283 = to_imx283(sd);
> @@ -982,6 +983,9 @@ static int imx283_set_pad_format(struct v4l2_subdev *sd,
>
> *format = fmt->format;
>
> + crop = v4l2_subdev_state_get_crop(sd_state, IMAGE_PAD);
> + *crop = mode->crop;
> +
> return 0;
> }
>
>
> --
> 2.52.0
>