1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
/*
SiI8348 Linux Driver
Copyright (C) 2013 Silicon Image, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation version 2.
This program is distributed AS-IS WITHOUT ANY WARRANTY of any
kind, whether express or implied; INCLUDING without the implied warranty
of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE or NON-INFRINGEMENT. See
the GNU General Public License for more details at http://www.gnu.org/licenses/gpl-2.0.html.
*/
/*
@file si_mhl_tx.h
*/
#include "sii_hal.h"
#define SCRATCHPAD_SIZE 16
typedef union
{
Mhl2VideoFormatData_t videoFormatData;
uint8_t asBytes[SCRATCHPAD_SIZE];
#ifdef MEDIA_DATA_TUNNEL_SUPPORT //(
mdt_burst_01_t mdtPackets;
#endif //)
}ScratchPad_u,*PScratchPad_u;
typedef enum
{
qs_auto_select_by_color_space = 0
,qs_full_range = 1
,qs_limited_range = 2
,qs_reserved = 3
}quantization_settings_e;
typedef struct
{
unsigned FLAGS_SCRATCHPAD_BUSY :1;
unsigned FLAGS_REQ_WRT_PENDING :1;
unsigned FLAGS_WRITE_BURST_PENDING :1;
unsigned FLAGS_RCP_READY :1;
unsigned FLAGS_HAVE_DEV_CATEGORY :1;
unsigned FLAGS_HAVE_DEV_FEATURE_FLAGS :1;
unsigned FLAGS_HAVE_COMPLETE_DEVCAP :1;
unsigned FLAGS_SENT_DCAP_RDY :1;
unsigned FLAGS_SENT_PATH_EN :1;
unsigned FLAGS_SENT_3D_REQ :1;
unsigned FLAGS_BURST_3D_VIC_DONE :1;
unsigned FLAGS_BURST_3D_DTD_DONE :1;
unsigned FLAGS_BURST_3D_DTD_VESA_DONE :1;
unsigned FLAGS_BURST_3D_DONE :1;
unsigned FLAGS_EDID_READ_DONE :1;
unsigned RAP_CONTENT_ON :1;
unsigned RAP_STATUS :1;
unsigned MHL_HPD :1;
unsigned MHL_RSEN :1;
unsigned reserved :13;
}MiscFlags_t;
//
// structure to hold operating information of MhlTx component
//
typedef struct
{
void *device_context;
uint8_t status_0; // Received status from peer is stored here
uint8_t status_1; // Received status from peer is stored here
uint8_t connected_ready; // local MHL CONNECTED_RDY register value
uint8_t link_mode; // local MHL LINK_MODE register value
bool_t mhl_connection_event;
uint8_t mhl_connected;
// msc_msg_arrived == true when a MSC MSG arrives, false when it has been picked up
bool_t msc_msg_arrived;
uint8_t msc_msg_sub_command;
uint8_t msc_msg_data;
uint8_t cbus_reference_count; // keep track of CBUS requests
// Remember last command, offset that was sent.
// Mostly for READ_DEVCAP command and other non-MSC_MSG commands
uint8_t msc_last_command;
uint8_t msc_last_offset;
uint8_t msc_last_data;
// Remember last MSC_MSG command (RCPE particularly)
uint8_t msc_msg_last_command;
uint8_t msc_msg_last_data;
uint8_t msc_save_rcp_key_code;
// support WRITE_BURST
ScratchPad_u incoming_scratch_pad;
ScratchPad_u outgoing_scratch_pad;
uint8_t burst_entry_count_3d_vic;
uint8_t vic_2d_index;
uint8_t vic_3d_index;
uint8_t burst_entry_count_3d_dtd;
uint8_t vesa_dtd_index;
uint8_t cea_861_dtd_index;
union
{
MiscFlags_t as_flags; // such as SCRATCHPAD_BUSY
uint32_t as_integer;
}misc_flags_u;
uint8_t preferred_clk_mode;
} mhlTx_config_t;
typedef enum
{
gebSuccess =0
,gebAcquisitionFailed
,gebReleaseFailed
,gebTimedOut
}si_mhl_tx_drv_get_edid_block_result_e;
uint16_t si_mhl_tx_drv_get_incoming_horizontal_total(void);
uint16_t si_mhl_tx_drv_get_incoming_vertical_total(void);
extern mhlTx_config_t mhlTxConfig;
#ifdef ENABLE_COLOR_SPACE_DEBUG_PRINT //(
void print_color_settings_impl(char *pszId,int iLine);
#define print_color_settings(id,line) print_color_settings_impl(id,line);
#else //)(
#define print_color_settings(id,line)
#endif //)
void si_mhl_tx_drv_set_output_color_space_impl(uint8_t outputClrSpc);
void si_mhl_tx_drv_set_input_color_space_impl(uint8_t inputClrSpc);
#define PackedPixelAvailable ((MHL_DEV_VID_LINK_SUPP_PPIXEL & mhlTxConfig.devcap_cache[DEVCAP_OFFSET_VID_LINK_MODE]) && (MHL_DEV_VID_LINK_SUPP_PPIXEL & DEVCAP_VAL_VID_LINK_MODE) )
#define si_mhl_tx_drv_set_output_color_space(outputClrSpc) {si_mhl_tx_drv_set_output_color_space_impl(outputClrSpc);print_color_settings(__FILE__" si_mhl_tx_drv_set_output_color_space",__LINE__)}
#define si_mhl_tx_drv_set_input_color_space(inputClrSpc) {si_mhl_tx_drv_set_input_color_space_impl(inputClrSpc); print_color_settings(__FILE__" si_mhl_tx_drv_set_input_color_space",__LINE__)}
#define SetMiscFlag(func,x) { mhlTxConfig.misc_flags_u.as_flags.x=1; TX_DEBUG_PRINT(("mhl_tx:%s set %s\n",#func,#x)); }
#define ClrMiscFlag(func,x) { mhlTxConfig.misc_flags_u.as_flags.x=0; TX_DEBUG_PRINT(("mhl_tx:%s clr %s\n",#func,#x)); }
#define TestMiscFlag(x) (mhlTxConfig.misc_flags_u.as_flags.x)
void si_mhl_tx_drv_set_upstream_edid(uint8_t *pEDID,uint16_t length);
void si_mhl_tx_tmds_enable(void);
si_mhl_tx_drv_get_edid_block_result_e si_mhl_tx_drv_get_edid_block(uint8_t *p_buf_edid,uint8_t blockNumber,uint8_t blockSize);
bool_t si_mhl_tx_set_int( uint8_t regToWrite,uint8_t mask, uint8_t priorityLevel );
|