si_edid.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  1. /*
  2. SiI8348 Linux Driver
  3. Copyright (C) 2013 Silicon Image, Inc.
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License as
  6. published by the Free Software Foundation version 2.
  7. This program is distributed AS-IS WITHOUT ANY WARRANTY of any
  8. kind, whether express or implied; INCLUDING without the implied warranty
  9. of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE or NON-INFRINGEMENT. See
  10. the GNU General Public License for more details at http://www.gnu.org/licenses/gpl-2.0.html.
  11. */
  12. #if !defined(SI_EDID_H)
  13. #define SI_EDID_H
  14. SI_PUSH_STRUCT_PACKING //(
  15. typedef struct SI_PACK_THIS_STRUCT _TwoBytes_t
  16. {
  17. unsigned char low;
  18. unsigned char high;
  19. }TwoBytes_t,*PTwoBytes_t;
  20. #define EDID_EXTENSION_TAG 0x02
  21. #define EDID_EXTENSION_BLOCK_MAP 0xF0
  22. #define EDID_REV_THREE 0x03
  23. //#define LONG_DESCR_LEN 18
  24. #define EDID_BLOCK_0 0x00
  25. #define EDID_BLOCK_2_3 0x01
  26. //#define EDID_BLOCK_0_OFFSET 0x0000
  27. typedef enum
  28. {
  29. DBTC_TERMINATOR = 0
  30. ,DBTC_AUDIO_DATA_BLOCK = 1
  31. ,DBTC_VIDEO_DATA_BLOCK = 2
  32. ,DBTC_VENDOR_SPECIFIC_DATA_BLOCK = 3
  33. ,DBTC_SPEAKER_ALLOCATION_DATA_BLOCK = 4
  34. ,DBTC_VESA_DTC_DATA_BLOCK = 5
  35. //reserved = 6
  36. ,DBTC_USE_EXTENDED_TAG = 7
  37. }data_block_tag_code_e;
  38. typedef struct SI_PACK_THIS_STRUCT _data_block_header_fields_t
  39. {
  40. uint8_t length_following_header:5;
  41. data_block_tag_code_e tag_code:3;
  42. }data_block_header_fields_t,*Pdata_block_header_fields_t;
  43. typedef union SI_PACK_THIS_STRUCT _data_block_header_byte_t
  44. {
  45. data_block_header_fields_t fields;
  46. uint8_t as_byte;
  47. }data_block_header_byte_t,*Pdata_block_header_byte_t;
  48. typedef enum
  49. {
  50. ETC_VIDEO_CAPABILITY_DATA_BLOCK = 0
  51. ,ETC_VENDOR_SPECIFIC_VIDEO_DATA_BLOCK = 1
  52. ,ETC_VESA_VIDEO_DISPLAY_DEVICE_INFORMATION_DATA_BLOCK = 2
  53. ,ETC_VESA_VIDEO_DATA_BLOCK = 3
  54. ,ETC_HDMI_VIDEO_DATA_BLOCK = 4
  55. ,ETC_COLORIMETRY_DATA_BLOCK = 5
  56. ,ETC_VIDEO_RELATED = 6
  57. ,ETC_CEA_MISC_AUDIO_FIELDS = 16
  58. ,ETC_VENDOR_SPECIFIC_AUDIO_DATA_BLOCK = 17
  59. ,ETC_HDMI_AUDIO_DATA_BLOCK = 18
  60. ,ETC_AUDIO_RELATED = 19
  61. ,ETC_GENERAL = 32
  62. }extended_tag_code_e;
  63. typedef struct SI_PACK_THIS_STRUCT _extended_tag_code_t
  64. {
  65. extended_tag_code_e etc:8;
  66. }extended_tag_code_t,*Pextended_tag_code_t;
  67. typedef struct SI_PACK_THIS_STRUCT _cea_short_descriptor_t
  68. {
  69. unsigned char VIC:7;
  70. unsigned char native:1;
  71. }cea_short_descriptor_t,*Pcea_short_descriptor_t;
  72. typedef struct SI_PACK_THIS_STRUCT _MHL_short_desc_t
  73. {
  74. cea_short_descriptor_t cea_short_desc;
  75. MHL2_video_descriptor_t mhl_vid_desc;
  76. }MHL_short_desc_t,*PMHL_short_desc_t;
  77. typedef struct SI_PACK_THIS_STRUCT _video_data_block_t
  78. {
  79. data_block_header_byte_t header;
  80. cea_short_descriptor_t short_descriptors[1];//open ended
  81. }video_data_block_t,*p_video_data_block_t;
  82. typedef enum
  83. {
  84. // reserved = 0
  85. afd_linear_PCM_IEC60958 = 1
  86. ,afd_AC3 = 2
  87. ,afd_MPEG1_layers_1_2 = 3
  88. ,afd_MPEG1_layer_3 = 4
  89. ,afdMPEG2_MultiChannel = 5
  90. ,afd_AAC = 6
  91. ,afd_DTS = 7
  92. ,afd_ATRAC = 8
  93. ,afd_one_bit_audio = 9
  94. ,afd_dolby_digital = 10
  95. ,afd_DTS_HD = 11
  96. ,afd_MAT_MLP = 12
  97. ,afd_DST = 13
  98. ,afd_WMA_Pro = 14
  99. //reserved = 15
  100. }AudioFormatCodes_e;
  101. typedef struct SI_PACK_THIS_STRUCT _CEA_short_audio_descriptor_t
  102. {
  103. unsigned char max_channels_minus_one :3;
  104. AudioFormatCodes_e audio_format_code :4;
  105. unsigned char F17 :1;
  106. unsigned char freq_32_Khz :1;
  107. unsigned char freq_44_1_KHz :1;
  108. unsigned char freq_48_KHz :1;
  109. unsigned char freq_88_2_KHz :1;
  110. unsigned char freq_96_KHz :1;
  111. unsigned char freq_176_4_KHz:1;
  112. unsigned char freq_192_KHz :1;
  113. unsigned char F27 :1;
  114. union
  115. {
  116. struct SI_PACK_THIS_STRUCT
  117. {
  118. unsigned res_16_bit:1;
  119. unsigned res_20_bit:1;
  120. unsigned res_24_bit:1;
  121. unsigned F33_37:5;
  122. }audio_code_1_LPCM;
  123. struct SI_PACK_THIS_STRUCT
  124. {
  125. uint8_t max_bit_rate_div_by_8_KHz;
  126. }audio_codes_2_8;
  127. struct SI_PACK_THIS_STRUCT
  128. {
  129. uint8_t default_zero;
  130. }audio_codes_9_15;
  131. }byte3;
  132. }CEA_short_audio_descriptor_t,*PCEA_short_audio_descriptor_t;
  133. typedef struct SI_PACK_THIS_STRUCT _audio_data_block_t
  134. {
  135. data_block_header_byte_t header;
  136. CEA_short_audio_descriptor_t short_audio_descriptors[1]; // open ended
  137. }audio_data_block_t,*Paudio_data_block_t;
  138. typedef struct SI_PACK_THIS_STRUCT _speaker_allocation_flags_t
  139. {
  140. unsigned char spk_front_left_front_right:1;
  141. unsigned char spk_LFE:1;
  142. unsigned char spk_front_center:1;
  143. unsigned char spk_rear_left_rear_right:1;
  144. unsigned char spk_rear_center:1;
  145. unsigned char spk_front_left_center_front_right_center:1;
  146. unsigned char spk_rear_left_center_rear_right_center:1;
  147. unsigned char spk_reserved:1;
  148. }speaker_allocation_flags_t,*Pspeaker_allocation_flags_t;
  149. typedef struct SI_PACK_THIS_STRUCT _speaker_allocation_data_block_payload_t
  150. {
  151. speaker_allocation_flags_t speaker_alloc_flags;
  152. uint8_t reserved[2];
  153. }speaker_allocation_data_block_payload_t,*Pspeaker_allocation_data_block_payload_t;
  154. typedef struct SI_PACK_THIS_STRUCT _speaker_allocation_data_block_t
  155. {
  156. data_block_header_byte_t header;
  157. speaker_allocation_data_block_payload_t payload;
  158. }speaker_allocation_data_block_t,*Pspeaker_allocation_data_block_t;
  159. typedef struct SI_PACK_THIS_STRUCT _HDMI_LLC_BA_t
  160. {
  161. unsigned char B:4;
  162. unsigned char A:4;
  163. }HDMI_LLC_BA_t,*PHDMI_LLC_BA_t;
  164. typedef struct SI_PACK_THIS_STRUCT _HDMI_LLC_DC_t
  165. {
  166. unsigned char D:4;
  167. unsigned char C:4;
  168. }HDMI_LLC_DC_t,*PHDMI_LLC_DC_t;
  169. typedef struct SI_PACK_THIS_STRUCT _HDMI_LLC_Byte6_t
  170. {
  171. unsigned char DVI_dual :1;
  172. unsigned char reserved :2;
  173. unsigned char DC_Y444 :1;
  174. unsigned char DC_30bit :1;
  175. unsigned char DC_36bit :1;
  176. unsigned char DC_48bit :1;
  177. unsigned char supports_AI :1;
  178. }HDMI_LLC_Byte6_t,*PHDMI_LLC_Byte6_t;
  179. typedef struct SI_PACK_THIS_STRUCT _HDMI_LLC_byte8_t
  180. {
  181. unsigned char CNC0_adjacent_pixels_independent :1;
  182. unsigned char CNC1_specific_processing_still_pictures :1;
  183. unsigned char CNC2_specific_processing_cinema_content :1;
  184. unsigned char CNC3_specific_processing_low_AV_latency :1;
  185. unsigned char reserved :1;
  186. unsigned char HDMI_video_present :1;
  187. unsigned char I_latency_fields_present :1;
  188. unsigned char latency_fields_present :1;
  189. }HDMI_LLC_byte8_t,*PHDMI_LLC_byte8_t;
  190. typedef enum
  191. {
  192. imsz_NO_ADDITIONAL = 0
  193. ,imsz_ASPECT_RATIO_CORRECT_BUT_NO_GUARRANTEE_OF_CORRECT_SIZE = 1
  194. ,imsz_CORRECT_SIZES_ROUNDED_TO_NEAREST_1_CM = 2
  195. ,imsz_CORRECT_SIZES_DIVIDED_BY_5_ROUNDED_TO_NEAREST_5_CM = 3
  196. }image_size_e;
  197. typedef struct SI_PACK_THIS_STRUCT _HDMI_LLC_Byte13_t
  198. {
  199. unsigned char reserved :3;
  200. image_size_e image_size :2;
  201. unsigned char _3D_multi_present :2;
  202. unsigned char _3D_present :1;
  203. }HDMI_LLC_Byte13_t,*PHDMI_LLC_Byte13_t;
  204. typedef struct SI_PACK_THIS_STRUCT _HDMI_LLC_Byte14_t
  205. {
  206. unsigned char HDMI_3D_len :5;
  207. unsigned char HDMI_VIC_len:3;
  208. }HDMI_LLC_Byte14_t,*PHDMI_LLC_Byte14_t;
  209. typedef struct SI_PACK_THIS_STRUCT _VSDB_byte_13_through_byte_15_t
  210. {
  211. HDMI_LLC_Byte13_t byte13;
  212. HDMI_LLC_Byte14_t byte14;
  213. uint8_t vicList[1]; // variable length list base on HDMI_VIC_len
  214. }VSDB_byte_13_through_byte_15_t,*PVSDB_byte_13_through_byte_15_t;
  215. typedef struct SI_PACK_THIS_STRUCT _VSDB_all_fields_byte_9_through_byte15_t
  216. {
  217. uint8_t video_latency;
  218. uint8_t audio_latency;
  219. uint8_t interlaced_video_latency;
  220. uint8_t interlaced_audio_latency;
  221. VSDB_byte_13_through_byte_15_t byte_13_through_byte_15;
  222. // There must be no fields after here
  223. }VSDB_all_fields_byte_9_through_byte15_t,*PVSDB_all_fields_byte_9_through_byte15_t;
  224. typedef struct SI_PACK_THIS_STRUCT _VSDB_all_fields_byte_9_through_byte_15_sans_progressive_latency_t
  225. {
  226. uint8_t interlaced_video_latency;
  227. uint8_t interlaced_audio_latency;
  228. VSDB_byte_13_through_byte_15_t byte_13_through_byte_15;
  229. // There must be no fields after here
  230. }VSDB_all_fields_byte_9_through_byte_15_sans_progressive_latency_t,*PVSDB_all_fields_byte_9_through_byte_15_sans_progressive_latency_t;
  231. typedef struct SI_PACK_THIS_STRUCT _VSDB_all_fields_byte_9_through_byte_15_sans_interlaced_latency_t
  232. {
  233. uint8_t video_latency;
  234. uint8_t audio_latency;
  235. VSDB_byte_13_through_byte_15_t byte_13_through_byte_15;
  236. // There must be no fields after here
  237. }VSDB_all_fields_byte_9_through_byte_15_sans_interlaced_latency_t,*PVSDB_all_fields_byte_9_through_byte_15_sans_interlaced_latency_t;
  238. typedef struct SI_PACK_THIS_STRUCT _VSDB_all_fields_byte_9_through_byte_15_sans_all_latency_t
  239. {
  240. VSDB_byte_13_through_byte_15_t byte_13_through_byte_15;
  241. // There must be no fields after here
  242. }VSDB_all_fields_byte_9_through_byte_15_sans_all_latency_t,*PVSDB_all_fields_byte_9_through_byte_15_sans_all_latency_t;
  243. typedef struct SI_PACK_THIS_STRUCT _HDMI_LLC_vsdb_payload_t
  244. {
  245. HDMI_LLC_BA_t B_A;
  246. HDMI_LLC_DC_t D_C;
  247. HDMI_LLC_Byte6_t byte6;
  248. uint8_t maxTMDSclock;
  249. HDMI_LLC_byte8_t byte8;
  250. union
  251. {
  252. VSDB_all_fields_byte_9_through_byte_15_sans_all_latency_t vsdb_all_fields_byte_9_through_byte_15_sans_all_latency;
  253. VSDB_all_fields_byte_9_through_byte_15_sans_progressive_latency_t vsdb_all_fields_byte_9_through_byte_15_sans_progressive_latency;
  254. VSDB_all_fields_byte_9_through_byte_15_sans_interlaced_latency_t vsdb_all_fields_byte_9_through_byte_15_sans_interlaced_latency;
  255. VSDB_all_fields_byte_9_through_byte15_t vsdb_all_fields_byte_9_through_byte_15;
  256. }vsdb_fields_byte_9_through_byte_15;
  257. // There must be no fields after here
  258. }HDMI_LLC_vsdb_payload_t,*PHDMI_LLC_vsdb_payload_t;
  259. typedef struct SI_PACK_THIS_STRUCT st_3D_structure_all_15_8_t
  260. {
  261. uint8_t frame_packing : 1;
  262. uint8_t reserved1 : 5;
  263. uint8_t top_bottom : 1;
  264. uint8_t reserved2 : 1;
  265. }_3D_structure_all_15_8_t,*P_3D_structure_all_15_8_t;
  266. typedef struct SI_PACK_THIS_STRUCT st_3D_structure_all_7_0_t
  267. {
  268. uint8_t side_by_side : 1;
  269. uint8_t reserved : 7;
  270. }_3D_structure_all_7_0_t,*P_3D_structure_all_7_0_t;
  271. typedef struct SI_PACK_THIS_STRUCT tag_3D_structure_all_t
  272. {
  273. _3D_structure_all_15_8_t _3D_structure_all_15_8;
  274. _3D_structure_all_7_0_t _3D_structure_all_7_0;
  275. }_3D_structure_all_t,*P_3D_structure_all_t;
  276. typedef struct SI_PACK_THIS_STRUCT tag_3D_mask_t
  277. {
  278. uint8_t _3D_mask_15_8;
  279. uint8_t _3D_mask_7_0;
  280. }_3D_mask_t,*P_3D_mask_t;
  281. typedef struct SI_PACK_THIS_STRUCT tag_2D_VIC_order_3D_structure_t
  282. {
  283. _3D_structure_e _3D_structure:4; // definition from info frame
  284. unsigned _2D_VIC_order:4;
  285. }_2D_VIC_order_3D_structure_t,*P_2D_VIC_order_3D_structure_t;
  286. typedef struct SI_PACK_THIS_STRUCT tag_3D_detail_t
  287. {
  288. unsigned char reserved :4;
  289. unsigned char _3D_detail :4;
  290. }_3D_detail_t,*P_3D_detail_t;
  291. typedef struct SI_PACK_THIS_STRUCT tag_3D_structure_and_detail_entry_sans_byte1_t
  292. {
  293. _2D_VIC_order_3D_structure_t byte0;
  294. /*see HDMI 1.4 spec w.r.t. contents of 3D_structure_X */
  295. }_3D_structure_and_detail_entry_sans_byte1_t,*P_3D_structure_and_detail_entry_sans_byte1_t;
  296. typedef struct SI_PACK_THIS_STRUCT tag_3D_structure_and_detail_entry_with_byte1_t
  297. {
  298. _2D_VIC_order_3D_structure_t byte0;
  299. _3D_detail_t byte1;
  300. }_3D_structure_and_detail_entry_with_byte1_t,*P_3D_structure_and_detail_entry_with_byte1_t;
  301. typedef union tag_3D_structure_and_detail_entry_u
  302. {
  303. _3D_structure_and_detail_entry_sans_byte1_t sans_byte1;
  304. _3D_structure_and_detail_entry_with_byte1_t with_byte1;
  305. }_3D_structure_and_detail_entry_u,*P_3D_structure_and_detail_entry_u;
  306. typedef struct SI_PACK_THIS_STRUCT _HDMI_3D_sub_block_sans_all_AND_mask_t
  307. {
  308. _3D_structure_and_detail_entry_u _3D_structure_and_detail_list[1];
  309. }HDMI_3D_sub_block_sans_all_AND_mask_t,*PHDMI_3D_sub_block_sans_all_AND_mask_t;
  310. typedef struct SI_PACK_THIS_STRUCT _HDMI_3D_sub_block_sans_mask_t
  311. {
  312. _3D_structure_all_t _3D_structure_all;
  313. _3D_structure_and_detail_entry_u _3D_structure_and_detail_list[1];
  314. }HDMI_3D_sub_block_sans_mask_t,*PHDMI_3D_sub_block_sans_mask_t;
  315. typedef struct SI_PACK_THIS_STRUCT _HDMI_3D_sub_block_with_all_AND_mask_t
  316. {
  317. _3D_structure_all_t _3D_structure_all;
  318. _3D_mask_t _3D_mask;
  319. _3D_structure_and_detail_entry_u _3D_structure_and_detail_list[1];
  320. }HDMI_3D_sub_block_with_all_AND_mask_t,*PHDMI_3D_sub_block_with_all_AND_mask_t;
  321. typedef union
  322. {
  323. HDMI_3D_sub_block_sans_all_AND_mask_t hDMI_3D_sub_block_sans_all_AND_mask;
  324. HDMI_3D_sub_block_sans_mask_t HDMI_3D_sub_block_sans_mask;
  325. HDMI_3D_sub_block_with_all_AND_mask_t HDMI_3D_sub_block_with_all_AND_mask;
  326. }HDMI_3D_sub_block_t,*PHDMI_3D_sub_block_t;
  327. typedef struct SI_PACK_THIS_STRUCT _vsdb_t
  328. {
  329. data_block_header_byte_t header;
  330. uint8_t IEEE_OUI[3];
  331. union
  332. {
  333. HDMI_LLC_vsdb_payload_t HDMI_LLC;
  334. uint8_t payload[1]; // open ended
  335. }payload_u;
  336. }vsdb_t,*P_vsdb_t;
  337. typedef enum
  338. {
  339. xvYCC_601 = 1
  340. ,xvYCC_709 = 2
  341. }colorimetry_xvYCC_e;
  342. typedef struct SI_PACK_THIS_STRUCT _colorimetry_xvYCC_t
  343. {
  344. colorimetry_xvYCC_e xvYCC :2;
  345. unsigned char reserved1 :6;
  346. }colorimetry_xvYCC_t,*Pcolorimetry_xvYCC_t;
  347. typedef struct SI_PACK_THIS_STRUCT _colorimetry_meta_data_t
  348. {
  349. unsigned char meta_data :3;
  350. unsigned char reserved2 :5;
  351. }colorimetry_meta_data_t,*Pcolorimetry_meta_data_t;
  352. typedef struct SI_PACK_THIS_STRUCT _colorimetry_data_payload_t
  353. {
  354. colorimetry_xvYCC_t ci_data;
  355. colorimetry_meta_data_t cm_meta_data;
  356. }colorimetry_data_payload_t,*Pcolorimetry_data_payload_t;
  357. typedef struct SI_PACK_THIS_STRUCT _colorimetry_data_block_t
  358. {
  359. data_block_header_byte_t header;
  360. extended_tag_code_t extended_tag;
  361. colorimetry_data_payload_t payload;
  362. }colorimetry_data_block_t,*Pcolorimetry_data_block_t;
  363. typedef enum
  364. {
  365. ceou_NEITHER = 0
  366. ,ceou_ALWAYS_OVERSCANNED = 1
  367. ,ceou_ALWAYS_UNDERSCANNED = 2
  368. ,ceou_BOTH = 3
  369. }CE_overscan_underscan_behavior_e;
  370. typedef enum
  371. {
  372. itou_NEITHER = 0
  373. ,itou_ALWAYS_OVERSCANNED = 1
  374. ,itou_ALWAYS_UNDERSCANNED = 2
  375. ,itou_BOTH = 3
  376. }IT_overscan_underscan_behavior_e;
  377. typedef enum
  378. {
  379. ptou_NEITHER = 0
  380. ,ptou_ALWAYS_OVERSCANNED = 1
  381. ,ptou_ALWAYS_UNDERSCANNED = 2
  382. ,ptou_BOTH = 3
  383. }PT_overscan_underscan_behavior_e;
  384. typedef struct SI_PACK_THIS_STRUCT _video_capability_data_payload_t
  385. {
  386. CE_overscan_underscan_behavior_e S_CE :2;
  387. IT_overscan_underscan_behavior_e S_IT :2;
  388. PT_overscan_underscan_behavior_e S_PT :2;
  389. unsigned QS :1;
  390. unsigned quantization_range_selectable:1;
  391. }video_capability_data_payload_t,*Pvideo_capability_data_payload_t;
  392. typedef struct SI_PACK_THIS_STRUCT _video_capability_data_block_t
  393. {
  394. data_block_header_byte_t header;
  395. extended_tag_code_t extended_tag;
  396. video_capability_data_payload_t payload;
  397. }video_capability_data_block_t,*Pvideo_capability_data_block_t;
  398. typedef struct SI_PACK_THIS_STRUCT _CEA_data_block_collection_t
  399. {
  400. data_block_header_byte_t header;
  401. union
  402. {
  403. extended_tag_code_t extended_tag;
  404. cea_short_descriptor_t short_descriptor;
  405. }payload_u;
  406. // open ended array of cea_short_descriptor_t starts here
  407. }CEA_data_block_collection_t,*PCEA_data_block_collection_t;
  408. typedef struct SI_PACK_THIS_STRUCT _CEA_extension_version_1_t
  409. {
  410. uint8_t reservedMustBeZero;
  411. uint8_t reserved[123];
  412. }CEA_extension_version_1_t,*PCEA_extension_version_1_t;
  413. typedef struct SI_PACK_THIS_STRUCT _CEA_extension_2_3_misc_support_t
  414. {
  415. uint8_t total_number_detailed_timing_descriptors_in_entire_EDID:4;
  416. uint8_t YCrCb422_support:1;
  417. uint8_t YCrCb444_support:1;
  418. uint8_t basic_audio_support:1;
  419. uint8_t underscan_IT_formats_by_default:1;
  420. }CEA_extension_2_3_misc_support_t,*PCEA_extension_2_3_misc_support_t;
  421. typedef struct SI_PACK_THIS_STRUCT _CEA_extension_version_2_t
  422. {
  423. CEA_extension_2_3_misc_support_t misc_support;
  424. uint8_t reserved[123];
  425. }CEA_extension_version_2_t,*PCEA_extension_version_2_t;
  426. typedef struct SI_PACK_THIS_STRUCT _CEA_extension_version_3_t
  427. {
  428. CEA_extension_2_3_misc_support_t misc_support;
  429. union
  430. {
  431. uint8_t data_block_collection[123];
  432. uint8_t reserved[123];
  433. }Offset4_u;
  434. }CEA_extension_version_3_t,*PCEA_extension_version_3_t;
  435. typedef struct SI_PACK_THIS_STRUCT _block_map_t
  436. {
  437. uint8_t tag;
  438. uint8_t block_tags[126];
  439. uint8_t checksum;
  440. }block_map_t, *Pblock_map_t;
  441. typedef struct SI_PACK_THIS_STRUCT _CEA_extension_t
  442. {
  443. uint8_t tag;
  444. uint8_t revision;
  445. uint8_t byte_offset_to_18_byte_descriptors;
  446. union
  447. {
  448. CEA_extension_version_1_t version1;
  449. CEA_extension_version_2_t version2;
  450. CEA_extension_version_3_t version3;
  451. }version_u;
  452. uint8_t checksum;
  453. }CEA_extension_t,*PCEA_extension_t;
  454. typedef struct SI_PACK_THIS_STRUCT _detailed_timing_descriptor_t
  455. {
  456. uint8_t pixel_clock_low;
  457. uint8_t pixel_clock_high;
  458. uint8_t horz_active_7_0;
  459. uint8_t horz_blanking_7_0;
  460. struct SI_PACK_THIS_STRUCT
  461. {
  462. unsigned char horz_blanking_11_8 :4;
  463. unsigned char horz_active_11_8 :4;
  464. }horz_active_blanking_high;
  465. uint8_t vert_active_7_0;
  466. uint8_t vert_blanking_7_0;
  467. struct SI_PACK_THIS_STRUCT
  468. {
  469. unsigned char vert_blanking_11_8 :4;
  470. unsigned char vert_active_11_8 :4;
  471. }vert_active_blanking_high;
  472. uint8_t horz_sync_offset_7_0;
  473. uint8_t horz_sync_pulse_width7_0;
  474. struct SI_PACK_THIS_STRUCT
  475. {
  476. unsigned char vert_sync_pulse_width_3_0 :4;
  477. unsigned char vert_sync_offset_3_0 :4;
  478. }vert_sync_offset_width;
  479. struct SI_PACK_THIS_STRUCT
  480. {
  481. unsigned char vert_sync_pulse_width_5_4 :2;
  482. unsigned char vert_sync_offset_5_4 :2;
  483. unsigned char horz_sync_pulse_width_9_8 :2;
  484. unsigned char horzSyncOffset9_8 :2;
  485. }hs_offset_hs_pulse_width_vs_offset_vs_pulse_width;
  486. uint8_t horz_image_size_in_mm_7_0;
  487. uint8_t vert_image_size_in_mm_7_0;
  488. struct SI_PACK_THIS_STRUCT
  489. {
  490. unsigned char vert_image_size_in_mm_11_8 :4;
  491. unsigned char horz_image_size_in_mm_11_8 :4;
  492. }image_size_high;
  493. uint8_t horz_border_in_lines;
  494. uint8_t vert_border_in_pixels;
  495. struct SI_PACK_THIS_STRUCT
  496. {
  497. unsigned char stereo_bit_0 :1;
  498. unsigned char sync_signal_options :2;
  499. unsigned char sync_signal_type :2;
  500. unsigned char stereo_bits_2_1 :2;
  501. unsigned char interlaced :1;
  502. }flags;
  503. }detailed_timing_descriptor_t,*Pdetailed_timing_descriptor_t;
  504. typedef struct SI_PACK_THIS_STRUCT _red_green_bits_1_0_t
  505. {
  506. unsigned char green_y :2;
  507. unsigned char green_x :2;
  508. unsigned char red_y :2;
  509. unsigned char red_x :2;
  510. }red_green_bits_1_0_t,*Pred_green_bits_1_0_t;
  511. typedef struct SI_PACK_THIS_STRUCT _blue_white_bits_1_0_t
  512. {
  513. unsigned char white_y :2;
  514. unsigned char white_x :2;
  515. unsigned char blue_y :2;
  516. unsigned char blue_x :2;
  517. }blue_white_bits_1_0_t,*Pblue_white_bits_1_0_t;
  518. typedef struct SI_PACK_THIS_STRUCT _established_timings_I_t
  519. {
  520. unsigned char et800x600_60Hz :1;
  521. unsigned char et800x600_56Hz :1;
  522. unsigned char et640x480_75Hz :1;
  523. unsigned char et640x480_72Hz :1;
  524. unsigned char et640x480_67Hz :1;
  525. unsigned char et640x480_60Hz :1;
  526. unsigned char et720x400_88Hz :1;
  527. unsigned char et720x400_70Hz :1;
  528. }established_timings_I_t,*Pestablished_timings_I_t;
  529. typedef struct SI_PACK_THIS_STRUCT _established_timings_II_t
  530. {
  531. unsigned char et1280x1024_75Hz:1;
  532. unsigned char et1024x768_75Hz :1;
  533. unsigned char et1024x768_70Hz :1;
  534. unsigned char et1024x768_60Hz :1;
  535. unsigned char et1024x768_87HzI:1;
  536. unsigned char et832x624_75Hz :1;
  537. unsigned char et800x600_75Hz :1;
  538. unsigned char et800x600_72Hz :1;
  539. }established_timings_II_t,*Pestablished_timings_II_t;
  540. typedef struct SI_PACK_THIS_STRUCT _manufacturers_timings_t
  541. {
  542. unsigned char reserved :7;
  543. unsigned char et1152x870_75Hz :1;
  544. }manufacturers_timings_t,*Pmanufacturers_timings_t;
  545. typedef enum
  546. {
  547. iar_16_to_10 = 0
  548. ,iar_4_to_3 = 1
  549. ,iar_5_to_4 = 2
  550. ,iar_16_to_9 = 3
  551. }image_aspect_ratio_e;
  552. typedef struct SI_PACK_THIS_STRUCT _standard_timing_t
  553. {
  554. unsigned char horz_pix_div_8_minus_31;
  555. unsigned char field_refresh_rate_minus_60:6;
  556. image_aspect_ratio_e image_aspect_ratio :2;
  557. }standard_timing_t,*Pstandard_timing_t;
  558. typedef struct SI_PACK_THIS_STRUCT _EDID_block0_t
  559. {
  560. unsigned char header_data[8];
  561. TwoBytes_t id_manufacturer_name;
  562. TwoBytes_t id_product_code;
  563. unsigned char serial_number[4];
  564. unsigned char week_of_manufacture;
  565. unsigned char year_of_manufacture;
  566. unsigned char EDID_version;
  567. unsigned char EDID_revision;
  568. unsigned char video_input_definition;
  569. unsigned char horz_screen_size_or_aspect_ratio;
  570. unsigned char vert_screen_size_or_aspect_ratio;
  571. unsigned char display_transfer_characteristic;
  572. unsigned char feature_support;
  573. red_green_bits_1_0_t red_green_bits_1_0;
  574. blue_white_bits_1_0_t blue_white_bits_1_0;
  575. unsigned char red_x;
  576. unsigned char red_y;
  577. unsigned char green_x;
  578. unsigned char green_y;
  579. unsigned char blue_x;
  580. unsigned char blue_y;
  581. unsigned char white_x;
  582. unsigned char white_y;
  583. established_timings_I_t established_timings_I;
  584. established_timings_II_t established_timings_II;
  585. manufacturers_timings_t manufacturers_timings;
  586. standard_timing_t standard_timings[8];
  587. detailed_timing_descriptor_t detailed_timing_descriptors[4];
  588. unsigned char extension_flag;
  589. unsigned char checksum;
  590. }EDID_block0_t,*PEDID_block0_t;
  591. typedef struct SI_PACK_THIS_STRUCT _monitor_name_t
  592. {
  593. uint8_t flag_required[2];
  594. uint8_t flag_reserved;
  595. uint8_t data_type_tag;
  596. uint8_t flag;
  597. uint8_t ascii_name[13];
  598. }monitor_name_t,*Pmonitor_name_t;
  599. typedef struct SI_PACK_THIS_STRUCT _monitor_range_limits_t
  600. {
  601. uint8_t flag_required[2];
  602. uint8_t flag_reserved;
  603. uint8_t data_type_tag;
  604. uint8_t flag;
  605. uint8_t min_vertical_rate_in_Hz;
  606. uint8_t max_vertical_rate_in_Hz;
  607. uint8_t min_horizontal_rate_in_KHz;
  608. uint8_t max_horizontal_rate_in_KHz;
  609. uint8_t max_pixel_clock_in_MHz_div_10;
  610. uint8_t tag_secondary_formula;
  611. uint8_t filler[7];
  612. }monitor_range_limits_t,*Pmonitor_range_limits_t;
  613. typedef union tag_18_byte_descriptor_u
  614. {
  615. detailed_timing_descriptor_t dtd;
  616. monitor_name_t name;
  617. monitor_range_limits_t range_limits;
  618. }_18_byte_descriptor_u,*P_18_byte_descriptor_u;
  619. typedef struct SI_PACK_THIS_STRUCT _display_mode_3D_info_t
  620. {
  621. unsigned char dmi_3D_supported:1;
  622. unsigned char dmi_sufficient_bandwidth:1;
  623. }display_mode_3D_info_t,*Pdisplay_mode_3D_info_t;
  624. typedef enum
  625. {
  626. vif_single_frame_rate = 0x00
  627. ,vif_dual_frame_rate = 0x01
  628. }VIC_info_flags_e;
  629. typedef enum
  630. {
  631. vsm_progressive = 0
  632. ,vsm_interlaced = 1
  633. }VIC_scan_mode_e;
  634. typedef enum
  635. {
  636. par_1_to_1
  637. ,par_16_to_15
  638. ,par_16_to_27
  639. ,par_16_to_45
  640. ,par_16_to_45_160_to_45
  641. ,par_1_to_15_10_to_15
  642. ,par_1_to_9_10_to_9
  643. ,par_2_to_15_20_to_15
  644. ,par_2_to_9
  645. ,par_2_to_9_20_to_9
  646. ,par_32_to_27
  647. ,par_32_to_45
  648. ,par_4_to_27_40_to_27
  649. ,par_4_to_9
  650. ,par_4_to_15
  651. ,par_64_to_45
  652. ,par_8_to_15
  653. ,par_8_to_27
  654. ,par_8_to_27_80_to_27
  655. ,par_8_to_45_80_to_45
  656. ,par_8_to_9
  657. }pixel_aspect_ratio_e;
  658. typedef struct SI_PACK_THIS_STRUCT _VIC_info_fields_t
  659. {
  660. image_aspect_ratio_e image_aspect_ratio :2;
  661. VIC_scan_mode_e interlaced :1;
  662. pixel_aspect_ratio_e pixel_aspect_ratio :5;
  663. VIC_info_flags_e frame_rate_info :1;
  664. uint8_t clocks_per_pixel_shift_count:2;
  665. uint8_t field2_v_blank :2;
  666. uint8_t reserved :3;
  667. }VIC_info_fields_t,*PVIC_info_fields_t;
  668. typedef struct SI_PACK_THIS_STRUCT _VIC_info_t
  669. {
  670. uint16_t columns;
  671. uint16_t rows;
  672. uint16_t h_blank_in_pixels;
  673. uint16_t v_blank_in_pixels;
  674. uint32_t field_rate_in_milliHz;
  675. VIC_info_fields_t fields;
  676. // uint16_t pixClockDiv10000;
  677. }VIC_info_t,*PVIC_info_t;
  678. typedef struct SI_PACK_THIS_STRUCT _HDMI_VIC_info_t
  679. {
  680. uint16_t columns;
  681. uint16_t rows;
  682. uint32_t field_rate_0_in_milliHz,field_rate_1_in_milliHz;
  683. uint32_t pixel_clock_0,pixel_clock_1;
  684. }HDMI_VIC_info_t,*PHDMI_VIC_info_t;
  685. #if 1//def ENABLE_EDID_DEBUG_PRINT //(
  686. void dump_EDID_block_impl(const char *pszFunction, int iLineNum,uint8_t override,uint8_t *pData,uint16_t length);
  687. void clear_EDID_block_impl(uint8_t *pData);
  688. #define DUMP_EDID_BLOCK(override,pData,length) dump_EDID_block_impl(__FUNCTION__,__LINE__,override,(uint8_t *)pData,length);
  689. #define CLEAR_EDID_BLOCK(pData) clear_EDID_block_impl(pData);
  690. #else //)(
  691. #define DUMP_EDID_BLOCK(override,pData,length) /* nothing to do */
  692. #define CLEAR_EDID_BLOCK(pData) /* nothing to do */
  693. #endif //)
  694. enum EDID_error_codes
  695. {
  696. EDID_OK,
  697. EDID_INCORRECT_HEADER,
  698. EDID_CHECKSUM_ERROR,
  699. EDID_NO_861_EXTENSIONS,
  700. EDID_SHORT_DESCRIPTORS_OK,
  701. EDID_LONG_DESCRIPTORS_OK,
  702. EDID_EXT_TAG_ERROR,
  703. EDID_REV_ADDR_ERROR,
  704. EDID_V_DESCR_OVERFLOW,
  705. EDID_UNKNOWN_TAG_CODE,
  706. EDID_NO_DETAILED_DESCRIPTORS,
  707. EDID_DDC_BUS_REQ_FAILURE,
  708. EDID_DDC_BUS_RELEASE_FAILURE,
  709. EDID_READ_TIMEOUT
  710. };
  711. SI_POP_STRUCT_PACKING //)
  712. #endif /* #if !defined(SI_EDID_H) */