[PATCH] rcar-vin: Limit NV12 availability to supported VIN channels only

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

 



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>
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 9e2e63ffcc47acad..62d308a4ddaee82e 100644
--- 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).
+	 */
+	if (pixelformat == V4L2_PIX_FMT_NV12 &&
+	    (!vin->info->nv12 || BIT(vin->id) & 0xcccc))
 		return NULL;
 
 	for (i = 0; i < ARRAY_SIZE(rvin_formats); i++)
-- 
2.23.0




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux