public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Prabhakar <prabhakar.csengg@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Fabrizio Castro <fabrizio.castro.jz@renesas.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: Re: [PATCH v6 23/23] media: renesas: rzg2l-cru: Add 'yuv' flag to IP format structure
Date: Sat, 19 Oct 2024 00:08:28 +0300	[thread overview]
Message-ID: <20241018210828.GA13357@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20241018133446.223516-24-prabhakar.mahadev-lad.rj@bp.renesas.com>

Hi Prabhakar,

Thank you for the patch.

On Fri, Oct 18, 2024 at 02:34:46PM +0100, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> 
> Add a 'yuv' flag to the `rzg2l_cru_ip_format` structure to indicate
> whether a given format is YUV-based and update the `rzg2l_cru_ip_formats`
> array with this flag appropriately. This change enables a more efficient
> way to check if the input and output formats use the same colorspace.
> 
> With this change, we can eliminate the use of `v4l2_format_info()` in
> `rzg2l_cru_initialize_image_conv()` as the necessary details for the source
> and destination formats are already available through the `yuv` flag.
> 
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h   | 2 ++
>  drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c    | 5 +++++
>  drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c | 6 +-----
>  3 files changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h
> index a83e78d9b0be..8b898ce05b84 100644
> --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h
> +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h
> @@ -69,6 +69,7 @@ struct rzg2l_cru_ip {
>   * @format: 4CC format identifier (V4L2_PIX_FMT_*)
>   * @icndmr: ICnDMR register value
>   * @bpp: bytes per pixel
> + * @yuv: Flag to indicate whether the format is YUV-based.
>   */
>  struct rzg2l_cru_ip_format {
>  	u32 code;
> @@ -76,6 +77,7 @@ struct rzg2l_cru_ip_format {
>  	u32 format;
>  	u32 icndmr;
>  	u8 bpp;
> +	bool yuv;
>  };
>  
>  /**
> diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c
> index d935d981f9d3..76a2b451f1da 100644
> --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c
> +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c
> @@ -18,6 +18,7 @@ static const struct rzg2l_cru_ip_format rzg2l_cru_ip_formats[] = {
>  		.format = V4L2_PIX_FMT_UYVY,
>  		.bpp = 2,
>  		.icndmr = ICnDMR_YCMODE_UYVY,
> +		.yuv = true,
>  	},
>  	{
>  		.code = MEDIA_BUS_FMT_SBGGR8_1X8,
> @@ -25,6 +26,7 @@ static const struct rzg2l_cru_ip_format rzg2l_cru_ip_formats[] = {
>  		.datatype = MIPI_CSI2_DT_RAW8,
>  		.bpp = 1,
>  		.icndmr = 0,
> +		.yuv = false,
>  	},
>  	{
>  		.code = MEDIA_BUS_FMT_SGBRG8_1X8,
> @@ -32,6 +34,7 @@ static const struct rzg2l_cru_ip_format rzg2l_cru_ip_formats[] = {
>  		.datatype = MIPI_CSI2_DT_RAW8,
>  		.bpp = 1,
>  		.icndmr = 0,
> +		.yuv = false,
>  	},
>  	{
>  		.code = MEDIA_BUS_FMT_SGRBG8_1X8,
> @@ -39,6 +42,7 @@ static const struct rzg2l_cru_ip_format rzg2l_cru_ip_formats[] = {
>  		.datatype = MIPI_CSI2_DT_RAW8,
>  		.bpp = 1,
>  		.icndmr = 0,
> +		.yuv = false,
>  	},
>  	{
>  		.code = MEDIA_BUS_FMT_SRGGB8_1X8,
> @@ -46,6 +50,7 @@ static const struct rzg2l_cru_ip_format rzg2l_cru_ip_formats[] = {
>  		.datatype = MIPI_CSI2_DT_RAW8,
>  		.bpp = 1,
>  		.icndmr = 0,
> +		.yuv = false,
>  	},
>  };
>  
> diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
> index a4dc3689599c..e980afc32504 100644
> --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
> +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
> @@ -210,7 +210,6 @@ static int rzg2l_cru_initialize_image_conv(struct rzg2l_cru_dev *cru,
>  					   struct v4l2_mbus_framefmt *ip_sd_fmt,
>  					   u8 csi_vc)
>  {
> -	const struct v4l2_format_info *src_finfo, *dst_finfo;
>  	const struct rzg2l_cru_ip_format *cru_video_fmt;
>  	const struct rzg2l_cru_ip_format *cru_ip_fmt;
>  
> @@ -225,11 +224,8 @@ static int rzg2l_cru_initialize_image_conv(struct rzg2l_cru_dev *cru,
>  		return -EINVAL;
>  	}
>  
> -	src_finfo = v4l2_format_info(cru_ip_fmt->format);
> -	dst_finfo = v4l2_format_info(cru->format.pixelformat);
> -
>  	/* If input and output use same colorspace, do bypass mode */
> -	if (v4l2_is_format_yuv(src_finfo) == v4l2_is_format_yuv(dst_finfo))
> +	if (cru_ip_fmt->yuv == cru_video_fmt->yuv)
>  		rzg2l_cru_write(cru, ICnMC,
>  				rzg2l_cru_read(cru, ICnMC) | ICnMC_CSCTHR);
>  	else

-- 
Regards,

Laurent Pinchart

      reply	other threads:[~2024-10-18 21:08 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18 13:34 [PATCH v6 00/23] media: platform: rzg2l-cru: CSI-2 and CRU enhancements Prabhakar
2024-10-18 13:34 ` [PATCH v6 01/23] media: rzg2l-cru: Use RZG2L_CRU_IP_SINK/SOURCE enum entries Prabhakar
2024-10-18 13:34 ` [PATCH v6 02/23] media: rzg2l-cru: Mark sink and source pad with MUST_CONNECT flag Prabhakar
2024-10-18 13:34 ` [PATCH v6 03/23] media: rzg2l-cru: csi2: " Prabhakar
2024-10-18 13:34 ` [PATCH v6 04/23] media: rzg2l-cru: csi2: Use ARRAY_SIZE() in media_entity_pads_init() Prabhakar
2024-10-18 13:34 ` [PATCH v6 05/23] media: rzg2l-cru: csi2: Implement .get_frame_desc() Prabhakar
2024-10-18 13:34 ` [PATCH v6 06/23] media: rzg2l-cru: Retrieve virtual channel information Prabhakar
2024-10-18 13:34 ` [PATCH v6 07/23] media: rzg2l-cru: Remove `channel` member from `struct rzg2l_cru_csi` Prabhakar
2024-10-18 13:34 ` [PATCH v6 08/23] media: rzg2l-cru: Use MIPI CSI-2 data types for ICnMC_INF definitions Prabhakar
2024-10-18 13:34 ` [PATCH v6 09/23] media: rzg2l-cru: Remove unused fields from rzg2l_cru_ip_format struct Prabhakar
2024-10-18 13:34 ` [PATCH v6 10/23] media: rzg2l-cru: Remove unnecessary WARN_ON check in format func Prabhakar
2024-10-18 13:34 ` [PATCH v6 11/23] media: rzg2l-cru: Simplify configuring input format for image processing Prabhakar
2024-10-18 13:34 ` [PATCH v6 12/23] media: rzg2l-cru: Inline calculating image size Prabhakar
2024-10-18 13:34 ` [PATCH v6 13/23] media: rzg2l-cru: Simplify handling of supported formats Prabhakar
2024-10-18 13:34 ` [PATCH v6 14/23] media: rzg2l-cru: Inline calculating bytesperline Prabhakar
2024-10-18 13:34 ` [PATCH v6 15/23] media: rzg2l-cru: Make use of v4l2_format_info() helpers Prabhakar
2024-10-18 13:34 ` [PATCH v6 16/23] media: rzg2l-cru: Use `rzg2l_cru_ip_formats` array in enum_frame_size Prabhakar
2024-10-18 13:34 ` [PATCH v6 17/23] media: rzg2l-cru: csi2: Remove unused field from rzg2l_csi2_format Prabhakar
2024-10-18 13:34 ` [PATCH v6 18/23] media: rzg2l-cru: video: Implement .link_validate() callback Prabhakar
2024-10-18 13:34 ` [PATCH v6 19/23] media: rzg2l-cru: csi2: Use rzg2l_csi2_formats array in enum_frame_size Prabhakar
2024-10-18 13:34 ` [PATCH v6 20/23] media: rzg2l-cru: Refactor ICnDMR register configuration Prabhakar
2024-10-18 13:34 ` [PATCH v6 21/23] media: rzg2l-cru: Add support to capture 8bit raw sRGB Prabhakar
2024-10-18 13:34 ` [PATCH v6 22/23] media: rzg2l-cru: Move register definitions to a separate file Prabhakar
2024-10-18 13:34 ` [PATCH v6 23/23] media: renesas: rzg2l-cru: Add 'yuv' flag to IP format structure Prabhakar
2024-10-18 21:08   ` Laurent Pinchart [this message]

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=20241018210828.GA13357@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=fabrizio.castro.jz@renesas.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=prabhakar.csengg@gmail.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=sakari.ailus@linux.intel.com \
    /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