aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/soc_mediabus.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/media/soc_mediabus.h')
-rw-r--r--include/media/soc_mediabus.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h
index b338108ec305..fae432544b41 100644
--- a/include/media/soc_mediabus.h
+++ b/include/media/soc_mediabus.h
@@ -16,18 +16,24 @@
16 16
17/** 17/**
18 * enum soc_mbus_packing - data packing types on the media-bus 18 * enum soc_mbus_packing - data packing types on the media-bus
19 * @SOC_MBUS_PACKING_NONE: no packing, bit-for-bit transfer to RAM 19 * @SOC_MBUS_PACKING_NONE: no packing, bit-for-bit transfer to RAM, one
20 * sample represents one pixel
20 * @SOC_MBUS_PACKING_2X8_PADHI: 16 bits transferred in 2 8-bit samples, in the 21 * @SOC_MBUS_PACKING_2X8_PADHI: 16 bits transferred in 2 8-bit samples, in the
21 * possibly incomplete byte high bits are padding 22 * possibly incomplete byte high bits are padding
22 * @SOC_MBUS_PACKING_2X8_PADLO: as above, but low bits are padding 23 * @SOC_MBUS_PACKING_2X8_PADLO: as above, but low bits are padding
23 * @SOC_MBUS_PACKING_EXTEND16: sample width (e.g., 10 bits) has to be extended 24 * @SOC_MBUS_PACKING_EXTEND16: sample width (e.g., 10 bits) has to be extended
24 * to 16 bits 25 * to 16 bits
26 * @SOC_MBUS_PACKING_VARIABLE: compressed formats with variable packing
27 * @SOC_MBUS_PACKING_1_5X8: used for packed YUV 4:2:0 formats, where 4
28 * pixels occupy 6 bytes in RAM
25 */ 29 */
26enum soc_mbus_packing { 30enum soc_mbus_packing {
27 SOC_MBUS_PACKING_NONE, 31 SOC_MBUS_PACKING_NONE,
28 SOC_MBUS_PACKING_2X8_PADHI, 32 SOC_MBUS_PACKING_2X8_PADHI,
29 SOC_MBUS_PACKING_2X8_PADLO, 33 SOC_MBUS_PACKING_2X8_PADLO,
30 SOC_MBUS_PACKING_EXTEND16, 34 SOC_MBUS_PACKING_EXTEND16,
35 SOC_MBUS_PACKING_VARIABLE,
36 SOC_MBUS_PACKING_1_5X8,
31}; 37};
32 38
33/** 39/**
@@ -57,9 +63,24 @@ struct soc_mbus_pixelfmt {
57 u8 bits_per_sample; 63 u8 bits_per_sample;
58}; 64};
59 65
66/**
67 * struct soc_mbus_lookup - Lookup FOURCC IDs by mediabus codes for pass-through
68 * @code: mediabus pixel-code
69 * @fmt: pixel format description
70 */
71struct soc_mbus_lookup {
72 enum v4l2_mbus_pixelcode code;
73 struct soc_mbus_pixelfmt fmt;
74};
75
76const struct soc_mbus_pixelfmt *soc_mbus_find_fmtdesc(
77 enum v4l2_mbus_pixelcode code,
78 const struct soc_mbus_lookup *lookup,
79 int n);
60const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc( 80const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc(
61 enum v4l2_mbus_pixelcode code); 81 enum v4l2_mbus_pixelcode code);
62s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf); 82s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf);
63int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf); 83int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf,
84 unsigned int *numerator, unsigned int *denominator);
64 85
65#endif 86#endif