Hi Niklas, On Thu, Nov 7, 2019 at 12:25 AM Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx> wrote: > When adding support for NV12 it was overlooked that the pixel format is > only supported on some VIN channels. Fix this by adding a check to only > accept NV12 on the supported channels (0, 1, 4, 5, 8, 9, 12 and 13). > > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx> Thanks for your patch! > --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c > +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c > @@ -76,7 +76,12 @@ const struct rvin_video_format *rvin_format_from_pixel(struct rvin_dev *vin, > if (vin->info->model == RCAR_M1 && pixelformat == V4L2_PIX_FMT_XBGR32) > return NULL; > > - if (pixelformat == V4L2_PIX_FMT_NV12 && !vin->info->nv12) > + /* > + * If NV12 is supported it's only supported on some channels (0, 1, 4, > + * 5, 8, 9, 12 and 13). Is this true for all SoCs, or do you need a vin->info->model == RCAR_GEN3 check? > + */ > + if (pixelformat == V4L2_PIX_FMT_NV12 && > + (!vin->info->nv12 || BIT(vin->id) & 0xcccc)) > return NULL; So 0xcccc = ~(BIT(0) | BIT(1) | BIT(4) | ...)? What if you ever have an id larger than 15? Wouldn't it be safer to check for !(BIT(vin->id) & 0x3333)? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds