1 From 9d12ccfea8cdc6d1dbb796a3023e8c8297a4465e Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Mon, 29 Nov 2021 19:11:29 +0000
4 Subject: [PATCH] staging/bcm2835-codec: Allow a different stride
7 Deinterlace and decode aren't affected in the same way as encode
8 and ISP by the alignment requirement on 3 plane YUV420.
9 Decode would be affected, but it always aligns the height up to
10 a macroblock, and uses the selection API to reflect that.
12 Add in the facility to set the bytesperline alignment per role.
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
16 .../bcm2835-codec/bcm2835-v4l2-codec.c | 135 ++++++++++--------
17 1 file changed, 74 insertions(+), 61 deletions(-)
19 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
20 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
21 @@ -88,6 +88,7 @@ enum bcm2835_codec_role {
28 static const char * const roles[] = {
29 @@ -145,7 +146,7 @@ static const char * const components[] =
30 struct bcm2835_codec_fmt {
33 - int bytesperline_align;
34 + u8 bytesperline_align[NUM_ROLES];
37 int size_multiplier_x2;
38 @@ -157,63 +158,63 @@ static const struct bcm2835_codec_fmt su
40 .fourcc = V4L2_PIX_FMT_YUV420,
42 - .bytesperline_align = 64,
43 + .bytesperline_align = { 32, 64, 64, 32 },
45 .mmal_fmt = MMAL_ENCODING_I420,
46 .size_multiplier_x2 = 3,
48 .fourcc = V4L2_PIX_FMT_YVU420,
50 - .bytesperline_align = 64,
51 + .bytesperline_align = { 32, 64, 64, 32 },
53 .mmal_fmt = MMAL_ENCODING_YV12,
54 .size_multiplier_x2 = 3,
56 .fourcc = V4L2_PIX_FMT_NV12,
58 - .bytesperline_align = 32,
59 + .bytesperline_align = { 32, 32, 32, 32 },
61 .mmal_fmt = MMAL_ENCODING_NV12,
62 .size_multiplier_x2 = 3,
64 .fourcc = V4L2_PIX_FMT_NV21,
66 - .bytesperline_align = 32,
67 + .bytesperline_align = { 32, 32, 32, 32 },
69 .mmal_fmt = MMAL_ENCODING_NV21,
70 .size_multiplier_x2 = 3,
72 .fourcc = V4L2_PIX_FMT_RGB565,
74 - .bytesperline_align = 32,
75 + .bytesperline_align = { 32, 32, 32, 32 },
77 .mmal_fmt = MMAL_ENCODING_RGB16,
78 .size_multiplier_x2 = 2,
80 .fourcc = V4L2_PIX_FMT_YUYV,
82 - .bytesperline_align = 32,
83 + .bytesperline_align = { 32, 32, 32, 32 },
85 .mmal_fmt = MMAL_ENCODING_YUYV,
86 .size_multiplier_x2 = 2,
88 .fourcc = V4L2_PIX_FMT_UYVY,
90 - .bytesperline_align = 32,
91 + .bytesperline_align = { 32, 32, 32, 32 },
93 .mmal_fmt = MMAL_ENCODING_UYVY,
94 .size_multiplier_x2 = 2,
96 .fourcc = V4L2_PIX_FMT_YVYU,
98 - .bytesperline_align = 32,
99 + .bytesperline_align = { 32, 32, 32, 32 },
101 .mmal_fmt = MMAL_ENCODING_YVYU,
102 .size_multiplier_x2 = 2,
104 .fourcc = V4L2_PIX_FMT_VYUY,
106 - .bytesperline_align = 32,
107 + .bytesperline_align = { 32, 32, 32, 32 },
109 .mmal_fmt = MMAL_ENCODING_VYUY,
110 .size_multiplier_x2 = 2,
111 @@ -221,21 +222,21 @@ static const struct bcm2835_codec_fmt su
113 .fourcc = V4L2_PIX_FMT_RGB24,
115 - .bytesperline_align = 32,
116 + .bytesperline_align = { 32, 32, 32, 32 },
118 .mmal_fmt = MMAL_ENCODING_RGB24,
119 .size_multiplier_x2 = 2,
121 .fourcc = V4L2_PIX_FMT_BGR24,
123 - .bytesperline_align = 32,
124 + .bytesperline_align = { 32, 32, 32, 32 },
126 .mmal_fmt = MMAL_ENCODING_BGR24,
127 .size_multiplier_x2 = 2,
129 .fourcc = V4L2_PIX_FMT_BGR32,
131 - .bytesperline_align = 32,
132 + .bytesperline_align = { 32, 32, 32, 32 },
134 .mmal_fmt = MMAL_ENCODING_BGRA,
135 .size_multiplier_x2 = 2,
136 @@ -244,7 +245,7 @@ static const struct bcm2835_codec_fmt su
138 .fourcc = V4L2_PIX_FMT_SRGGB8,
140 - .bytesperline_align = 32,
141 + .bytesperline_align = { 32, 32, 32, 32 },
143 .mmal_fmt = MMAL_ENCODING_BAYER_SRGGB8,
144 .size_multiplier_x2 = 2,
145 @@ -252,7 +253,7 @@ static const struct bcm2835_codec_fmt su
147 .fourcc = V4L2_PIX_FMT_SBGGR8,
149 - .bytesperline_align = 32,
150 + .bytesperline_align = { 32, 32, 32, 32 },
152 .mmal_fmt = MMAL_ENCODING_BAYER_SBGGR8,
153 .size_multiplier_x2 = 2,
154 @@ -260,7 +261,7 @@ static const struct bcm2835_codec_fmt su
156 .fourcc = V4L2_PIX_FMT_SGRBG8,
158 - .bytesperline_align = 32,
159 + .bytesperline_align = { 32, 32, 32, 32 },
161 .mmal_fmt = MMAL_ENCODING_BAYER_SGRBG8,
162 .size_multiplier_x2 = 2,
163 @@ -268,7 +269,7 @@ static const struct bcm2835_codec_fmt su
165 .fourcc = V4L2_PIX_FMT_SGBRG8,
167 - .bytesperline_align = 32,
168 + .bytesperline_align = { 32, 32, 32, 32 },
170 .mmal_fmt = MMAL_ENCODING_BAYER_SGBRG8,
171 .size_multiplier_x2 = 2,
172 @@ -277,7 +278,7 @@ static const struct bcm2835_codec_fmt su
174 .fourcc = V4L2_PIX_FMT_SRGGB10P,
176 - .bytesperline_align = 32,
177 + .bytesperline_align = { 32, 32, 32, 32 },
179 .mmal_fmt = MMAL_ENCODING_BAYER_SRGGB10P,
180 .size_multiplier_x2 = 2,
181 @@ -285,7 +286,7 @@ static const struct bcm2835_codec_fmt su
183 .fourcc = V4L2_PIX_FMT_SBGGR10P,
185 - .bytesperline_align = 32,
186 + .bytesperline_align = { 32, 32, 32, 32 },
188 .mmal_fmt = MMAL_ENCODING_BAYER_SBGGR10P,
189 .size_multiplier_x2 = 2,
190 @@ -293,7 +294,7 @@ static const struct bcm2835_codec_fmt su
192 .fourcc = V4L2_PIX_FMT_SGRBG10P,
194 - .bytesperline_align = 32,
195 + .bytesperline_align = { 32, 32, 32, 32 },
197 .mmal_fmt = MMAL_ENCODING_BAYER_SGRBG10P,
198 .size_multiplier_x2 = 2,
199 @@ -301,7 +302,7 @@ static const struct bcm2835_codec_fmt su
201 .fourcc = V4L2_PIX_FMT_SGBRG10P,
203 - .bytesperline_align = 32,
204 + .bytesperline_align = { 32, 32, 32, 32 },
206 .mmal_fmt = MMAL_ENCODING_BAYER_SGBRG10P,
207 .size_multiplier_x2 = 2,
208 @@ -310,7 +311,7 @@ static const struct bcm2835_codec_fmt su
210 .fourcc = V4L2_PIX_FMT_SRGGB12P,
212 - .bytesperline_align = 32,
213 + .bytesperline_align = { 32, 32, 32, 32 },
215 .mmal_fmt = MMAL_ENCODING_BAYER_SRGGB12P,
216 .size_multiplier_x2 = 2,
217 @@ -318,7 +319,7 @@ static const struct bcm2835_codec_fmt su
219 .fourcc = V4L2_PIX_FMT_SBGGR12P,
221 - .bytesperline_align = 32,
222 + .bytesperline_align = { 32, 32, 32, 32 },
224 .mmal_fmt = MMAL_ENCODING_BAYER_SBGGR12P,
225 .size_multiplier_x2 = 2,
226 @@ -326,7 +327,7 @@ static const struct bcm2835_codec_fmt su
228 .fourcc = V4L2_PIX_FMT_SGRBG12P,
230 - .bytesperline_align = 32,
231 + .bytesperline_align = { 32, 32, 32, 32 },
233 .mmal_fmt = MMAL_ENCODING_BAYER_SGRBG12P,
234 .size_multiplier_x2 = 2,
235 @@ -334,7 +335,7 @@ static const struct bcm2835_codec_fmt su
237 .fourcc = V4L2_PIX_FMT_SGBRG12P,
239 - .bytesperline_align = 32,
240 + .bytesperline_align = { 32, 32, 32, 32 },
242 .mmal_fmt = MMAL_ENCODING_BAYER_SGBRG12P,
243 .size_multiplier_x2 = 2,
244 @@ -343,7 +344,7 @@ static const struct bcm2835_codec_fmt su
246 .fourcc = V4L2_PIX_FMT_SRGGB14P,
248 - .bytesperline_align = 32,
249 + .bytesperline_align = { 32, 32, 32, 32 },
251 .mmal_fmt = MMAL_ENCODING_BAYER_SRGGB14P,
252 .size_multiplier_x2 = 2,
253 @@ -351,7 +352,7 @@ static const struct bcm2835_codec_fmt su
255 .fourcc = V4L2_PIX_FMT_SBGGR14P,
257 - .bytesperline_align = 32,
258 + .bytesperline_align = { 32, 32, 32, 32 },
260 .mmal_fmt = MMAL_ENCODING_BAYER_SBGGR14P,
261 .size_multiplier_x2 = 2,
262 @@ -360,7 +361,7 @@ static const struct bcm2835_codec_fmt su
264 .fourcc = V4L2_PIX_FMT_SGRBG14P,
266 - .bytesperline_align = 32,
267 + .bytesperline_align = { 32, 32, 32, 32 },
269 .mmal_fmt = MMAL_ENCODING_BAYER_SGRBG14P,
270 .size_multiplier_x2 = 2,
271 @@ -368,7 +369,7 @@ static const struct bcm2835_codec_fmt su
273 .fourcc = V4L2_PIX_FMT_SGBRG14P,
275 - .bytesperline_align = 32,
276 + .bytesperline_align = { 32, 32, 32, 32 },
278 .mmal_fmt = MMAL_ENCODING_BAYER_SGBRG14P,
279 .size_multiplier_x2 = 2,
280 @@ -377,7 +378,7 @@ static const struct bcm2835_codec_fmt su
282 .fourcc = V4L2_PIX_FMT_SRGGB16,
284 - .bytesperline_align = 32,
285 + .bytesperline_align = { 32, 32, 32, 32 },
287 .mmal_fmt = MMAL_ENCODING_BAYER_SRGGB16,
288 .size_multiplier_x2 = 2,
289 @@ -385,7 +386,7 @@ static const struct bcm2835_codec_fmt su
291 .fourcc = V4L2_PIX_FMT_SBGGR16,
293 - .bytesperline_align = 32,
294 + .bytesperline_align = { 32, 32, 32, 32 },
296 .mmal_fmt = MMAL_ENCODING_BAYER_SBGGR16,
297 .size_multiplier_x2 = 2,
298 @@ -393,7 +394,7 @@ static const struct bcm2835_codec_fmt su
300 .fourcc = V4L2_PIX_FMT_SGRBG16,
302 - .bytesperline_align = 32,
303 + .bytesperline_align = { 32, 32, 32, 32 },
305 .mmal_fmt = MMAL_ENCODING_BAYER_SGRBG16,
306 .size_multiplier_x2 = 2,
307 @@ -401,7 +402,7 @@ static const struct bcm2835_codec_fmt su
309 .fourcc = V4L2_PIX_FMT_SGBRG16,
311 - .bytesperline_align = 32,
312 + .bytesperline_align = { 32, 32, 32, 32 },
314 .mmal_fmt = MMAL_ENCODING_BAYER_SGBRG16,
315 .size_multiplier_x2 = 2,
316 @@ -411,7 +412,7 @@ static const struct bcm2835_codec_fmt su
318 .fourcc = V4L2_PIX_FMT_SRGGB10,
320 - .bytesperline_align = 32,
321 + .bytesperline_align = { 32, 32, 32, 32 },
323 .mmal_fmt = MMAL_ENCODING_BAYER_SRGGB10,
324 .size_multiplier_x2 = 2,
325 @@ -419,7 +420,7 @@ static const struct bcm2835_codec_fmt su
327 .fourcc = V4L2_PIX_FMT_SBGGR10,
329 - .bytesperline_align = 32,
330 + .bytesperline_align = { 32, 32, 32, 32 },
332 .mmal_fmt = MMAL_ENCODING_BAYER_SBGGR10,
333 .size_multiplier_x2 = 2,
334 @@ -427,7 +428,7 @@ static const struct bcm2835_codec_fmt su
336 .fourcc = V4L2_PIX_FMT_SGRBG10,
338 - .bytesperline_align = 32,
339 + .bytesperline_align = { 32, 32, 32, 32 },
341 .mmal_fmt = MMAL_ENCODING_BAYER_SGRBG10,
342 .size_multiplier_x2 = 2,
343 @@ -435,7 +436,7 @@ static const struct bcm2835_codec_fmt su
345 .fourcc = V4L2_PIX_FMT_SGBRG10,
347 - .bytesperline_align = 32,
348 + .bytesperline_align = { 32, 32, 32, 32 },
350 .mmal_fmt = MMAL_ENCODING_BAYER_SGBRG10,
351 .size_multiplier_x2 = 2,
352 @@ -444,7 +445,7 @@ static const struct bcm2835_codec_fmt su
354 .fourcc = V4L2_PIX_FMT_SRGGB12,
356 - .bytesperline_align = 32,
357 + .bytesperline_align = { 32, 32, 32, 32 },
359 .mmal_fmt = MMAL_ENCODING_BAYER_SRGGB12,
360 .size_multiplier_x2 = 2,
361 @@ -452,7 +453,7 @@ static const struct bcm2835_codec_fmt su
363 .fourcc = V4L2_PIX_FMT_SBGGR12,
365 - .bytesperline_align = 32,
366 + .bytesperline_align = { 32, 32, 32, 32 },
368 .mmal_fmt = MMAL_ENCODING_BAYER_SBGGR12,
369 .size_multiplier_x2 = 2,
370 @@ -460,7 +461,7 @@ static const struct bcm2835_codec_fmt su
372 .fourcc = V4L2_PIX_FMT_SGRBG12,
374 - .bytesperline_align = 32,
375 + .bytesperline_align = { 32, 32, 32, 32 },
377 .mmal_fmt = MMAL_ENCODING_BAYER_SGRBG12,
378 .size_multiplier_x2 = 2,
379 @@ -468,7 +469,7 @@ static const struct bcm2835_codec_fmt su
381 .fourcc = V4L2_PIX_FMT_SGBRG12,
383 - .bytesperline_align = 32,
384 + .bytesperline_align = { 32, 32, 32, 32 },
386 .mmal_fmt = MMAL_ENCODING_BAYER_SGBRG12,
387 .size_multiplier_x2 = 2,
388 @@ -477,7 +478,7 @@ static const struct bcm2835_codec_fmt su
390 .fourcc = V4L2_PIX_FMT_SRGGB14,
392 - .bytesperline_align = 32,
393 + .bytesperline_align = { 32, 32, 32, 32 },
395 .mmal_fmt = MMAL_ENCODING_BAYER_SRGGB14,
396 .size_multiplier_x2 = 2,
397 @@ -485,7 +486,7 @@ static const struct bcm2835_codec_fmt su
399 .fourcc = V4L2_PIX_FMT_SBGGR14,
401 - .bytesperline_align = 32,
402 + .bytesperline_align = { 32, 32, 32, 32 },
404 .mmal_fmt = MMAL_ENCODING_BAYER_SBGGR14,
405 .size_multiplier_x2 = 2,
406 @@ -493,7 +494,7 @@ static const struct bcm2835_codec_fmt su
408 .fourcc = V4L2_PIX_FMT_SGRBG14,
410 - .bytesperline_align = 32,
411 + .bytesperline_align = { 32, 32, 32, 32 },
413 .mmal_fmt = MMAL_ENCODING_BAYER_SGRBG14,
414 .size_multiplier_x2 = 2,
415 @@ -501,7 +502,7 @@ static const struct bcm2835_codec_fmt su
417 .fourcc = V4L2_PIX_FMT_SGBRG14,
419 - .bytesperline_align = 32,
420 + .bytesperline_align = { 32, 32, 32, 32 },
422 .mmal_fmt = MMAL_ENCODING_BAYER_SGBRG14,
423 .size_multiplier_x2 = 2,
424 @@ -511,7 +512,7 @@ static const struct bcm2835_codec_fmt su
426 .fourcc = V4L2_PIX_FMT_GREY,
428 - .bytesperline_align = 32,
429 + .bytesperline_align = { 32, 32, 32, 32 },
431 .mmal_fmt = MMAL_ENCODING_GREY,
432 .size_multiplier_x2 = 2,
433 @@ -519,7 +520,7 @@ static const struct bcm2835_codec_fmt su
435 .fourcc = V4L2_PIX_FMT_Y10P,
437 - .bytesperline_align = 32,
438 + .bytesperline_align = { 32, 32, 32, 32 },
440 .mmal_fmt = MMAL_ENCODING_Y10P,
441 .size_multiplier_x2 = 2,
442 @@ -527,7 +528,7 @@ static const struct bcm2835_codec_fmt su
444 .fourcc = V4L2_PIX_FMT_Y12P,
446 - .bytesperline_align = 32,
447 + .bytesperline_align = { 32, 32, 32, 32 },
449 .mmal_fmt = MMAL_ENCODING_Y12P,
450 .size_multiplier_x2 = 2,
451 @@ -535,7 +536,7 @@ static const struct bcm2835_codec_fmt su
453 .fourcc = V4L2_PIX_FMT_Y14P,
455 - .bytesperline_align = 32,
456 + .bytesperline_align = { 32, 32, 32, 32 },
458 .mmal_fmt = MMAL_ENCODING_Y14P,
459 .size_multiplier_x2 = 2,
460 @@ -543,7 +544,7 @@ static const struct bcm2835_codec_fmt su
462 .fourcc = V4L2_PIX_FMT_Y16,
464 - .bytesperline_align = 32,
465 + .bytesperline_align = { 32, 32, 32, 32 },
467 .mmal_fmt = MMAL_ENCODING_Y16,
468 .size_multiplier_x2 = 2,
469 @@ -551,7 +552,7 @@ static const struct bcm2835_codec_fmt su
470 /* 10 bit as 16bpp */
471 .fourcc = V4L2_PIX_FMT_Y10,
473 - .bytesperline_align = 32,
474 + .bytesperline_align = { 32, 32, 32, 32 },
476 .mmal_fmt = MMAL_ENCODING_Y10,
477 .size_multiplier_x2 = 2,
478 @@ -559,7 +560,7 @@ static const struct bcm2835_codec_fmt su
479 /* 12 bit as 16bpp */
480 .fourcc = V4L2_PIX_FMT_Y12,
482 - .bytesperline_align = 32,
483 + .bytesperline_align = { 32, 32, 32, 32 },
485 .mmal_fmt = MMAL_ENCODING_Y12,
486 .size_multiplier_x2 = 2,
487 @@ -567,7 +568,7 @@ static const struct bcm2835_codec_fmt su
488 /* 14 bit as 16bpp */
489 .fourcc = V4L2_PIX_FMT_Y14,
491 - .bytesperline_align = 32,
492 + .bytesperline_align = { 32, 32, 32, 32 },
494 .mmal_fmt = MMAL_ENCODING_Y14,
495 .size_multiplier_x2 = 2,
496 @@ -840,9 +841,10 @@ static inline unsigned int get_sizeimage
499 static inline unsigned int get_bytesperline(int width,
500 - struct bcm2835_codec_fmt *fmt)
501 + struct bcm2835_codec_fmt *fmt,
502 + enum bcm2835_codec_role role)
504 - return ALIGN((width * fmt->depth) >> 3, fmt->bytesperline_align);
505 + return ALIGN((width * fmt->depth) >> 3, fmt->bytesperline_align[role]);
508 static void setup_mmal_port_format(struct bcm2835_codec_ctx *ctx,
509 @@ -1040,7 +1042,7 @@ static void handle_fmt_changed(struct bc
511 q_data->selection_set = true;
512 q_data->bytesperline = get_bytesperline(format->es.video.width,
514 + q_data->fmt, ctx->dev->role);
516 q_data->height = format->es.video.height;
517 q_data->sizeimage = format->buffer_size_min;
518 @@ -1422,11 +1424,13 @@ static int vidioc_try_fmt(struct bcm2835
519 f->fmt.pix_mp.height = ALIGN(f->fmt.pix_mp.height, 16);
521 f->fmt.pix_mp.num_planes = 1;
522 - min_bytesperline = get_bytesperline(f->fmt.pix_mp.width, fmt);
523 + min_bytesperline = get_bytesperline(f->fmt.pix_mp.width, fmt,
525 if (f->fmt.pix_mp.plane_fmt[0].bytesperline < min_bytesperline)
526 f->fmt.pix_mp.plane_fmt[0].bytesperline = min_bytesperline;
527 f->fmt.pix_mp.plane_fmt[0].bytesperline =
528 - ALIGN(f->fmt.pix_mp.plane_fmt[0].bytesperline, fmt->bytesperline_align);
529 + ALIGN(f->fmt.pix_mp.plane_fmt[0].bytesperline,
530 + fmt->bytesperline_align[ctx->dev->role]);
532 sizeimage = get_sizeimage(f->fmt.pix_mp.plane_fmt[0].bytesperline,
533 f->fmt.pix_mp.width, f->fmt.pix_mp.height,
534 @@ -1581,7 +1585,8 @@ static int vidioc_s_fmt(struct bcm2835_c
535 q_data_dst->height = ALIGN(q_data->crop_height, 16);
537 q_data_dst->bytesperline =
538 - get_bytesperline(f->fmt.pix_mp.width, q_data_dst->fmt);
539 + get_bytesperline(f->fmt.pix_mp.width, q_data_dst->fmt,
541 q_data_dst->sizeimage = get_sizeimage(q_data_dst->bytesperline,
542 q_data_dst->crop_width,
544 @@ -1810,6 +1815,8 @@ static int vidioc_g_selection(struct fil
553 @@ -1920,6 +1927,8 @@ static int vidioc_s_selection(struct fil
562 @@ -3087,7 +3096,8 @@ static int bcm2835_codec_open(struct fil
563 ctx->q_data[V4L2_M2M_SRC].height = DEFAULT_HEIGHT;
564 ctx->q_data[V4L2_M2M_SRC].bytesperline =
565 get_bytesperline(DEFAULT_WIDTH,
566 - ctx->q_data[V4L2_M2M_SRC].fmt);
567 + ctx->q_data[V4L2_M2M_SRC].fmt,
569 ctx->q_data[V4L2_M2M_SRC].sizeimage =
570 get_sizeimage(ctx->q_data[V4L2_M2M_SRC].bytesperline,
571 ctx->q_data[V4L2_M2M_SRC].crop_width,
572 @@ -3100,7 +3110,8 @@ static int bcm2835_codec_open(struct fil
573 ctx->q_data[V4L2_M2M_DST].height = DEFAULT_HEIGHT;
574 ctx->q_data[V4L2_M2M_DST].bytesperline =
575 get_bytesperline(DEFAULT_WIDTH,
576 - ctx->q_data[V4L2_M2M_DST].fmt);
577 + ctx->q_data[V4L2_M2M_DST].fmt,
579 ctx->q_data[V4L2_M2M_DST].sizeimage =
580 get_sizeimage(ctx->q_data[V4L2_M2M_DST].bytesperline,
581 ctx->q_data[V4L2_M2M_DST].crop_width,
582 @@ -3230,6 +3241,8 @@ static int bcm2835_codec_open(struct fil
583 v4l2_ctrl_handler_init(hdl, 0);
590 ctx->fh.m2m_ctx = v4l2_m2m_ctx_init(dev->m2m_dev, ctx, &queue_init);