Re: [PATCH v3 5/8] media: renesas: vsp1: Fix crop width and height clamping on RPF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Laurent

On Fri, Jul 04, 2025 at 03:18:09AM +0300, Laurent Pinchart wrote:
> The vsp1 driver doesn't enforce a minimum value on the RPF crop rectangle
> width and height. Empty rectangles are accepted, leading to incorrect
> hardware behaviour. Fix it by adding minimum width and height
> constraints to the value clamping.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>

Reviewed-by: Jacopo Mondi <jacopo.mondi@xxxxxxxxxxxxxxxx>

Thanks
  j

> ---
>  drivers/media/platform/renesas/vsp1/vsp1_rwpf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/renesas/vsp1/vsp1_rwpf.c b/drivers/media/platform/renesas/vsp1/vsp1_rwpf.c
> index ffc1b3ab54e2..ccc7608f538d 100644
> --- a/drivers/media/platform/renesas/vsp1/vsp1_rwpf.c
> +++ b/drivers/media/platform/renesas/vsp1/vsp1_rwpf.c
> @@ -261,9 +261,9 @@ static int vsp1_rwpf_set_selection(struct v4l2_subdev *subdev,
>
>  	sel->r.left = clamp_t(int, sel->r.left, 0, format->width - min_width);
>  	sel->r.top = clamp_t(int, sel->r.top, 0, format->height - min_height);
> -	sel->r.width = min_t(unsigned int, sel->r.width,
> +	sel->r.width = clamp(sel->r.width, min_width,
>  			     format->width - sel->r.left);
> -	sel->r.height = min_t(unsigned int, sel->r.height,
> +	sel->r.height = clamp(sel->r.height, min_height,
>  			      format->height - sel->r.top);
>
>  	crop = v4l2_subdev_state_get_crop(state, RWPF_PAD_SINK);
> --
> Regards,
>
> Laurent Pinchart
>
>




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux