[PATCH v2 02/17] media: rockchip: rga: add comment about pixel alignment for YUV formats

Nicolas Dufresne nicolas at ndufresne.ca
Tue Nov 24 12:45:18 PST 2026


Le mercredi 16 septembre 2026 à 17:09 +0200, Sven Püschel a écrit :
> Add a comment to clarify the use of fixed step_height values for all YUV
> formats. While the commit introducing the change already explains the
> reasoning, add an explicit comment to improve the visibility of the
> reasoning.
> 
> Signed-off-by: Sven Püschel <s.pueschel at pengutronix.de>

Reviewed-by: Nicolas Dufresne <nicolas.dufresne at collabora.com>

> ---
>  drivers/media/platform/rockchip/rga/rga.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/platform/rockchip/rga/rga.c
> index bd0afd33affe4..efe5541078214 100644
> --- a/drivers/media/platform/rockchip/rga/rga.c
> +++ b/drivers/media/platform/rockchip/rga/rga.c
> @@ -414,6 +414,16 @@ static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f)
>  		.step_height = 1,
>  	};
>  
> +	/*
> +	 * Technically 4:2:2 YUV formats don't need a step_height of 2.
> +	 * But for the RGA3 this is explicitly documented in  section 5.6.3
> +	 * of the RK3588 TRM Part 2.
> +	 * And the RGA2 vendor driver also checks that the height (and width)
> +	 * is aligned to 2 when a YUV format is used.
> +	 *
> +	 * Therefore be safe and always align width and height to 2
> +	 * when a YUV format is used.
> +	 */
>  	if (v4l2_is_format_yuv(v4l2_format_info(pix_fmt->pixelformat))) {
>  		frmsize.step_width = 2;
>  		frmsize.step_height = 2;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-rockchip/attachments/20261124/1cf75ee1/attachment.sig>


More information about the Linux-rockchip mailing list