1 From 0bc0dd69488ae3e0ef593596586d84639b93bf4d Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 7 Jan 2021 10:45:16 +0000
4 Subject: [PATCH] staging/bcm2835-codec: 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-codec/bcm2835-v4l2-codec.c | 128 +++++++++++++++++-
13 1 file changed, 126 insertions(+), 2 deletions(-)
15 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
16 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
17 @@ -381,6 +381,106 @@ static const struct bcm2835_codec_fmt su
18 .size_multiplier_x2 = 2,
21 + /* Bayer formats unpacked to 16bpp */
23 + .fourcc = V4L2_PIX_FMT_SRGGB10,
25 + .bytesperline_align = 32,
27 + .mmal_fmt = MMAL_ENCODING_BAYER_SRGGB10,
28 + .size_multiplier_x2 = 2,
31 + .fourcc = V4L2_PIX_FMT_SBGGR10,
33 + .bytesperline_align = 32,
35 + .mmal_fmt = MMAL_ENCODING_BAYER_SBGGR10,
36 + .size_multiplier_x2 = 2,
39 + .fourcc = V4L2_PIX_FMT_SGRBG10,
41 + .bytesperline_align = 32,
43 + .mmal_fmt = MMAL_ENCODING_BAYER_SGRBG10,
44 + .size_multiplier_x2 = 2,
47 + .fourcc = V4L2_PIX_FMT_SGBRG10,
49 + .bytesperline_align = 32,
51 + .mmal_fmt = MMAL_ENCODING_BAYER_SGBRG10,
52 + .size_multiplier_x2 = 2,
56 + .fourcc = V4L2_PIX_FMT_SRGGB12,
58 + .bytesperline_align = 32,
60 + .mmal_fmt = MMAL_ENCODING_BAYER_SRGGB12,
61 + .size_multiplier_x2 = 2,
64 + .fourcc = V4L2_PIX_FMT_SBGGR12,
66 + .bytesperline_align = 32,
68 + .mmal_fmt = MMAL_ENCODING_BAYER_SBGGR12,
69 + .size_multiplier_x2 = 2,
72 + .fourcc = V4L2_PIX_FMT_SGRBG12,
74 + .bytesperline_align = 32,
76 + .mmal_fmt = MMAL_ENCODING_BAYER_SGRBG12,
77 + .size_multiplier_x2 = 2,
80 + .fourcc = V4L2_PIX_FMT_SGBRG12,
82 + .bytesperline_align = 32,
84 + .mmal_fmt = MMAL_ENCODING_BAYER_SGBRG12,
85 + .size_multiplier_x2 = 2,
89 + .fourcc = V4L2_PIX_FMT_SRGGB14,
91 + .bytesperline_align = 32,
93 + .mmal_fmt = MMAL_ENCODING_BAYER_SRGGB14,
94 + .size_multiplier_x2 = 2,
97 + .fourcc = V4L2_PIX_FMT_SBGGR14,
99 + .bytesperline_align = 32,
101 + .mmal_fmt = MMAL_ENCODING_BAYER_SBGGR14,
102 + .size_multiplier_x2 = 2,
105 + .fourcc = V4L2_PIX_FMT_SGRBG14,
107 + .bytesperline_align = 32,
109 + .mmal_fmt = MMAL_ENCODING_BAYER_SGRBG14,
110 + .size_multiplier_x2 = 2,
113 + .fourcc = V4L2_PIX_FMT_SGBRG14,
115 + .bytesperline_align = 32,
117 + .mmal_fmt = MMAL_ENCODING_BAYER_SGBRG14,
118 + .size_multiplier_x2 = 2,
121 /* Monochrome MIPI formats */
123 .fourcc = V4L2_PIX_FMT_GREY,
124 @@ -422,6 +522,30 @@ static const struct bcm2835_codec_fmt su
125 .mmal_fmt = MMAL_ENCODING_Y16,
126 .size_multiplier_x2 = 2,
128 + /* 10 bit as 16bpp */
129 + .fourcc = V4L2_PIX_FMT_Y10,
131 + .bytesperline_align = 32,
133 + .mmal_fmt = MMAL_ENCODING_Y10,
134 + .size_multiplier_x2 = 2,
136 + /* 12 bit as 16bpp */
137 + .fourcc = V4L2_PIX_FMT_Y12,
139 + .bytesperline_align = 32,
141 + .mmal_fmt = MMAL_ENCODING_Y12,
142 + .size_multiplier_x2 = 2,
144 + /* 14 bit as 16bpp */
145 + .fourcc = V4L2_PIX_FMT_Y14,
147 + .bytesperline_align = 32,
149 + .mmal_fmt = MMAL_ENCODING_Y14,
150 + .size_multiplier_x2 = 2,
152 /* Compressed formats */
153 .fourcc = V4L2_PIX_FMT_H264,
155 @@ -2681,10 +2805,10 @@ static const struct v4l2_m2m_ops m2m_ops
157 /* Size of the array to provide to the VPU when asking for the list of supported
159 - * The ISP component currently advertises 44 input formats, so add a small
160 + * The ISP component currently advertises 62 input formats, so add a small
163 -#define MAX_SUPPORTED_ENCODINGS 50
164 +#define MAX_SUPPORTED_ENCODINGS 70
166 /* Populate dev->supported_fmts with the formats supported by those ports. */
167 static int bcm2835_codec_get_supported_fmts(struct bcm2835_codec_dev *dev)