1 //<MStar Software> 2 //****************************************************************************** 3 // MStar Software 4 // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved. 5 // All software, firmware and related documentation herein ("MStar Software") are 6 // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by 7 // law, including, but not limited to, copyright law and international treaties. 8 // Any use, modification, reproduction, retransmission, or republication of all 9 // or part of MStar Software is expressly prohibited, unless prior written 10 // permission has been granted by MStar. 11 // 12 // By accessing, browsing and/or using MStar Software, you acknowledge that you 13 // have read, understood, and agree, to be bound by below terms ("Terms") and to 14 // comply with all applicable laws and regulations: 15 // 16 // 1. MStar shall retain any and all right, ownership and interest to MStar 17 // Software and any modification/derivatives thereof. 18 // No right, ownership, or interest to MStar Software and any 19 // modification/derivatives thereof is transferred to you under Terms. 20 // 21 // 2. You understand that MStar Software might include, incorporate or be 22 // supplied together with third party`s software and the use of MStar 23 // Software may require additional licenses from third parties. 24 // Therefore, you hereby agree it is your sole responsibility to separately 25 // obtain any and all third party right and license necessary for your use of 26 // such third party`s software. 27 // 28 // 3. MStar Software and any modification/derivatives thereof shall be deemed as 29 // MStar`s confidential information and you agree to keep MStar`s 30 // confidential information in strictest confidence and not disclose to any 31 // third party. 32 // 33 // 4. MStar Software is provided on an "AS IS" basis without warranties of any 34 // kind. Any warranties are hereby expressly disclaimed by MStar, including 35 // without limitation, any warranties of merchantability, non-infringement of 36 // intellectual property rights, fitness for a particular purpose, error free 37 // and in conformity with any international standard. You agree to waive any 38 // claim against MStar for any loss, damage, cost or expense that you may 39 // incur related to your use of MStar Software. 40 // In no event shall MStar be liable for any direct, indirect, incidental or 41 // consequential damages, including without limitation, lost of profit or 42 // revenues, lost or damage of data, and unauthorized system use. 43 // You agree that this Section 4 shall still apply without being affected 44 // even if MStar Software has been modified by MStar in accordance with your 45 // request or instruction for your use, except otherwise agreed by both 46 // parties in writing. 47 // 48 // 5. If requested, MStar may from time to time provide technical supports or 49 // services in relation with MStar Software to you for your use of 50 // MStar Software in conjunction with your or your customer`s product 51 // ("Services"). 52 // You understand and agree that, except otherwise agreed by both parties in 53 // writing, Services are provided on an "AS IS" basis and the warranty 54 // disclaimer set forth in Section 4 above shall apply. 55 // 56 // 6. Nothing contained herein shall be construed as by implication, estoppels 57 // or otherwise: 58 // (a) conferring any license or right to use MStar name, trademark, service 59 // mark, symbol or any other identification; 60 // (b) obligating MStar or any of its affiliates to furnish any person, 61 // including without limitation, you and your customers, any assistance 62 // of any kind whatsoever, or any information; or 63 // (c) conferring any license or right under any intellectual property right. 64 // 65 // 7. These terms shall be governed by and construed in accordance with the laws 66 // of Taiwan, R.O.C., excluding its conflict of law rules. 67 // Any and all dispute arising out hereof or related hereto shall be finally 68 // settled by arbitration referred to the Chinese Arbitration Association, 69 // Taipei in accordance with the ROC Arbitration Law and the Arbitration 70 // Rules of the Association by three (3) arbitrators appointed in accordance 71 // with the said Rules. 72 // The place of arbitration shall be in Taipei, Taiwan and the language shall 73 // be English. 74 // The arbitration award shall be final and binding to both parties. 75 // 76 //****************************************************************************** 77 //<MStar Software> 78 //////////////////////////////////////////////////////////////////////////////// 79 // 80 // Copyright (c) 2006-2010 MStar Semiconductor, Inc. 81 // All rights reserved. 82 // 83 // Unless otherwise stipulated in writing, any and all information contained 84 // herein regardless in any format shall remain the sole proprietary of 85 // MStar Semiconductor Inc. and be kept in strict confidence 86 // (��MStar Confidential Information��) by the recipient. 87 // Any unauthorized act including without limitation unauthorized disclosure, 88 // copying, use, reproduction, sale, distribution, modification, disassembling, 89 // reverse engineering and compiling of the contents of MStar Confidential 90 // Information is unlawful and strictly prohibited. MStar hereby reserves the 91 // rights to any and all damages, losses, costs and expenses resulting therefrom. 92 // 93 //////////////////////////////////////////////////////////////////////////////// 94 95 /////////////////////////////////////////////////////////////////////////////////////////////////// 96 /// 97 /// @file apiHDMITx_NDS.h 98 /// @author MStar Semiconductor,Inc. 99 /// @brief HDMI Tx API header file for NDS 100 /////////////////////////////////////////////////////////////////////////////////////////////////// 101 102 #ifndef _API_HDMITX_NDS_H_ 103 #define _API_HDMITX_NDS_H_ 104 105 #include "hdmi.h" 106 107 108 #ifdef CUSTOMER_NDS 109 //17.7.7.5 Ioctl: Get Events 110 DLL_PUBLIC MS_BOOL MApi_HDMITx_Get_Events(MS_U32 *events, MS_BOOL bEraseEvent); 111 //17.7.7.8 Ioctl: Get Connection Status 112 DLL_PUBLIC MS_BOOL MApi_HDMITx_Get_Rx_CONNECTION_STATUS(HDMIConnectionStatus *status); 113 //17.7.7.9 Ioctl: Get EEDID Block 114 DLL_PUBLIC MS_BOOL MApi_HDMITx_Get_EEDID_Block(HDMIGetEEDIDBlock *eedid); 115 //17.7.7.10 Ioctl: Start 116 DLL_PUBLIC MS_BOOL MApi_HDMITx_Set_HDMI_Protocol(MS_U8 protocol); 117 //17.7.7.11 Ioctl: Stop 118 DLL_PUBLIC MS_BOOL MApi_HDMITx_Stop(void); 119 //17.7.7.14 Ioctl: Set Video Code 120 DLL_PUBLIC MS_BOOL MApi_HDMITx_Set_Video_Code(MS_U8 *videoCode); 121 //17.7.7.15 Ioctl: Set Pixel Format 122 DLL_PUBLIC MS_BOOL MApi_HDMITx_Set_Pixel_Format(MS_U8 *pixelFormat); 123 //17.7.7.16 Ioctl: Set Aspect Ratio 124 DLL_PUBLIC MS_BOOL MApi_HDMITx_Set_Aspect_Ratio(HDMIAspectRatio *aspectRatio); 125 //17.7.7.17 Ioctl: Set Colorimetry 126 DLL_PUBLIC MS_BOOL MApi_HDMITx_Set_Colorimetry(HDMIColorimetry *colorimetryData); 127 //17.7.7.18 Ioctl: Set AVMUTE 128 //17.7.7.19 Ioctl: Clear AVMUTE 129 DLL_PUBLIC MS_BOOL MApi_HDMITx_Set_AVMUTE(MS_BOOL bflag); 130 //17.7.7.20 Ioctl: HDCP Start Authentication 131 DLL_PUBLIC MS_BOOL MApi_HDMITx_HDCP_Start_Authentication(void); 132 //17.7.7.21 Ioctl: HDCP Stop Authentication 133 DLL_PUBLIC MS_BOOL MApi_HDMITx_HDCP_Stop_Authentication(void); 134 //17.7.7.22 Ioctl: HDCP Get Bcaps 135 DLL_PUBLIC MS_BOOL MApi_HDMITx_HDCP_Get_BCaps(HDMIHDCPBCaps *arg); 136 //17.7.7.23 Ioctl: HDCP Get Bstatus 137 DLL_PUBLIC MS_BOOL MApi_HDMITx_HDCP_Get_BStatus(HDMIHDCPBStatus *arg); 138 //17.7.7.24 Ioctl: HDCP Send SRM List 139 DLL_PUBLIC MS_BOOL MApi_HDMITx_HDCP_Send_SRM(DigitalCPSrm *srm); 140 DLL_PUBLIC void MApi_HDMITx_HDCP_Reset_SRM(void); 141 //17.7.7.25 Ioctl: HDCP Encryption Control 142 DLL_PUBLIC MS_BOOL MApi_HDMITx_HDCP_Encryption_Enable(MS_U8 control); 143 //17.7.7.26 Ioctl: HDCP Get Status 144 DLL_PUBLIC MS_BOOL MApi_HDMITx_HDCP_Get_HDCP_Status(MS_U8 *status); 145 //17.7.7.27 Ioctl: HDCP Configure 146 DLL_PUBLIC MS_BOOL MApi_HDMITx_HDCP_Configure(HDMIHDCPConfiguration *arg); 147 //17.7.7.28 Ioctl: CEC Read 148 DLL_PUBLIC MS_BOOL MApi_HDMITx_CEC_Read(HDMICECRead *readMsgs); 149 //17.7.7.29 Ioctl: CEC Write 150 DLL_PUBLIC MS_BOOL MApi_HDMITx_CEC_Write(HDMICECMessage *msg); 151 152 #endif //CUSTOMER_NDS 153 154 155 #if 0 156 157 158 #include "MsTypes.h" 159 //#include "halHDMITx.h" 160 //#include "drvHDMITx.h" 161 //#include "regHDMITx.h" 162 163 164 165 #ifdef __cplusplus 166 extern "C" 167 { 168 #endif 169 170 #define CUSTOMER_NDS 171 172 #ifdef CUSTOMER_NDS 173 #ifndef __HDMI_H__ 174 //------------------------------------------------------------------------------------------------- 175 // Macro and Define 176 //------------------------------------------------------------------------------------------------- 177 178 179 /* HDMI Event definitions. */ 180 #define HDMI_EVENT_HOTPLUGGED (0x00000001U) 181 #define HDMI_EVENT_HOTUNPLUG (0x00000002U) 182 #define HDMI_EVENT_CEC_RECEIVED (0x00000010U) 183 #define HDMI_EVENT_CP_AUTHENTICATED (0x00100000U) 184 #define HDMI_EVENT_CP_AUTHENTICATION_FAILED (0x00200000U) 185 #define HDMI_EVENT_CP_KSV_REVOKED (0x00400000U) 186 #define HDMI_EVENT_CP_KSV_INVALID (0x00800000U) 187 #define HDMI_EVENT_CP_LINK_INTEGRITY_FAILED (0x01000000U) 188 #define HDMI_EVENT_CP_LINK_INTEGRITY_NO_ACK (0x02000000U) 189 190 /* HDCP Protection Status */ 191 #define HDMI_STATUS_NOT_AUTHENTICATED (1) 192 #define HDMI_STATUS_AUTHENTICATED (2) 193 #define HDMI_STATUS_NOT_AUTHENTICATED_KSV_INVALID (3) 194 #define HDMI_STATUS_NOT_AUTHENTICATED_KSV_REVOKED (4) 195 #define HDMI_STATUS_NOT_AUTHENTICATED_LINK_INTEGRITY_FAILED (5) 196 #define HDMI_STATUS_NOT_AUTHENTICATED_LINK_INTEGRITY_NO_ACK (6) 197 #define HDMI_STATUS_AUTHENTICATION_DISABLED (7) 198 199 /* Capabilities Versions */ 200 #define HDMI_CAP_V0 (0x00000001) 201 202 /* HDMI Specification Versions */ 203 #define HDMI_SPEC_HDMI_1_0 (0x01) 204 #define HDMI_SPEC_HDMI_1_1 (0x02) 205 #define HDMI_SPEC_HDMI_1_2 (0x03) 206 #define HDMI_SPEC_HDMI_1_2a (0x04) 207 #define HDMI_SPEC_HDMI_1_3 (0x05) 208 #define HDMI_SPEC_HDMI_1_3a (0x06) 209 210 /* HDCP Specification Versions 211 */ 212 #define HDMI_SPEC_HDCP_1_0 (0x01) 213 #define HDMI_SPEC_HDCP_1_1 (0x02) 214 #define HDMI_SPEC_HDCP_1_2 (0x03) 215 #define HDMI_SPEC_HDCP_1_3 (0x04) 216 217 /* HDMI Features */ 218 #define HDMI_FEATURE_CEC (0x00000001) 219 #define HDMI_FEATURE_EXTENDED_COLORIMETRY (0x00000002) 220 #define HDMI_FEATURE_PIXEL_FORMAT_RGB (0x00000010) 221 #define HDMI_FEATURE_PIXEL_FORMAT_YCbCr422 (0x00000020) 222 #define HDMI_FEATURE_PIXEL_FORMAT_YCbCr444 (0x00000040) 223 224 #define HDMI_EEDID_BLOCK_SIZE (128) 225 226 /* HDMI Protocol */ 227 #define HDMI_PROTOCOL_DVI (1) 228 #define HDMI_PROTOCOL_HDMI (2) 229 230 /* HDMI Pixel Format */ 231 #define HDMI_PIXEL_FORMAT_RGB (0x00) 232 #define HDMI_PIXEL_FORMAT_YCbCr422 (0x20) 233 #define HDMI_PIXEL_FORMAT_YCbCr444 (0x40) 234 235 /* Source Aspect Ratio Definitions */ 236 #define HDMI_SOURCE_ASPECT_RATIO_NO_DATA (0x00) 237 #define HDMI_SOURCE_ASPECT_RATIO_4_3 (0x10) 238 #define HDMI_SOURCE_ASPECT_RATIO_16_9 (0x20) 239 /* Active Format Descriptor Definitions */ 240 #define HDMI_AFD_SAME_AS_PICTURE (0x08) 241 #define HDMI_AFD_4_3_CENTER (0x09) 242 #define HDMI_AFD_16_9_CENTER (0x0A) 243 #define HDMI_AFD_14_9_CENTER (0x0B) 244 /* AFDInfo Valid Definitions */ 245 #define HDMI_AFDINFO_INVALID (0x00) 246 #define HDMI_AFDINFO_VALID (0x10) 247 /* BarInfo Valid Definitions */ 248 #define HDMI_BARINFO_INVALID (0x00) 249 #define HDMI_BARINFO_VERTICAL_VALID (0x04) 250 #define HDMI_BARINFO_HORIZONTAL_VALID (0x08) 251 #define HDMI_BARINFO_BOTH_VALID (0x0C) 252 /* ScanInfo Valid Definitions */ 253 #define HDMI_SCANINFO_NO_DATA (0x00) 254 #define HDMI_SCANINFO_OVERSCANNED (0x01) 255 #define HDMI_SCANINFO_UNDERSCANNED (0x02) 256 /* Scaling Definitions */ 257 #define HDMI_SCALING_NO_SCALING (0x00) 258 #define HDMI_SCALING_HORIZONTAL (0x01) 259 #define HDMI_SCALING_VERTICAL (0x02) 260 #define HDMI_SCALING_HORIZONTAL_VERTICAL (0x03) 261 262 /* Colorimetry Definitions */ 263 #define HDMI_COLORIMETRY_NONE (0x00) 264 #define HDMI_COLORIMETRY_SMPTE_170M (0x40) 265 #define HDMI_COLORIMETRY_ITU_709 (0x80) 266 #define HDMI_COLORIMETRY_EXTENDED (0xC0) 267 /* Extended Colorimetry Definitions */ 268 #define HDMI_EXTENDED_COLORIMETRY_XVCC601 (0x00) 269 #define HDMI_EXTENDED_COLORIMETRY_XVCC709 (0x10) 270 271 //------------------------------------------------------------------------------------------------- 272 // Type and Structure 273 //------------------------------------------------------------------------------------------------- 274 275 /// cccc 276 /* HDMI CapsEx Structure */ 277 typedef struct 278 { 279 MS_U32 version; 280 void* capability; 281 MS_U32 capabilitySize; 282 } HDMICapsEx; 283 284 /// cccc 285 /* Struct HDMICapsV0 */ 286 typedef struct 287 { 288 MS_U32 features; // HDMI Features 289 MS_U8 numBlenderConnections; // The number of different blender connections supported by this device 290 MS_U8 numSPDIFConnections; // The number of different SPDIF Formatter connections supported by this HDMI device. 291 MS_U8 hdmiVersion; // HDMI Specification Versions 292 MS_U8 hdcpVersion; // HDCP Specification Versions 293 } HDMICapsV0; 294 295 /// cccc 296 typedef struct 297 { 298 MS_U8 attached; 299 MS_U8 powered; 300 } HDMIConnectionStatus; 301 302 /// cccc 303 typedef struct 304 { 305 MS_U32 blockNumber; 306 MS_U8 eedid[HDMI_EEDID_BLOCK_SIZE]; 307 MS_U32 timeOut; 308 } HDMIGetEEDIDBlock; 309 310 /// cccc 311 typedef struct 312 { 313 MS_U8 pictureAspectRatio; 314 MS_U8 activeFormatDescriptor; 315 MS_U16 topBarEndsLine; 316 MS_U16 bottomBarStartsLine; 317 MS_U16 leftBarEndsPixel; 318 MS_U16 rightBarStartsPixel; 319 MS_U8 barinfoValidity; 320 MS_U8 afdValidity; 321 MS_U8 scanInfo; 322 MS_U8 scalingInfo; 323 } HDMIAspectRatio; 324 325 /// cccc 326 typedef struct 327 { 328 MS_U8 colorimetry; 329 MS_U8 extendedColorimetry; 330 } HDMIColorimetry; 331 332 /// cccc 333 typedef struct 334 { 335 MS_U8 bcaps; 336 MS_U32 timeOut; 337 } HDMIHDCPBCaps; 338 339 /// cccc 340 typedef struct 341 { 342 MS_U16 bstatus; 343 MS_U32 timeOut; 344 } HDMIHDCPBStatus; 345 346 typedef struct 347 { 348 MS_U32 length; 349 MS_U8 *data; 350 } DigitalCPSrm; 351 352 /// cccc 353 typedef struct 354 { 355 MS_U32 encryptionStartTime; 356 MS_U8 checkPjIntegrity; 357 } HDMIHDCPConfiguration; 358 359 360 // cccc 361 typedef struct 362 { 363 MS_U8 header; 364 MS_U8 messageLength ; 365 MS_U8 message[16]; 366 } HDMICECMessage; 367 368 /// cccc 369 typedef struct 370 { 371 HDMICECMessage *messages ; 372 MS_U8 numMessages; 373 MS_U8 numMessagesReturned; 374 } HDMICECRead; 375 376 #endif 377 //------------------------------------------------------------------------------------------------- 378 // Function and Variable 379 //------------------------------------------------------------------------------------------------- 380 381 //17.7.7.5 Ioctl: Get Events 382 MS_S8 MApi_HDMITx_Get_Events(MS_U32 *events); 383 //17.7.7.8 Ioctl: Get Connection Status 384 MS_S8 MApi_HDMITx_Get_Rx_CONNECTION_STATUS(HDMIConnectionStatus *status); 385 //17.7.7.9 Ioctl: Get EEDID Block 386 MS_S8 MApi_HDMITx_Get_EEDID_Block(HDMIGetEEDIDBlock *eedid); 387 //17.7.7.10 Ioctl: Start 388 MS_S8 MApi_HDMITx_Set_HDMI_Protocol(MS_U8 protocol); 389 //17.7.7.11 Ioctl: Stop 390 MS_S8 MApi_HDMITx_Stop(void); 391 //17.7.7.14 Ioctl: Set Video Code 392 MS_S8 MApi_HDMITx_Set_Video_Code(MS_U8 *videoCode); 393 //17.7.7.15 Ioctl: Set Pixel Format 394 MS_S8 MApi_HDMITx_Set_Pixel_Format(MS_U8 *pixelFormat); 395 //17.7.7.16 Ioctl: Set Aspect Ratio 396 MS_S8 MApi_HDMITx_Set_Aspect_Ratio(HDMIAspectRatio *aspectRatio); 397 //17.7.7.17 Ioctl: Set Colorimetry 398 MS_S8 MApi_HDMITx_Set_Colorimetry(HDMIColorimetry *colorimetryData); 399 //17.7.7.18 Ioctl: Set AVMUTE 400 //17.7.7.19 Ioctl: Clear AVMUTE 401 MS_S8 MApi_HDMITx_Set_AVMUTE(MS_BOOL bflag); 402 //17.7.7.20 Ioctl: HDCP Start Authentication 403 MS_S8 MApi_HDMITx_HDCP_Start_Authentication(void); 404 //17.7.7.21 Ioctl: HDCP Stop Authentication 405 MS_S8 MApi_HDMITx_HDCP_Stop_Authentication(void); 406 //17.7.7.22 Ioctl: HDCP Get Bcaps 407 MS_S8 MApi_HDMITx_HDCP_Get_BCaps(HDMIHDCPBCaps *arg); 408 //17.7.7.23 Ioctl: HDCP Get Bstatus 409 MS_S8 MApi_HDMITx_HDCP_Get_BStatus(HDMIHDCPBStatus *arg); 410 //17.7.7.24 Ioctl: HDCP Send SRM List 411 MS_S8 MApi_HDMITx_HDCP_Send_SRM(DigitalCPSrm *srm); 412 //17.7.7.25 Ioctl: HDCP Encryption Control 413 MS_S8 MApi_HDMITx_HDCP_Encryption_Enable(MS_U8 control); 414 //17.7.7.26 Ioctl: HDCP Get Status 415 MS_S8 MApi_HDMITx_HDCP_Get_HDCP_Status(MS_U8 *status); 416 //17.7.7.27 Ioctl: HDCP Configure 417 MS_S8 MApi_HDMITx_HDCP_Configure(HDMIHDCPConfiguration *arg); 418 //17.7.7.28 Ioctl: CEC Read 419 MS_S8 MApi_HDMITx_CEC_Read(HDMICECRead *readMsgs); 420 //17.7.7.29 Ioctl: CEC Write 421 MS_S8 MApi_HDMITx_CEC_Write(HDMICECMessage *msg); 422 423 #endif //CUSTOMER_NDS 424 425 #ifdef __cplusplus 426 } 427 #endif 428 429 #endif 430 #endif // _API_HDMITX_NDS_H_ 431 432 433