Re: [PATCH] media: atomisp: Avoid picking too big sensor resolution

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

 



On Wed, Nov 06, 2024 at 10:55:09PM +0100, Hans de Goede wrote:
> atomisp_try_fmt() is limiting the width of the requested resolution to 1920
> before calling the sensor's try_fmt() method. But it is not limiting
> the height. In case of the old mode-list based t4ka3 driver which has
> a mode list of:
> 
> 736x496
> 896x736
> 1936x1096
> 3280x2464
> 
> This results in 3280x2464 being selected when try_fmt is called
> with a requested resolution of 3280x2464, which is not supported because
> its width > 1920 .
> 
> Fix this by also limiting the height when in preview mode.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

...

> +	/*
> +	 * The preview pipeline does not support width > 1920. Also limit height
> +	 * to avoid sensor drivers still picking a too wide resolution.
> +	 */
> +	if (asd->run_mode->val == ATOMISP_RUN_MODE_PREVIEW) {
>  		f->width = min_t(u32, f->width, 1920);
> +		f->height = min_t(u32, f->height, 1440);

Perhaps umin() instead of min_t() in both cases?

> +	}

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux