[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220205233332.67316-1-mike.rudenko@gmail.com>
Date: Sun, 6 Feb 2022 02:33:31 +0300
From: Mikhail Rudenko <mike.rudenko@...il.com>
To: Yong Deng <yong.deng@...ewell.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Maxime Ripard <mripard@...nel.org>,
Chen-Yu Tsai <wens@...e.org>,
Jernej Skrabec <jernej.skrabec@...il.com>
Cc: Mikhail Rudenko <mike.rudenko@...il.com>,
linux-media@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-sunxi@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: [PATCH] media: sun6i-csi: fix colorspace in sun6i_video_try_fmt()
With gstreamer 1.19.3 all attempts to capture video in YUV formats on
our Allwinner H3-based custom board with an ov5640 sensor result in
pipeline crashes with the following messages:
Device '/dev/video0' does not support 2:0:0:0 colorimetry
Additional debug info:
Device wants 2:0:0:0 colorimetry
Fix this by setting the correct colorspace in sun6i_video_try_fmt().
Signed-off-by: Mikhail Rudenko <mike.rudenko@...il.com>
---
Actually there is a second issue with sun6i_video_try_fmt(): reported
bytesperline is wrong for planar YUV formats, but I believe it will be
fixed by [1].
[1] https://lore.kernel.org/linux-media/20220205185429.2278860-40-paul.kocialkowski@bootlin.com/
drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c
index 607a8d39fbe2..682c26536034 100644
--- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c
+++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c
@@ -368,7 +368,11 @@ static int sun6i_video_try_fmt(struct sun6i_video *video,
if (pixfmt->field == V4L2_FIELD_ANY)
pixfmt->field = V4L2_FIELD_NONE;
- pixfmt->colorspace = V4L2_COLORSPACE_RAW;
+ if (pixfmt->pixelformat == V4L2_PIX_FMT_JPEG)
+ pixfmt->colorspace = V4L2_COLORSPACE_JPEG;
+ else
+ pixfmt->colorspace = V4L2_COLORSPACE_SRGB;
+
pixfmt->ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT;
pixfmt->quantization = V4L2_QUANTIZATION_DEFAULT;
pixfmt->xfer_func = V4L2_XFER_FUNC_DEFAULT;
--
2.35.1
Powered by blists - more mailing lists