[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <04ae3f0b-c2f8-4553-9b49-302cc638c0c7@ideasonboard.com>
Date: Thu, 31 Oct 2024 11:07:00 +0530
From: Umang Jain <umang.jain@...asonboard.com>
To: Stefan Klug <stefan.klug@...asonboard.com>,
libcamera-devel@...ts.libcamera.org, linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Sakari Ailus <sakari.ailus@...ux.intel.com>,
Kieran Bingham <kieran.bingham@...asonboard.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>
Subject: Re: [PATCH] media: imx283: Report correct V4L2_SEL_TGT_CROP
Hi Stefan
On 30/10/24 10:04 pm, Stefan Klug wrote:
> 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.
>
> Signed-off-by: Stefan Klug <stefan.klug@...asonboard.com>
> ---
> 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 3174d5ffd2d7..c8863c9e0ccf 100644
> --- a/drivers/media/i2c/imx283.c
> +++ b/drivers/media/i2c/imx283.c
> @@ -1123,6 +1123,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);
> @@ -1149,6 +1150,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;
> +
One thing to note, is the crop for binning modes.
Do you need to report
mode->crop.width / mode->hbin_ratio
mode->crop.height / mode->vbin_ratio
for those modes?
> return 0;
> }
>
Powered by blists - more mailing lists