aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-11 14:49:23 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-11 14:49:23 -0500
commit2183a58803c2bbd87c2d0057eed6779ec4718d4d (patch)
tree910860a2f0c1f22efe840428f11077a5bd478933 /include/uapi/linux
parente28870f9b3e92cd3570925089c6bb789c2603bc4 (diff)
parent71947828caef0c83d4245f7d1eaddc799b4ff1d1 (diff)
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 ...
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/Kbuild1
-rw-r--r--include/uapi/linux/media-bus-format.h125
-rw-r--r--include/uapi/linux/v4l2-common.h2
-rw-r--r--include/uapi/linux/v4l2-mediabus.h219
-rw-r--r--include/uapi/linux/v4l2-subdev.h6
-rw-r--r--include/uapi/linux/videodev2.h101
6 files changed, 327 insertions, 127 deletions
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index 8523f9bb72f2..401c4c3ec285 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -243,6 +243,7 @@ header-y += map_to_7segment.h
243header-y += matroxfb.h 243header-y += matroxfb.h
244header-y += mdio.h 244header-y += mdio.h
245header-y += media.h 245header-y += media.h
246header-y += media-bus-format.h
246header-y += mei.h 247header-y += mei.h
247header-y += memfd.h 248header-y += memfd.h
248header-y += mempolicy.h 249header-y += mempolicy.h
diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h
new file mode 100644
index 000000000000..23b40908be30
--- /dev/null
+++ b/include/uapi/linux/media-bus-format.h
@@ -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 */
diff --git a/include/uapi/linux/v4l2-common.h b/include/uapi/linux/v4l2-common.h
index 2f6f8cafe773..15273987093e 100644
--- a/include/uapi/linux/v4l2-common.h
+++ b/include/uapi/linux/v4l2-common.h
@@ -43,6 +43,8 @@
43#define V4L2_SEL_TGT_CROP_DEFAULT 0x0001 43#define V4L2_SEL_TGT_CROP_DEFAULT 0x0001
44/* Cropping bounds */ 44/* Cropping bounds */
45#define V4L2_SEL_TGT_CROP_BOUNDS 0x0002 45#define V4L2_SEL_TGT_CROP_BOUNDS 0x0002
46/* Native frame size */
47#define V4L2_SEL_TGT_NATIVE_SIZE 0x0003
46/* Current composing area */ 48/* Current composing area */
47#define V4L2_SEL_TGT_COMPOSE 0x0100 49#define V4L2_SEL_TGT_COMPOSE 0x0100
48/* Default composing area */ 50/* Default composing area */
diff --git a/include/uapi/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h
index 1445e858854f..5a86d8ede09c 100644
--- a/include/uapi/linux/v4l2-mediabus.h
+++ b/include/uapi/linux/v4l2-mediabus.h
@@ -11,122 +11,10 @@
11#ifndef __LINUX_V4L2_MEDIABUS_H 11#ifndef __LINUX_V4L2_MEDIABUS_H
12#define __LINUX_V4L2_MEDIABUS_H 12#define __LINUX_V4L2_MEDIABUS_H
13 13
14#include <linux/media-bus-format.h>
14#include <linux/types.h> 15#include <linux/types.h>
15#include <linux/videodev2.h> 16#include <linux/videodev2.h>
16 17
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 */
37enum 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
130/** 18/**
131 * struct v4l2_mbus_framefmt - frame format on the media bus 19 * struct v4l2_mbus_framefmt - frame format on the media bus
132 * @width: frame width 20 * @width: frame width
@@ -134,6 +22,8 @@ enum v4l2_mbus_pixelcode {
134 * @code: data format code (from enum v4l2_mbus_pixelcode) 22 * @code: data format code (from enum v4l2_mbus_pixelcode)
135 * @field: used interlacing type (from enum v4l2_field) 23 * @field: used interlacing type (from enum v4l2_field)
136 * @colorspace: colorspace of the data (from enum v4l2_colorspace) 24 * @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)
137 */ 27 */
138struct v4l2_mbus_framefmt { 28struct v4l2_mbus_framefmt {
139 __u32 width; 29 __u32 width;
@@ -141,7 +31,108 @@ struct v4l2_mbus_framefmt {
141 __u32 code; 31 __u32 code;
142 __u32 field; 32 __u32 field;
143 __u32 colorspace; 33 __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
52enum 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),
145}; 135};
136#endif /* __KERNEL__ */
146 137
147#endif 138#endif
diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h
index a619cdd300ac..e0a7e3da498a 100644
--- a/include/uapi/linux/v4l2-subdev.h
+++ b/include/uapi/linux/v4l2-subdev.h
@@ -68,7 +68,7 @@ struct v4l2_subdev_crop {
68 * struct v4l2_subdev_mbus_code_enum - Media bus format enumeration 68 * struct v4l2_subdev_mbus_code_enum - Media bus format enumeration
69 * @pad: pad number, as reported by the media API 69 * @pad: pad number, as reported by the media API
70 * @index: format index during enumeration 70 * @index: format index during enumeration
71 * @code: format code (from enum v4l2_mbus_pixelcode) 71 * @code: format code (MEDIA_BUS_FMT_ definitions)
72 */ 72 */
73struct v4l2_subdev_mbus_code_enum { 73struct v4l2_subdev_mbus_code_enum {
74 __u32 pad; 74 __u32 pad;
@@ -81,7 +81,7 @@ struct v4l2_subdev_mbus_code_enum {
81 * struct v4l2_subdev_frame_size_enum - Media bus format enumeration 81 * struct v4l2_subdev_frame_size_enum - Media bus format enumeration
82 * @pad: pad number, as reported by the media API 82 * @pad: pad number, as reported by the media API
83 * @index: format index during enumeration 83 * @index: format index during enumeration
84 * @code: format code (from enum v4l2_mbus_pixelcode) 84 * @code: format code (MEDIA_BUS_FMT_ definitions)
85 */ 85 */
86struct v4l2_subdev_frame_size_enum { 86struct v4l2_subdev_frame_size_enum {
87 __u32 index; 87 __u32 index;
@@ -109,7 +109,7 @@ struct v4l2_subdev_frame_interval {
109 * struct v4l2_subdev_frame_interval_enum - Frame interval enumeration 109 * struct v4l2_subdev_frame_interval_enum - Frame interval enumeration
110 * @pad: pad number, as reported by the media API 110 * @pad: pad number, as reported by the media API
111 * @index: frame interval index during enumeration 111 * @index: frame interval index during enumeration
112 * @code: format code (from enum v4l2_mbus_pixelcode) 112 * @code: format code (MEDIA_BUS_FMT_ definitions)
113 * @width: frame width in pixels 113 * @width: frame width in pixels
114 * @height: frame height in pixels 114 * @height: frame height in pixels
115 * @interval: frame interval in seconds 115 * @interval: frame interval in seconds
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 1c2f84fd4d99..d279c1b75cf7 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -178,30 +178,103 @@ enum v4l2_memory {
178 178
179/* see also http://vektor.theorem.ca/graphics/ycbcr/ */ 179/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
180enum v4l2_colorspace { 180enum v4l2_colorspace {
181 /* ITU-R 601 -- broadcast NTSC/PAL */ 181 /* SMPTE 170M: used for broadcast NTSC/PAL SDTV */
182 V4L2_COLORSPACE_SMPTE170M = 1, 182 V4L2_COLORSPACE_SMPTE170M = 1,
183 183
184 /* 1125-Line (US) HDTV */ 184 /* Obsolete pre-1998 SMPTE 240M HDTV standard, superseded by Rec 709 */
185 V4L2_COLORSPACE_SMPTE240M = 2, 185 V4L2_COLORSPACE_SMPTE240M = 2,
186 186
187 /* HD and modern captures. */ 187 /* Rec.709: used for HDTV */
188 V4L2_COLORSPACE_REC709 = 3, 188 V4L2_COLORSPACE_REC709 = 3,
189 189
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 */
191 V4L2_COLORSPACE_BT878 = 4, 194 V4L2_COLORSPACE_BT878 = 4,
192 195
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 */
194 V4L2_COLORSPACE_470_SYSTEM_M = 5, 200 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 */
195 V4L2_COLORSPACE_470_SYSTEM_BG = 6, 207 V4L2_COLORSPACE_470_SYSTEM_BG = 6,
196 208
197 /* I know there will be cameras that send this. So, this is 209 /*
198 * unspecified chromaticities and full 0-255 on each of the 210 * Effectively shorthand for V4L2_COLORSPACE_SRGB, V4L2_YCBCR_ENC_601
199 * Y'CbCr components 211 * and V4L2_QUANTIZATION_FULL_RANGE. To be used for (Motion-)JPEG.
200 */ 212 */
201 V4L2_COLORSPACE_JPEG = 7, 213 V4L2_COLORSPACE_JPEG = 7,
202 214
203 /* For RGB colourspaces, this is probably a good start. */ 215 /* For RGB colorspaces such as produces by most webcams. */
204 V4L2_COLORSPACE_SRGB = 8, 216 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
225enum 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
269enum 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,
205}; 278};
206 279
207enum v4l2_priority { 280enum v4l2_priority {
@@ -294,6 +367,8 @@ struct v4l2_pix_format {
294 __u32 colorspace; /* enum v4l2_colorspace */ 367 __u32 colorspace; /* enum v4l2_colorspace */
295 __u32 priv; /* private data, depends on pixelformat */ 368 __u32 priv; /* private data, depends on pixelformat */
296 __u32 flags; /* format flags (V4L2_PIX_FMT_FLAG_*) */ 369 __u32 flags; /* format flags (V4L2_PIX_FMT_FLAG_*) */
370 __u32 ycbcr_enc; /* enum v4l2_ycbcr_encoding */
371 __u32 quantization; /* enum v4l2_quantization */
297}; 372};
298 373
299/* Pixel format FOURCC depth Description */ 374/* Pixel format FOURCC depth Description */
@@ -1249,6 +1324,7 @@ struct v4l2_input {
1249#define V4L2_IN_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ 1324#define V4L2_IN_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
1250#define V4L2_IN_CAP_CUSTOM_TIMINGS V4L2_IN_CAP_DV_TIMINGS /* For compatibility */ 1325#define V4L2_IN_CAP_CUSTOM_TIMINGS V4L2_IN_CAP_DV_TIMINGS /* For compatibility */
1251#define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */ 1326#define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */
1327#define V4L2_IN_CAP_NATIVE_SIZE 0x00000008 /* Supports setting native size */
1252 1328
1253/* 1329/*
1254 * V I D E O O U T P U T S 1330 * V I D E O O U T P U T S
@@ -1272,6 +1348,7 @@ struct v4l2_output {
1272#define V4L2_OUT_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ 1348#define V4L2_OUT_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
1273#define V4L2_OUT_CAP_CUSTOM_TIMINGS V4L2_OUT_CAP_DV_TIMINGS /* For compatibility */ 1349#define V4L2_OUT_CAP_CUSTOM_TIMINGS V4L2_OUT_CAP_DV_TIMINGS /* For compatibility */
1274#define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */ 1350#define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */
1351#define V4L2_OUT_CAP_NATIVE_SIZE 0x00000008 /* Supports setting native size */
1275 1352
1276/* 1353/*
1277 * C O N T R O L S 1354 * C O N T R O L S
@@ -1777,6 +1854,8 @@ struct v4l2_plane_pix_format {
1777 * @plane_fmt: per-plane information 1854 * @plane_fmt: per-plane information
1778 * @num_planes: number of planes for this format 1855 * @num_planes: number of planes for this format
1779 * @flags: format flags (V4L2_PIX_FMT_FLAG_*) 1856 * @flags: format flags (V4L2_PIX_FMT_FLAG_*)
1857 * @ycbcr_enc: enum v4l2_ycbcr_encoding, Y'CbCr encoding
1858 * @quantization: enum v4l2_quantization, colorspace quantization
1780 */ 1859 */
1781struct v4l2_pix_format_mplane { 1860struct v4l2_pix_format_mplane {
1782 __u32 width; 1861 __u32 width;
@@ -1788,7 +1867,9 @@ struct v4l2_pix_format_mplane {
1788 struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES]; 1867 struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES];
1789 __u8 num_planes; 1868 __u8 num_planes;
1790 __u8 flags; 1869 __u8 flags;
1791 __u8 reserved[10]; 1870 __u8 ycbcr_enc;
1871 __u8 quantization;
1872 __u8 reserved[8];
1792} __attribute__ ((packed)); 1873} __attribute__ ((packed));
1793 1874
1794/** 1875/**