vc04_services: isp: Report input node as wanting full range RAW color space
authorDavid Plowman <david.plowman@raspberrypi.com>
Thu, 21 Oct 2021 13:49:15 +0000 (14:49 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:13 +0000 (11:33 +0000)
RAW color spaces are more usually reported as having full range
quantization.

Tested using libcamera.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c

index f22f0e1546674d9ce98431be00f0af93b354a387..ee893f875c42ea0e38ed72251821f3de37dfa09e 100644 (file)
@@ -1034,7 +1034,9 @@ static int bcm2835_isp_node_try_fmt(struct file *file, void *priv,
                /* In all cases, we only support the defaults for these: */
                f->fmt.pix.ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(f->fmt.pix.colorspace);
                f->fmt.pix.xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(f->fmt.pix.colorspace);
-               is_rgb = f->fmt.pix.colorspace == V4L2_COLORSPACE_SRGB;
+               /* RAW counts as sRGB here so that we get full range. */
+               is_rgb = f->fmt.pix.colorspace == V4L2_COLORSPACE_SRGB ||
+                       f->fmt.pix.colorspace == V4L2_COLORSPACE_RAW;
                f->fmt.pix.quantization = V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, f->fmt.pix.colorspace,
                                                                        f->fmt.pix.ycbcr_enc);