849417f6ae471b6770ba444cbc4adc83a4fada9c
[openwrt/openwrt.git] /
1 From ef305037fd7423386d3a59b640114bdff67d824f Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 6 May 2020 18:11:14 +0100
4 Subject: [PATCH] staging: vc04_services: isp: Add monochrome image
5 formats
6
7 Adds support for monochrome image formats in the various
8 MIPI packings.
9
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
11 ---
12 .../bcm2835-isp/bcm2835_isp_fmts.h | 52 ++++++++++++++++++-
13 .../vc04_services/vchiq-mmal/mmal-encodings.h | 7 +++
14 2 files changed, 58 insertions(+), 1 deletion(-)
15
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 @@ -328,7 +328,57 @@ static const struct bcm2835_isp_fmt supp
19 .colorspace = V4L2_COLORSPACE_RAW,
20 .step_size = 2,
21 }, {
22 - /* ISP statistics format */
23 + /* Monochrome MIPI formats */
24 + /* 8 bit */
25 + .fourcc = V4L2_PIX_FMT_GREY,
26 + .depth = 8,
27 + .bytesperline_align = 32,
28 + .flags = 0,
29 + .mmal_fmt = MMAL_ENCODING_GREY,
30 + .size_multiplier_x2 = 2,
31 + .colorspace = V4L2_COLORSPACE_RAW,
32 + .step_size = 2,
33 + }, {
34 + /* 10 bit */
35 + .fourcc = V4L2_PIX_FMT_Y10P,
36 + .depth = 10,
37 + .bytesperline_align = 32,
38 + .flags = 0,
39 + .mmal_fmt = MMAL_ENCODING_Y10P,
40 + .size_multiplier_x2 = 2,
41 + .colorspace = V4L2_COLORSPACE_RAW,
42 + .step_size = 2,
43 + }, {
44 + /* 12 bit */
45 + .fourcc = V4L2_PIX_FMT_Y12P,
46 + .depth = 12,
47 + .bytesperline_align = 32,
48 + .flags = 0,
49 + .mmal_fmt = MMAL_ENCODING_Y12P,
50 + .size_multiplier_x2 = 2,
51 + .colorspace = V4L2_COLORSPACE_RAW,
52 + .step_size = 2,
53 + }, {
54 + /* 14 bit */
55 + .fourcc = V4L2_PIX_FMT_Y14P,
56 + .depth = 14,
57 + .bytesperline_align = 32,
58 + .flags = 0,
59 + .mmal_fmt = MMAL_ENCODING_Y14P,
60 + .size_multiplier_x2 = 2,
61 + .colorspace = V4L2_COLORSPACE_RAW,
62 + .step_size = 2,
63 + }, {
64 + /* 16 bit */
65 + .fourcc = V4L2_PIX_FMT_Y16,
66 + .depth = 16,
67 + .bytesperline_align = 32,
68 + .flags = 0,
69 + .mmal_fmt = MMAL_ENCODING_Y16,
70 + .size_multiplier_x2 = 2,
71 + .colorspace = V4L2_COLORSPACE_RAW,
72 + .step_size = 2,
73 + }, {
74 .fourcc = V4L2_META_FMT_BCM2835_ISP_STATS,
75 .mmal_fmt = MMAL_ENCODING_BRCM_STATS,
76 /* The rest are not valid fields for stats. */
77 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-encodings.h
78 +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-encodings.h
79 @@ -102,6 +102,13 @@
80 #define MMAL_ENCODING_BAYER_SGRBG16 MMAL_FOURCC('G', 'R', '1', '6')
81 #define MMAL_ENCODING_BAYER_SRGGB16 MMAL_FOURCC('R', 'G', '1', '6')
82
83 +/* MIPI packed monochrome images */
84 +#define MMAL_ENCODING_GREY MMAL_FOURCC('G', 'R', 'E', 'Y')
85 +#define MMAL_ENCODING_Y10P MMAL_FOURCC('Y', '1', '0', 'P')
86 +#define MMAL_ENCODING_Y12P MMAL_FOURCC('Y', '1', '2', 'P')
87 +#define MMAL_ENCODING_Y14P MMAL_FOURCC('Y', '1', '4', 'P')
88 +#define MMAL_ENCODING_Y16 MMAL_FOURCC('Y', '1', '6', ' ')
89 +
90 /** An EGL image handle
91 */
92 #define MMAL_ENCODING_EGL_IMAGE MMAL_FOURCC('E', 'G', 'L', 'I')