staging/bcm2835-isp: Add the unpacked (16bpp) raw formats
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Thu, 7 Jan 2021 11:37:10 +0000 (11:37 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:08 +0000 (11:33 +0000)
Now that the firmware supports the unpacked (16bpp) variants
of the MIPI raw formats, add the mappings.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
drivers/staging/vc04_services/bcm2835-isp/bcm2835-isp-fmts.h
drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c

index acd0d5b..12d8ec8 100644 (file)
@@ -298,6 +298,106 @@ static const struct bcm2835_isp_fmt supported_formats[] = {
                .colorspace         = V4L2_COLORSPACE_RAW,
                .step_size          = 2,
        }, {
+               /* Bayer formats unpacked to 16bpp */
+               /* 10 bit */
+               .fourcc             = V4L2_PIX_FMT_SRGGB10,
+               .depth              = 16,
+               .bytesperline_align = 32,
+               .mmal_fmt           = MMAL_ENCODING_BAYER_SRGGB10,
+               .size_multiplier_x2 = 2,
+               .colorspace         = V4L2_COLORSPACE_RAW,
+               .step_size          = 2,
+       }, {
+               .fourcc             = V4L2_PIX_FMT_SBGGR10,
+               .depth              = 16,
+               .bytesperline_align = 32,
+               .mmal_fmt           = MMAL_ENCODING_BAYER_SBGGR10,
+               .size_multiplier_x2 = 2,
+               .colorspace         = V4L2_COLORSPACE_RAW,
+               .step_size          = 2,
+       }, {
+               .fourcc             = V4L2_PIX_FMT_SGRBG10,
+               .depth              = 16,
+               .bytesperline_align = 32,
+               .mmal_fmt           = MMAL_ENCODING_BAYER_SGRBG10,
+               .size_multiplier_x2 = 2,
+               .colorspace         = V4L2_COLORSPACE_RAW,
+               .step_size          = 2,
+       }, {
+               .fourcc             = V4L2_PIX_FMT_SGBRG10,
+               .depth              = 16,
+               .bytesperline_align = 32,
+               .mmal_fmt           = MMAL_ENCODING_BAYER_SGBRG10,
+               .size_multiplier_x2 = 2,
+               .colorspace         = V4L2_COLORSPACE_RAW,
+               .step_size          = 2,
+       }, {
+               /* 12 bit */
+               .fourcc             = V4L2_PIX_FMT_SRGGB12,
+               .depth              = 16,
+               .bytesperline_align = 32,
+               .mmal_fmt           = MMAL_ENCODING_BAYER_SRGGB12,
+               .size_multiplier_x2 = 2,
+               .colorspace         = V4L2_COLORSPACE_RAW,
+               .step_size          = 2,
+       }, {
+               .fourcc             = V4L2_PIX_FMT_SBGGR12,
+               .depth              = 16,
+               .bytesperline_align = 32,
+               .mmal_fmt           = MMAL_ENCODING_BAYER_SBGGR12,
+               .size_multiplier_x2 = 2,
+               .colorspace         = V4L2_COLORSPACE_RAW,
+               .step_size          = 2,
+       }, {
+               .fourcc             = V4L2_PIX_FMT_SGRBG12,
+               .depth              = 16,
+               .bytesperline_align = 32,
+               .mmal_fmt           = MMAL_ENCODING_BAYER_SGRBG12,
+               .size_multiplier_x2 = 2,
+               .colorspace         = V4L2_COLORSPACE_RAW,
+               .step_size          = 2,
+       }, {
+               .fourcc             = V4L2_PIX_FMT_SGBRG12,
+               .depth              = 16,
+               .bytesperline_align = 32,
+               .mmal_fmt           = MMAL_ENCODING_BAYER_SGBRG12,
+               .size_multiplier_x2 = 2,
+               .colorspace         = V4L2_COLORSPACE_RAW,
+               .step_size          = 2,
+       }, {
+               /* 14 bit */
+               .fourcc             = V4L2_PIX_FMT_SRGGB14,
+               .depth              = 16,
+               .bytesperline_align = 32,
+               .mmal_fmt           = MMAL_ENCODING_BAYER_SRGGB14,
+               .size_multiplier_x2 = 2,
+               .colorspace         = V4L2_COLORSPACE_RAW,
+               .step_size          = 2,
+       }, {
+               .fourcc             = V4L2_PIX_FMT_SBGGR14,
+               .depth              = 16,
+               .bytesperline_align = 32,
+               .mmal_fmt           = MMAL_ENCODING_BAYER_SBGGR14,
+               .size_multiplier_x2 = 2,
+               .colorspace         = V4L2_COLORSPACE_RAW,
+               .step_size          = 2,
+       }, {
+               .fourcc             = V4L2_PIX_FMT_SGRBG14,
+               .depth              = 16,
+               .bytesperline_align = 32,
+               .mmal_fmt           = MMAL_ENCODING_BAYER_SGRBG14,
+               .size_multiplier_x2 = 2,
+               .colorspace         = V4L2_COLORSPACE_RAW,
+               .step_size          = 2,
+       }, {
+               .fourcc             = V4L2_PIX_FMT_SGBRG14,
+               .depth              = 16,
+               .bytesperline_align = 32,
+               .mmal_fmt           = MMAL_ENCODING_BAYER_SGBRG14,
+               .size_multiplier_x2 = 2,
+               .colorspace         = V4L2_COLORSPACE_RAW,
+               .step_size          = 2,
+       }, {
                /* Monochrome MIPI formats */
                /* 8 bit */
                .fourcc             = V4L2_PIX_FMT_GREY,
@@ -344,6 +444,33 @@ static const struct bcm2835_isp_fmt supported_formats[] = {
                .colorspace         = V4L2_COLORSPACE_RAW,
                .step_size          = 2,
        }, {
+               /* 10 bit as 16bpp */
+               .fourcc             = V4L2_PIX_FMT_Y10,
+               .depth              = 16,
+               .bytesperline_align = 32,
+               .mmal_fmt           = MMAL_ENCODING_Y10,
+               .size_multiplier_x2 = 2,
+               .colorspace         = V4L2_COLORSPACE_RAW,
+               .step_size          = 2,
+       }, {
+               /* 12 bit as 16bpp */
+               .fourcc             = V4L2_PIX_FMT_Y12,
+               .depth              = 16,
+               .bytesperline_align = 32,
+               .mmal_fmt           = MMAL_ENCODING_Y12,
+               .size_multiplier_x2 = 2,
+               .colorspace         = V4L2_COLORSPACE_RAW,
+               .step_size          = 2,
+       }, {
+               /* 14 bit as 16bpp */
+               .fourcc             = V4L2_PIX_FMT_Y14,
+               .depth              = 16,
+               .bytesperline_align = 32,
+               .mmal_fmt           = MMAL_ENCODING_Y14,
+               .size_multiplier_x2 = 2,
+               .colorspace         = V4L2_COLORSPACE_RAW,
+               .step_size          = 2,
+       }, {
                .fourcc             = V4L2_META_FMT_BCM2835_ISP_STATS,
                .mmal_fmt           = MMAL_ENCODING_BRCM_STATS,
                /* The rest are not valid fields for stats. */
index 3ecb8a1..1e3ef82 100644 (file)
@@ -1148,11 +1148,11 @@ static const struct v4l2_ioctl_ops bcm2835_isp_node_ioctl_ops = {
  * Size of the array to provide to the VPU when asking for the list of supported
  * formats.
  *
- * The ISP component currently advertises 44 input formats, so add a small
+ * The ISP component currently advertises 62 input formats, so add a small
  * overhead on that. Should the component advertise more formats then the excess
  * will be dropped and a warning logged.
  */
-#define MAX_SUPPORTED_ENCODINGS 50
+#define MAX_SUPPORTED_ENCODINGS 70
 
 /* Populate node->supported_fmts with the formats supported by those ports. */
 static int bcm2835_isp_get_supported_fmts(struct bcm2835_isp_node *node)