Hi Niklas,

Thank you for the patch.

On Tuesday 14 Mar 2017 19:59:57 Niklas Söderlund wrote:
> If the requested pixelformat is not supported only revert to the current
> pixelformat, do not revert the entire format. Also if the pixelformat
> needs to be reverted the pixel information needs to be fetched once
> more.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
> ---
>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> b/drivers/media/platform/rcar-vin/rcar-v4l2.c index
> 956092ba6ef9bc6f..27b7733e96afe3e9 100644
> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> @@ -226,9 +226,8 @@ static int __rvin_try_format(struct rvin_dev *vin,
>       if (!info) {
>               vin_dbg(vin, "Format %x not found, keeping %x\n",
>                       pix->pixelformat, vin->format.pixelformat);
> -             *pix = vin->format;
> -             pix->width = rwidth;
> -             pix->height = rheight;
> +             pix->pixelformat = vin->format.pixelformat;

You should set a fixed default in this case to achieve a more deterministic 
behaviour. You can for instance pick the first entry of, which will also save 
you from calling rvin_format_from_pixel() as you can then replace it with 
&rvin_formats[0].

> +             info = rvin_format_from_pixel(pix->pixelformat);
>       }
> 
>       /* Always recalculate */

-- 
Regards,

Laurent Pinchart

Reply via email to