8a4c0280e7e5c1b664535b5bcffcd6f627197bf0
[openwrt/staging/ansuel.git] /
1 From 069a73472178545d5b4683ba3c83eb5b16f0fb6a Mon Sep 17 00:00:00 2001
2 From: David Plowman <david.plowman@raspberrypi.com>
3 Date: Thu, 21 Oct 2021 14:49:15 +0100
4 Subject: [PATCH] vc04_services: isp: Report input node as wanting full
5 range RAW color space
6
7 RAW color spaces are more usually reported as having full range
8 quantization.
9
10 Tested using libcamera.
11
12 Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
13 ---
14 drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c | 4 +++-
15 1 file changed, 3 insertions(+), 1 deletion(-)
16
17 --- a/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c
18 +++ b/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c
19 @@ -1034,7 +1034,9 @@ static int bcm2835_isp_node_try_fmt(stru
20 /* In all cases, we only support the defaults for these: */
21 f->fmt.pix.ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(f->fmt.pix.colorspace);
22 f->fmt.pix.xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(f->fmt.pix.colorspace);
23 - is_rgb = f->fmt.pix.colorspace == V4L2_COLORSPACE_SRGB;
24 + /* RAW counts as sRGB here so that we get full range. */
25 + is_rgb = f->fmt.pix.colorspace == V4L2_COLORSPACE_SRGB ||
26 + f->fmt.pix.colorspace == V4L2_COLORSPACE_RAW;
27 f->fmt.pix.quantization = V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, f->fmt.pix.colorspace,
28 f->fmt.pix.ycbcr_enc);
29