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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
/*
* SiI8620 Linux Driver
*
* Copyright (C) 2013-2014 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.
*/
#if !defined(SI_INFOFRAME_H)
#define SI_INFOFRAME_H
struct __attribute__ ((__packed__)) info_frame_header_t {
uint8_t type_code;
uint8_t version_number;
uint8_t length;
};
enum AviColorSpace_e {
acsRGB,
acsYCbCr422,
acsYCbCr444,
acsYCbCr420
};
enum avi_quant_range_e {
aqr_default = 0,
aqr_limited_range,
aqr_full_range,
aqr_reserved
};
/*
* AVI Info Frame Structure
*/
struct __attribute__ ((__packed__)) avi_info_frame_data_byte_1_t {
uint8_t ScanInfo:2;
uint8_t BarInfo:2;
uint8_t ActiveFormatInfoPresent:1;
enum AviColorSpace_e colorSpace:2;
uint8_t futureMustBeZero:1;
};
struct __attribute__ ((__packed__)) avi_info_frame_data_byte_2_t {
uint8_t ActiveFormatAspectRatio:4;
uint8_t PictureAspectRatio:2;
uint8_t Colorimetry:2;
};
struct __attribute__ ((__packed__)) avi_info_frame_data_byte_3_t {
uint8_t NonUniformPictureScaling:2;
uint8_t RGBQuantizationRange:2;
uint8_t ExtendedColorimetry:3;
uint8_t ITContent:1;
};
struct __attribute__ ((__packed__)) avi_info_frame_data_byte_4_t {
uint8_t VIC:7;
uint8_t futureMustBeZero:1;
};
enum BitsContent_e {
cnGraphics,
cnPhoto,
cnCinema,
cnGame
};
enum AviQuantization_e {
aqLimitedRange,
aqFullRange,
aqReserved0,
aqReserved1
};
struct __attribute__ ((__packed__)) avi_info_frame_data_byte_5_t {
uint8_t pixelRepetionFactor:4;
enum BitsContent_e content:2;
enum AviQuantization_e quantization:2;
};
struct __attribute__ ((__packed__)) hw_avi_named_payload_t {
uint8_t checksum;
union {
struct __attribute__ ((__packed__)) {
struct avi_info_frame_data_byte_1_t pb1;
struct avi_info_frame_data_byte_2_t
colorimetryAspectRatio;
struct avi_info_frame_data_byte_3_t pb3;
struct avi_info_frame_data_byte_4_t VIC;
struct avi_info_frame_data_byte_5_t pb5;
uint8_t LineNumEndTopBarLow;
uint8_t LineNumEndTopBarHigh;
uint8_t LineNumStartBottomBarLow;
uint8_t LineNumStartBottomBarHigh;
uint8_t LineNumEndLeftBarLow;
uint8_t LineNumEndLeftBarHigh;
uint8_t LineNumStartRightBarLow;
uint8_t LineNumStartRightBarHigh;
} bitFields;
uint8_t infoFrameData[13];
} ifData_u;
};
/* this union overlays the TPI HW for AVI InfoFrames,
* starting at REG_TPI_AVI_CHSUM.
*/
union hw_avi_payload_t {
struct hw_avi_named_payload_t namedIfData;
uint8_t ifData[14];
};
struct __attribute__ ((__packed__)) avi_payload_t {
union hw_avi_payload_t hwPayLoad;
uint8_t byte_14;
uint8_t byte_15;
};
struct __attribute__ ((__packed__)) avi_info_frame_t {
struct info_frame_header_t header;
struct avi_payload_t payLoad;
};
/* these values determine the interpretation of PB5 */
enum HDMI_Video_Format_e {
hvfNoAdditionalHDMIVideoFormatPresent,
hvfExtendedResolutionFormatPresent,
hvf3DFormatIndicationPresent
};
enum _3D_structure_e {
tdsFramePacking,
tdsTopAndBottom = 0x06,
tdsSideBySide = 0x08
};
enum ThreeDExtData_e {
tdedHorizontalSubSampling,
tdedQuincunxOddLeftOddRight = 0x04,
tdedQuincunxOddLeftEvenRight,
tdedQuincunxEvenLeftOddRight,
tdedQuincunxEvenLeftEvenRight
};
enum ThreeDMetaDataType_e {
tdmdParallaxIso23022_3Section6_x_2_2
};
struct __attribute__ ((__packed__)) vendor_specific_payload_t {
uint8_t checksum;
uint8_t IEEERegistrationIdentifier[3]; /* 0x000C03 Little Endian */
struct __attribute__ ((__packed__)) {
unsigned reserved:5;
enum HDMI_Video_Format_e HDMI_Video_Format:3;
} pb4;
union {
uint8_t HDMI_VIC;
struct __attribute__ ((__packed__)) _ThreeDStructure {
unsigned reserved:3;
unsigned ThreeDMetaPresent:1;
enum _3D_structure_e threeDStructure:4;
} ThreeDStructure;
} pb5;
struct __attribute__ ((__packed__)) {
uint8_t reserved:4;
uint8_t threeDExtData:4; /* ThreeDExtData_e */
} pb6;
struct __attribute__ ((__packed__)) _PB7 {
uint8_t threeDMetaDataLength:5;
uint8_t threeDMetaDataType:3; /* ThreeDMetaDataType_e */
} pb7;
};
struct __attribute__ ((__packed__)) vendor_specific_info_frame_t {
struct info_frame_header_t header;
struct vendor_specific_payload_t payLoad;
};
/*
* MPEG Info Frame Structure
* Table 8-11 on page 141 of HDMI Spec v1.4
*/
struct __attribute__ ((__packed__)) unr_info_frame_t {
struct info_frame_header_t header;
uint8_t checksum;
uint8_t byte_1;
uint8_t byte_2;
uint8_t byte_3;
uint8_t byte_4;
uint8_t byte_5;
uint8_t byte_6;
};
#ifdef ENABLE_DUMP_INFOFRAME
void DumpIncomingInfoFrameImpl(char *pszId, char *pszFile, int iLine,
info_frame_t *pInfoFrame, uint8_t length);
#define DumpIncomingInfoFrame(pData, length) \
DumpIncomingInfoFrameImpl(#pData, __FILE__, __LINE__, \
(info_frame_t *)pData, length)
#else
#define DumpIncomingInfoFrame(pData, length) /* do nothing */
#endif
#endif /* if !defined(SI_INFOFRAME_H) */
|