1/*
2Copyright (c) 2012, Broadcom Europe Ltd
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are met:
7 * Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9 * Redistributions in binary form must reproduce the above copyright
10 notice, this list of conditions and the following disclaimer in the
11 documentation and/or other materials provided with the distribution.
12 * Neither the name of the copyright holder nor the
13 names of its contributors may be used to endorse or promote products
14 derived from this software without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*/
27
28/*
29 * HDMI common host header for TV service, defines resolution code which host applications should
30 * use for power up command for HDMI
31 */
32
33#ifndef _VC_HDMI_H_
34#define _VC_HDMI_H_
35
36#include "vc_hdmi_property.h" /**< All HDMI related properties have been moved to here */
37
38typedef int VC_HDMI_BOOL_T;
39
40/**
41 * HDMI resolution groups. There are two main groups:
42 * CEA - the conventional HDMI ones like 720p
43 * DMT - computer monitor resolutions like XGA
44 */
45typedef enum {
46 HDMI_RES_GROUP_INVALID = 0, /**< Initialised value */
47 HDMI_RES_GROUP_CEA = 1, /**< CEA - HDMI device */
48 HDMI_RES_GROUP_DMT = 2, /**< DMT - computer monitors */
49 HDMI_RES_GROUP_CEA_3D = 3, /* deprecated */
50 HDMI_RES_GROUP_CUSTOM = 4, /**< Custom timings from the client */
51
52} HDMI_RES_GROUP_T;
53
54#define HDMI_RES_GROUP_NAME(g) \
55 (((g) == HDMI_RES_GROUP_INVALID) ? "Invalid" : \
56 (((g) == HDMI_RES_GROUP_CEA) ? "CEA" : \
57 (((g) == HDMI_RES_GROUP_DMT) ? "DMT" : \
58 (((g) == HDMI_RES_GROUP_CUSTOM) ? "Custom" : \
59 "Unknown"))))
60
61/**
62 * CEA 861 defined video code and aspect ratios for various HDMI modes
63 * Not all values are valid for AVI infoframe
64 */
65typedef enum {
66 HDMI_ASPECT_UNKNOWN = 0, /**< Unknown aspect ratio, or not one of the values below */
67 HDMI_ASPECT_4_3 = 1, /**< 4:3 */
68 HDMI_ASPECT_14_9 = 2, /**< 14:9 */
69 HDMI_ASPECT_16_9 = 3, /**< 16:9 */
70 HDMI_ASPECT_5_4 = 4, /**< 5:4 */
71 HDMI_ASPECT_16_10 = 5, /**< 16:10*/
72 HDMI_ASPECT_15_9 = 6, /**< 15:9 */
73 HDMI_ASPECT_64_27 = 7, /**< 64:27 */
74 HDMI_ASPECT_21_9 = HDMI_ASPECT_64_27, /**< 21:9 is jargon, 64:27 is the actual aspect ratio */
75 HDMI_ASPECT_256_135 = 8, /**< 256:135 */
76 /* More aspect ratio values may be added here if defined by CEA in future */
77} HDMI_ASPECT_T;
78
79/**
80 * Display options set the bounding box (only used in CEA mode)
81 */
82typedef struct {
83 uint16_t aspect; /**<HDMI_ASPECT_T */
84 /** Active area information - meanings as in CEA-861. */
85 uint16_t vertical_bar_present; /**<VC_HDMI_BOOL_T */
86 uint16_t left_bar_width;
87 uint16_t right_bar_width;
88 uint16_t horizontal_bar_present; /**<VC_HDMI_BOOL_T */
89 uint16_t top_bar_height;
90 uint16_t bottom_bar_height;
91 /** S0/S1 flags as defined in CEA-861. */
92 uint8_t overscan_flags;
93} HDMI_DISPLAY_OPTIONS_T;
94
95/**
96 * HDMI internal state (with some of the properties related to current display signal)
97 * Also see SDTV_DISPLAY_STATE_T in vc_sdtv.h, members up to scan_mode will be in the
98 * same position as the equivalent state in SDTV_DISPLAY_STATE_T;
99 */
100typedef struct {
101 uint32_t state;
102 uint32_t width;
103 uint32_t height;
104 uint16_t frame_rate;
105 uint16_t scan_mode;
106 uint32_t group; /**<HDMI_RES_GROUP_T */
107 uint32_t mode; /* This is the mode number of the format */
108 uint16_t pixel_rep; /* Pixel repetition factor, only relevant for CEA formats */
109 uint16_t aspect_ratio; /* This is the format's native aspect ratio */
110 HDMI_DISPLAY_OPTIONS_T display_options; /* This has the aspect ratio sent in AVI infoframe */
111 uint16_t pixel_encoding;
112 uint16_t format_3d; /* 3D format, only relevant for CEA formats */
113} HDMI_DISPLAY_STATE_T;
114
115/**
116 * Copy protection for HDMI, only HDCP is available
117 * This enum is to make it consistent with the enums
118 * SDTV_CP_MODE_T in vc_sdtv.h
119 */
120typedef enum {
121 HDMI_CP_NONE = 0, /**< No copyprotection */
122 HDMI_CP_HDCP = 1 /**< HDCP 1.x */
123} HDMI_CP_MODE_T;
124
125/**
126 * HDMI operation modes
127 */
128typedef enum {
129 HDMI_MODE_OFF, /**< Off! */
130 HDMI_MODE_DVI, /**< DVI */
131 HDMI_MODE_HDMI, /**< HDMI */
132 HDMI_MODE_3D /**< HDMI 1.4a 3D */
133} HDMI_MODE_T;
134
135/**
136 * Possible values for the Source Product Description type code (in SPD infoframe).
137 * Taken from the CEA-861 spec.
138 */
139typedef enum {
140 HDMI_SPD_TYPE_UNKNOWN,
141 HDMI_SPD_TYPE_STB, /**<Digital STB */
142 HDMI_SPD_TYPE_DVD, /**<DVD player */
143 HDMI_SPD_TYPE_DVHS, /**<D-VHS */
144 HDMI_SPD_TYPE_HDD_RECORDER, /**<HDD video recoder */
145 HDMI_SPD_TYPE_DVC, /**<DVC */
146 HDMI_SPD_TYPE_DSC, /**<DSC */
147 HDMI_SPD_TYPE_VCD, /**<Video CD */
148 HDMI_SPD_TYPE_GAME, /**<Game */
149 HDMI_SPD_TYPE_PC, /**<PC general */
150 HDMI_SPD_TYPE_BD, /**<Blu-Ray Disc */
151 HDMI_SPD_TYPE_SACD, /**<Super Audio CD */
152 HDMI_SPD_TYPE_HDDVD, /**<HD DVD */
153 HDMI_SPD_TYPE_PMP /**<Personal media player */
154} HDMI_SPD_TYPE_CODE_T;
155
156/**
157 * Structure for SPD infoframe
158 */
159typedef struct {
160 char *manufacturer; /**< Manufacture name (up to 8 characters) */
161 char *description; /**< Product name (up to 16 characters) */
162 HDMI_SPD_TYPE_CODE_T type; /**< Product type */
163} HDMI_SPD_DATA_T;
164
165/**
166 * These are CEA mode numbers (sent in AVI infoframe) for different resolutions as define in CEA-861
167 * 1080i at 100/120Hz (40,46) are supported by HDMI H/W but note we cannot
168 * display the debug overlay under these modes.
169 * Some modes have two codes, the first one has aspect ratio 4:3 and
170 * the second one (with "H" suffix") 16:9.
171 * The modes with "4x", etc. are the same the corresponding "non-multiplied" modes
172 * but clocked at a higher pixel clock.
173 */
174typedef enum {
175 HDMI_CEA_VGA = 1,
176 HDMI_CEA_480p60 = 2,
177 HDMI_CEA_480p60H = 3,
178 HDMI_CEA_720p60 = 4,
179 HDMI_CEA_1080i60 = 5,
180 HDMI_CEA_480i60 = 6,
181 HDMI_CEA_480i60H = 7,
182 HDMI_CEA_240p60 = 8,
183 HDMI_CEA_240p60H = 9,
184 HDMI_CEA_480i60_4x = 10,
185 HDMI_CEA_480i60_4xH = 11,
186 HDMI_CEA_240p60_4x = 12,
187 HDMI_CEA_240p60_4xH = 13,
188 HDMI_CEA_480p60_2x = 14,
189 HDMI_CEA_480p60_2xH = 15,
190 HDMI_CEA_1080p60 = 16,
191 HDMI_CEA_576p50 = 17,
192 HDMI_CEA_576p50H = 18,
193 HDMI_CEA_720p50 = 19,
194 HDMI_CEA_1080i50 = 20,
195 HDMI_CEA_576i50 = 21,
196 HDMI_CEA_576i50H = 22,
197 HDMI_CEA_288p50 = 23,
198 HDMI_CEA_288p50H = 24,
199 HDMI_CEA_576i50_4x = 25,
200 HDMI_CEA_576i50_4xH = 26,
201 HDMI_CEA_288p50_4x = 27,
202 HDMI_CEA_288p50_4xH = 28,
203 HDMI_CEA_576p50_2x = 29,
204 HDMI_CEA_576p50_2xH = 30,
205 HDMI_CEA_1080p50 = 31,
206 HDMI_CEA_1080p24 = 32,
207 HDMI_CEA_1080p25 = 33,
208 HDMI_CEA_1080p30 = 34,
209 HDMI_CEA_480p60_4x = 35,
210 HDMI_CEA_480p60_4xH = 36,
211 HDMI_CEA_576p50_4x = 37,
212 HDMI_CEA_576p50_4xH = 38,
213 HDMI_CEA_1080i50_rb = 39,
214 HDMI_CEA_1080i100 = 40,
215 HDMI_CEA_720p100 = 41,
216 HDMI_CEA_576p100 = 42,
217 HDMI_CEA_576p100H = 43,
218 HDMI_CEA_576i100 = 44,
219 HDMI_CEA_576i100H = 45,
220 HDMI_CEA_1080i120 = 46,
221 HDMI_CEA_720p120 = 47,
222 HDMI_CEA_480p120 = 48,
223 HDMI_CEA_480p120H = 49,
224 HDMI_CEA_480i120 = 50,
225 HDMI_CEA_480i120H = 51,
226 HDMI_CEA_576p200 = 52,
227 HDMI_CEA_576p200H = 53,
228 HDMI_CEA_576i200 = 54,
229 HDMI_CEA_576i200H = 55,
230 HDMI_CEA_480p240 = 56,
231 HDMI_CEA_480p240H = 57,
232 HDMI_CEA_480i240 = 58,
233 HDMI_CEA_480i240H = 59,
234 HDMI_CEA_720p24 = 60,
235 HDMI_CEA_720p25 = 61,
236 HDMI_CEA_720p30 = 62,
237 HDMI_CEA_1080p120 = 63,
238 HDMI_CEA_1080p100 = 64,
239
240 /* Up-to-date as of CEA 861-E */
241
242 HDMI_CEA_OFF = 0xff /**<Special code to shutdown HDMI */
243
244} HDMI_CEA_RES_CODE_T;
245
246/**
247 * These are the DMT modes from VESA. They are used for powering up
248 * HDMI in DMT resolutions and are not sent in AVI infoframes.
249 * Enum is ordered as ascending order of DMT id.
250 * All reduced blanking formats are 60Hz unless stated otherwise.
251 */
252typedef enum {
253 HDMI_DMT_640x350_85 = 0x1, /**<640x350 */
254 HDMI_DMT_640x400_85 = 0x2, /**<640x400 */
255 HDMI_DMT_IBM_VGA_85 = 0x3, /**<720x400 */
256 HDMI_DMT_VGA_60 = 0x4, /**<640x480 (60Hz is same as VGA above) */
257 HDMI_DMT_VGA_72 = 0x5,
258 HDMI_DMT_VGA_75 = 0x6,
259 HDMI_DMT_VGA_85 = 0x7,
260 HDMI_DMT_SVGA_56 = 0x8, /**<800x600 */
261 HDMI_DMT_SVGA_60 = 0x9,
262 HDMI_DMT_SVGA_72 = 0xA,
263 HDMI_DMT_SVGA_75 = 0xB,
264 HDMI_DMT_SVGA_85 = 0xC,
265 HDMI_DMT_SVGA_120 = 0xD,
266 HDMI_DMT_848x480_60 = 0xE, /**<848x480 */
267 HDMI_DMT_XGA_43 = 0xF, /**<1024x768 - interlaced, DO NOT USE */
268 HDMI_DMT_XGA_60 = 0x10, /**<1024x768 */
269 HDMI_DMT_XGA_70 = 0x11,
270 HDMI_DMT_XGA_75 = 0x12,
271 HDMI_DMT_XGA_85 = 0x13,
272 HDMI_DMT_XGA_120 = 0x14,
273 HDMI_DMT_XGAP_75 = 0x15, /**<1152x864 */
274 HDMI_DMT_WXGA_RB = 0x16, /**<1280x768 reduced blanking */
275 HDMI_DMT_WXGA_60 = 0x17,
276 HDMI_DMT_WXGA_75 = 0x18,
277 HDMI_DMT_WXGA_85 = 0x19,
278 HDMI_DMT_WXGA_120 = 0x1A, /**<120Hz with reduced blanking */
279 HDMI_DMT_1280x800_RB = 0x1B, /**<1280x800 reduced blanking */
280 HDMI_DMT_1280x800_60 = 0x1C,
281 HDMI_DMT_1280x800_75 = 0x1D,
282 HDMI_DMT_1280x800_85 = 0x1E,
283 HDMI_DMT_1280x800_120 = 0x1F, /** reduced blanking */
284 HDMI_DMT_1280x960_60 = 0x20, /**<1280x960 */
285 HDMI_DMT_1280x960_85 = 0x21,
286 HDMI_DMT_1280x960_120 = 0x22, /** reduced blanking */
287 HDMI_DMT_SXGA_60 = 0x23, /**<1280x1024 */
288 HDMI_DMT_SXGA_75 = 0x24,
289 HDMI_DMT_SXGA_85 = 0x25,
290 HDMI_DMT_SXGA_120 = 0x26, /** reduced blanking */
291 HDMI_DMT_1360x768_60 = 0x27, /**<1360x768 */
292 HDMI_DMT_1360x768_120 = 0x28, /**<120 Hz with reduced blanking */
293 HDMI_DMT_SXGAP_RB = 0x29, /**<1400x1050 reduced blanking */
294 HDMI_DMT_SXGAP_60 = 0x2A,
295 HDMI_DMT_SXGAP_75 = 0x2B,
296 HDMI_DMT_SXGAP_85 = 0x2C,
297 HDMI_DMT_SXGAP_120 = 0x2D, /** reduced blanking */
298 HDMI_DMT_1440x900_RB = 0x2E, /**<1440x900 reduced blanking */
299 HDMI_DMT_1440x900_60 = 0x2F,
300 HDMI_DMT_1440x900_75 = 0x30,
301 HDMI_DMT_1440x900_85 = 0x31,
302 HDMI_DMT_1440x900_120 = 0x32, /** reduced blanking */
303 HDMI_DMT_UXGA_60 = 0x33, /**<1600x1200 60Hz */
304 HDMI_DMT_UXGA_65 = 0x34,
305 HDMI_DMT_UXGA_70 = 0x35,
306 HDMI_DMT_UXGA_75 = 0x36,
307 HDMI_DMT_UXGA_85 = 0x37,
308 HDMI_DMT_UXGA_120 = 0x38, /** reduced blanking */
309 HDMI_DMT_SWXGAP_RB = 0x39, /**<1680x1050 reduced blanking */
310 HDMI_DMT_SWXGAP_60 = 0x3A, /**<1680x1050 60Hz */
311 HDMI_DMT_SWXGAP_75 = 0x3B,
312 HDMI_DMT_SWXGAP_85 = 0x3C,
313 HDMI_DMT_SWXGAP_120 = 0x3D, /** reduced blanking */
314 HDMI_DMT_1792x1344_60 = 0x3E, /**<1792x1344 60Hz */
315 HDMI_DMT_1792x1344_75 = 0x3F, /**<1792x1344 75Hz */
316 HDMI_DMT_1792x1344_120 = 0x40, /** reduced blanking */
317 HDMI_DMT_1856x1392_60 = 0x41, /**<1856x1392 60Hz */
318 HDMI_DMT_1856x1392_75 = 0x42, /**<1856x1392 75Hz */
319 HDMI_DMT_1856x1392_120 = 0x43, /** reduced blanking */
320 HDMI_DMT_WUXGA_RB = 0x44, /**<1920x1200 reduced blanking */
321 HDMI_DMT_WUXGA_60 = 0x45, /**<1920x1200 60Hz */
322 HDMI_DMT_WUXGA_75 = 0x46, /**<1920x1200 75Hz */
323 HDMI_DMT_WUXGA_85 = 0x47, /**<1920x1200 85Hz */
324 HDMI_DMT_WUXGA_120 = 0x48, /** reduced blanking */
325 HDMI_DMT_1920x1440_60 = 0x49, /**<1920x1440 60Hz */
326 HDMI_DMT_1920x1440_75 = 0x4A, /**<1920x1440 75Hz */
327 HDMI_DMT_1920x1440_120 = 0x4B, /** reduced blanking */
328 HDMI_DMT_2560x1600_RB = 0x4C, /**<2560x1600 reduced blanking */
329 HDMI_DMT_2560x1600_60 = 0x4D, /**<2560x1600 60 Hz */
330 HDMI_DMT_2560x1600_75 = 0x4E, /**<2560x1600 75 Hz */
331 HDMI_DMT_2560x1600_85 = 0x4E, /**<2560x1600 85 Hz */
332 HDMI_DMT_2560x1600_120 = 0x50, /** reduced blanking */
333 HDMI_DMT_1366x768_60 = 0x51, /**<1366x768 60Hz */
334 HDMI_DMT_1080p_60 = 0x52, /**<Same as 1080p60 above */
335 HDMI_DMT_1600x900_RB = 0x53, /**<1600x900 reduced blanking */
336 HDMI_DMT_2048x1152_RB = 0x54, /**<2048x1152 reduced blanking */
337 HDMI_DMT_720p_60 = 0x55, /**<Same as 720p60 above */
338 HDMI_DMT_1366x768_RB = 0x56, /**<1366x768 reduced blanking */
339 /* Up-to-date as of VESA DMT v1 r12 */
340
341 HDMI_DMT_OFF = 0xff
342} HDMI_DMT_RES_CODE_T;
343
344/**
345 * HDMI scanmode
346 */
347typedef enum {
348 HDMI_NONINTERLACED,
349 HDMI_INTERLACED
350} HDMI_INTERLACED_T;
351
352/**
353 * Preference for powering up HDMI using best mode
354 * Note we will only use CEA modes for matching
355 */
356typedef enum {
357 HDMI_MODE_MATCH_NONE = 0x0, /**<No mode*/
358 HDMI_MODE_MATCH_FRAMERATE = 0x1, /**<Match based on frame rate */
359 HDMI_MODE_MATCH_RESOLUTION = 0x2, /**<Match based on resolution */
360 HDMI_MODE_MATCH_SCANMODE = 0x4 /**<Match based on scan mode */
361} EDID_MODE_MATCH_FLAG_T;
362
363/**
364 * Audio support flags
365 */
366typedef enum {
367 EDID_AUDIO_NO_SUPPORT = (1 << 0), /**<No support for that format */
368 EDID_AUDIO_CHAN_UNSUPPORTED = (1 << 1), /**<max. no. of channels exceeded */
369 EDID_AUDIO_FS_UNSUPPORTED = (1 << 2), /**<no support for that sampling frequency */
370 EDID_AUDIO_BR_UNSUPPORTED = (1 << 3), /**<max. bitrate exceeded */
371 EDID_AUDIO_SAMP_UNSUPPORTED = (1 << 4), /**sample size unsupported (pcm only) */
372} EDID_AUDIO_SUPPORT_FLAG_T;
373
374/**
375 * Enums for audio support in audio descriptor block (CEA only)
376 * audio formats as specified in CEA Short Audio Descriptors
377 */
378typedef enum {
379 EDID_AudioFormat_eReserved, /**<Refer to header when set in audio info frame */
380 EDID_AudioFormat_ePCM, /**<Plain old PCM, mandatory for any audio support */
381 EDID_AudioFormat_eAC3, /**<AC3 */
382 EDID_AudioFormat_eMPEG1, /**<Mpeg layer 1 and 2 */
383 EDID_AudioFormat_eMP3, /**<Mpeg layer 3 */
384 EDID_AudioFormat_eMPEG2, /**<Mpeg 2 audio */
385 EDID_AudioFormat_eAAC, /**<AAC */
386 EDID_AudioFormat_eDTS, /**<DTS */
387 EDID_AudioFormat_eATRAC, /**<Sony proprietary */
388 EDID_AudioFormat_eDSD, /**<Super Audio CD 1-bit audio */
389 EDID_AudioFormat_eEAC3, /**<Dolby Digital + */
390 EDID_AudioFormat_eDTS_HD, /**<DTS-HD */
391 EDID_AudioFormat_eMLP, /**<Meridian Lossless Packing - for DVD audio */
392 EDID_AudioFormat_eDST, /**<Direct stream transfer - compressed super audio CD */
393 EDID_AudioFormat_eWMAPRO, /**<WMA Pro */
394 EDID_AudioFormat_eExtended, /**<Refer to byte 3 of audio db for coding extension type */
395
396 EDID_AudioFormat_eMaxCount
397} EDID_AudioFormat;
398
399/**
400 * If audio format is set to EDID_AudioFormat_eExtended,
401 * this gives the extended audio type (see CEA-861E section 6.6.1)
402 */
403typedef enum {
404 EDID_AudioCodingExtension_NONE = 0x0, /** no extension, for audio format != Extended */
405 EDID_AudioCodingExtension_HEAAC = 0x1, /**<HE-AAC */
406 EDID_AudioCodingExtension_HEAAC2 = 0x2, /**<HE-AAC v2 */
407 EDID_AudioCodingExtension_MPEGSUR = 0x3, /**<MPEG Surround */
408
409 EDID_AudioCodingExtension_max
410} EDID_AudioCodingExtension;
411
412/**
413 * Audio sample rates as specified in CEA Short Audio Descriptors
414 */
415typedef enum {
416 EDID_AudioSampleRate_eReferToHeader = 0x0, /**<Only used in audio infoframe */
417 EDID_AudioSampleRate_e32KHz = (1 << 0), /**<32 kHz (mandatory) */
418 EDID_AudioSampleRate_e44KHz = (1 << 1), /**<44.1 kHz (mandatory) */
419 EDID_AudioSampleRate_e48KHz = (1 << 2), /**<48kHz (mandatory) */
420 EDID_AudioSampleRate_e88KHz = (1 << 3), /**<88.2 kHz */
421 EDID_AudioSampleRate_e96KHz = (1 << 4), /**<96kHz */
422 EDID_AudioSampleRate_e176KHz = (1 << 5), /**<176.4 kHz */
423 EDID_AudioSampleRate_e192KHz = (1 << 6) /**<192 kHz */
424} EDID_AudioSampleRate;
425
426/**
427 * Audio sample sizes (L-PCM) as specified in CEA Short Audio Descriptors
428 */
429typedef enum {
430 EDID_AudioSampleSize_refertoheader = 0x0, /**<Only used in audio infoframe */
431 EDID_AudioSampleSize_16bit = 0x1, /**<16-bit samples (mandatory) */
432 EDID_AudioSampleSize_20bit = 0x2, /**<20-bit samples */
433 EDID_AudioSampleSize_24bit = 0x4 /**<24-bit samples */
434} EDID_AudioSampleSize;
435
436/**
437 * LFE feedback level as described in audio db
438 */
439typedef enum {
440 EDID_AudioLFEFB_UNKNOWN = 0x0, /**<Refer to other information */
441 EDID_AudioLFEFB_0dB = 0x1, /**<0dB - same level as other channels */
442 EDID_AudioLFEFB_10dB = 0x2 /**<+10dB relative to other channels */
443} EDID_AudioLFEFB;
444
445/**
446 * All possible 3D structures
447 * to be used in decoded 3D modes (e.g. HDMI_3D_SUPPORTED_MODE)
448 */
449typedef enum {
450 HDMI_3D_STRUCT_NONE = 0,
451 HDMI_3D_STRUCT_FRAME_PACKING = (1<<0),
452 HDMI_3D_STRUCT_FIELD_ALTERNATIVE = (1<<1),
453 HDMI_3D_STRUCT_LINE_ALTERNATIVE = (1<<2),
454 HDMI_3D_STRUCT_SIDE_BY_SIDE_FULL = (1<<3),
455 HDMI_3D_STRUCT_L_DEPTH = (1<<4),
456 HDMI_3D_STRUCT_L_DEPTH_GRAPHICS_GRAPHICS_DEPTH = (1<<5),
457 HDMI_3D_STRUCT_TOP_AND_BOTTOM = (1<<6),
458 HDMI_3D_STRUCT_SIDE_BY_SIDE_HALF_HORIZONTAL = (1<<7),
459 HDMI_3D_STRUCT_SIDE_BY_SIDE_HALF_ODD_LEFT_ODD_RIGHT = (1<<8),
460 HDMI_3D_STRUCT_SIDE_BY_SIDE_HALF_ODD_LEFT_EVEN_RIGHT = (1<<9),
461 HDMI_3D_STRUCT_SIDE_BY_SIDE_HALF_EVEN_LEFT_ODD_RIGHT = (1<<10),
462 HDMI_3D_STRUCT_SIDE_BY_SIDE_HALF_EVEN_LEFT_EVEN_RIGHT = (1<<11),
463 HDMI_3D_STRUCT_FRAME_SEQUENTIAL = (1<<12),
464} HDMI_3D_STRUCT_T;
465
466/**
467 * HDMI notifications (defined as a bit mask to be conveniently returned as a state),
468 * make sure this does not clash with the values in vc_sdtv.h
469 * SDTV notifications start at bit 16.
470 * These values are returned by the TV service in a callback.
471 */
472typedef enum {
473 VC_HDMI_UNPLUGGED = (1 << 0), /**<HDMI cable is detached */
474 VC_HDMI_ATTACHED = (1 << 1), /**<HDMI cable is attached but not powered on */
475 VC_HDMI_DVI = (1 << 2), /**<HDMI is on but in DVI mode (no audio) */
476 VC_HDMI_HDMI = (1 << 3), /**<HDMI is on and HDMI mode is active */
477 VC_HDMI_HDCP_UNAUTH = (1 << 4), /**<HDCP authentication is broken (e.g. Ri mismatched) or not active */
478 VC_HDMI_HDCP_AUTH = (1 << 5), /**<HDCP is active */
479 VC_HDMI_HDCP_KEY_DOWNLOAD = (1 << 6), /**<HDCP key download successful/fail */
480 VC_HDMI_HDCP_SRM_DOWNLOAD = (1 << 7), /**<HDCP revocation list download successful/fail */
481 VC_HDMI_CHANGING_MODE = (1 << 8), /**<HDMI is starting to change mode, clock has not yet been set */
482
483} VC_HDMI_NOTIFY_T;
484#define VC_HDMI_STANDBY (VC_HDMI_ATTACHED) /* For backward code compatibility */
485
486/**
487 * Callback reason and arguments from HDMI middleware
488 * Each callback comes with two optional uint32_t parameters.
489 * Reason param1 param2 remark
490 * VC_HDMI_UNPLUGGED - - cable is unplugged
491 * VC_HDMI_STANDBY CEA/DMT mode code cable is plugged in and peripheral powered off (preferred mode sent back if available)
492 * VC_HDMI_DVI CEA/DMT mode code DVI mode is active at said resolution
493 * VC_HDMI_HDMI CEA(3D)/DMT mode code HDMI mode is active at said resolution (in 3D mode if CEA3D)
494 * VC_HDMI_HDCP_UNAUTH HDCP_ERROR_T retry? HDCP is inactive, the error can be none if we actively disable HDCP, if retry is non-zero, HDCP will attempt to reauthenticate
495 * VC_HDMI_HDCP_AUTH - - HDCP is active
496 * VC_HDMI_HDCP_KEY_DOWNLOAD success? - HDCP key download success (zero) or not (non zero)
497 * VC_HDMI_HDCP_SRM_DOWNLOAD no. of keys - HDCP revocation list download set no. of keys (zero means failure)
498 * VC_HDMI_CHANGING_MODE 0 0 No information is supplied in this callback
499 */
500
501/* Some constants which are required on host side */
502#define HDCP_KEY_BLOCK_SIZE 328 /* KSV, padding, device keys and hash. */
503#define HDCP_KSV_LENGTH 5
504#define HDCP_MAX_DEVICE 127 /* Max. number of HDCP downstream device supported */
505#define HDCP_MAX_DEPTH 7 /* Max. number of levels HDCP 1.x can have */
506#define EDID_BLOCKSIZE 128
507#define HDMI_NUM_PACKET_BYTES 28 /* Size of HDMI infoframes minus the header */
508#define HDMI_MAX_EXPLICIT_3D_MODES 31 /* The number of explicit 3D modes is stored in 5 bits */
509#define EDID_MONITOR_DESC_SIZE 18 /* Size of detailed timing descriptor in EDID */
510#define EDID_DESC_HEADER_LEN 5 /* Size of detailed timing descriptor header in EDID */
511#define EDID_DESC_ASCII_STRING_LEN (EDID_MONITOR_DESC_SIZE - EDID_DESC_HEADER_LEN)
512#define EDID_DEVICE_VENDOR_ID_LENGTH 3 /* Expanded Device Vendor ID length in EDID */
513
514/* All CEC related constants now reside in vc_cec.h */
515
516/**
517 * General callback function for both HDMI and HDCP middleware
518 * reason is the notification nature
519 * param1 and param2 have different meanings depending on the notification (see above)
520 *
521 * @param client_p is the callback context
522 *
523 * @param reason is the callback reason
524 *
525 * @param param1 is the first callback argument (meaning as above)
526 *
527 * @param param2 is the second callback argument (meaning as above)
528 *
529 * @return void
530 */
531typedef void (*HDMI_CALLBACK_T)(void *client_p, VC_HDMI_NOTIFY_T reason, uint32_t param1, uint32_t param2);
532
533/* TV service error return code */
534typedef enum {
535 VC_HDMI_SUCCESS = 0, /** OK */
536 VC_HDMI_ERROR_FORMAT_UNSUPPORTED = 1, /** format not supported */
537 VC_HDMI_ERROR_INVALID_FORMAT = 2, /** invalid format */
538 VC_HDMI_ERROR_INVALID_PROPERTY = 3, /** invalid property */
539 VC_HDMI_ERROR_OUT_OF_RANGE = 4, /** invalid values passed to set property */
540 VC_HDMI_ERROR_INVALID_INFOFRAME = 5, /** invalid infoframe */
541} VC_HDMI_ERROR_T;
542
543/* Defines for backward code compatibility (these were originally in hdmi.h) */
544typedef VC_HDMI_ERROR_T HDMI_RESULT_T;
545#define HDMI_RESULT_SUCCESS (VC_HDMI_SUCCESS)
546#define HDMI_RESULT_FAILED (VC_HDMI_ERROR_FORMAT_UNSUPPORTED)
547
548#endif
549