Commit | Line | Data |
---|---|---|
6fa3eb70 S |
1 | /* |
2 | ||
3 | SiI8348 Linux Driver | |
4 | ||
5 | Copyright (C) 2013 Silicon Image, Inc. | |
6 | ||
7 | This program is free software; you can redistribute it and/or | |
8 | modify it under the terms of the GNU General Public License as | |
9 | published by the Free Software Foundation version 2. | |
10 | This program is distributed AS-IS WITHOUT ANY WARRANTY of any | |
11 | kind, whether express or implied; INCLUDING without the implied warranty | |
12 | of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE or NON-INFRINGEMENT. See | |
13 | the GNU General Public License for more details at http://www.gnu.org/licenses/gpl-2.0.html. | |
14 | ||
15 | */ | |
16 | ||
17 | #define EDID_BLOCK_SIZE 128 | |
18 | #define BIT_EDID_FIELD_FORMAT_HDMI_TO_RGB 0x00 | |
19 | #define BIT_EDID_FIELD_FORMAT_YCbCr422 0x01 | |
20 | #define BIT_EDID_FIELD_FORMAT_YCbCr444 0x02 | |
21 | #define BIT_EDID_FIELD_FORMAT_DVI_TO_RGB 0x03 | |
22 | ||
23 | typedef struct | |
24 | { | |
25 | unsigned parse_3d_in_progress :1; | |
26 | unsigned FLAGS_SENT_3D_REQ :1; | |
27 | unsigned FLAGS_BURST_3D_VIC_DONE :1; | |
28 | unsigned FLAGS_BURST_3D_DTD_DONE :1; | |
29 | ||
30 | unsigned FLAGS_BURST_3D_DTD_VESA_DONE :1; | |
31 | unsigned FLAGS_BURST_3D_DONE :1; | |
32 | unsigned FLAGS_EDID_READ_DONE :1; | |
33 | unsigned reserved :1; | |
34 | }edid_3d_flags_t,*edid_3d_flags_p; | |
35 | ||
36 | #define MAX_V_DESCRIPTORS 21 | |
37 | #define MAX_A_DESCRIPTORS 10 | |
38 | #define MAX_SPEAKER_CONFIGURATIONS 4 | |
39 | #define AUDIO_DESCR_SIZE 3 | |
40 | ||
41 | #define NUM_VIDEO_DATA_BLOCKS_LIMIT 3 | |
42 | ||
43 | typedef struct _edid_parse_data_t | |
44 | { | |
45 | edid_3d_flags_t flags; | |
46 | P_vsdb_t p_HDMI_vsdb; | |
47 | p_video_data_block_t p_video_data_blocks_2d[NUM_VIDEO_DATA_BLOCKS_LIMIT]; | |
48 | Pvideo_capability_data_block_t p_video_capability_data_block; | |
49 | PVSDB_byte_13_through_byte_15_t p_byte_13_through_byte_15; | |
50 | P_3D_mask_t p_3d_mask; | |
51 | P_3D_structure_and_detail_entry_u p_three_d; | |
52 | uint8_t *p_3d_limit; | |
53 | uint8_t num_video_data_blocks; /* counter for initial EDID parsing, persists afterwards */ | |
54 | uint8_t video_data_block_index; /* counter for 3D write burst parsing. */ | |
55 | uint8_t burst_entry_count_3d_vic; | |
56 | uint8_t vic_2d_index; | |
57 | uint8_t vic_3d_index; | |
58 | uint8_t burst_entry_count_3d_dtd; | |
59 | uint8_t vesa_dtd_index; | |
60 | uint8_t cea_861_dtd_index; | |
61 | ||
62 | CEA_short_audio_descriptor_t audio_descriptors[MAX_A_DESCRIPTORS]; /* maximum number of audio descriptors */ | |
63 | uint8_t speaker_alloc[MAX_SPEAKER_CONFIGURATIONS]; /* maximum number of speaker configurations */ | |
64 | bool underscan; /* "1" if DTV monitor underscans IT video formats by default */ | |
65 | bool basic_audio; /* Sink supports Basic Audio */ | |
66 | bool YCbCr_4_4_4; /* Sink supports YCbCr 4:4:4 */ | |
67 | bool YCbCr_4_2_2; /* Sink supports YCbCr 4:2:2 */ | |
68 | bool HDMI_sink; /* "1" if HDMI signature found */ | |
69 | uint8_t CEC_A_B; /* CEC Physical address. See HDMI 1.3 Table 8-6 */ | |
70 | uint8_t CEC_C_D; | |
71 | uint8_t video_capability_flags; | |
72 | uint8_t colorimetry_support_flags; /* IEC 61966-2-4 colorimetry support: 1 - xvYCC601; 2 - xvYCC709 */ | |
73 | uint8_t meta_data_profile; | |
74 | bool _3D_supported; | |
75 | uint8_t num_EDID_extensions; | |
76 | }edid_parse_data_t; | |
77 | ||
78 | struct mhl_dev_context; | |
79 | ||
80 | typedef struct | |
81 | { | |
82 | struct mhl_dev_context *dev_context; | |
83 | void *drv_context; | |
84 | edid_parse_data_t parse_data; | |
85 | uint8_t EDID_block_data [4*EDID_BLOCK_SIZE]; | |
86 | }edid_3d_data_t,*edid_3d_data_p; | |
87 | ||
88 | void *si_edid_create_context(void *dev_context,void *drv_context); | |
89 | void si_edid_destroy_context(void *context); | |
90 | void si_mhl_tx_initiate_edid_sequence(void *context); | |
91 | //void si_mhl_tx_send_3d_req(void *context); | |
92 | void si_mhl_tx_process_3d_vic_burst(void *context, PMHL2_video_format_data_t pWriteBurstData ); | |
93 | void si_mhl_tx_process_3d_dtd_burst(void *context,PMHL2_video_format_data_t pWriteBurstData); | |
94 | uint32_t si_mhl_tx_find_timings_from_totals(edid_3d_data_p mhl_edid_3d_data); | |
95 | int si_edid_sink_is_hdmi(void *context); | |
96 | int si_edid_quantization_range_selectable(void *context); | |
97 | int si_edid_sink_supports_YCbCr422(void *context); | |
98 | int si_edid_sink_supports_YCbCr444(void *context); | |
99 | int si_edid_find_pixel_clock_from_HDMI_VIC(void *context,uint8_t vic); | |
100 | int si_edid_find_pixel_clock_from_AVI_VIC(void *context,uint8_t vic); | |
101 | typedef enum | |
102 | { | |
103 | ne_NO_HPD = -4 | |
104 | ,ne_BAD_DATA = -3 | |
105 | ,ne_BAD_CHECKSUM = ne_BAD_DATA | |
106 | ,ne_BAD_HEADER = -2 | |
107 | ,ne_BAD_HEADER_OFFSET_BY_1 = -1 | |
108 | ,ne_SUCCESS = 0 | |
109 | }NumExtensions_e; | |
110 | ||
111 | int si_mhl_tx_get_num_cea_861_extensions(void *context, | |
112 | uint8_t block_number); | |
113 | int si_edid_read_done(void *context); | |
114 | void si_edid_reset(edid_3d_data_p mhl_edid_3d_data); | |
115 | uint8_t qualify_pixel_clock_for_mhl(edid_3d_data_p mhl_edid_3d_data, | |
116 | uint32_t pixel_clock_frequency, | |
117 | uint8_t bits_per_pixel); | |
118 | uint8_t calculate_generic_checksum(uint8_t *infoFrameData,uint8_t checkSum,uint8_t length); |