diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-09-01 11:58:22 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-22 03:53:25 -0400 |
commit | dacdde78b39e49edf2f7af85be4b613978280b26 (patch) | |
tree | 78765a533ff3520c0145bcb9f35f0d5f5a4109ff /include/linux/v4l2-mediabus.h | |
parent | 076704332ca6da550cbc279918ef8b88b4ac1e45 (diff) |
[media] v4l: Group media bus pixel codes by types and sort them alphabetically
Adding new pixel codes at the end of the enumeration will soon create a
mess, so group the pixel codes by type and sort them by bus_width, bits
per component, samples per pixel and order of subsamples.
As the codes are part of the kernel ABI their value can't change when a
new code is inserted in the enumeration, so they are given an explicit
numerical value. When inserting a new pixel code developers must use and
update the next free value.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/linux/v4l2-mediabus.h')
-rw-r--r-- | include/linux/v4l2-mediabus.h | 77 |
1 files changed, 46 insertions, 31 deletions
diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h index dc1d5c0432d4..cccfa34bab1f 100644 --- a/include/linux/v4l2-mediabus.h +++ b/include/linux/v4l2-mediabus.h | |||
@@ -24,39 +24,54 @@ | |||
24 | * transferred first, "BE" means that the most significant bits are transferred | 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 | 25 | * first, and "PADHI" and "PADLO" define which bits - low or high, in the |
26 | * incomplete high byte, are filled with padding bits. | 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. | ||
27 | */ | 36 | */ |
28 | enum v4l2_mbus_pixelcode { | 37 | enum v4l2_mbus_pixelcode { |
29 | V4L2_MBUS_FMT_FIXED = 1, | 38 | V4L2_MBUS_FMT_FIXED = 0x0001, |
30 | V4L2_MBUS_FMT_YUYV8_2X8, | 39 | |
31 | V4L2_MBUS_FMT_YVYU8_2X8, | 40 | /* RGB - next is 0x1009 */ |
32 | V4L2_MBUS_FMT_UYVY8_2X8, | 41 | V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE = 0x1001, |
33 | V4L2_MBUS_FMT_VYUY8_2X8, | 42 | V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE = 0x1002, |
34 | V4L2_MBUS_FMT_YVYU10_2X10, | 43 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 0x1003, |
35 | V4L2_MBUS_FMT_YUYV10_2X10, | 44 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE = 0x1004, |
36 | V4L2_MBUS_FMT_YVYU10_1X20, | 45 | V4L2_MBUS_FMT_BGR565_2X8_BE = 0x1005, |
37 | V4L2_MBUS_FMT_YUYV10_1X20, | 46 | V4L2_MBUS_FMT_BGR565_2X8_LE = 0x1006, |
38 | V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE, | 47 | V4L2_MBUS_FMT_RGB565_2X8_BE = 0x1007, |
39 | V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE, | 48 | V4L2_MBUS_FMT_RGB565_2X8_LE = 0x1008, |
40 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, | 49 | |
41 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, | 50 | /* YUV (including grey) - next is 0x200f */ |
42 | V4L2_MBUS_FMT_RGB565_2X8_LE, | 51 | V4L2_MBUS_FMT_Y8_1X8 = 0x2001, |
43 | V4L2_MBUS_FMT_RGB565_2X8_BE, | 52 | V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002, |
44 | V4L2_MBUS_FMT_BGR565_2X8_LE, | 53 | V4L2_MBUS_FMT_VYUY8_1_5X8 = 0x2003, |
45 | V4L2_MBUS_FMT_BGR565_2X8_BE, | 54 | V4L2_MBUS_FMT_YUYV8_1_5X8 = 0x2004, |
46 | V4L2_MBUS_FMT_SBGGR8_1X8, | 55 | V4L2_MBUS_FMT_YVYU8_1_5X8 = 0x2005, |
47 | V4L2_MBUS_FMT_SBGGR10_1X10, | 56 | V4L2_MBUS_FMT_UYVY8_2X8 = 0x2006, |
48 | V4L2_MBUS_FMT_Y8_1X8, | 57 | V4L2_MBUS_FMT_VYUY8_2X8 = 0x2007, |
49 | V4L2_MBUS_FMT_Y10_1X10, | 58 | V4L2_MBUS_FMT_YUYV8_2X8 = 0x2008, |
50 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE, | 59 | V4L2_MBUS_FMT_YVYU8_2X8 = 0x2009, |
51 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE, | 60 | V4L2_MBUS_FMT_Y10_1X10 = 0x200a, |
52 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE, | 61 | V4L2_MBUS_FMT_YUYV10_2X10 = 0x200b, |
53 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE, | 62 | V4L2_MBUS_FMT_YVYU10_2X10 = 0x200c, |
54 | V4L2_MBUS_FMT_SGRBG8_1X8, | 63 | V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d, |
55 | V4L2_MBUS_FMT_SBGGR12_1X12, | 64 | V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e, |
56 | V4L2_MBUS_FMT_YUYV8_1_5X8, | 65 | |
57 | V4L2_MBUS_FMT_YVYU8_1_5X8, | 66 | /* Bayer - next is 0x3009 */ |
58 | V4L2_MBUS_FMT_UYVY8_1_5X8, | 67 | V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001, |
59 | V4L2_MBUS_FMT_VYUY8_1_5X8, | 68 | V4L2_MBUS_FMT_SGRBG8_1X8 = 0x3002, |
69 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE = 0x3003, | ||
70 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE = 0x3004, | ||
71 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE = 0x3005, | ||
72 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE = 0x3006, | ||
73 | V4L2_MBUS_FMT_SBGGR10_1X10 = 0x3007, | ||
74 | V4L2_MBUS_FMT_SBGGR12_1X12 = 0x3008, | ||
60 | }; | 75 | }; |
61 | 76 | ||
62 | /** | 77 | /** |