[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250226192413.2903243-1-stefan.klug@ideasonboard.com>
Date: Wed, 26 Feb 2025 20:23:53 +0100
From: Stefan Klug <stefan.klug@...asonboard.com>
To: libcamera-devel@...ts.libcamera.org,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Paul Elder <paul.elder@...asonboard.com>,
Dafna Hirschfeld <dafna@...tmail.com>,
linux-media@...r.kernel.org,
linux-rockchip@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Cc: Stefan Klug <stefan.klug@...asonboard.com>,
Heiko Stuebner <heiko@...ech.de>
Subject: [PATCH] media: rkisp1: Apply full quantization when color space JPEG is requested
When color space V4L2_COLORSPACE_JPEG is requested the ISP incorrectly
sets the output quantization to V4L2_QUANTIZATION_LIM_RANGE. Fix that by
applying the default quantization for the requested color space.
Fixes: c1ec5efba080 ("media: rkisp1: Allow setting all color space fields on ISP source pad")
Signed-off-by: Stefan Klug <stefan.klug@...asonboard.com>
---
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
index d94917211828..98635d875ac4 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
@@ -646,7 +646,7 @@ static void rkisp1_isp_set_src_fmt(struct rkisp1_isp *isp,
/*
* Copy the color space for the sink pad. When converting from Bayer to
- * YUV, default to a limited quantization range.
+ * YUV, default to the default quantization range of the color space.
*/
src_fmt->colorspace = sink_fmt->colorspace;
src_fmt->xfer_func = sink_fmt->xfer_func;
@@ -654,7 +654,8 @@ static void rkisp1_isp_set_src_fmt(struct rkisp1_isp *isp,
if (sink_info->pixel_enc == V4L2_PIXEL_ENC_BAYER &&
src_info->pixel_enc == V4L2_PIXEL_ENC_YUV)
- src_fmt->quantization = V4L2_QUANTIZATION_LIM_RANGE;
+ src_fmt->quantization = V4L2_MAP_QUANTIZATION_DEFAULT(
+ false, sink_fmt->colorspace, sink_fmt->ycbcr_enc);
else
src_fmt->quantization = sink_fmt->quantization;
--
2.43.0
Powered by blists - more mailing lists