mt8193edid.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. #ifndef __mt8193edid_h__
  2. #define __mt8193edid_h__
  3. #ifdef HDMI_MT8193_SUPPORT
  4. #include "extd_hdmi.h"
  5. enum _AUDIO_BITSTREAM_TYPE_T {
  6. AVD_BITS_NONE = 0,
  7. AVD_LPCM = 1,
  8. AVD_AC3,
  9. AVD_MPEG1_AUD,
  10. AVD_MP3,
  11. AVD_MPEG2_AUD,
  12. AVD_AAC,
  13. AVD_DTS,
  14. AVD_ATRAC,
  15. AVD_DSD,
  16. AVD_DOLBY_PLUS,
  17. AVD_DTS_HD,
  18. AVD_MAT_MLP,
  19. AVD_DST,
  20. AVD_WMA,
  21. AVD_CDDA,
  22. AVD_SACD_PCM,
  23. AVD_HDCD = 0xfe,
  24. AVD_BITS_OTHERS = 0xff
  25. };
  26. #define AUDIO_BITSTREAM_TYPE_T enum _AUDIO_BITSTREAM_TYPE_T
  27. enum _GET_EDID_T {
  28. EXTERNAL_EDID = 0,
  29. INTERNAL_EDID,
  30. NO_EDID
  31. };
  32. #define GET_EDID_T enum _GET_EDID_T
  33. #define SINK_480P (1 << 0)
  34. #define SINK_720P60 (1 << 1)
  35. #define SINK_1080I60 (1 << 2)
  36. #define SINK_1080P60 (1 << 3)
  37. #define SINK_480P_1440 (1 << 4)
  38. #define SINK_480P_2880 (1 << 5)
  39. #define SINK_480I (1 << 6)
  40. #define SINK_480I_1440 (1 << 7)
  41. #define SINK_480I_2880 (1 << 8)
  42. #define SINK_1080P30 (1 << 9)
  43. #define SINK_576P (1 << 10)
  44. #define SINK_720P50 (1 << 11)
  45. #define SINK_1080I50 (1 << 12)
  46. #define SINK_1080P50 (1 << 13)
  47. #define SINK_576P_1440 (1 << 14)
  48. #define SINK_576P_2880 (1 << 15)
  49. #define SINK_576I (1 << 16)
  50. #define SINK_576I_1440 (1 << 17)
  51. #define SINK_576I_2880 (1 << 18)
  52. #define SINK_1080P25 (1 << 19)
  53. #define SINK_1080P24 (1 << 20)
  54. #define SINK_1080P23976 (1 << 21)
  55. #define SINK_1080P2997 (1 << 22)
  56. /* This HDMI_SINK_VIDEO_COLORIMETRY_T will define what kind of YCBCR */
  57. /* can be supported by sink. */
  58. /* And each bit also defines the colorimetry data block of EDID. */
  59. #define SINK_YCBCR_444 (1<<0)
  60. #define SINK_YCBCR_422 (1<<1)
  61. #define SINK_XV_YCC709 (1<<2)
  62. #define SINK_XV_YCC601 (1<<3)
  63. #define SINK_METADATA0 (1<<4)
  64. #define SINK_METADATA1 (1<<5)
  65. #define SINK_METADATA2 (1<<6)
  66. #define SINK_RGB (1<<7)
  67. /* HDMI_SINK_VCDB_T Each bit defines the VIDEO Capability Data Block of EDID. */
  68. #define SINK_CE_ALWAYS_OVERSCANNED (1<<0)
  69. #define SINK_CE_ALWAYS_UNDERSCANNED (1<<1)
  70. #define SINK_CE_BOTH_OVER_AND_UNDER_SCAN (1<<2)
  71. #define SINK_IT_ALWAYS_OVERSCANNED (1<<3)
  72. #define SINK_IT_ALWAYS_UNDERSCANNED (1<<4)
  73. #define SINK_IT_BOTH_OVER_AND_UNDER_SCAN (1<<5)
  74. #define SINK_PT_ALWAYS_OVERSCANNED (1<<6)
  75. #define SINK_PT_ALWAYS_UNDERSCANNED (1<<7)
  76. #define SINK_PT_BOTH_OVER_AND_UNDER_SCAN (1<<8)
  77. #define SINK_RGB_SELECTABLE (1<<9)
  78. /* HDMI_SINK_AUDIO_DECODER_T define what kind of audio decoder */
  79. /* can be supported by sink. */
  80. #define HDMI_SINK_AUDIO_DEC_LPCM (1<<0)
  81. #define HDMI_SINK_AUDIO_DEC_AC3 (1<<1)
  82. #define HDMI_SINK_AUDIO_DEC_MPEG1 (1<<2)
  83. #define HDMI_SINK_AUDIO_DEC_MP3 (1<<3)
  84. #define HDMI_SINK_AUDIO_DEC_MPEG2 (1<<4)
  85. #define HDMI_SINK_AUDIO_DEC_AAC (1<<5)
  86. #define HDMI_SINK_AUDIO_DEC_DTS (1<<6)
  87. #define HDMI_SINK_AUDIO_DEC_ATRAC (1<<7)
  88. #define HDMI_SINK_AUDIO_DEC_DSD (1<<8)
  89. #define HDMI_SINK_AUDIO_DEC_DOLBY_PLUS (1<<9)
  90. #define HDMI_SINK_AUDIO_DEC_DTS_HD (1<<10)
  91. #define HDMI_SINK_AUDIO_DEC_MAT_MLP (1<<11)
  92. #define HDMI_SINK_AUDIO_DEC_DST (1<<12)
  93. #define HDMI_SINK_AUDIO_DEC_WMA (1<<13)
  94. /* Sink audio channel ability for a fixed Fs */
  95. #define SINK_AUDIO_2CH (1<<0)
  96. #define SINK_AUDIO_3CH (1<<1)
  97. #define SINK_AUDIO_4CH (1<<2)
  98. #define SINK_AUDIO_5CH (1<<3)
  99. #define SINK_AUDIO_6CH (1<<4)
  100. #define SINK_AUDIO_7CH (1<<5)
  101. #define SINK_AUDIO_8CH (1<<6)
  102. /* Sink supported sampling rate for a fixed channel number */
  103. #define SINK_AUDIO_32k (1<<0)
  104. #define SINK_AUDIO_44k (1<<1)
  105. #define SINK_AUDIO_48k (1<<2)
  106. #define SINK_AUDIO_88k (1<<3)
  107. #define SINK_AUDIO_96k (1<<4)
  108. #define SINK_AUDIO_176k (1<<5)
  109. #define SINK_AUDIO_192k (1<<6)
  110. /* The following definition is for Sink speaker allocation data block . */
  111. #define SINK_AUDIO_FL_FR (1<<0)
  112. #define SINK_AUDIO_LFE (1<<1)
  113. #define SINK_AUDIO_FC (1<<2)
  114. #define SINK_AUDIO_RL_RR (1<<3)
  115. #define SINK_AUDIO_RC (1<<4)
  116. #define SINK_AUDIO_FLC_FRC (1<<5)
  117. #define SINK_AUDIO_RLC_RRC (1<<6)
  118. /* The following definition is */
  119. /* For EDID Audio Support, //HDMI_EDID_CHKSUM_AND_AUDIO_SUP_T */
  120. #define SINK_BASIC_AUDIO_NO_SUP (1<<0)
  121. #define SINK_SAD_NO_EXIST (1<<1) /* short audio descriptor */
  122. #define SINK_BASE_BLK_CHKSUM_ERR (1<<2)
  123. #define SINK_EXT_BLK_CHKSUM_ERR (1<<3)
  124. /* The following definition is for the output channel of */
  125. /* audio decoder AUDIO_DEC_OUTPUT_CHANNEL_T */
  126. #define AUDIO_DEC_FL (1<<0)
  127. #define AUDIO_DEC_FR (1<<1)
  128. #define AUDIO_DEC_LFE (1<<2)
  129. #define AUDIO_DEC_FC (1<<3)
  130. #define AUDIO_DEC_RL (1<<4)
  131. #define AUDIO_DEC_RR (1<<5)
  132. #define AUDIO_DEC_RC (1<<6)
  133. #define AUDIO_DEC_FLC (1<<7)
  134. #define AUDIO_DEC_FRC (1<<8)
  135. /* (5) Define the EDID relative information */
  136. /* (5.1) Define one EDID block length */
  137. #define EDID_BLOCK_LEN 128
  138. /* (5.2) Define EDID header length */
  139. #define EDID_HEADER_LEN 8
  140. /* (5.3) Define the address for EDID info. (ref. EDID Recommended Practive for EIA/CEA-861) */
  141. /* Base Block 0 */
  142. #define EDID_ADDR_HEADER 0x00
  143. #define EDID_ADDR_VERSION 0x12
  144. #define EDID_ADDR_REVISION 0x13
  145. #define EDID_IMAGE_HORIZONTAL_SIZE 0x15
  146. #define EDID_IMAGE_VERTICAL_SIZE 0x16
  147. #define EDID_ADDR_FEATURE_SUPPORT 0x18
  148. #define EDID_ADDR_TIMING_DSPR_1 0x36
  149. #define EDID_ADDR_TIMING_DSPR_2 0x48
  150. #define EDID_ADDR_MONITOR_DSPR_1 0x5A
  151. #define EDID_ADDR_MONITOR_DSPR_2 0x6C
  152. #define EDID_ADDR_EXT_BLOCK_FLAG 0x7E
  153. #define EDID_ADDR_EXTEND_BYTE3 0x03 /* EDID address: 0x83 */
  154. /* for ID receiver if RGB, YCbCr 4:2:2 or 4:4:4 */
  155. /* Extension Block 1: */
  156. #define EXTEDID_ADDR_TAG 0x00
  157. #define EXTEDID_ADDR_REVISION 0x01
  158. #define EXTEDID_ADDR_OFST_TIME_DSPR 0x02
  159. /* (5.4) Define the ID for descriptor block type */
  160. /* Notice: reference Table 11 ~ 14 of "EDID Recommended Practive for EIA/CEA-861" */
  161. #define DETAIL_TIMING_DESCRIPTOR -1
  162. #define UNKNOWN_DESCRIPTOR -255
  163. #define MONITOR_NAME_DESCRIPTOR 0xFC
  164. #define MONITOR_RANGE_LIMITS_DESCRIPTOR 0xFD
  165. /* (5.5) Define the offset address of info. within detail timing descriptor block */
  166. #define OFST_PXL_CLK_LO 0
  167. #define OFST_PXL_CLK_HI 1
  168. #define OFST_H_ACTIVE_LO 2
  169. #define OFST_H_BLANKING_LO 3
  170. #define OFST_H_ACT_BLA_HI 4
  171. #define OFST_V_ACTIVE_LO 5
  172. #define OFST_V_BLANKING_LO 6
  173. #define OFST_V_ACTIVE_HI 7
  174. #define OFST_FLAGS 17
  175. /* (5.6) Define the ID for EDID extension type */
  176. #define LCD_TIMING 0x1
  177. #define CEA_TIMING_EXTENSION 0x01
  178. #define EDID_20_EXTENSION 0x20
  179. #define COLOR_INFO_TYPE0 0x30
  180. #define DVI_FEATURE_DATA 0x40
  181. #define TOUCH_SCREEN_MAP 0x50
  182. #define BLOCK_MAP 0xF0
  183. #define EXTENSION_DEFINITION 0xFF
  184. /* (5.7) Define EDID VSDB header length */
  185. #define EDID_VSDB_LEN 0x03
  186. enum _HDMI_SINK_DEEP_COLOR_T {
  187. HDMI_SINK_NO_DEEP_COLOR = 0,
  188. HDMI_SINK_DEEP_COLOR_10_BIT = (1 << 0),
  189. HDMI_SINK_DEEP_COLOR_12_BIT = (1 << 1),
  190. HDMI_SINK_DEEP_COLOR_16_BIT = (1 << 2)
  191. };
  192. #define HDMI_SINK_DEEP_COLOR_T enum _HDMI_SINK_DEEP_COLOR_T
  193. struct _HDMI_SINK_AV_CAP_T {
  194. unsigned int ui4_sink_cea_ntsc_resolution; /* use HDMI_SINK_VIDEO_RES_T */
  195. unsigned int ui4_sink_cea_pal_resolution; /* use HDMI_SINK_VIDEO_RES_T */
  196. unsigned int ui4_sink_dtd_ntsc_resolution; /* use HDMI_SINK_VIDEO_RES_T */
  197. unsigned int ui4_sink_dtd_pal_resolution; /* use HDMI_SINK_VIDEO_RES_T */
  198. unsigned int ui4_sink_1st_dtd_ntsc_resolution; /* use HDMI_SINK_VIDEO_RES_T */
  199. unsigned int ui4_sink_1st_dtd_pal_resolution; /* use HDMI_SINK_VIDEO_RES_T */
  200. unsigned int ui4_sink_native_ntsc_resolution; /* use HDMI_SINK_VIDEO_RES_T */
  201. unsigned int ui4_sink_native_pal_resolution; /* use HDMI_SINK_VIDEO_RES_T */
  202. unsigned short ui2_sink_colorimetry; /* use HDMI_SINK_VIDEO_COLORIMETRY_T */
  203. unsigned short ui2_sink_vcdb_data; /* use HDMI_SINK_VCDB_T */
  204. unsigned short ui2_sink_aud_dec; /* HDMI_SINK_AUDIO_DECODER_T */
  205. unsigned char ui1_sink_dsd_ch_num;
  206. unsigned char ui1_sink_pcm_ch_sampling[7];
  207. /* n: channel number index, value: each bit means sampling rate for this channel number (SINK_AUDIO_32k..) */
  208. unsigned char ui1_sink_pcm_bit_size[7];
  209. /* //n: channel number index, value: each bit means bit size for this channel number */
  210. unsigned char ui1_sink_dst_ch_sampling[7];
  211. /* n: channel number index, value: each bit means sampling rate for this channel number (SINK_AUDIO_32k..) */
  212. unsigned char ui1_sink_dsd_ch_sampling[7];
  213. /* n: channel number index, value: each bit means sampling rate for this channel number (SINK_AUDIO_32k..) */
  214. unsigned short ui1_sink_max_tmds_clock;
  215. unsigned char ui1_sink_spk_allocation;
  216. unsigned char ui1_sink_content_cnc;
  217. unsigned char ui1_sink_p_latency_present;
  218. unsigned char ui1_sink_i_latency_present;
  219. unsigned char ui1_sink_p_audio_latency;
  220. unsigned char ui1_sink_p_video_latency;
  221. unsigned char ui1_sink_i_audio_latency;
  222. unsigned char ui1_sink_i_video_latency;
  223. unsigned char e_sink_rgb_color_bit;
  224. unsigned char e_sink_ycbcr_color_bit;
  225. unsigned char u1_sink_support_ai; /* kenny add 2010/4/25 */
  226. unsigned char u1_sink_max_tmds; /* kenny add 2010/4/25 */
  227. unsigned short ui2_edid_chksum_and_audio_sup; /* HDMI_EDID_CHKSUM_AND_AUDIO_SUP_T */
  228. unsigned short ui2_sink_cec_address;
  229. unsigned char b_sink_edid_ready;
  230. unsigned char b_sink_support_hdmi_mode;
  231. unsigned char ui1_ExtEdid_Revision;
  232. unsigned char ui1_Edid_Version;
  233. unsigned char ui1_Edid_Revision;
  234. unsigned char ui1_sink_support_ai;
  235. unsigned char ui1_Display_Horizontal_Size;
  236. unsigned char ui1_Display_Vertical_Size;
  237. unsigned char b_sink_hdmi_video_present;
  238. unsigned char ui1_CNC;
  239. unsigned char b_sink_3D_present;
  240. unsigned int ui4_sink_cea_3D_resolution;
  241. };
  242. #define HDMI_SINK_AV_CAP_T struct _HDMI_SINK_AV_CAP_T
  243. struct HDMI_EDID_INFO_T {
  244. unsigned int ui4_ntsc_resolution; /* use EDID_VIDEO_RES_T, there are many resolution */
  245. unsigned int ui4_pal_resolution; /* use EDID_VIDEO_RES_T */
  246. unsigned int ui4_sink_native_ntsc_resolution;
  247. /* use EDID_VIDEO_RES_T, only one NTSC resolution, Zero means none native NTSC resolution is available */
  248. unsigned int ui4_sink_native_pal_resolution;
  249. /* use EDID_VIDEO_RES_T, only one resolution, Zero means none native PAL resolution is available */
  250. unsigned int ui4_sink_cea_ntsc_resolution; /* use EDID_VIDEO_RES_T */
  251. unsigned int ui4_sink_cea_pal_resolution; /* use EDID_VIDEO_RES_T */
  252. unsigned int ui4_sink_dtd_ntsc_resolution; /* use EDID_VIDEO_RES_T */
  253. unsigned int ui4_sink_dtd_pal_resolution; /* use EDID_VIDEO_RES_T */
  254. unsigned int ui4_sink_1st_dtd_ntsc_resolution; /* use EDID_VIDEO_RES_T */
  255. unsigned int ui4_sink_1st_dtd_pal_resolution; /* use EDID_VIDEO_RES_T */
  256. unsigned short ui2_sink_colorimetry; /* use EDID_VIDEO_COLORIMETRY_T */
  257. unsigned char ui1_sink_rgb_color_bit; /* color bit for RGB */
  258. unsigned char ui1_sink_ycbcr_color_bit; /* color bit for YCbCr */
  259. unsigned short ui2_sink_aud_dec; /* use EDID_AUDIO_DECODER_T */
  260. unsigned char ui1_sink_is_plug_in; /* 1: Plug in 0:Plug Out */
  261. unsigned int ui4_hdmi_pcm_ch_type; /* use EDID_A_FMT_CH_TYPE */
  262. unsigned int ui4_hdmi_pcm_ch3ch4ch5ch7_type; /* use EDID_A_FMT_CH_TYPE1 */
  263. unsigned int ui4_dac_pcm_ch_type; /* use EDID_A_FMT_CH_TYPE */
  264. unsigned char ui1_sink_i_latency_present;
  265. unsigned char ui1_sink_p_audio_latency;
  266. unsigned char ui1_sink_p_video_latency;
  267. unsigned char ui1_sink_i_audio_latency;
  268. unsigned char ui1_sink_i_video_latency;
  269. unsigned char ui1ExtEdid_Revision;
  270. unsigned char ui1Edid_Version;
  271. unsigned char ui1Edid_Revision;
  272. unsigned char ui1_Display_Horizontal_Size;
  273. unsigned char ui1_Display_Vertical_Size;
  274. unsigned int ui4_ID_Serial_Number;
  275. unsigned int ui4_sink_cea_3D_resolution;
  276. unsigned char ui1_sink_support_ai; /* 0: not support AI, 1:support AI */
  277. unsigned short ui2_sink_cec_address;
  278. unsigned short ui1_sink_max_tmds_clock;
  279. unsigned short ui2_sink_3D_structure;
  280. unsigned int ui4_sink_cea_FP_SUP_3D_resolution;
  281. unsigned int ui4_sink_cea_TOB_SUP_3D_resolution;
  282. unsigned int ui4_sink_cea_SBS_SUP_3D_resolution;
  283. unsigned short ui2_sink_ID_manufacturer_name; /* (08H~09H) */
  284. unsigned short ui2_sink_ID_product_code; /* (0aH~0bH) */
  285. unsigned int ui4_sink_ID_serial_number; /* (0cH~0fH) */
  286. unsigned char ui1_sink_week_of_manufacture; /* (10H) */
  287. unsigned char ui1_sink_year_of_manufacture; /* (11H) base on year 1990 */
  288. };
  289. extern void mt8193_checkedid(unsigned char i1noedid);
  290. extern unsigned char mt8193_fgreadedid(unsigned char i1noedid);
  291. extern void vShowEdidInformation(void);
  292. extern void vShowEdidRawData(void);
  293. extern void vClearEdidInfo(void);
  294. extern void mt8193_AppGetEdidInfo(HDMI_EDID_T *pv_get_info);
  295. extern unsigned char vCheckPcmBitSize(unsigned char ui1ChNumInx);
  296. extern unsigned char mt8193_Check_EdidHeader(void);
  297. extern void hdmi_show_def_info(void);
  298. #endif
  299. #endif