1 From 9a021facd450a55231938131702cbc8b4e9c92e7 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 7 Jan 2021 11:37:10 +0000
4 Subject: [PATCH] staging/bcm2835-isp: Add the unpacked (16bpp) raw
7 Now that the firmware supports the unpacked (16bpp) variants
8 of the MIPI raw formats, add the mappings.
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
12 .../bcm2835-isp/bcm2835-isp-fmts.h | 127 ++++++++++++++++++
13 .../bcm2835-isp/bcm2835-v4l2-isp.c | 4 +-
14 2 files changed, 129 insertions(+), 2 deletions(-)
16 --- a/drivers/staging/vc04_services/bcm2835-isp/bcm2835-isp-fmts.h
17 +++ b/drivers/staging/vc04_services/bcm2835-isp/bcm2835-isp-fmts.h
18 @@ -298,6 +298,106 @@ static const struct bcm2835_isp_fmt supp
19 .colorspace = V4L2_COLORSPACE_RAW,
22 + /* Bayer formats unpacked to 16bpp */
24 + .fourcc = V4L2_PIX_FMT_SRGGB10,
26 + .bytesperline_align = 32,
27 + .mmal_fmt = MMAL_ENCODING_BAYER_SRGGB10,
28 + .size_multiplier_x2 = 2,
29 + .colorspace = V4L2_COLORSPACE_RAW,
32 + .fourcc = V4L2_PIX_FMT_SBGGR10,
34 + .bytesperline_align = 32,
35 + .mmal_fmt = MMAL_ENCODING_BAYER_SBGGR10,
36 + .size_multiplier_x2 = 2,
37 + .colorspace = V4L2_COLORSPACE_RAW,
40 + .fourcc = V4L2_PIX_FMT_SGRBG10,
42 + .bytesperline_align = 32,
43 + .mmal_fmt = MMAL_ENCODING_BAYER_SGRBG10,
44 + .size_multiplier_x2 = 2,
45 + .colorspace = V4L2_COLORSPACE_RAW,
48 + .fourcc = V4L2_PIX_FMT_SGBRG10,
50 + .bytesperline_align = 32,
51 + .mmal_fmt = MMAL_ENCODING_BAYER_SGBRG10,
52 + .size_multiplier_x2 = 2,
53 + .colorspace = V4L2_COLORSPACE_RAW,
57 + .fourcc = V4L2_PIX_FMT_SRGGB12,
59 + .bytesperline_align = 32,
60 + .mmal_fmt = MMAL_ENCODING_BAYER_SRGGB12,
61 + .size_multiplier_x2 = 2,
62 + .colorspace = V4L2_COLORSPACE_RAW,
65 + .fourcc = V4L2_PIX_FMT_SBGGR12,
67 + .bytesperline_align = 32,
68 + .mmal_fmt = MMAL_ENCODING_BAYER_SBGGR12,
69 + .size_multiplier_x2 = 2,
70 + .colorspace = V4L2_COLORSPACE_RAW,
73 + .fourcc = V4L2_PIX_FMT_SGRBG12,
75 + .bytesperline_align = 32,
76 + .mmal_fmt = MMAL_ENCODING_BAYER_SGRBG12,
77 + .size_multiplier_x2 = 2,
78 + .colorspace = V4L2_COLORSPACE_RAW,
81 + .fourcc = V4L2_PIX_FMT_SGBRG12,
83 + .bytesperline_align = 32,
84 + .mmal_fmt = MMAL_ENCODING_BAYER_SGBRG12,
85 + .size_multiplier_x2 = 2,
86 + .colorspace = V4L2_COLORSPACE_RAW,
90 + .fourcc = V4L2_PIX_FMT_SRGGB14,
92 + .bytesperline_align = 32,
93 + .mmal_fmt = MMAL_ENCODING_BAYER_SRGGB14,
94 + .size_multiplier_x2 = 2,
95 + .colorspace = V4L2_COLORSPACE_RAW,
98 + .fourcc = V4L2_PIX_FMT_SBGGR14,
100 + .bytesperline_align = 32,
101 + .mmal_fmt = MMAL_ENCODING_BAYER_SBGGR14,
102 + .size_multiplier_x2 = 2,
103 + .colorspace = V4L2_COLORSPACE_RAW,
106 + .fourcc = V4L2_PIX_FMT_SGRBG14,
108 + .bytesperline_align = 32,
109 + .mmal_fmt = MMAL_ENCODING_BAYER_SGRBG14,
110 + .size_multiplier_x2 = 2,
111 + .colorspace = V4L2_COLORSPACE_RAW,
114 + .fourcc = V4L2_PIX_FMT_SGBRG14,
116 + .bytesperline_align = 32,
117 + .mmal_fmt = MMAL_ENCODING_BAYER_SGBRG14,
118 + .size_multiplier_x2 = 2,
119 + .colorspace = V4L2_COLORSPACE_RAW,
122 /* Monochrome MIPI formats */
124 .fourcc = V4L2_PIX_FMT_GREY,
125 @@ -343,6 +443,33 @@ static const struct bcm2835_isp_fmt supp
126 .size_multiplier_x2 = 2,
127 .colorspace = V4L2_COLORSPACE_RAW,
130 + /* 10 bit as 16bpp */
131 + .fourcc = V4L2_PIX_FMT_Y10,
133 + .bytesperline_align = 32,
134 + .mmal_fmt = MMAL_ENCODING_Y10,
135 + .size_multiplier_x2 = 2,
136 + .colorspace = V4L2_COLORSPACE_RAW,
139 + /* 12 bit as 16bpp */
140 + .fourcc = V4L2_PIX_FMT_Y12,
142 + .bytesperline_align = 32,
143 + .mmal_fmt = MMAL_ENCODING_Y12,
144 + .size_multiplier_x2 = 2,
145 + .colorspace = V4L2_COLORSPACE_RAW,
148 + /* 14 bit as 16bpp */
149 + .fourcc = V4L2_PIX_FMT_Y14,
151 + .bytesperline_align = 32,
152 + .mmal_fmt = MMAL_ENCODING_Y14,
153 + .size_multiplier_x2 = 2,
154 + .colorspace = V4L2_COLORSPACE_RAW,
157 .fourcc = V4L2_META_FMT_BCM2835_ISP_STATS,
158 .mmal_fmt = MMAL_ENCODING_BRCM_STATS,
159 --- a/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c
160 +++ b/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c
161 @@ -1146,11 +1146,11 @@ static const struct v4l2_ioctl_ops bcm28
162 * Size of the array to provide to the VPU when asking for the list of supported
165 - * The ISP component currently advertises 44 input formats, so add a small
166 + * The ISP component currently advertises 62 input formats, so add a small
167 * overhead on that. Should the component advertise more formats then the excess
168 * will be dropped and a warning logged.
170 -#define MAX_SUPPORTED_ENCODINGS 50
171 +#define MAX_SUPPORTED_ENCODINGS 70
173 /* Populate node->supported_fmts with the formats supported by those ports. */
174 static int bcm2835_isp_get_supported_fmts(struct bcm2835_isp_node *node)