mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: git@apitzsch.eu
Cc: Ricardo Ribalda <ribalda@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	~postmarketos/upstreaming@lists.sr.ht,
	phone-devel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	Vincent Knecht <vincent.knecht@mailoo.org>
Subject: Re: [PATCH v4 01/13] media: i2c: imx214: Use subdev active state
Date: Tue, 17 Dec 2024 09:55:37 +0000	[thread overview]
Message-ID: <Z2FKmSszfaj86WBV@kekkonen.localdomain> (raw)
In-Reply-To: <20241216-imx214-v4-1-8cbda160fbce@apitzsch.eu>

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

  parent reply	other threads:[~2024-12-17  9:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16 21:00 [PATCH v4 00/13] media: i2c: imx214: Miscellaneous cleanups and improvements André Apitzsch via B4 Relay
2024-12-16 21:00 ` [PATCH v4 01/13] media: i2c: imx214: Use subdev active state André Apitzsch via B4 Relay
2024-12-16 21:20   ` Ricardo Ribalda Delgado
2024-12-17  9:55   ` Sakari Ailus [this message]
2024-12-16 21:00 ` [PATCH v4 02/13] media: i2c: imx214: Simplify with dev_err_probe() André Apitzsch via B4 Relay
2024-12-16 21:00 ` [PATCH v4 03/13] media: i2c: imx214: Convert to CCI register access helpers André Apitzsch via B4 Relay
2024-12-16 21:00 ` [PATCH v4 04/13] media: i2c: imx214: Replace register addresses with macros André Apitzsch via B4 Relay
2024-12-16 21:00 ` [PATCH v4 05/13] media: i2c: imx214: Drop IMX214_REG_EXPOSURE from mode reg arrays André Apitzsch via B4 Relay
2024-12-16 21:00 ` [PATCH v4 06/13] media: i2c: imx214: Check number of lanes from device tree André Apitzsch via B4 Relay
2024-12-16 21:00 ` [PATCH v4 07/13] media: i2c: imx214: Add vblank and hblank controls André Apitzsch via B4 Relay
2024-12-16 21:00 ` [PATCH v4 08/13] media: i2c: imx214: Implement vflip/hflip controls André Apitzsch via B4 Relay
2024-12-16 21:00 ` [PATCH v4 09/13] media: i2c: imx214: Add analogue/digital gain control André Apitzsch via B4 Relay
2024-12-16 21:00 ` [PATCH v4 10/13] media: i2c: imx214: Verify chip ID André Apitzsch via B4 Relay
2024-12-16 21:00 ` [PATCH v4 11/13] media: i2c: imx214: Add test pattern control André Apitzsch via B4 Relay
2024-12-16 21:00 ` [PATCH v4 12/13] media: i2c: imx214: Fix clock handling on probe error or remove André Apitzsch via B4 Relay
2024-12-16 21:00 ` [PATCH v4 13/13] media: i2c: imx214: Fix link frequency validation André Apitzsch via B4 Relay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z2FKmSszfaj86WBV@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=git@apitzsch.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=phone-devel@vger.kernel.org \
    --cc=ribalda@kernel.org \
    --cc=vincent.knecht@mailoo.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®