Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH] media: rzg2l-cru: Remove height alignment restriction
@ 2026-05-21 13:19 Prabhakar
  2026-06-05  7:33 ` Jacopo Mondi
  0 siblings, 1 reply; 2+ messages in thread
From: Prabhakar @ 2026-05-21 13:19 UTC (permalink / raw)
  To: Lad Prabhakar, Jacopo Mondi, Mauro Carvalho Chehab
  Cc: linux-renesas-soc, linux-media, linux-kernel, Prabhakar, Biju Das,
	Fabrizio Castro, Tommaso Merciai

From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

The CRU hardware found on RZ/G2L and RZ/G3E SoCs does not impose any
height alignment requirement, so enforcing power-of-two alignment on
the frame height is unnecessary.

Remove the power-of-two height alignment restriction in the call to
v4l_bound_align_image() by changing the height alignment argument
from 2 to 0.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
index 1ab4b4c1745e..8d8103c51f29 100644
--- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
+++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
@@ -843,7 +843,7 @@ static void rzg2l_cru_format_align(struct rzg2l_cru_dev *cru,
 
 	/* Limit to CRU capabilities */
 	v4l_bound_align_image(&pix->width, 320, info->max_width, 1,
-			      &pix->height, 240, info->max_height, 2, 0);
+			      &pix->height, 240, info->max_height, 0, 0);
 
 	v4l2_fill_pixfmt(pix, pix->pixelformat, pix->width, pix->height);
 
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: rzg2l-cru: Remove height alignment restriction
  2026-05-21 13:19 [PATCH] media: rzg2l-cru: Remove height alignment restriction Prabhakar
@ 2026-06-05  7:33 ` Jacopo Mondi
  0 siblings, 0 replies; 2+ messages in thread
From: Jacopo Mondi @ 2026-06-05  7:33 UTC (permalink / raw)
  To: Prabhakar
  Cc: Lad Prabhakar, Jacopo Mondi, Mauro Carvalho Chehab,
	linux-renesas-soc, linux-media, linux-kernel, Biju Das,
	Fabrizio Castro, Tommaso Merciai

Hello Prabhakar

On Thu, May 21, 2026 at 02:19:11PM +0100, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> The CRU hardware found on RZ/G2L and RZ/G3E SoCs does not impose any
> height alignment requirement, so enforcing power-of-two alignment on
> the frame height is unnecessary.
>
> Remove the power-of-two height alignment restriction in the call to
> v4l_bound_align_image() by changing the height alignment argument
> from 2 to 0.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
>  drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
> index 1ab4b4c1745e..8d8103c51f29 100644
> --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
> +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
> @@ -843,7 +843,7 @@ static void rzg2l_cru_format_align(struct rzg2l_cru_dev *cru,
>
>  	/* Limit to CRU capabilities */
>  	v4l_bound_align_image(&pix->width, 320, info->max_width, 1,
> -			      &pix->height, 240, info->max_height, 2, 0);
> +			      &pix->height, 240, info->max_height, 0, 0);

Where does this setting ends up being written to which register ? I
had a quick look and I couldn't find it o_o

To be honest I didn't even find any register where the expected frame
dimensions have to be programmed, so I assume we only set the memory
destination address and the stride and the rest is handled
automatically ?

The peripheral supports image clipping which is currently not
implemented as far as I can see. How do we expect to control it ?
Through the TGT_CROP rectangle ? Just as a note, the V2H EPPrC
register reports:

"If an odd number is specified, the CRU operates as if an even number
(the specified number + 1) is specified."

But as far as I understand, clipping is not controlled by the image
format.

btw I think the halign parameter of v4l_bound_align_image() should be
set to 1 and not 0

>
>  	v4l2_fill_pixfmt(pix, pix->pixelformat, pix->width, pix->height);
>
> --
> 2.54.0
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-05  7:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-21 13:19 [PATCH] media: rzg2l-cru: Remove height alignment restriction Prabhakar
2026-06-05  7:33 ` Jacopo Mondi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox