[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z2FKmSszfaj86WBV@kekkonen.localdomain>
Date: Tue, 17 Dec 2024 09:55:37 +0000
From: Sakari Ailus <sakari.ailus@...ux.intel.com>
To: git@...tzsch.eu
Cc: Ricardo Ribalda <ribalda@...nel.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
~postmarketos/upstreaming@...ts.sr.ht, phone-devel@...r.kernel.org,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
Dave Stevenson <dave.stevenson@...pberrypi.com>,
Vincent Knecht <vincent.knecht@...loo.org>
Subject: Re: [PATCH v4 01/13] media: i2c: imx214: Use subdev active state
Hi André,
On Mon, Dec 16, 2024 at 10:00:47PM +0100, André Apitzsch via B4 Relay wrote:
> @@ -604,34 +568,23 @@ static int imx214_set_format(struct v4l2_subdev *sd,
> struct v4l2_rect *__crop;
> const struct imx214_mode *mode;
>
> - mutex_lock(&imx214->mutex);
> -
> - __crop = __imx214_get_pad_crop(imx214, sd_state, format->pad,
> - format->which);
> -
> mode = v4l2_find_nearest_size(imx214_modes,
> ARRAY_SIZE(imx214_modes), width, height,
> format->format.width,
> format->format.height);
>
> - __crop->width = mode->width;
> - __crop->height = mode->height;
> + imx214_update_pad_format(imx214, mode, &format->format,
> + format->format.code);
> + __format = v4l2_subdev_state_get_format(sd_state, 0);
>
> - __format = __imx214_get_pad_format(imx214, sd_state, format->pad,
> - format->which);
> - __format->width = __crop->width;
> - __format->height = __crop->height;
> - __format->code = IMX214_MBUS_CODE;
> - __format->field = V4L2_FIELD_NONE;
> - __format->colorspace = V4L2_COLORSPACE_SRGB;
> - __format->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(__format->colorspace);
> - __format->quantization = V4L2_MAP_QUANTIZATION_DEFAULT(true,
> - __format->colorspace, __format->ycbcr_enc);
> - __format->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(__format->colorspace);
> + *__format = format->format;
>
> - format->format = *__format;
> + __crop = v4l2_subdev_state_get_crop(sd_state, 0);
> + __crop->width = mode->width;
> + __crop->height = mode->height;
>
> - mutex_unlock(&imx214->mutex);
> + if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE)
> + imx214->cur_mode = mode;
While the patch is a major improvement as of now, it'd be nice to get rid
of the cur_mode field. Could you instead obtai nthe mode using
v4l2_find_nearest_size()?
I'm fine with changing this in a new patch on top of the set.
--
Regards,
Sakari Ailus
Powered by blists - more mailing lists