mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Manikandan.M@microchip.com>
To: <sam@ravnborg.org>, <bbrezillon@kernel.org>,
	<maarten.lankhorst@linux.intel.com>, <mripard@kernel.org>,
	<tzimmermann@suse.de>, <airlied@gmail.com>, <simona@ffwll.ch>,
	<Nicolas.Ferre@microchip.com>, <alexandre.belloni@bootlin.com>,
	<claudiu.beznea@tuxon.dev>, <Hari.PrasathGE@microchip.com>,
	<Durai.ManickamKR@microchip.com>,
	<dri-devel@lists.freedesktop.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Cc: <Cyrille.Pitchen@microchip.com>
Subject: Re: [PATCH] drm: atmel-hlcdc: fix atmel_xlcdc_plane_setup_scaler()
Date: Tue, 14 Oct 2025 10:14:42 +0000	[thread overview]
Message-ID: <4ab432ea-6670-4315-93c4-3bc56f17f774@microchip.com> (raw)
In-Reply-To: <20241014094942.325211-1-manikandan.m@microchip.com>

On 14/10/24 3:19 pm, Manikandan Muralidharan wrote:
> From: Cyrille Pitchen <cyrille.pitchen@microchip.com>
> 
> On SoCs, like the SAM9X75, which embed the XLCDC ip, the registers that
> configure the unified scaling engine were not filled with proper values.
> 
> Indeed, for YCbCr formats, the VXSCFACT bitfield of the HEOCFG25
> register and the HXSCFACT bitfield of the HEOCFG27 register were
> incorrect.
> 
> For 4:2:0 formats, both vertical and horizontal factors for
> chroma chanels should be divided by 2 from the factors for the luma
> channel. Hence:
> 
> HEOCFG24.VXSYFACT = VFACTOR
> HEOCFG25.VSXCFACT = VFACTOR / 2
> HEOCFG26.HXSYFACT = HFACTOR
> HEOCFG27.HXSCFACT = HFACTOR / 2
> 
> However, for 4:2:2 formats, only the horizontal factor for chroma
> chanels should be divided by 2 from the factor for the luma channel;
> the vertical factor is the same for all the luma and chroma channels.
> Hence:
> 
> HEOCFG24.VXSYFACT = VFACTOR
> HEOCFG25.VXSCFACT = VFACTOR
> HEOCFG26.HXSYFACT = HFACTOR
> HEOCFG27.HXSCFACT = HFACTOR / 2
> 
> Fixes: d498771b0b83 ("drm: atmel_hlcdc: Add support for XLCDC using IP specific driver ops")
> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@microchip.com>

Applied to drm-misc-next.

drm: atmel-hlcdc: fix atmel_xlcdc_plane_setup_scaler()
https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/a312acdc

> ---
>   .../gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c   | 27 ++++++++++++++++---
>   1 file changed, 24 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> index 4bcaf2cd7672..41c7351ae811 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> @@ -365,13 +365,34 @@ void atmel_xlcdc_plane_setup_scaler(struct atmel_hlcdc_plane *plane,
>   				    xfactor);
>   
>   	/*
> -	 * With YCbCr 4:2:2 and YCbYcr 4:2:0 window resampling, configuration
> -	 * register LCDC_HEOCFG25.VXSCFACT and LCDC_HEOCFG27.HXSCFACT is half
> +	 * With YCbCr 4:2:0 window resampling, configuration register
> +	 * LCDC_HEOCFG25.VXSCFACT and LCDC_HEOCFG27.HXSCFACT values are half
>   	 * the value of yfactor and xfactor.
> +	 *
> +	 * On the other hand, with YCbCr 4:2:2 window resampling, only the
> +	 * configuration register LCDC_HEOCFG27.HXSCFACT value is half the value
> +	 * of the xfactor; the value of LCDC_HEOCFG25.VXSCFACT is yfactor (no
> +	 * division by 2).
>   	 */
> -	if (state->base.fb->format->format == DRM_FORMAT_YUV420) {
> +	switch (state->base.fb->format->format) {
> +	/* YCbCr 4:2:2 */
> +	case DRM_FORMAT_YUYV:
> +	case DRM_FORMAT_UYVY:
> +	case DRM_FORMAT_YVYU:
> +	case DRM_FORMAT_VYUY:
> +	case DRM_FORMAT_YUV422:
> +	case DRM_FORMAT_NV61:
> +		xfactor /= 2;
> +		break;
> +
> +	/* YCbCr 4:2:0 */
> +	case DRM_FORMAT_YUV420:
> +	case DRM_FORMAT_NV21:
>   		yfactor /= 2;
>   		xfactor /= 2;
> +		break;
> +	default:
> +		break;
>   	}
>   
>   	atmel_hlcdc_layer_write_cfg(&plane->layer, desc->layout.scaler_config + 2,

-- 
Thanks and Regards,
Manikandan M.


      parent reply	other threads:[~2025-10-14 10:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14  9:49 Manikandan Muralidharan
2024-10-18 23:24 ` Dmitry Baryshkov
2024-10-21  7:56 ` Nicolas Ferre
2025-01-28  4:59   ` Manikandan.M
2025-10-14 10:14 ` Manikandan.M [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=4ab432ea-6670-4315-93c4-3bc56f17f774@microchip.com \
    --to=manikandan.m@microchip.com \
    --cc=Cyrille.Pitchen@microchip.com \
    --cc=Durai.ManickamKR@microchip.com \
    --cc=Hari.PrasathGE@microchip.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=airlied@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bbrezillon@kernel.org \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=sam@ravnborg.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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®