diff options
author | Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> | 2019-12-06 19:39:32 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-02-24 17:21:20 +0300 |
commit | e18976eecabd252ca406ae2325e983f8eaa348cd (patch) | |
tree | 3bcd1c33a3a8f5ccbfc37a79c73338e7028dd0a2 /drivers/media/platform/rcar-vin | |
parent | 9ac560d48d3caab7c6e8cd259520598631535271 (diff) | |
download | linux-e18976eecabd252ca406ae2325e983f8eaa348cd.tar.xz |
media: rcar-vin: Limit NV12 availability to supported VIN channels only
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@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/rcar-vin')
-rw-r--r-- | drivers/media/platform/rcar-vin/rcar-v4l2.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index a76472c62cb1..c60dcf444b02 100644 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c @@ -79,7 +79,11 @@ const struct rvin_video_format *rvin_format_from_pixel(struct rvin_dev *vin, return NULL; break; case V4L2_PIX_FMT_NV12: - if (!vin->info->nv12) + /* + * If NV12 is supported it's only supported on channels 0, 1, 4, + * 5, 8, 9, 12 and 13. + */ + if (!vin->info->nv12 || !(BIT(vin->id) & 0x3333)) return NULL; break; default: |