Re: [PATCH v2 02/17] media: rockchip: rga: add comment about pixel alignment for YUV formats
From: Nicolas Dufresne
Date: Tue Nov 24 2026 - 15:45:27 EST
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@xxxxxxxxxxxxxx>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@xxxxxxxxxxxxx>
> ---
> 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;
Attachment:
signature.asc
Description: This is a digitally signed message part