History

Merge tag 'media/v3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media updates from Mauro Carvalho Chehab: - Two new dvb frontend drivers: mn88472 and mn88473 - A new driver for some PCIe DVBSky cards - A new remote controller driver: meson-ir - One LIRC staging driver got rewritten and promoted to mainstream: igorplugusb - A new tuner driver (m88rs6000t) - The old omap2 media driver got removed from staging. This driver uses an old DMA API and it is likely broken on recent kernels. Nobody cared enough to fix it - Media bus format moved to a separate header, as DRM will also use the definitions there - mem2mem_testdev were renamed to vim2m, in order to use the same naming convention taken by the other virtual test driver (vivid) - Added a new driver for coda SoC (coda-jpeg) - The cx88 driver got converted to use videobuf2 core - Make DMABUF export buffer to work with DMA Scatter/Gather and Vmalloc cores - Lots of other fixes, improvements and cleanups on the drivers. * tag 'media/v3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (384 commits) [media] mn88473: One function call less in mn88473_init() after error [media] mn88473: Remove uneeded check before release_firmware() [media] lirc_zilog: Deletion of unnecessary checks before vfree() [media] MAINTAINERS: Add myself as img-ir maintainer [media] img-ir: Don't set driver's module owner [media] img-ir: Depend on METAG or MIPS or COMPILE_TEST [media] img-ir/hw: Drop [un]register_decoder declarations [media] img-ir/hw: Fix potential deadlock stopping timer [media] img-ir/hw: Always read data to clear buffer [media] redrat3: ensure dma is setup properly [media] ddbridge: remove unneeded check before dvb_unregister_device() [media] si2157: One function call less in si2157_init() after error [media] tuners: remove uneeded checks before release_firmware() [media] arm: omap2: rx51-peripherals: fix build warning [media] stv090x: add an extra protetion against buffer overflow [media] stv090x: Remove an unreachable code [media] stv090x: Some whitespace cleanups [media] em28xx: checkpatch cleanup: whitespaces/new lines cleanups [media] si2168: add support for firmware files in new format [media] si2168: debug printout for firmware version ...

Linus Torvalds committed 11 years ago

Commit 2183a582 parents e28870f 7194782416 files · +16517 −13239Browse files

Showing the changes to include/uapi/linux (6 of 416 files). Show all

Unified · Split

6 files
  1. include/uapi/linux/Kbuild +1 −0
  2. include/uapi/linux/media-bus-format.h +125 −0
  3. include/uapi/linux/v4l2-common.h +2 −0
  4. include/uapi/linux/v4l2-mediabus.h +105 −114
  5. include/uapi/linux/v4l2-subdev.h +3 −3
  6. include/uapi/linux/videodev2.h +91 −10
include/uapi/linux/Kbuild+1−0
@@ -243,6 +243,7 @@ header-y += map_to_7segment.h · 242 unmodified lines
243243 header-y += matroxfb.h
244244 header-y += mdio.h
245245 header-y += media.h
246+header-y += media-bus-format.h
246247 header-y += mei.h
247248 header-y += memfd.h
248249 header-y += mempolicy.h
include/uapi/linux/media-bus-format.h+125−0
@@ -0,0 +1,125 @@
1+/*
2+ * Media Bus API header
3+ *
4+ * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
5+ *
6+ * This program is free software; you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License version 2 as
8+ * published by the Free Software Foundation.
9+ */
10+
11+#ifndef __LINUX_MEDIA_BUS_FORMAT_H
12+#define __LINUX_MEDIA_BUS_FORMAT_H
13+
14+/*
15+ * These bus formats uniquely identify data formats on the data bus. Format 0
16+ * is reserved, MEDIA_BUS_FMT_FIXED shall be used by host-client pairs, where
17+ * the data format is fixed. Additionally, "2X8" means that one pixel is
18+ * transferred in two 8-bit samples, "BE" or "LE" specify in which order those
19+ * samples are transferred over the bus: "LE" means that the least significant
20+ * bits are transferred first, "BE" means that the most significant bits are
21+ * transferred first, and "PADHI" and "PADLO" define which bits - low or high,
22+ * in the incomplete high byte, are filled with padding bits.
23+ *
24+ * The bus formats are grouped by type, bus_width, bits per component, samples
25+ * per pixel and order of subsamples. Numerical values are sorted using generic
26+ * numerical sort order (8 thus comes before 10).
27+ *
28+ * As their value can't change when a new bus format is inserted in the
29+ * enumeration, the bus formats are explicitly given a numerical value. The next
30+ * free values for each category are listed below, update them when inserting
31+ * new pixel codes.
32+ */
33+
34+#define MEDIA_BUS_FMT_FIXED 0x0001
35+
36+/* RGB - next is 0x100e */
37+#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001
38+#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002
39+#define MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE 0x1003
40+#define MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE 0x1004
41+#define MEDIA_BUS_FMT_BGR565_2X8_BE 0x1005
42+#define MEDIA_BUS_FMT_BGR565_2X8_LE 0x1006
43+#define MEDIA_BUS_FMT_RGB565_2X8_BE 0x1007
44+#define MEDIA_BUS_FMT_RGB565_2X8_LE 0x1008
45+#define MEDIA_BUS_FMT_RGB666_1X18 0x1009
46+#define MEDIA_BUS_FMT_RGB888_1X24 0x100a
47+#define MEDIA_BUS_FMT_RGB888_2X12_BE 0x100b
48+#define MEDIA_BUS_FMT_RGB888_2X12_LE 0x100c
49+#define MEDIA_BUS_FMT_ARGB8888_1X32 0x100d
50+
51+/* YUV (including grey) - next is 0x2024 */
52+#define MEDIA_BUS_FMT_Y8_1X8 0x2001
53+#define MEDIA_BUS_FMT_UV8_1X8 0x2015
54+#define MEDIA_BUS_FMT_UYVY8_1_5X8 0x2002
55+#define MEDIA_BUS_FMT_VYUY8_1_5X8 0x2003
56+#define MEDIA_BUS_FMT_YUYV8_1_5X8 0x2004
57+#define MEDIA_BUS_FMT_YVYU8_1_5X8 0x2005
58+#define MEDIA_BUS_FMT_UYVY8_2X8 0x2006
59+#define MEDIA_BUS_FMT_VYUY8_2X8 0x2007
60+#define MEDIA_BUS_FMT_YUYV8_2X8 0x2008
61+#define MEDIA_BUS_FMT_YVYU8_2X8 0x2009
62+#define MEDIA_BUS_FMT_Y10_1X10 0x200a
63+#define MEDIA_BUS_FMT_UYVY10_2X10 0x2018
64+#define MEDIA_BUS_FMT_VYUY10_2X10 0x2019
65+#define MEDIA_BUS_FMT_YUYV10_2X10 0x200b
66+#define MEDIA_BUS_FMT_YVYU10_2X10 0x200c
67+#define MEDIA_BUS_FMT_Y12_1X12 0x2013
68+#define MEDIA_BUS_FMT_UYVY8_1X16 0x200f
69+#define MEDIA_BUS_FMT_VYUY8_1X16 0x2010
70+#define MEDIA_BUS_FMT_YUYV8_1X16 0x2011
71+#define MEDIA_BUS_FMT_YVYU8_1X16 0x2012
72+#define MEDIA_BUS_FMT_YDYUYDYV8_1X16 0x2014
73+#define MEDIA_BUS_FMT_UYVY10_1X20 0x201a
74+#define MEDIA_BUS_FMT_VYUY10_1X20 0x201b
75+#define MEDIA_BUS_FMT_YUYV10_1X20 0x200d
76+#define MEDIA_BUS_FMT_YVYU10_1X20 0x200e
77+#define MEDIA_BUS_FMT_YUV10_1X30 0x2016
78+#define MEDIA_BUS_FMT_AYUV8_1X32 0x2017
79+#define MEDIA_BUS_FMT_UYVY12_2X12 0x201c
80+#define MEDIA_BUS_FMT_VYUY12_2X12 0x201d
81+#define MEDIA_BUS_FMT_YUYV12_2X12 0x201e
82+#define MEDIA_BUS_FMT_YVYU12_2X12 0x201f
83+#define MEDIA_BUS_FMT_UYVY12_1X24 0x2020
84+#define MEDIA_BUS_FMT_VYUY12_1X24 0x2021
85+#define MEDIA_BUS_FMT_YUYV12_1X24 0x2022
86+#define MEDIA_BUS_FMT_YVYU12_1X24 0x2023
87+
88+/* Bayer - next is 0x3019 */
89+#define MEDIA_BUS_FMT_SBGGR8_1X8 0x3001
90+#define MEDIA_BUS_FMT_SGBRG8_1X8 0x3013
91+#define MEDIA_BUS_FMT_SGRBG8_1X8 0x3002
92+#define MEDIA_BUS_FMT_SRGGB8_1X8 0x3014
93+#define MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8 0x3015
94+#define MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8 0x3016
95+#define MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8 0x3017
96+#define MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8 0x3018
97+#define MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8 0x300b
98+#define MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8 0x300c
99+#define MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8 0x3009
100+#define MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8 0x300d
101+#define MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE 0x3003
102+#define MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE 0x3004
103+#define MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE 0x3005
104+#define MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE 0x3006
105+#define MEDIA_BUS_FMT_SBGGR10_1X10 0x3007
106+#define MEDIA_BUS_FMT_SGBRG10_1X10 0x300e
107+#define MEDIA_BUS_FMT_SGRBG10_1X10 0x300a
108+#define MEDIA_BUS_FMT_SRGGB10_1X10 0x300f
109+#define MEDIA_BUS_FMT_SBGGR12_1X12 0x3008
110+#define MEDIA_BUS_FMT_SGBRG12_1X12 0x3010
111+#define MEDIA_BUS_FMT_SGRBG12_1X12 0x3011
112+#define MEDIA_BUS_FMT_SRGGB12_1X12 0x3012
113+
114+/* JPEG compressed formats - next is 0x4002 */
115+#define MEDIA_BUS_FMT_JPEG_1X8 0x4001
116+
117+/* Vendor specific formats - next is 0x5002 */
118+
119+/* S5C73M3 sensor specific interleaved UYVY and JPEG */
120+#define MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8 0x5001
121+
122+/* HSV - next is 0x6002 */
123+#define MEDIA_BUS_FMT_AHSV8888_1X32 0x6001
124+
125+#endif /* __LINUX_MEDIA_BUS_FORMAT_H */
include/uapi/linux/v4l2-common.h+2−0
@@ -43,6 +43,8 @@ · 42 unmodified lines
4343 #define V4L2_SEL_TGT_CROP_DEFAULT 0x0001
4444 /* Cropping bounds */
4545 #define V4L2_SEL_TGT_CROP_BOUNDS 0x0002
46+/* Native frame size */
47+#define V4L2_SEL_TGT_NATIVE_SIZE 0x0003
4648 /* Current composing area */
4749 #define V4L2_SEL_TGT_COMPOSE 0x0100
4850 /* Default composing area */
include/uapi/linux/v4l2-mediabus.h+105−114
@@ -11,122 +11,10 @@ · 10 unmodified lines
1111 #ifndef __LINUX_V4L2_MEDIABUS_H
1212 #define __LINUX_V4L2_MEDIABUS_H
1313
14+#include <linux/media-bus-format.h>
1415 #include <linux/types.h>
1516 #include <linux/videodev2.h>
1617
17−/*
18− * These pixel codes uniquely identify data formats on the media bus. Mostly
19− * they correspond to similarly named V4L2_PIX_FMT_* formats, format 0 is
20− * reserved, V4L2_MBUS_FMT_FIXED shall be used by host-client pairs, where the
21− * data format is fixed. Additionally, "2X8" means that one pixel is transferred
22− * in two 8-bit samples, "BE" or "LE" specify in which order those samples are
23− * transferred over the bus: "LE" means that the least significant bits are
24− * transferred first, "BE" means that the most significant bits are transferred
25− * first, and "PADHI" and "PADLO" define which bits - low or high, in the
26− * incomplete high byte, are filled with padding bits.
27− *
28− * The pixel codes are grouped by type, bus_width, bits per component, samples
29− * per pixel and order of subsamples. Numerical values are sorted using generic
30− * numerical sort order (8 thus comes before 10).
31− *
32− * As their value can't change when a new pixel code is inserted in the
33− * enumeration, the pixel codes are explicitly given a numerical value. The next
34− * free values for each category are listed below, update them when inserting
35− * new pixel codes.
36− */
37−enum v4l2_mbus_pixelcode {
38− V4L2_MBUS_FMT_FIXED = 0x0001,
39−
40− /* RGB - next is 0x100e */
41− V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE = 0x1001,
42− V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE = 0x1002,
43− V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 0x1003,
44− V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE = 0x1004,
45− V4L2_MBUS_FMT_BGR565_2X8_BE = 0x1005,
46− V4L2_MBUS_FMT_BGR565_2X8_LE = 0x1006,
47− V4L2_MBUS_FMT_RGB565_2X8_BE = 0x1007,
48− V4L2_MBUS_FMT_RGB565_2X8_LE = 0x1008,
49− V4L2_MBUS_FMT_RGB666_1X18 = 0x1009,
50− V4L2_MBUS_FMT_RGB888_1X24 = 0x100a,
51− V4L2_MBUS_FMT_RGB888_2X12_BE = 0x100b,
52− V4L2_MBUS_FMT_RGB888_2X12_LE = 0x100c,
53− V4L2_MBUS_FMT_ARGB8888_1X32 = 0x100d,
54−
55− /* YUV (including grey) - next is 0x2024 */
56− V4L2_MBUS_FMT_Y8_1X8 = 0x2001,
57− V4L2_MBUS_FMT_UV8_1X8 = 0x2015,
58− V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002,
59− V4L2_MBUS_FMT_VYUY8_1_5X8 = 0x2003,
60− V4L2_MBUS_FMT_YUYV8_1_5X8 = 0x2004,
61− V4L2_MBUS_FMT_YVYU8_1_5X8 = 0x2005,
62− V4L2_MBUS_FMT_UYVY8_2X8 = 0x2006,
63− V4L2_MBUS_FMT_VYUY8_2X8 = 0x2007,
64− V4L2_MBUS_FMT_YUYV8_2X8 = 0x2008,
65− V4L2_MBUS_FMT_YVYU8_2X8 = 0x2009,
66− V4L2_MBUS_FMT_Y10_1X10 = 0x200a,
67− V4L2_MBUS_FMT_UYVY10_2X10 = 0x2018,
68− V4L2_MBUS_FMT_VYUY10_2X10 = 0x2019,
69− V4L2_MBUS_FMT_YUYV10_2X10 = 0x200b,
70− V4L2_MBUS_FMT_YVYU10_2X10 = 0x200c,
71− V4L2_MBUS_FMT_Y12_1X12 = 0x2013,
72− V4L2_MBUS_FMT_UYVY8_1X16 = 0x200f,
73− V4L2_MBUS_FMT_VYUY8_1X16 = 0x2010,
74− V4L2_MBUS_FMT_YUYV8_1X16 = 0x2011,
75− V4L2_MBUS_FMT_YVYU8_1X16 = 0x2012,
76− V4L2_MBUS_FMT_YDYUYDYV8_1X16 = 0x2014,
77− V4L2_MBUS_FMT_UYVY10_1X20 = 0x201a,
78− V4L2_MBUS_FMT_VYUY10_1X20 = 0x201b,
79− V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d,
80− V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e,
81− V4L2_MBUS_FMT_YUV10_1X30 = 0x2016,
82− V4L2_MBUS_FMT_AYUV8_1X32 = 0x2017,
83− V4L2_MBUS_FMT_UYVY12_2X12 = 0x201c,
84− V4L2_MBUS_FMT_VYUY12_2X12 = 0x201d,
85− V4L2_MBUS_FMT_YUYV12_2X12 = 0x201e,
86− V4L2_MBUS_FMT_YVYU12_2X12 = 0x201f,
87− V4L2_MBUS_FMT_UYVY12_1X24 = 0x2020,
88− V4L2_MBUS_FMT_VYUY12_1X24 = 0x2021,
89− V4L2_MBUS_FMT_YUYV12_1X24 = 0x2022,
90− V4L2_MBUS_FMT_YVYU12_1X24 = 0x2023,
91−
92− /* Bayer - next is 0x3019 */
93− V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001,
94− V4L2_MBUS_FMT_SGBRG8_1X8 = 0x3013,
95− V4L2_MBUS_FMT_SGRBG8_1X8 = 0x3002,
96− V4L2_MBUS_FMT_SRGGB8_1X8 = 0x3014,
97− V4L2_MBUS_FMT_SBGGR10_ALAW8_1X8 = 0x3015,
98− V4L2_MBUS_FMT_SGBRG10_ALAW8_1X8 = 0x3016,
99− V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8 = 0x3017,
100− V4L2_MBUS_FMT_SRGGB10_ALAW8_1X8 = 0x3018,
101− V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8 = 0x300b,
102− V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8 = 0x300c,
103− V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8 = 0x3009,
104− V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8 = 0x300d,
105− V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE = 0x3003,
106− V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE = 0x3004,
107− V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE = 0x3005,
108− V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE = 0x3006,
109− V4L2_MBUS_FMT_SBGGR10_1X10 = 0x3007,
110− V4L2_MBUS_FMT_SGBRG10_1X10 = 0x300e,
111− V4L2_MBUS_FMT_SGRBG10_1X10 = 0x300a,
112− V4L2_MBUS_FMT_SRGGB10_1X10 = 0x300f,
113− V4L2_MBUS_FMT_SBGGR12_1X12 = 0x3008,
114− V4L2_MBUS_FMT_SGBRG12_1X12 = 0x3010,
115− V4L2_MBUS_FMT_SGRBG12_1X12 = 0x3011,
116− V4L2_MBUS_FMT_SRGGB12_1X12 = 0x3012,
117−
118− /* JPEG compressed formats - next is 0x4002 */
119− V4L2_MBUS_FMT_JPEG_1X8 = 0x4001,
120−
121− /* Vendor specific formats - next is 0x5002 */
122−
123− /* S5C73M3 sensor specific interleaved UYVY and JPEG */
124− V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8 = 0x5001,
125−
126− /* HSV - next is 0x6002 */
127− V4L2_MBUS_FMT_AHSV8888_1X32 = 0x6001,
128−};
129−
13018 /**
13119 * struct v4l2_mbus_framefmt - frame format on the media bus
13220 * @width: frame width
@@ -134,6 +22,8 @@ enum v4l2_mbus_pixelcode { · 1 unmodified line
13422 * @code: data format code (from enum v4l2_mbus_pixelcode)
13523 * @field: used interlacing type (from enum v4l2_field)
13624 * @colorspace: colorspace of the data (from enum v4l2_colorspace)
25+ * @ycbcr_enc: YCbCr encoding of the data (from enum v4l2_ycbcr_encoding)
26+ * @quantization: quantization of the data (from enum v4l2_quantization)
13727 */
13828 struct v4l2_mbus_framefmt {
13929 __u32 width;
@@ -141,7 +31,108 @@ struct v4l2_mbus_framefmt { · 1 unmodified line
14131 __u32 code;
14232 __u32 field;
14333 __u32 colorspace;
144− __u32 reserved[7];
34+ __u32 ycbcr_enc;
35+ __u32 quantization;
36+ __u32 reserved[5];
37+};
38+
39+#ifndef __KERNEL__
40+/*
41+ * enum v4l2_mbus_pixelcode and its definitions are now deprecated, and
42+ * MEDIA_BUS_FMT_ definitions (defined in media-bus-format.h) should be
43+ * used instead.
44+ *
45+ * New defines should only be added to media-bus-format.h. The
46+ * v4l2_mbus_pixelcode enum is frozen.
47+ */
48+
49+#define V4L2_MBUS_FROM_MEDIA_BUS_FMT(name) \
50+ V4L2_MBUS_FMT_ ## name = MEDIA_BUS_FMT_ ## name
51+
52+enum v4l2_mbus_pixelcode {
53+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(FIXED),
54+
55+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB444_2X8_PADHI_BE),
56+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB444_2X8_PADHI_LE),
57+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB555_2X8_PADHI_BE),
58+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB555_2X8_PADHI_LE),
59+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(BGR565_2X8_BE),
60+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(BGR565_2X8_LE),
61+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB565_2X8_BE),
62+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB565_2X8_LE),
63+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB666_1X18),
64+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB888_1X24),
65+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB888_2X12_BE),
66+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB888_2X12_LE),
67+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(ARGB8888_1X32),
68+
69+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(Y8_1X8),
70+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(UV8_1X8),
71+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY8_1_5X8),
72+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY8_1_5X8),
73+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV8_1_5X8),
74+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU8_1_5X8),
75+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY8_2X8),
76+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY8_2X8),
77+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV8_2X8),
78+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU8_2X8),
79+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(Y10_1X10),
80+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY10_2X10),
81+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY10_2X10),
82+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV10_2X10),
83+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU10_2X10),
84+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(Y12_1X12),
85+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY8_1X16),
86+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY8_1X16),
87+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV8_1X16),
88+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU8_1X16),
89+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(YDYUYDYV8_1X16),
90+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY10_1X20),
91+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY10_1X20),
92+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV10_1X20),
93+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU10_1X20),
94+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUV10_1X30),
95+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(AYUV8_1X32),
96+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY12_2X12),
97+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY12_2X12),
98+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV12_2X12),
99+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU12_2X12),
100+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY12_1X24),
101+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY12_1X24),
102+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV12_1X24),
103+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU12_1X24),
104+
105+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR8_1X8),
106+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGBRG8_1X8),
107+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGRBG8_1X8),
108+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SRGGB8_1X8),
109+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_ALAW8_1X8),
110+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGBRG10_ALAW8_1X8),
111+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGRBG10_ALAW8_1X8),
112+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SRGGB10_ALAW8_1X8),
113+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_DPCM8_1X8),
114+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGBRG10_DPCM8_1X8),
115+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGRBG10_DPCM8_1X8),
116+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SRGGB10_DPCM8_1X8),
117+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_2X8_PADHI_BE),
118+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_2X8_PADHI_LE),
119+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_2X8_PADLO_BE),
120+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_2X8_PADLO_LE),
121+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_1X10),
122+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGBRG10_1X10),
123+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGRBG10_1X10),
124+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SRGGB10_1X10),
125+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR12_1X12),
126+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGBRG12_1X12),
127+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGRBG12_1X12),
128+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(SRGGB12_1X12),
129+
130+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(JPEG_1X8),
131+
132+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(S5C_UYVY_JPEG_1X8),
133+
134+ V4L2_MBUS_FROM_MEDIA_BUS_FMT(AHSV8888_1X32),
145135 };
136+#endif /* __KERNEL__ */
146137
147138 #endif
include/uapi/linux/v4l2-subdev.h+3−3
@@ -68,7 +68,7 @@ struct v4l2_subdev_crop { · 67 unmodified lines
6868 * struct v4l2_subdev_mbus_code_enum - Media bus format enumeration
6969 * @pad: pad number, as reported by the media API
7070 * @index: format index during enumeration
71− * @code: format code (from enum v4l2_mbus_pixelcode)
71+ * @code: format code (MEDIA_BUS_FMT_ definitions)
7272 */
7373 struct v4l2_subdev_mbus_code_enum {
7474 __u32 pad;
@@ -81,7 +81,7 @@ struct v4l2_subdev_mbus_code_enum { · 6 unmodified lines
8181 * struct v4l2_subdev_frame_size_enum - Media bus format enumeration
8282 * @pad: pad number, as reported by the media API
8383 * @index: format index during enumeration
84− * @code: format code (from enum v4l2_mbus_pixelcode)
84+ * @code: format code (MEDIA_BUS_FMT_ definitions)
8585 */
8686 struct v4l2_subdev_frame_size_enum {
8787 __u32 index;
@@ -109,7 +109,7 @@ struct v4l2_subdev_frame_interval { · 21 unmodified lines
109109 * struct v4l2_subdev_frame_interval_enum - Frame interval enumeration
110110 * @pad: pad number, as reported by the media API
111111 * @index: frame interval index during enumeration
112− * @code: format code (from enum v4l2_mbus_pixelcode)
112+ * @code: format code (MEDIA_BUS_FMT_ definitions)
113113 * @width: frame width in pixels
114114 * @height: frame height in pixels
115115 * @interval: frame interval in seconds
include/uapi/linux/videodev2.h+91−10
@@ -178,30 +178,103 @@ enum v4l2_memory { · 177 unmodified lines
178178
179179 /* see also http://vektor.theorem.ca/graphics/ycbcr/ */
180180 enum v4l2_colorspace {
181− /* ITU-R 601 -- broadcast NTSC/PAL */
181+ /* SMPTE 170M: used for broadcast NTSC/PAL SDTV */
182182 V4L2_COLORSPACE_SMPTE170M = 1,
183183
184− /* 1125-Line (US) HDTV */
184+ /* Obsolete pre-1998 SMPTE 240M HDTV standard, superseded by Rec 709 */
185185 V4L2_COLORSPACE_SMPTE240M = 2,
186186
187− /* HD and modern captures. */
187+ /* Rec.709: used for HDTV */
188188 V4L2_COLORSPACE_REC709 = 3,
189189
190− /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
190+ /*
191+ * Deprecated, do not use. No driver will ever return this. This was
192+ * based on a misunderstanding of the bt878 datasheet.
193+ */
191194 V4L2_COLORSPACE_BT878 = 4,
192195
193− /* These should be useful. Assume 601 extents. */
196+ /*
197+ * NTSC 1953 colorspace. This only makes sense when dealing with
198+ * really, really old NTSC recordings. Superseded by SMPTE 170M.
199+ */
194200 V4L2_COLORSPACE_470_SYSTEM_M = 5,
201+
202+ /*
203+ * EBU Tech 3213 PAL/SECAM colorspace. This only makes sense when
204+ * dealing with really old PAL/SECAM recordings. Superseded by
205+ * SMPTE 170M.
206+ */
195207 V4L2_COLORSPACE_470_SYSTEM_BG = 6,
196208
197− /* I know there will be cameras that send this. So, this is
198− * unspecified chromaticities and full 0-255 on each of the
199− * Y'CbCr components
209+ /*
210+ * Effectively shorthand for V4L2_COLORSPACE_SRGB, V4L2_YCBCR_ENC_601
211+ * and V4L2_QUANTIZATION_FULL_RANGE. To be used for (Motion-)JPEG.
200212 */
201213 V4L2_COLORSPACE_JPEG = 7,
202214
203− /* For RGB colourspaces, this is probably a good start. */
215+ /* For RGB colorspaces such as produces by most webcams. */
204216 V4L2_COLORSPACE_SRGB = 8,
217+
218+ /* AdobeRGB colorspace */
219+ V4L2_COLORSPACE_ADOBERGB = 9,
220+
221+ /* BT.2020 colorspace, used for UHDTV. */
222+ V4L2_COLORSPACE_BT2020 = 10,
223+};
224+
225+enum v4l2_ycbcr_encoding {
226+ /*
227+ * Mapping of V4L2_YCBCR_ENC_DEFAULT to actual encodings for the
228+ * various colorspaces:
229+ *
230+ * V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_470_SYSTEM_M,
231+ * V4L2_COLORSPACE_470_SYSTEM_BG, V4L2_COLORSPACE_ADOBERGB and
232+ * V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601
233+ *
234+ * V4L2_COLORSPACE_REC709: V4L2_YCBCR_ENC_709
235+ *
236+ * V4L2_COLORSPACE_SRGB: V4L2_YCBCR_ENC_SYCC
237+ *
238+ * V4L2_COLORSPACE_BT2020: V4L2_YCBCR_ENC_BT2020
239+ *
240+ * V4L2_COLORSPACE_SMPTE240M: V4L2_YCBCR_ENC_SMPTE240M
241+ */
242+ V4L2_YCBCR_ENC_DEFAULT = 0,
243+
244+ /* ITU-R 601 -- SDTV */
245+ V4L2_YCBCR_ENC_601 = 1,
246+
247+ /* Rec. 709 -- HDTV */
248+ V4L2_YCBCR_ENC_709 = 2,
249+
250+ /* ITU-R 601/EN 61966-2-4 Extended Gamut -- SDTV */
251+ V4L2_YCBCR_ENC_XV601 = 3,
252+
253+ /* Rec. 709/EN 61966-2-4 Extended Gamut -- HDTV */
254+ V4L2_YCBCR_ENC_XV709 = 4,
255+
256+ /* sYCC (Y'CbCr encoding of sRGB) */
257+ V4L2_YCBCR_ENC_SYCC = 5,
258+
259+ /* BT.2020 Non-constant Luminance Y'CbCr */
260+ V4L2_YCBCR_ENC_BT2020 = 6,
261+
262+ /* BT.2020 Constant Luminance Y'CbcCrc */
263+ V4L2_YCBCR_ENC_BT2020_CONST_LUM = 7,
264+
265+ /* SMPTE 240M -- Obsolete HDTV */
266+ V4L2_YCBCR_ENC_SMPTE240M = 8,
267+};
268+
269+enum v4l2_quantization {
270+ /*
271+ * The default for R'G'B' quantization is always full range. For
272+ * Y'CbCr the quantization is always limited range, except for
273+ * SYCC, XV601, XV709 or JPEG: those are full range.
274+ */
275+ V4L2_QUANTIZATION_DEFAULT = 0,
276+ V4L2_QUANTIZATION_FULL_RANGE = 1,
277+ V4L2_QUANTIZATION_LIM_RANGE = 2,
205278 };
206279
207280 enum v4l2_priority {
@@ -294,6 +367,8 @@ struct v4l2_pix_format { · 86 unmodified lines
294367 __u32 colorspace; /* enum v4l2_colorspace */
295368 __u32 priv; /* private data, depends on pixelformat */
296369 __u32 flags; /* format flags (V4L2_PIX_FMT_FLAG_*) */
370+ __u32 ycbcr_enc; /* enum v4l2_ycbcr_encoding */
371+ __u32 quantization; /* enum v4l2_quantization */
297372 };
298373
299374 /* Pixel format FOURCC depth Description */
@@ -1249,6 +1324,7 @@ struct v4l2_input { · 949 unmodified lines
12491324 #define V4L2_IN_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
12501325 #define V4L2_IN_CAP_CUSTOM_TIMINGS V4L2_IN_CAP_DV_TIMINGS /* For compatibility */
12511326 #define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */
1327+#define V4L2_IN_CAP_NATIVE_SIZE 0x00000008 /* Supports setting native size */
12521328
12531329 /*
12541330 * V I D E O O U T P U T S
@@ -1272,6 +1348,7 @@ struct v4l2_output { · 17 unmodified lines
12721348 #define V4L2_OUT_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
12731349 #define V4L2_OUT_CAP_CUSTOM_TIMINGS V4L2_OUT_CAP_DV_TIMINGS /* For compatibility */
12741350 #define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */
1351+#define V4L2_OUT_CAP_NATIVE_SIZE 0x00000008 /* Supports setting native size */
12751352
12761353 /*
12771354 * C O N T R O L S
@@ -1777,6 +1854,8 @@ struct v4l2_plane_pix_format { · 499 unmodified lines
17771854 * @plane_fmt: per-plane information
17781855 * @num_planes: number of planes for this format
17791856 * @flags: format flags (V4L2_PIX_FMT_FLAG_*)
1857+ * @ycbcr_enc: enum v4l2_ycbcr_encoding, Y'CbCr encoding
1858+ * @quantization: enum v4l2_quantization, colorspace quantization
17801859 */
17811860 struct v4l2_pix_format_mplane {
17821861 __u32 width;
@@ -1788,7 +1867,9 @@ struct v4l2_pix_format_mplane { · 5 unmodified lines
17881867 struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES];
17891868 __u8 num_planes;
17901869 __u8 flags;
1791− __u8 reserved[10];
1870+ __u8 ycbcr_enc;
1871+ __u8 quantization;
1872+ __u8 reserved[8];
17921873 } __attribute__ ((packed));
17931874
17941875 /**