brcm2708: add kernel 4.14 support
[openwrt/staging/chunkeey.git] / target / linux / brcm2708 / patches-4.14 / 950-0376-staging-bcm2835-camera-Fix-indentation-of-tables.patch
1 From 212b50d76ee63b58a59ccb687719583f72ea5e23 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Thu, 10 May 2018 12:42:17 -0700
4 Subject: [PATCH 376/454] staging: bcm2835-camera: Fix indentation of tables
5
6 commit 6166045e7964067dba0da43a122de27ceb49be7b upstream
7
8 As requested by Mauro Carvalho Chehab in review.
9
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
11 Signed-off-by: Eric Anholt <eric@anholt.net>
12 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 ---
14 .../bcm2835-camera/bcm2835-camera.c | 289 +++++++++---------
15 1 file changed, 139 insertions(+), 150 deletions(-)
16
17 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
18 +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
19 @@ -81,145 +81,132 @@ static const struct v4l2_fract
20 /* video formats */
21 static struct mmal_fmt formats[] = {
22 {
23 - .name = "4:2:0, planar, YUV",
24 - .fourcc = V4L2_PIX_FMT_YUV420,
25 - .flags = 0,
26 - .mmal = MMAL_ENCODING_I420,
27 - .depth = 12,
28 - .mmal_component = MMAL_COMPONENT_CAMERA,
29 - .ybbp = 1,
30 - .remove_padding = 1,
31 - },
32 - {
33 - .name = "4:2:2, packed, YUYV",
34 - .fourcc = V4L2_PIX_FMT_YUYV,
35 - .flags = 0,
36 - .mmal = MMAL_ENCODING_YUYV,
37 - .depth = 16,
38 - .mmal_component = MMAL_COMPONENT_CAMERA,
39 - .ybbp = 2,
40 - .remove_padding = 0,
41 - },
42 - {
43 - .name = "RGB24 (LE)",
44 - .fourcc = V4L2_PIX_FMT_RGB24,
45 - .flags = 0,
46 - .mmal = MMAL_ENCODING_RGB24,
47 - .depth = 24,
48 - .mmal_component = MMAL_COMPONENT_CAMERA,
49 - .ybbp = 3,
50 - .remove_padding = 0,
51 - },
52 - {
53 - .name = "JPEG",
54 - .fourcc = V4L2_PIX_FMT_JPEG,
55 - .flags = V4L2_FMT_FLAG_COMPRESSED,
56 - .mmal = MMAL_ENCODING_JPEG,
57 - .depth = 8,
58 - .mmal_component = MMAL_COMPONENT_IMAGE_ENCODE,
59 - .ybbp = 0,
60 - .remove_padding = 0,
61 - },
62 - {
63 - .name = "H264",
64 - .fourcc = V4L2_PIX_FMT_H264,
65 - .flags = V4L2_FMT_FLAG_COMPRESSED,
66 - .mmal = MMAL_ENCODING_H264,
67 - .depth = 8,
68 - .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
69 - .ybbp = 0,
70 - .remove_padding = 0,
71 - },
72 - {
73 - .name = "MJPEG",
74 - .fourcc = V4L2_PIX_FMT_MJPEG,
75 - .flags = V4L2_FMT_FLAG_COMPRESSED,
76 - .mmal = MMAL_ENCODING_MJPEG,
77 - .depth = 8,
78 - .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
79 - .ybbp = 0,
80 - .remove_padding = 0,
81 - },
82 - {
83 - .name = "4:2:2, packed, YVYU",
84 - .fourcc = V4L2_PIX_FMT_YVYU,
85 - .flags = 0,
86 - .mmal = MMAL_ENCODING_YVYU,
87 - .depth = 16,
88 - .mmal_component = MMAL_COMPONENT_CAMERA,
89 - .ybbp = 2,
90 - .remove_padding = 0,
91 - },
92 - {
93 - .name = "4:2:2, packed, VYUY",
94 - .fourcc = V4L2_PIX_FMT_VYUY,
95 - .flags = 0,
96 - .mmal = MMAL_ENCODING_VYUY,
97 - .depth = 16,
98 - .mmal_component = MMAL_COMPONENT_CAMERA,
99 - .ybbp = 2,
100 - .remove_padding = 0,
101 - },
102 - {
103 - .name = "4:2:2, packed, UYVY",
104 - .fourcc = V4L2_PIX_FMT_UYVY,
105 - .flags = 0,
106 - .mmal = MMAL_ENCODING_UYVY,
107 - .depth = 16,
108 - .mmal_component = MMAL_COMPONENT_CAMERA,
109 - .ybbp = 2,
110 - .remove_padding = 0,
111 - },
112 - {
113 - .name = "4:2:0, planar, NV12",
114 - .fourcc = V4L2_PIX_FMT_NV12,
115 - .flags = 0,
116 - .mmal = MMAL_ENCODING_NV12,
117 - .depth = 12,
118 - .mmal_component = MMAL_COMPONENT_CAMERA,
119 - .ybbp = 1,
120 - .remove_padding = 1,
121 - },
122 - {
123 - .name = "RGB24 (BE)",
124 - .fourcc = V4L2_PIX_FMT_BGR24,
125 - .flags = 0,
126 - .mmal = MMAL_ENCODING_BGR24,
127 - .depth = 24,
128 - .mmal_component = MMAL_COMPONENT_CAMERA,
129 - .ybbp = 3,
130 - .remove_padding = 0,
131 - },
132 - {
133 - .name = "4:2:0, planar, YVU",
134 - .fourcc = V4L2_PIX_FMT_YVU420,
135 - .flags = 0,
136 - .mmal = MMAL_ENCODING_YV12,
137 - .depth = 12,
138 - .mmal_component = MMAL_COMPONENT_CAMERA,
139 - .ybbp = 1,
140 - .remove_padding = 1,
141 - },
142 - {
143 - .name = "4:2:0, planar, NV21",
144 - .fourcc = V4L2_PIX_FMT_NV21,
145 - .flags = 0,
146 - .mmal = MMAL_ENCODING_NV21,
147 - .depth = 12,
148 - .mmal_component = MMAL_COMPONENT_CAMERA,
149 - .ybbp = 1,
150 - .remove_padding = 1,
151 - },
152 - {
153 - .name = "RGB32 (BE)",
154 - .fourcc = V4L2_PIX_FMT_BGR32,
155 - .flags = 0,
156 - .mmal = MMAL_ENCODING_BGRA,
157 - .depth = 32,
158 - .mmal_component = MMAL_COMPONENT_CAMERA,
159 - .ybbp = 4,
160 - .remove_padding = 0,
161 - },
162 + .name = "4:2:0, planar, YUV",
163 + .fourcc = V4L2_PIX_FMT_YUV420,
164 + .flags = 0,
165 + .mmal = MMAL_ENCODING_I420,
166 + .depth = 12,
167 + .mmal_component = MMAL_COMPONENT_CAMERA,
168 + .ybbp = 1,
169 + .remove_padding = 1,
170 + }, {
171 + .name = "4:2:2, packed, YUYV",
172 + .fourcc = V4L2_PIX_FMT_YUYV,
173 + .flags = 0,
174 + .mmal = MMAL_ENCODING_YUYV,
175 + .depth = 16,
176 + .mmal_component = MMAL_COMPONENT_CAMERA,
177 + .ybbp = 2,
178 + .remove_padding = 0,
179 + }, {
180 + .name = "RGB24 (LE)",
181 + .fourcc = V4L2_PIX_FMT_RGB24,
182 + .flags = 0,
183 + .mmal = MMAL_ENCODING_RGB24,
184 + .depth = 24,
185 + .mmal_component = MMAL_COMPONENT_CAMERA,
186 + .ybbp = 3,
187 + .remove_padding = 0,
188 + }, {
189 + .name = "JPEG",
190 + .fourcc = V4L2_PIX_FMT_JPEG,
191 + .flags = V4L2_FMT_FLAG_COMPRESSED,
192 + .mmal = MMAL_ENCODING_JPEG,
193 + .depth = 8,
194 + .mmal_component = MMAL_COMPONENT_IMAGE_ENCODE,
195 + .ybbp = 0,
196 + .remove_padding = 0,
197 + }, {
198 + .name = "H264",
199 + .fourcc = V4L2_PIX_FMT_H264,
200 + .flags = V4L2_FMT_FLAG_COMPRESSED,
201 + .mmal = MMAL_ENCODING_H264,
202 + .depth = 8,
203 + .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
204 + .ybbp = 0,
205 + .remove_padding = 0,
206 + }, {
207 + .name = "MJPEG",
208 + .fourcc = V4L2_PIX_FMT_MJPEG,
209 + .flags = V4L2_FMT_FLAG_COMPRESSED,
210 + .mmal = MMAL_ENCODING_MJPEG,
211 + .depth = 8,
212 + .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
213 + .ybbp = 0,
214 + .remove_padding = 0,
215 + }, {
216 + .name = "4:2:2, packed, YVYU",
217 + .fourcc = V4L2_PIX_FMT_YVYU,
218 + .flags = 0,
219 + .mmal = MMAL_ENCODING_YVYU,
220 + .depth = 16,
221 + .mmal_component = MMAL_COMPONENT_CAMERA,
222 + .ybbp = 2,
223 + .remove_padding = 0,
224 + }, {
225 + .name = "4:2:2, packed, VYUY",
226 + .fourcc = V4L2_PIX_FMT_VYUY,
227 + .flags = 0,
228 + .mmal = MMAL_ENCODING_VYUY,
229 + .depth = 16,
230 + .mmal_component = MMAL_COMPONENT_CAMERA,
231 + .ybbp = 2,
232 + .remove_padding = 0,
233 + }, {
234 + .name = "4:2:2, packed, UYVY",
235 + .fourcc = V4L2_PIX_FMT_UYVY,
236 + .flags = 0,
237 + .mmal = MMAL_ENCODING_UYVY,
238 + .depth = 16,
239 + .mmal_component = MMAL_COMPONENT_CAMERA,
240 + .ybbp = 2,
241 + .remove_padding = 0,
242 + }, {
243 + .name = "4:2:0, planar, NV12",
244 + .fourcc = V4L2_PIX_FMT_NV12,
245 + .flags = 0,
246 + .mmal = MMAL_ENCODING_NV12,
247 + .depth = 12,
248 + .mmal_component = MMAL_COMPONENT_CAMERA,
249 + .ybbp = 1,
250 + .remove_padding = 1,
251 + }, {
252 + .name = "RGB24 (BE)",
253 + .fourcc = V4L2_PIX_FMT_BGR24,
254 + .flags = 0,
255 + .mmal = MMAL_ENCODING_BGR24,
256 + .depth = 24,
257 + .mmal_component = MMAL_COMPONENT_CAMERA,
258 + .ybbp = 3,
259 + .remove_padding = 0,
260 + }, {
261 + .name = "4:2:0, planar, YVU",
262 + .fourcc = V4L2_PIX_FMT_YVU420,
263 + .flags = 0,
264 + .mmal = MMAL_ENCODING_YV12,
265 + .depth = 12,
266 + .mmal_component = MMAL_COMPONENT_CAMERA,
267 + .ybbp = 1,
268 + .remove_padding = 1,
269 + }, {
270 + .name = "4:2:0, planar, NV21",
271 + .fourcc = V4L2_PIX_FMT_NV21,
272 + .flags = 0,
273 + .mmal = MMAL_ENCODING_NV21,
274 + .depth = 12,
275 + .mmal_component = MMAL_COMPONENT_CAMERA,
276 + .ybbp = 1,
277 + .remove_padding = 1,
278 + }, {
279 + .name = "RGB32 (BE)",
280 + .fourcc = V4L2_PIX_FMT_BGR32,
281 + .flags = 0,
282 + .mmal = MMAL_ENCODING_BGRA,
283 + .depth = 32,
284 + .mmal_component = MMAL_COMPONENT_CAMERA,
285 + .ybbp = 4,
286 + .remove_padding = 0,
287 + },
288 };
289
290 static struct mmal_fmt *get_format(struct v4l2_format *f)
291 @@ -709,17 +696,19 @@ static int set_overlay_params(struct bm2
292 struct vchiq_mmal_port *port)
293 {
294 struct mmal_parameter_displayregion prev_config = {
295 - .set = MMAL_DISPLAY_SET_LAYER | MMAL_DISPLAY_SET_ALPHA |
296 - MMAL_DISPLAY_SET_DEST_RECT | MMAL_DISPLAY_SET_FULLSCREEN,
297 - .layer = PREVIEW_LAYER,
298 - .alpha = dev->overlay.global_alpha,
299 - .fullscreen = 0,
300 - .dest_rect = {
301 - .x = dev->overlay.w.left,
302 - .y = dev->overlay.w.top,
303 - .width = dev->overlay.w.width,
304 - .height = dev->overlay.w.height,
305 - },
306 + .set = MMAL_DISPLAY_SET_LAYER |
307 + MMAL_DISPLAY_SET_ALPHA |
308 + MMAL_DISPLAY_SET_DEST_RECT |
309 + MMAL_DISPLAY_SET_FULLSCREEN,
310 + .layer = PREVIEW_LAYER,
311 + .alpha = dev->overlay.global_alpha,
312 + .fullscreen = 0,
313 + .dest_rect = {
314 + .x = dev->overlay.w.left,
315 + .y = dev->overlay.w.top,
316 + .width = dev->overlay.w.width,
317 + .height = dev->overlay.w.height,
318 + },
319 };
320 return vchiq_mmal_port_parameter_set(dev->instance, port,
321 MMAL_PARAMETER_DISPLAYREGION,