1 From a51b310cccaeac9b0971323dc6fe641fa632c63c 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
7 RAW color spaces are more usually reported as having full range
10 Tested using libcamera.
12 Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
14 drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c | 4 +++-
15 1 file changed, 3 insertions(+), 1 deletion(-)
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 @@ -1032,7 +1032,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);