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) 2008-2009 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 apiXC.h 98 /// @brief XC Interface 99 /// @author MStar Semiconductor Inc. 100 /////////////////////////////////////////////////////////////////////////////////////////////////// 101 102 /*! \defgroup Video Video modules 103 104 XC is used for \n 105 1. video display \n 106 2. 3D support \n 107 3. mirror mode spoort \n 108 4. frame rate convert and output timing control \n 109 5. OSDC timing control \n 110 For more information,see \link XC_CORE XC_CORE modules \endlink \n 111 112 There are three parts as follow,\n 113 ACE is used for \n 114 1. control the picture quality,include brightness, contrast, CSC ,etc.\n 115 2. MWE function.\n 116 DBC is used for\n 117 1. Dynamic Backlight Curve : Calculate the DBC base on average value.\n 118 DLC is used for\n 119 1. Dynamic Luma Curve : Calculate the DLC curve base on histogram and average value.\n 120 For more information,see \link XC_BE XC_BE modules \endlink \n 121 122 ADC is used to control ADC relative setting for YPbPr, VGA, SCART, AV, SV, ATV.\n 123 For more information,see \link XC_SRC XC_SRC modules \endlink \n 124 125 There are three parts as follow,\n 126 Auto is used to implement auto adjust and auto calibration.\n 127 Mode Parse mechanism is a fast and easy way to look up input timing according to different timing characteristics.\n 128 PC monitor is used to detect signal information.\n 129 For more information,see \link XC_FE XC_FE modules \endlink \n 130 131 DIP is a video capture function ,the whole function block separate four part,source select, clip window, HV scaling down , output window.\n 132 For more information,see \link XC_DWIN XC_DWIN modules \endlink 133 134 * \defgroup XC_CORE XC_CORE modules 135 * \ingroup Video 136 137 XC is used for \n 138 1. video display \n 139 2. 3D support \n 140 3. mirror mode spoort \n 141 4. frame rate convert and output timing control \n 142 5. OSDC timing control \n 143 For more information,see \link XC XC interface (apiXC.h) \endlink 144 145 * \defgroup XC XC interface (apiXC.h) 146 * \ingroup XC_CORE 147 148 XC is used for: 149 150 - 1. video display 151 - support input source as VGA, ATV, CVBS, S-video, YPbPr, SCART, HDMI, DTV, MM 152 - support output as main window, sub window, CVBS out 153 - suoport crop, scaling video to any size and position for display 154 155 - 2. 3D support 156 - support 3D input format as frame packing, field alternative, line alternative, side by side, top bottom, checker board, frame alternative 157 - support 3D output format as line alternative, top bottom, side by side, frame alternative, checker board, pixel alternative, only L frame, only R frame 158 - support normal 2D convert to 3D 159 160 - 3. mirror mode spoort 161 - support H mirror, V mirror, and H+V mirror 162 163 - 4. frame rate convert and output timing control 164 165 - 5. OSDC timing control 166 - support for video and OSD seperate transfer with VB1 167 168 <b> Operation Code Flow: </b> \n 169 check flow chart directly. 170 \image html apiXC_code_follow.png 171 172 * \defgroup XC_INIT XC init control 173 * \ingroup XC 174 175 *! \defgroup XC_INFO XC Infomation pool 176 * \ingroup XC 177 178 *! \defgroup XC_TIMING_DETECT XC Timing detect 179 * \ingroup XC 180 181 *! \defgroup XC_MUX XC mux and path setting 182 * \ingroup XC 183 184 *! \defgroup XC_SCALER XC scaler function 185 * \ingroup XC 186 187 *! \defgroup XC_FRC XC embedded FRC function 188 * \ingroup XC 189 190 *! \defgroup XC_3D XC 3D function 191 * \ingroup XC 192 193 *! \defgroup XC_DS XC DS function 194 * \ingroup XC 195 196 *! \defgroup XC_PQ XC PQ related function 197 * \ingroup XC 198 199 *! \defgroup XC_LD XC Local Dimming function 200 * \ingroup XC 201 202 *! \defgroup XC_OSD XC OSD related function 203 * \ingroup XC 204 205 *! \defgroup XC_VE XC VE function 206 * \ingroup XC 207 208 *! \defgroup XC_DISPLAY XC display function 209 * \ingroup XC 210 211 *! \defgroup XC_GAMMA XC gamma function 212 * \ingroup XC 213 214 *! \defgroup XC_TEST_PATTERN XC test pattern 215 * \ingroup XC 216 217 *! \defgroup XC_UTILITY XC utility function 218 * \ingroup XC 219 220 *! \defgroup XC_ToBeModified XC api to be modified 221 * \ingroup XC 222 223 *! \defgroup XC_ToBeRemove XC api to be removed 224 * \ingroup XC 225 */ 226 227 #ifndef _API_XC_H_ 228 #define _API_XC_H_ 229 230 #include "MsDevice.h" 231 // Driver 232 #include "drvXC_IOPort.h" 233 #include "UFO.h" 234 //? SYMBOL_WEAK defined here , but cause SN compile error 235 //#include "MsCommon.h" 236 #ifdef __cplusplus 237 extern "C" 238 { 239 #endif 240 241 //------------------------------------------------------------------------------------------------- 242 // Macro and Define 243 //------------------------------------------------------------------------------------------------- 244 245 //------------------------------------------------------------------------------------------------- 246 // This macro defined in mscommon.h originally, here just for avoid SN compile error 247 //------------------------------------------------------------------------------------------------- 248 #ifndef SYMBOL_WEAK 249 #define SYMBOL_WEAK __attribute__((weak)) 250 #endif 251 252 // library information 253 #define MSIF_XC_LIB_CODE {'X','C','_','_'} 254 #define MSIF_XC_LIBVER {'0','9'} 255 #define MSIF_XC_BUILDNUM {'1','0'} 256 #define MSIF_XC_CHANGELIST {'0','0','7','0','9','8','0','1'} 257 #define XC_API_VERSION /* Character String for DRV/API version */ \ 258 MSIF_TAG, /* 'MSIF' */ \ 259 MSIF_CLASS, /* '00' */ \ 260 MSIF_CUS, /* 0x0000 */ \ 261 MSIF_MOD, /* 0x0000 */ \ 262 MSIF_CHIP, \ 263 MSIF_CPU, \ 264 MSIF_XC_LIB_CODE , /* IP__ */ \ 265 MSIF_XC_LIBVER , /* 0.0 ~ Z.Z */ \ 266 MSIF_XC_BUILDNUM , /* 00 ~ 99 */ \ 267 MSIF_XC_CHANGELIST, /* CL# */ \ 268 MSIF_OS 269 270 #define XC_INITDATA_VERSION 1 271 #define XC_OUTPUT_TIMING_ADJUST_VERSION 1 272 /// PANEL_INFO_EX version of current XC lib 273 #define PANEL_INFO_EX_VERSION 2 274 /// hw 2d to 3d para version 275 #define HW2DTO3DPARA_VERSION 2 276 /// 3d detect format para version 277 #define DETECT3DFORMATPARA_VERSION 1 278 279 /// ApiStatusEX version of current XC lib 280 /// Define below to distinguish from API_PNLSTATUS_EX_VERSION 281 #define API_XCSTATUS_EX_VERSION 5 282 #define API_STATUS_EX_VERSION API_XCSTATUS_EX_VERSION 283 284 /// 3d fp info version of current XC lib 285 #define XC_3D_FPINFOPARA_VERSION 1 286 /// report pixel info version of current XC lib 287 #define XC_REPORT_PIXELINFO_VERSION 1 288 289 #define API_XCDS_INFO_VERSION 1 290 #define API_DS_INFO_VERSION API_XCDS_INFO_VERSION 291 292 /// osdc disp info version of current XC lib 293 #define ODSC_DISPINFO_VERSIN 1 294 295 #define XC_INVALID_HEAP_ID 0xFFFFFFFF 296 297 #define _BIT(_bit_) (1 << (_bit_)) 298 299 //---------------------------- 300 // Return value 301 //---------------------------- 302 303 /// XC Return Value 304 typedef enum 305 { 306 E_APIXC_RET_FAIL = 0, ///<Fail 307 E_APIXC_RET_OK, ///<OK 308 E_APIXC_RET_FAIL_FUN_NOT_SUPPORT, ///<Fail 309 E_APIXC_RET_FAIL_ENUM_NOT_SUPPORT, ///<Fail 310 E_APIXC_RET_FAIL_INVALID_PARAMETER, ///<Fail 311 } E_APIXC_ReturnValue; 312 313 //---------------------------- 314 // Debug Switch 315 //---------------------------- 316 #define XC_DBGLEVEL_OFF (0x0000) ///< Turn off 317 #define XC_DBGLEVEL_SETWINDOW (0x0001) ///< Set Window 318 #define XC_DBGLEVEL_SETTIMING (0x0002) ///< LPLL / SetPanelTiming 319 #define XC_DBGLEVEL_SYNCDETECT (0x0004) ///< Sync detection ======>Not using it by now 320 #define XC_DBGLEVEL_MUX (0x0008) ///< Mux / Path Creation 321 #define XC_DBGLEVEL_MODEPARSE (0x0010) ///< Mode Parse ======>Not using it by now 322 #define XC_DBGLEVEL_HDMIMONITOR (0x0020) ///< HDMI and Package Monitor ===>Not using it by now 323 #define XC_DBGLEVEL_AUTOGEOMETRY (0x0040) ///< Auto Geometry / Auto Calibration 324 #define XC_DGBLEVEL_CROPCALC (0x0080) ///< Crop Window / Memory / OPM / IPM calculation 325 326 #define XC_DBGLEVEL_SETTIMING_ISR (0x0100) ///< ISR / SetPanelTiming 327 #define XC_DBGLEVEL_DWIN_SETWINDOW (0x0200) ///< DWIN / Set Window 328 #define XC_DBGLEVEL_FUNCTION_TRACE (0x0400) ///< Trace XC function using status 329 #define XC_DBGLEVEL_PARAMETER_TRACE (0x0800) ///< Trace XC function parameter 330 331 #define XC_DBGLEVEL_SEAMLESSZAP (0x1000) ///< Seamless Zapping 332 //---------------------------- 333 // Input signal detect 334 //---------------------------- 335 336 #define XC_MD_VSYNC_POR_BIT _BIT(0) ///< VSnc polarity bit(0/1 = positive/negative) 337 #define XC_MD_HSYNC_POR_BIT _BIT(1) ///< HSync polarity bit(0/1 = positive/negative) 338 #define XC_MD_HSYNC_LOSS_BIT _BIT(2) ///< HSync loss bit 339 #define XC_MD_VSYNC_LOSS_BIT _BIT(3) ///< VSync loss bit 340 #define XC_MD_INTERLACE_BIT _BIT(4) ///< Interlace mode 341 #define XC_MD_USER_MODE_BIT _BIT(7) ///< User new mode (Not found in mode table) 342 #define XC_MD_SYNC_LOSS (XC_MD_HSYNC_LOSS_BIT | XC_MD_VSYNC_LOSS_BIT) ///< VSync & HSync loss bit 343 344 //---------------------------- 345 // 3D macros 346 //---------------------------- 347 #define DOUBLEHD_PRESCALE_VONEHDSIZE (540) 348 349 #define DOUBLEHD_1080X2I_FRAME_VSIZE (1080) 350 #define DOUBLEHD_1080X2I_FIELD_VSIZE (540) 351 #define DOUBLEHD_1080X2I_HSIZE (1920) 352 #define DOUBLEHD_1080X2I_VACT_SPACE1 (23) 353 #define DOUBLEHD_1080X2I_VACT_SPACE2 (22) 354 #define DOUBLEHD_1080X2I_VSIZE (DOUBLEHD_1080X2I_FRAME_VSIZE*2+DOUBLEHD_1080X2I_VACT_SPACE1*2+DOUBLEHD_1080X2I_VACT_SPACE2) 355 356 #define DOUBLEHD_1080X2P_VSIZE (2205) 357 #define DOUBLEHD_1080X2P_FRAME_VSIZE (1080) 358 #define DOUBLEHD_1080X2P_HSIZE (1920) 359 #define DOUBLEHD_1080X2P_GARBAGE_VSIZE (45) 360 361 #define DOUBLEHD_720X2P_VSIZE (1470) 362 #define DOUBLEHD_720X2P_FRAME_VSIZE (720) 363 #define DOUBLEHD_720X2P_HSIZE (1280) 364 #define DOUBLEHD_720X2P_GARBAGE_VSIZE (30) 365 366 #define DOUBLEHD_576X2P_VSIZE (1201) 367 #define DOUBLEHD_576X2P_FRAME_VSIZE (576) 368 #define DOUBLEHD_576X2P_HSIZE (720) 369 #define DOUBLEHD_576X2P_GARBAGE_VSIZE (49) 370 371 //720X480p 372 #define DOUBLEHD_480X2P_VSIZE (1005) 373 #define DOUBLEHD_480X2P_FRAME_VSIZE (480) 374 #define DOUBLEHD_480X2P_HSIZE (720) 375 #define DOUBLEHD_480X2P_GARBAGE_VSIZE (45) 376 377 //640X480p 378 #define DOUBLEHD_640_480X2P_VSIZE (1005) 379 #define DOUBLEHD_640_480X2P_FRAME_VSIZE (480) 380 #define DOUBLEHD_640_480X2P_HSIZE (640) 381 #define DOUBLEHD_640_480X2P_GARBAGE_VSIZE (45) 382 383 // Field Interleave 384 #define FIELD_INTERLEAVE_1080X2I_FRAME_VSIZE (1080) 385 #define FIELD_INTERLEAVE_1080X2I_FIELD_VISZE (540) 386 #define FIELD_INTERLEAVE_1080X2I_HISZE (1920) 387 #define FIELD_INTERLEAVE_1080X2I_VACT_SPACE (23) 388 #define FIELD_INTERLEAVE_1080X2I_VISZE (FIELD_INTERLEAVE_1080X2I_FRAME_VSIZE+FIELD_INTERLEAVE_1080X2I_VACT_SPACE) 389 390 391 ///< When disable panel_info_ex, this means disable all valid panel info 392 #define PANEL_INFO_EX_INVALID_ALL 0xFFFF 393 //------------------------------------------------------------------------------------------------- 394 // Type and Structure 395 //------------------------------------------------------------------------------------------------- 396 397 //---------------------------- 398 // Common 399 //---------------------------- 400 401 /// Define mute type 402 typedef enum 403 { 404 E_MAIN_WINDOW_MUTE =0, ///< main window mute 405 E_SUB_WINDOW_MUTE =1, ///< sub window mute 406 E_PANEL_MUTE = 2 ///< panel mute 407 }EN_MUTE_TYPE; 408 409 410 /// Define window type 411 typedef enum 412 { 413 MAIN_WINDOW=0, ///< main window if with PIP or without PIP 414 SUB_WINDOW=1, ///< sub window if PIP 415 MAX_WINDOW /// The max support window 416 }SCALER_WIN; 417 418 #define PIP_WINDOWS MAX_WINDOW 419 420 /// Define Window position and size attribute 421 typedef struct __attribute__((packed)) 422 { 423 MS_U16 x; ///<start x of the window 424 MS_U16 y; ///<start y of the window 425 MS_U16 width; ///<width of the window 426 MS_U16 height; ///<height of the window 427 } MS_WINDOW_TYPE; 428 429 //////////////////////////////////////////////////////////////////////////////// 430 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 431 // This is abstract input source for XC library. If you want to add another one. 432 // Please contace with XC member 433 //////////////////////////////////////////////////////////////////////////////// 434 435 /// Define Input type 436 typedef enum 437 { 438 INPUT_SOURCE_VGA, ///<0 VGA input 439 INPUT_SOURCE_TV, ///<1 TV input 440 441 INPUT_SOURCE_CVBS, ///<2 AV 1 442 INPUT_SOURCE_CVBS2, ///<3 AV 2 443 INPUT_SOURCE_CVBS3, ///<4 AV 3 444 INPUT_SOURCE_CVBS4, ///<5 AV 4 445 INPUT_SOURCE_CVBS5, ///<6 AV 5 446 INPUT_SOURCE_CVBS6, ///<7 AV 6 447 INPUT_SOURCE_CVBS7, ///<8 AV 7 448 INPUT_SOURCE_CVBS8, ///<9 AV 8 449 INPUT_SOURCE_CVBS_MAX, ///<10 AV max 450 451 INPUT_SOURCE_SVIDEO, ///<11 S-video 1 452 INPUT_SOURCE_SVIDEO2, ///<12 S-video 2 453 INPUT_SOURCE_SVIDEO3, ///<13 S-video 3 454 INPUT_SOURCE_SVIDEO4, ///<14 S-video 4 455 INPUT_SOURCE_SVIDEO_MAX, ///<15 S-video max 456 457 INPUT_SOURCE_YPBPR, ///<16 Component 1 458 INPUT_SOURCE_YPBPR2, ///<17 Component 2 459 INPUT_SOURCE_YPBPR3, ///<18 Component 3 460 INPUT_SOURCE_YPBPR_MAX, ///<19 Component max 461 462 INPUT_SOURCE_SCART, ///<20 Scart 1 463 INPUT_SOURCE_SCART2, ///<21 Scart 2 464 INPUT_SOURCE_SCART_MAX, ///<22 Scart max 465 466 INPUT_SOURCE_HDMI, ///<23 HDMI 1 467 INPUT_SOURCE_HDMI2, ///<24 HDMI 2 468 INPUT_SOURCE_HDMI3, ///<25 HDMI 3 469 INPUT_SOURCE_HDMI4, ///<26 HDMI 4 470 INPUT_SOURCE_HDMI_MAX, ///<27 HDMI max 471 472 INPUT_SOURCE_DTV, ///<28 DTV 473 474 INPUT_SOURCE_DVI, ///<29 DVI 1 475 INPUT_SOURCE_DVI2, ///<30 DVI 2 476 INPUT_SOURCE_DVI3, ///<31 DVI 2 477 INPUT_SOURCE_DVI4, ///<32 DVI 4 478 INPUT_SOURCE_DVI_MAX, ///<33 DVI max 479 480 // Application source 481 INPUT_SOURCE_STORAGE, ///<34 Storage 482 INPUT_SOURCE_KTV, ///<35 KTV 483 INPUT_SOURCE_JPEG, ///<36 JPEG 484 485 //Support Dual MVOP port 486 INPUT_SOURCE_DTV2, ///<37 DTV 487 INPUT_SOURCE_STORAGE2, ///<38 Storage 488 489 //Support Third MVOP port 490 INPUT_SOURCE_DTV3, ///<39 DTV 491 492 // Support OP capture 493 INPUT_SOURCE_SCALER_OP, ///<40 scaler OP 494 495 INPUT_SOURCE_VGA2, /// <41 VGA2 496 INPUT_SOURCE_VGA3, /// <42 VGA3 497 498 INPUT_SOURCE_NUM, ///<43 number of the source 499 INPUT_SOURCE_NONE = INPUT_SOURCE_NUM, ///<NULL input 500 } INPUT_SOURCE_TYPE_t; 501 502 #define IsSrcTypeAV(x) (((x)>=INPUT_SOURCE_CVBS)&&((x)<=INPUT_SOURCE_CVBS_MAX))/// x is AV 503 #define IsSrcTypeSV(x) (((x)>=INPUT_SOURCE_SVIDEO)&&((x)<=INPUT_SOURCE_SVIDEO_MAX))///< x is SV 504 #define IsSrcTypeATV(x) ((x)==INPUT_SOURCE_TV)///< x is ATV 505 #define IsSrcTypeScart(x) (((x)>=INPUT_SOURCE_SCART)&&((x)<=INPUT_SOURCE_SCART_MAX))///< x is Scart 506 #define IsSrcTypeHDMI(x) (((x)>=INPUT_SOURCE_HDMI)&&((x)<=INPUT_SOURCE_HDMI_MAX))///< x is HDMI 507 #define IsSrcTypeVga(x) (((x)==INPUT_SOURCE_VGA) || ((x)==INPUT_SOURCE_VGA2) || ((x)==INPUT_SOURCE_VGA3))///< x is VGA 508 #define IsSrcTypeYPbPr(x) (((x)>=INPUT_SOURCE_YPBPR)&&((x)<=INPUT_SOURCE_YPBPR_MAX))///< x is YPbPr 509 #define IsSrcTypeDTV(x) (((x)==INPUT_SOURCE_DTV) || ((x)==INPUT_SOURCE_DTV2) || ((x)==INPUT_SOURCE_DTV3))///< x is DTV 510 #define IsSrcTypeDVI(x) (((x)>=INPUT_SOURCE_DVI)&&((x)<=INPUT_SOURCE_DVI_MAX))///< x is DVI 511 #define IsSrcTypeJpeg(x) ((x)==INPUT_SOURCE_JPEG)///< x is JPEG 512 #define IsSrcTypeStorage(x) (((x)==INPUT_SOURCE_STORAGE) || ((x)==INPUT_SOURCE_STORAGE2) ||IsSrcTypeJpeg(x))///< x is Storage 513 #define IsSrcTypeDigitalVD(x) ( IsSrcTypeAV(x)||IsSrcTypeSV(x)||IsSrcTypeATV(x)||IsSrcTypeScart(x))///< x is VD 514 #define IsSrcTypeAnalog(x) ( IsSrcTypeVga(x)|| IsSrcTypeYPbPr(x))///< x is Analog 515 #define IsSrcTypeVideo(x) ( IsSrcTypeYPbPr(x) || IsSrcTypeATV(x) || IsSrcTypeAV(x) || IsSrcTypeSV(x) || IsSrcTypeScart(x) || IsSrcTypeDTV(x) ) ///< x is Video 516 #define IsSrcTypeCapture(x) ((x)==INPUT_SOURCE_SCALER_OP)///< x is scaler OP 517 518 //////////////////////////////////////////////////////////////////////////////// 519 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 520 // This is abstract output source for XC library. If you want to add another one. 521 // Please contace with XC member 522 //////////////////////////////////////////////////////////////////////////////// 523 524 /// Define output type 525 typedef enum 526 { 527 OUTPUT_NONE = 0, ///<NULL output 528 OUTPUT_SCALER_MAIN_WINDOW = 1, ///<output to Scaler main window 529 OUTPUT_SCALER2_MAIN_WINDOW = 2, 530 531 OUTPUT_SCALER_SUB_WINDOW = 10, ///<output to Scaler sub window 532 OUTPUT_SCALER2_SUB_WINDOW = 11, 533 534 OUTPUT_CVBS1 = 20, ///<output to CVBS1 535 OUTPUT_CVBS2, ///<output to CVBS2 536 // Reserved area 537 538 OUTPUT_YPBPR0 = 40, ///<output to YPBPR0 539 OUTPUT_YPBPR1, ///<output to YPBPR1 540 // Reserved area 541 542 OUTPUT_HDMI1 = 60, ///<output to HDMI1 543 OUTPUT_HDMI2, ///<output to HDMI2 544 545 OUTPUT_OFFLINE_DETECT = 80, ///<output to OFFLINE detect 546 547 OUTPUT_SCALER_DWIN = 100, ///<output to Dwin 548 549 OUTPUT_NUM, ///<number of outputs 550 }E_DEST_TYPE; 551 552 553 /// Define DeInterlace mode 554 typedef enum 555 { 556 557 MS_DEINT_OFF=0, ///<deinterlace mode off 558 MS_DEINT_2DDI_BOB, ///<deinterlace mode: BOB 559 MS_DEINT_2DDI_AVG, ///<deinterlace mode: AVG 560 MS_DEINT_3DDI_HISTORY, ///<deinterlace mode: HISTORY // 24 bit 561 MS_DEINT_3DDI, ///<deinterlace mode:3DDI// 16 bit 562 } MS_DEINTERLACE_MODE; 563 564 565 /// Define the members of IP Sync Status 566 typedef struct 567 { 568 MS_U8 u8SyncStatus; ///< IP Sync status: refer to MD_VSYNC_POR_BIT, etc 569 MS_U16 u16Hperiod; ///<H Period 570 MS_U16 u16Vtotal; ///<Vertcal total 571 } XC_IP_SYNC_STATUS; 572 573 typedef enum 574 { 575 CMA_XC_SELF_MEM = 0, 576 CMA_XC_COBUFF_MEM = 1, 577 CMA_XC_MEM_NUM = 2, 578 } XC_CMA_CLIENT; 579 580 typedef struct 581 { 582 MS_U32 u32HeapID; 583 MS_U64 u64AddrHeapOffset; 584 } XC_CMA_CONFIG; 585 586 /// Define Freerun color 587 typedef enum 588 { 589 E_XC_FREE_RUN_COLOR_BLACK, 590 E_XC_FREE_RUN_COLOR_WHITE, 591 E_XC_FREE_RUN_COLOR_BLUE, 592 E_XC_FREE_RUN_COLOR_RED, 593 E_XC_FREE_RUN_COLOR_GREEN, 594 E_XC_FREE_RUN_COLOR_MAX, 595 } XC_FREERUN_COLOR; 596 597 /// Define which panel output timing change mode is used to change VFreq for same panel 598 typedef enum 599 { 600 E_XC_PNL_CHG_DCLK = 0, ///<change output DClk to change Vfreq. 601 E_XC_PNL_CHG_HTOTAL = 1, ///<change H total to change Vfreq. 602 E_XC_PNL_CHG_VTOTAL = 2, ///<change V total to change Vfreq. 603 } E_XC_PNL_OUT_TIMING_MODE; 604 605 typedef enum 606 { 607 E_XC_PNL_LPLL_TTL, ///< TTL type 608 E_XC_PNL_LPLL_LVDS, ///< LVDS type 609 E_XC_PNL_LPLL_RSDS, ///< RSDS type 610 E_XC_PNL_LPLL_MINILVDS, ///< TCON //E_XC_PNL_LPLL_MINILVDS_6P_2Link 611 E_XC_PNL_LPLL_ANALOG_MINILVDS, ///< Analog TCON 612 E_XC_PNL_LPLL_DIGITAL_MINILVDS, ///< Digital TCON 613 E_XC_PNL_LPLL_MFC, ///< Ursa (TTL output to Ursa) 614 E_XC_PNL_LPLL_DAC_I, ///< DAC output 615 E_XC_PNL_LPLL_DAC_P, ///< DAC output 616 E_XC_PNL_LPLL_PDPLVDS, ///< For PDP(Vsync use Manually MODE) 617 E_XC_PNL_LPLL_EXT, 618 }E_XC_PNL_LPLL_TYPE; 619 620 621 typedef enum 622 { 623 624 E_XC_PNL_LPLL_EPI34_8P = E_XC_PNL_LPLL_EXT, 625 E_XC_PNL_LPLL_EPI28_8P, 626 E_XC_PNL_LPLL_EPI34_6P, 627 E_XC_PNL_LPLL_EPI28_6P, 628 629 ///< replace this with E_XC_PNL_LPLL_MINILVD 630 E_XC_PNL_LPLL_MINILVDS_5P_2L, 631 E_XC_PNL_LPLL_MINILVDS_4P_2L, 632 E_XC_PNL_LPLL_MINILVDS_3P_2L, 633 E_XC_PNL_LPLL_MINILVDS_6P_1L, 634 E_XC_PNL_LPLL_MINILVDS_5P_1L, 635 E_XC_PNL_LPLL_MINILVDS_4P_1L, 636 E_XC_PNL_LPLL_MINILVDS_3P_1L, 637 638 E_XC_PNL_LPLL_HS_LVDS, ///< High speed LVDS 639 E_XC_PNL_LPLL_HF_LVDS, ///< High Freqquency LVDS 640 641 E_XC_PNL_LPLL_TTL_TCON, 642 E_XC_PNL_LPLL_MINILVDS_2CH_3P_8BIT, ///< 2 channel, 3 pair, 8 bits 643 E_XC_PNL_LPLL_MINILVDS_2CH_4P_8BIT, ///< 2 channel, 4 pair, 8 bits 644 E_XC_PNL_LPLL_MINILVDS_2CH_5P_8BIT, ///< 2 channel, 5 pair, 8 bits 645 E_XC_PNL_LPLL_MINILVDS_2CH_6P_8BIT, ///< 2 channel, 6 pair, 8 bits 646 647 E_XC_PNL_LPLL_MINILVDS_1CH_3P_8BIT, ///< 1 channel, 3 pair, 8 bits 648 E_XC_PNL_LPLL_MINILVDS_1CH_4P_8BIT, ///< 1 channel, 4 pair, 8 bits 649 E_XC_PNL_LPLL_MINILVDS_1CH_5P_8BIT, ///< 1 channel, 5 pair, 8 bits 650 E_XC_PNL_LPLL_MINILVDS_1CH_6P_8BIT, ///< 1 channel, 6 pair, 8 bits 651 652 E_XC_PNL_LPLL_MINILVDS_2CH_3P_6BIT, ///< 2 channel, 3 pari, 6 bits 653 E_XC_PNL_LPLL_MINILVDS_2CH_4P_6BIT, ///< 2 channel, 4 pari, 6 bits 654 E_XC_PNL_LPLL_MINILVDS_2CH_5P_6BIT, ///< 2 channel, 5 pari, 6 bits 655 E_XC_PNL_LPLL_MINILVDS_2CH_6P_6BIT, ///< 2 channel, 6 pari, 6 bits 656 657 E_XC_PNL_LPLL_MINILVDS_1CH_3P_6BIT, ///< 1 channel, 3 pair, 6 bits 658 E_XC_PNL_LPLL_MINILVDS_1CH_4P_6BIT, ///< 1 channel, 4 pair, 6 bits 659 E_XC_PNL_LPLL_MINILVDS_1CH_5P_6BIT, ///< 1 channel, 5 pair, 6 bits 660 E_XC_PNL_LPLL_MINILVDS_1CH_6P_6BIT, ///< 1 channel, 6 pair, 6 bits 661 662 E_XC_PNL_LPLL_HDMI_BYPASS_MODE, //40 // HDMI Bypass Mode 663 664 E_XC_PNL_LPLL_EPI34_2P, /// 41 665 E_XC_PNL_LPLL_EPI34_4P, /// 42 666 E_XC_PNL_LPLL_EPI28_2P, /// 43 667 E_XC_PNL_LPLL_EPI28_4P, /// 44 668 669 E_XC_PNL_LPLL_VBY1_10BIT_4LANE, ///45 670 E_XC_PNL_LPLL_VBY1_10BIT_2LANE, ///46 671 E_XC_PNL_LPLL_VBY1_10BIT_1LANE, ///47 672 E_XC_PNL_LPLL_VBY1_8BIT_4LANE, ///48 673 E_XC_PNL_LPLL_VBY1_8BIT_2LANE, ///49 674 E_XC_PNL_LPLL_VBY1_8BIT_1LANE, ///50 675 676 E_XC_PNL_LPLL_VBY1_10BIT_8LANE, ///51 677 E_XC_PNL_LPLL_VBY1_8BIT_8LANE, ///52 678 679 E_XC_PNL_LPLL_EPI28_12P, /// 53 680 681 E_XC_PNL_LPLL_HS_LVDS_BYPASS_MODE, ///54 682 E_XC_PNL_LPLL_VBY1_10BIT_4LANE_BYPASS_MODE, ///55 683 E_XC_PNL_LPLL_VBY1_8BIT_4LANE_BYPASS_MODE, ///56 684 685 E_XC_PNL_LPLL_TYPE_MAX, 686 }E_XC_PNL_LPLL_EXT_TYPE; 687 688 typedef enum 689 { 690 E_XC_MOD_OUTPUT_SINGLE = 0, ///< single channel 691 E_XC_MOD_OUTPUT_DUAL = 1, ///< dual channel 692 693 E_XC_MOD_OUTPUT_QUAD = 2, ///< quad channel 694 695 } E_XC_OUTPUT_MODE; 696 697 typedef enum 698 { 699 VFREQ_50HZ = 0x00, 700 VFREQ_60HZ = 0x01, 701 VFREQ_FROM_SRC = 0x02, 702 VFREQ_FROM_PANEL = 0x03, 703 } E_VFREQ_SEL; 704 705 /// Sources to VE 706 typedef enum 707 { 708 E_XC_NONE =0x00, 709 E_XC_IP = 0x01, ///< Scaler IP 710 E_XC_VOP2 = 0x02, ///< Scaler VOP2 711 E_XC_BRI = 0x04, ///< Scaler BRI 712 713 /// Please use this for OSD OP video capture!!! 714 E_XC_OP2 = 0x08, ///< Scaler OP2 - After Blending with OSD 715 E_XC_GAM = 0x10, ///< Scaler Gamma - Without Blending with OSD 716 E_XC_DITHER = 0x20, ///< Scaler noise dither - Without Blending with OSD 717 718 /// Please use this for non-OSD OP video capture!!! 719 E_XC_OVERLAP = 0x40, ///< Scaler color overlap - Without Blending with OSD 720 E_XC_IP_SUB = 0x80, ///< Scaler IP of sub window 721 }E_XC_SOURCE_TO_VE; 722 723 ///Port connect to pin 8 of SCART 724 typedef enum 725 { 726 E_XC_SCARTID_NONE = 0x00, ///< No connection 727 E_XC_SCARTID_TO_HSYNC0 = 0x01, ///< Pin 8 of SCART connects to Hsync 0 728 E_XC_SCARTID_TO_HSYNC1 = 0x02, ///< Pin 8 of SCART connects to Hsync 1 729 E_XC_SCARTID_TO_HSYNC2 = 0x04, ///< Pin 8 of SCART connects to Hsync 2 730 E_XC_SCARTID_TO_SOG0 = 0x08, ///< Pin 8 of SCART connects to SOG0 731 E_XC_SCARTID_TO_SOG1 = 0x10, ///< Pin 8 of SCART connects to SOG1 732 E_XC_SCARTID_TO_SOG2 = 0x20, ///< Pin 8 of SCART connects to SOG2 733 }E_XC_SCART_ID_PORT; 734 735 /// Items for query driver or H/W capability. 736 typedef enum 737 { 738 E_XC_SUPPORT_IMMESWITCH = 0x00000001, ///< return true if H/W support HDMI immeswitch 739 740 E_XC_SUPPORT_DVI_AUTO_EQ = 0x00000005, ///< return true if driver support Auto EQ. 741 742 E_XC_SUPPORT_FRC_INSIDE = 0x00000100, ///< return true if scaler driver support FRC (MFC) function. 743 744 }E_XC_CAPABILITY; 745 746 typedef enum 747 { 748 E_XC_IMMESWITCH = 0x00000001, ///< return true if H/W support HDMI immeswitch 749 750 E_XC_DVI_AUTO_EQ = 0x00000002, ///< return true if driver support Auto EQ. 751 752 E_XC_FRC_INSIDE = 0x00000004, ///< return true if scaler driver support FRC (MFC) function. 753 754 E_XC_DIP_CHIP_CAPS = 0x00000008, ///< return dip chip caps. 755 756 E_XC_3D_FBL_CAPS = 0x00000010, ///< return true if chip support fbl 3d.attention:fbl 3d only support sbs to lbl and sbs to sbs 757 758 E_XC_HW_SEAMLESS_ZAPPING = 0x00000020, ///< return true if H/W support seamless zapping 759 760 E_XC_SUPPORT_DEVICE1 = 0x00000040, ///< return true if H/W support scaler device1 761 762 E_XC_SUPPORT_DETECT3D_IN3DMODE = 0x00000080, ///< return true if H/W support detecting 3d when already in 3d mode 763 764 E_XC_2DTO3D_VERSION = 0x00000100, ///< return value 2D-to-3D version 765 766 E_XC_SUPPORT_FORCE_VSP_IN_DS_MODE = 0x00000200, ///< return if H/W support force post-Vscalin-down in DS mode 767 768 E_XC_SUPPORT_FRCM_MODE = 0x00000400, ///< return if H/W support frcm 769 770 E_XC_SUPPORT_INTERLACE_OUT = 0x00000800, ///< return if H/W supports interlace output timing 771 772 E_XC_SUPPORT_4K2K_WITH_PIP = 0x00001000, ///< return if H/W supports output is 4k2k and open pip 773 774 E_XC_SUPPORT_4K2K_60P = 0x00002000, ///< return if H/W supports output is 4k2k_60P timing 775 776 E_XC_SUPPORT_PIP_PATCH_USING_SC1_MAIN_AS_SC0_SUB = 0x00004000,///<return if sc1 suport PIP 777 778 E_XC_HW_4K2K_VIP_PEAKING_LIMITATION = 0x00008000, ///return if H/W has vip peaking limitation 779 }E_XC_CAPS; 780 781 typedef enum 782 { 783 E_XC_DS_INDEX_MVOP, 784 E_XC_DS_INDEX_SCALER, 785 E_XC_DS_INDEX_MAX, 786 }E_XC_DS_INDEX_SOURCE; 787 788 typedef enum 789 { 790 E_XC_FRC_InputTiming_2K1K, 791 E_XC_FRC_InputTiming_4K2K, 792 E_XC_FRC_InputTiming_MAX, 793 }E_XC_FRC_InputTiming; 794 795 typedef enum 796 { 797 PIXEL_SHIFT_MOVE_MAIN_WINDOW = 0x0001, 798 PIXEL_SHIFT_MOVE_SUB_WINDOW = 0x0002, 799 PIXEL_SHIFT_MOVE_REPORT_WINDOW = 0x0004, 800 PIXEL_SHIFT_MOVE_OSD_LAYER = 0x0008, 801 PIXEL_SHIFT_DO_OVERSCAN = 0x0010, 802 } PIXEL_SHIFT_FEATURE; 803 /// Define panel information 804 typedef struct __attribute__((packed)) 805 { 806 // XC need below information do to frame lock 807 808 MS_U16 u16HStart; ///<DE H start 809 810 MS_U16 u16VStart; ///<DE V start 811 812 MS_U16 u16Width; ///<DE H width 813 814 MS_U16 u16Height; ///< DE V height 815 816 MS_U16 u16HTotal; ///<H total 817 818 MS_U16 u16VTotal; ///<V total 819 820 MS_U16 u16DefaultVFreq; ///<Panel output Vfreq., used in free run 821 822 MS_U8 u8LPLL_Mode; ///<0: single mode, 1: dual mode 823 E_XC_PNL_OUT_TIMING_MODE enPnl_Out_Timing_Mode; ///<Define which panel output timing change mode is used to change VFreq for same panel 824 825 // Later need to refine to use Min/Max SET for PDP panel, but for LCD, it maybe no need to check the Min/Max SET 826 MS_U16 u16DefaultHTotal; ///<default H total 827 MS_U16 u16DefaultVTotal; ///<default V total 828 829 MS_U32 u32MinSET; 830 MS_U32 u32MaxSET; 831 E_XC_PNL_LPLL_TYPE eLPLL_Type; /// 832 } XC_PANEL_INFO; 833 834 835 /// Define the extern special panel information for FPLL or other usage 836 /// Usage: 837 /// The first 3 members of below structure must be set as their corresponding description 838 /// The other members are set according to your request, none used members should be cleared to zero 839 /// Example code of set VTT slowly: 840 /// XC_PANEL_INFO_EX stPanelInfoEx; 841 /// memset(&stPanelInfoEx, 0, sizeof(XC_PANEL_INFO_EX)); 842 /// stPanelInfoEx.u32PanelInfoEx_Version = PANEL_INFO_EX_VERSION; 843 /// stPanelInfoEx.u16PanelInfoEX_Length = sizeof(XC_PANEL_INFO_EX); 844 /// 845 /// stPanelInfoEx.bVttStepsValid = TRUE; 846 /// stPanelInfoEx.bVttDelayValid = TRUE; 847 /// stPanelInfoEx.u16VttSteps = xx; //set how many steps u want to set the vtt 848 /// stPanelInfoEx.u16VttDelay = xx;// set the delay between steps of setting vtt 849 /// stPanelInfoEx.u16VFreq = 500; //this step setting info is only for 50hz 850 /// if(MApi_XC_SetExPanelInfo(TRUE, &stPanelInfoEx))//Check the set is accepted or not 851 /// stPanelInfoEx.u16VFreq = 600; //set same steps info for 60 hz 852 /// if(MApi_XC_SetExPanelInfo(TRUE, &stPanelInfoEx))//Check the set is accepted or not 853 /// 854 typedef struct __attribute__((packed)) 855 { 856 MS_U32 u32PanelInfoEx_Version; ///<Version of current structure. Please always set to "PANEL_INFO_EX_VERSION" as input 857 MS_U16 u16PanelInfoEX_Length; ///<Length of this structure, u16PanelInfoEX_Length=sizeof(XC_PANEL_INFO_EX) 858 MS_U16 u16VFreq; ///<Output Vfreq, unit: (1Hz/10), range 0~PANEL_INFO_EX_INVALID_ALL 859 ///<If disable ex panel info and u16VFreq = 0xFFFF means disable all valid ex panel info 860 ///<If disable ex panel info and u16VFreq = 600 means disable the valid ex panel info for 60 hz 861 MS_U16 u16HTotal; ///<H total of output "u16VFreq" 862 MS_BOOL bHTotalValid; ///H total setting is valid in this structure 863 MS_U16 u16VTotal; ///<V total of output "u16VFreq" 864 MS_BOOL bVTotalValid; ///V total setting is valid in this structure 865 MS_U32 u32DClk; ///<DCLK of output "u16VFreq", unit: KHz 866 MS_BOOL bDClkValid; ///DCLK, unit: KHz 867 MS_U16 u16MinHTotal; ///<Min H total 868 MS_BOOL bMinHTotalValid; ///Min H total 869 MS_U16 u16MinVTotal; ///<Min V total 870 MS_BOOL bMinVTotalValid; ///Min V total 871 MS_U32 u32MinDClk; ///<Min DCLK, unit: KHz 872 MS_BOOL bMinDClkValid; ///Min DCLK, unit: KHz 873 MS_U16 u16MaxHTotal; ///<Max H total 874 MS_BOOL bMaxHTotalValid; ///Max H total 875 MS_U16 u16MaxVTotal; ///<Max V total 876 MS_BOOL bMaxVTotalValid; ///Max V total 877 MS_U32 u32MaxDClk; ///<Min DCLK, unit: KHz 878 MS_BOOL bMaxDClkValid; ///Min DCLK, unit: KHz 879 // sync related 880 MS_U16 u16HSyncWidth; ///<VOP_01[7:0], PANEL_HSYNC_WIDTH 881 MS_BOOL bHSyncWidthValid; ///< VOP_01[7:0], PANEL_HSYNC_WIDTH 882 MS_U16 u16HSyncBackPorch; ///<PANEL_HSYNC_BACK_PORCH, no register setting, provide value for query only 883 ///<not support Manuel VSync Start/End now 884 ///<VOP_02[10:0] VSync start = Vtt - VBackPorch - VSyncWidth 885 ///<VOP_03[10:0] VSync end = Vtt - VBackPorch 886 MS_BOOL bHSyncBackPorchValid; 887 MS_U16 u16VSyncWidth; ///<define PANEL_VSYNC_WIDTH 888 MS_BOOL bVSyncWidthValid; 889 MS_U16 u16VSyncBackPorch; ///<define PANEL_VSYNC_BACK_PORCH 890 MS_BOOL bVSyncBackPorchValid; 891 //step by step adjustment when 50/60 HZ Output switch 892 MS_U16 u16HttSteps; ///<Number of adjusting step from Old Htt to new htt 893 MS_BOOL bHttStepsValid; 894 MS_U16 u16HttDelay; ///<Delay time in two steps 895 MS_BOOL bHttDelayValid; 896 MS_U16 u16VttSteps; ///<Number of adjusting step from Old Htt to new htt 897 MS_BOOL bVttStepsValid; 898 MS_U16 u16VttDelay; ///<Delay time in two steps 899 MS_BOOL bVttDelayValid; 900 MS_U16 u16DclkSteps; ///<Number of adjusting step from Old Htt to new htt 901 MS_BOOL bDclkStepsValid; 902 MS_U16 u16DclkDelay; ///<Delay time in two steps 903 MS_BOOL bDclkDelayValid; ///<DclkDelay setting is valid in this structure 904 }XC_PANEL_INFO_EX; 905 906 /// Define new panel information 907 typedef struct 908 { 909 MS_U32 u32TimingAdjustSetting_version; ///<Version of current structure. Please always set this value as XC_OUTPUT_TIMING_ADJUST_VERSION 910 911 MS_U16 u16HTotal_Step; ///<Number of adjusting step from Old Htt to new htt 912 MS_U16 u16HTotal_Delay; ///<Delay time in two steps 913 MS_U16 u16HTotal_Ratio; ///<Ratio of Htt for change to specific framerate (X10). 914 915 MS_U16 u16VTotal_Step; ///<Number of adjusting step from Old Vtt to new Vtt 916 MS_U16 u16VTotal_Delay; ///<Delay time in two steps 917 MS_U16 u16VTotal_Ratio; ///<Ratio of Vtt for change to specific framerate (X10). 918 919 MS_U16 u16Dclk_Step; ///<Number of adjusting step from Old Dclk to new Dclk 920 MS_U16 u16Dclk_Delay; ///<Delay time in two steps 921 MS_U16 u16Dclk_Ratio; ///<Ratio of Dclk for change to specific framerate (X10). 922 923 }XC_OUTPUT_TIMING_ADJUST_SETTING; 924 925 /// Define the initial data for XC 926 typedef struct __attribute__((packed)) 927 { 928 MS_U32 u32XC_version; ///<Version of current structure. 929 // system related 930 MS_U32 u32XTAL_Clock; ///<Crystal clock in Hz 931 932 // frame buffer related 933 MS_PHY u32Main_FB_Start_Addr; ///<scaler main window frame buffer start address, absolute without any alignment 934 MS_PHY u32Main_FB_Size; ///<scaler main window frame buffer size, the unit is BYTES 935 MS_PHY u32Sub_FB_Start_Addr; ///<scaler sub window frame buffer start address, absolute without any alignment 936 MS_PHY u32Sub_FB_Size; ///<scaler sub window frame buffer size, the unit is BYTES 937 938 // HDMI related, will be moved to HDMI module 939 MS_BOOL bCEC_Use_Interrupt; ///<CEC use interrupt or not, if not, will use polling 940 941 // This is related to chip package. ( Share Ground / Non-Share Ground ) 942 MS_BOOL bIsShareGround; 943 944 // function related 945 MS_BOOL bEnableIPAutoCoast; ///<Enable IP auto coast 946 947 MS_BOOL bMirror; ///<mirror mode 948 949 // panel related 950 XC_PANEL_INFO stPanelInfo; ///<panel infomation 951 952 // DLC 953 MS_BOOL bDLC_Histogram_From_VBlank; ///<If set to TRUE, the Y max/min report value is read from V blanking area 954 955 // This is related to layout 956 MS_U16 eScartIDPort_Sel; ///<This is port selection (E_XC_SCART_ID_PORT) of Scart ID pin 8 957 958 // frcm frame buffer related 959 MS_PHY u32Main_FRCM_FB_Start_Addr; ///<scaler main window frcm frame buffer start address, absolute without any alignment 960 MS_PHY u32Main_FRCM_FB_Size; ///<scaler main window frcm frame buffer size, the unit is BYTES 961 MS_PHY u32Sub_FRCM_FB_Start_Addr; ///<scaler sub window frcm frame buffer start address, absolute without any alignment 962 MS_PHY u32Sub_FRCM_FB_Size; ///<scaler sub window frcm frame buffer size, the unit is BYTES 963 } XC_INITDATA; 964 965 /// define generic API infomation 966 typedef struct __attribute__((packed)) 967 { 968 MS_U8 u8MaxWindowNum; ///<max window number that XC driver supports such as MAIN/SUB window 969 MS_U8 u8NumOfDigitalDDCRam; ///<indicate how many Digital DDCRam that use can use without external EDID EEPROM 970 MS_U8 u8MaxFrameNumInMem; ///<indicate maximal number of frames (Progressive mode) supported by scaler simultaneously 971 MS_U8 u8MaxFieldNumInMem; ///<indicate maximal number of fields (Interlace mode) supported by scaler simultaneously 972 } XC_ApiInfo; 973 974 /// define the information of set window 975 typedef struct 976 { 977 //------------- 978 // Input 979 //------------- 980 INPUT_SOURCE_TYPE_t enInputSourceType; ///<Input source 981 982 //------------- 983 // Window 984 //------------- 985 MS_WINDOW_TYPE stCapWin; ///<Capture window 986 MS_WINDOW_TYPE stDispWin; ///<Display window 987 MS_WINDOW_TYPE stCropWin; ///<Crop window 988 989 //------------- 990 // Timing 991 //------------- 992 MS_BOOL bInterlace; ///<Interlaced or Progressive 993 MS_BOOL bHDuplicate; ///<flag for vop horizontal duplicate, for MVD, YPbPr, indicate input double sampled or not 994 MS_U16 u16InputVFreq; ///<Input V Frequency, VFreqx10, for calculate output panel timing 995 MS_U16 u16InputVTotal; ///<Input Vertical total, for calculate output panel timing 996 MS_U16 u16DefaultHtotal; ///<Default Htotal for VGA/YPbPr input 997 MS_U8 u8DefaultPhase; ///<Obsolete 998 999 //------------------------- 1000 // customized post scaling 1001 //------------------------- 1002 MS_BOOL bHCusScaling; ///<assign post H customized scaling instead of using XC scaling 1003 MS_U16 u16HCusScalingSrc; ///<post H customized scaling src width 1004 MS_U16 u16HCusScalingDst; ///<post H customized scaling dst width 1005 MS_BOOL bVCusScaling; ///<assign post V manuel scaling instead of using XC scaling 1006 MS_U16 u16VCusScalingSrc; ///<post V customized scaling src height 1007 MS_U16 u16VCusScalingDst; ///<post V customized scaling dst height 1008 1009 //-------------- 1010 // 9 lattice 1011 //-------------- 1012 MS_BOOL bDisplayNineLattice; ///<used to indicate where to display in panel and where to put in frame buffer 1013 1014 //------------------------- 1015 // customized pre scaling 1016 //------------------------- 1017 MS_BOOL bPreHCusScaling; ///<assign pre H customized scaling instead of using XC scaling 1018 MS_U16 u16PreHCusScalingSrc; ///<pre H customized scaling src width 1019 MS_U16 u16PreHCusScalingDst; ///<pre H customized scaling dst width 1020 MS_BOOL bPreVCusScaling; ///<assign pre V manuel scaling instead of using XC scaling 1021 MS_U16 u16PreVCusScalingSrc; ///<pre V customized scaling src height 1022 MS_U16 u16PreVCusScalingDst; ///<pre V customized scaling dst height 1023 MS_U16 u16DefaultPhase; ///<Default Phase for VGA/YPbPr input 1024 } XC_SETWIN_INFO; 1025 1026 typedef struct 1027 { //mastering color display: color volumne of a display 1028 MS_U32 u32MaxLuminance; 1029 MS_U32 u32MinLuminance; 1030 MS_U16 u16DisplayPrimaries[3][2]; 1031 MS_U16 u16WhitePoint[2]; 1032 } XC_DS_MasterColorDisplay; 1033 1034 typedef struct 1035 { 1036 //color_description: indicates the chromaticity/opto-electronic coordinates of the source primaries 1037 MS_U8 u8ColorPrimaries; 1038 MS_U8 u8TransferCharacteristics; 1039 // matrix coefficients in deriving YUV signal from RGB 1040 MS_U8 u8MatrixCoefficients; 1041 } XC_DS_ColorDescription; 1042 1043 typedef struct 1044 { 1045 // bit[0]: MS_ColorDescription present or valid, bit[1]: MS_MasterColorDisplay present or valid 1046 MS_U32 u32FrmInfoExtAvail; 1047 // mastering color display: color volumne of a display 1048 XC_DS_ColorDescription stColorDescription; 1049 XC_DS_MasterColorDisplay stMasterColorDisplay; 1050 } XC_DS_HDRInfo; 1051 1052 typedef struct{ 1053 //MVOP 1054 MS_U32 u32ApiDSInfo_Version; ///<Version of current structure. Please always set to "PANEL_INFO_EX_VERSION" as input 1055 MS_U16 u16ApiDSInfo_Length; 1056 MS_U32 u32MFCodecInfo; 1057 XC_DS_HDRInfo stHDRInfo; 1058 }XC_DS_INFO; 1059 1060 1061 /// define the information for dynamic scaling (DS) 1062 /// one entry of DS is: 1063 /// 1064 /// 8 bit alignment 1065 /// LSB ----> MSB 1066 /// OP (32bits) -> IP (32bits) 1067 /// [7:0] [15:8] [23:16] [31:24] 1068 /// Data_L Data_H Reg_Addr(16bit) Reg_Bank 1069 /// 1070 /// 16 bit alignment 1071 /// LSB ----> MSB 1072 /// OP (32bits) -> IP (32bits) -> 0xFFFFFFFF, 0xFFFFFFFF (dummy) 1073 /// 1074 /// If bIP_DS_On == FALSE, the DS will ignore the IP information 1075 /// If bOP_DS_On == FALSE, the DS will ignore the OP information 1076 typedef struct 1077 { 1078 MS_PHY u32DS_Info_BaseAddr; ///< The memory base address to update IP/OP dynamic scaling registers. Absolute without any alignment. 1079 MS_U8 u8MIU_Select; ///< 0: MIU0, 1: MIU1, etc. 1080 MS_U8 u8DS_Index_Depth; ///< The index depth (how many entries to fire per MVOP Vsync falling) of DS 1081 MS_BOOL bOP_DS_On; ///< OP dynamic scaling on/off 1082 MS_BOOL bIPS_DS_On; ///< IPS dynamic scaling on/off 1083 MS_BOOL bIPM_DS_On; ///< IPM dynamic scaling on/off 1084 } XC_DynamicScaling_Info; 1085 1086 /// Define source type for DIP 1087 typedef enum 1088 { 1089 SCALER_DIP_SOURCE_TYPE_SUB2 = 0, ///< DIP from SUB2(IP_F3) 1090 SCALER_DIP_SOURCE_TYPE_MAIN = 1, ///< DIP from MAIN(IP_MAIN) 1091 SCALER_DIP_SOURCE_TYPE_SUB = 2, ///< DIP from SUB (IP_SUB) 1092 SCALER_DIP_SOURCE_TYPE_OP_MAIN = 3, ///< HVSP MAIN 1093 SCALER_DIP_SOURCE_TYPE_OP_SUB = 4, ///< HVSP SUB 1094 SCALER_DIP_SOURCE_TYPE_DRAM = 5, ///< DIP from DRAM 1095 SCALER_DIP_SOURCE_TYPE_OP_CAPTURE = 6, ///< DIP from OP capture 1096 SCALER_DIP_SOURCE_TYPE_OSD = 7, ///< DIP from OSD capture 1097 SCALER_DIP_SOURCE_TYPE_SC2_OP_CAPTURE = 8, ///< DIP from SC2 OP capture 1098 MAX_SCALER_DIP_SOURCE_NUM ///< The max support window 1099 }SCALER_DIP_SOURCE_TYPE; 1100 1101 /// Define the path type 1102 typedef enum 1103 { 1104 PATH_TYPE_SYNCHRONOUS, ///<synchronous path type 1105 PATH_TYPE_ASYNCHRONOUS, ///<asynchronous path type 1106 }E_PATH_TYPE; 1107 1108 /// Define the mux path information 1109 typedef struct 1110 { 1111 E_PATH_TYPE Path_Type; ///<path type 1112 INPUT_SOURCE_TYPE_t src; ///<source input type 1113 E_DEST_TYPE dest; ///<destination type of output 1114 1115 void (* path_thread)(INPUT_SOURCE_TYPE_t src, MS_BOOL bRealTimeMonitorOnly); ///<path read 1116 void (* SyncEventHandler )(INPUT_SOURCE_TYPE_t src, void* para); ///<sync event handler 1117 void (* DestOnOff_Event_Handler )(INPUT_SOURCE_TYPE_t src, void* para); ///<destination on off event handler 1118 void (* dest_periodic_handler )(INPUT_SOURCE_TYPE_t src, MS_BOOL bRealTimeMonitorOnly) ; ///<destination periodic handler 1119 } XC_MUX_PATH_INFO; 1120 1121 /// Image store format in XC 1122 typedef enum 1123 { 1124 IMAGE_STORE_444_24BIT, ///< (8+8+8) Y Cb Cr / B G R 1125 IMAGE_STORE_422_16BIT, ///< (8+8) Y Cb Y Cr / G B G R 1126 IMAGE_STORE_422_24BIT, ///< (10+10+4) Y Cb Y Cr / G B G R -- Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 - C5 C4 C3 C2 C1 C0 Y9 Y8 - xx xx xx xx C9 C8 C7 C6 1127 } MS_IMAGE_STORE_FMT; 1128 1129 /// XC API status 1130 typedef struct 1131 { 1132 //---------------------- 1133 // Customer setting 1134 //---------------------- 1135 INPUT_SOURCE_TYPE_t enInputSourceType; ///< Input source type 1136 1137 //---------------------- 1138 // Window 1139 //---------------------- 1140 MS_WINDOW_TYPE stCapWin; ///<Capture window 1141 MS_WINDOW_TYPE stDispWin; ///<Display window 1142 MS_WINDOW_TYPE stCropWin; ///<Crop window 1143 1144 //---------------------- 1145 // Timing 1146 //---------------------- 1147 MS_BOOL bInterlace; ///<Interlaced or Progressive 1148 MS_BOOL bHDuplicate; ///<flag for vop horizontal duplicate, for MVD, YPbPr, indicate input double sampled or not 1149 MS_U16 u16InputVFreq; ///<Input V Frequency, VFreqx10, for calculate output panel timing 1150 MS_U16 u16InputVTotal; ///<Input Vertical total, for calculate output panel timing 1151 MS_U16 u16DefaultHtotal; ///<Default Htotal for VGA/YPbPr input 1152 MS_U8 u8DefaultPhase; ///<Obsolete, use u16DefaultPhase instead 1153 1154 //---------------------- 1155 // customized scaling 1156 //---------------------- 1157 MS_BOOL bHCusScaling; ///<assign H customized scaling instead of using XC scaling 1158 MS_U16 u16HCusScalingSrc; ///<H customized scaling src width 1159 MS_U16 u16HCusScalingDst; ///<H customized scaling dst width 1160 MS_BOOL bVCusScaling; ///<assign V manuel scaling instead of using XC scaling 1161 MS_U16 u16VCusScalingSrc; ///<V customized scaling src height 1162 MS_U16 u16VCusScalingDst; ///<V customized scaling dst height 1163 1164 //-------------- 1165 // 9 lattice 1166 //-------------- 1167 MS_BOOL bDisplayNineLattice; ///<used to indicate where to display in panel and where to put in frame buffer 1168 1169 //---------------------- 1170 // XC internal setting 1171 //---------------------- 1172 1173 /* scaling ratio */ 1174 MS_U16 u16H_SizeAfterPreScaling; ///<Horizontal size after prescaling 1175 MS_U16 u16V_SizeAfterPreScaling; ///<Vertical size after prescaling 1176 MS_BOOL bPreV_ScalingDown; ///<define whether it's pre-Vertical scaling down 1177 1178 /* real crop win in memory */ 1179 MS_WINDOW_TYPE ScaledCropWin; 1180 1181 /* others */ 1182 MS_U32 u32Op2DclkSet; ///<OP to Dot clock set 1183 1184 /* Video screen status */ 1185 MS_BOOL bBlackscreenEnabled; ///<Black screen status 1186 MS_BOOL bBluescreenEnabled; ///<Blue screen status 1187 MS_U16 u16VideoDark; ///<Video dark 1188 1189 MS_U16 u16V_Length; ///<for MDrv_Scaler_SetFetchNumberLimit 1190 MS_U16 u16BytePerWord; ///<BytePerWord in Scaler 1191 MS_U16 u16OffsetPixelAlignment; ///<Pixel alignment of Offset (including IPM/OPM) 1192 MS_U8 u8BitPerPixel; ///<Bits number Per Pixel 1193 MS_DEINTERLACE_MODE eDeInterlaceMode; ///<De-interlace mode 1194 MS_U8 u8DelayLines; ///<delay lines 1195 MS_BOOL bMemFmt422; ///<whether memory format is 422, for easy usage 1196 MS_IMAGE_STORE_FMT eMemory_FMT; ///<memory format 1197 MS_BOOL bForceNRoff; ///<Force NR off 1198 MS_BOOL bEn3DNR; ///<whether it's 3DNR enabled 1199 MS_BOOL bUseYUVSpace; ///< color format before 3x3 matrix 1200 MS_BOOL bMemYUVFmt; ///< memroy color format 1201 MS_BOOL bForceRGBin; ///<Force set format in memory as RGB (only for RGB input source) 1202 MS_BOOL bLinearMode; ///<Is current memory format LinearMode? 1203 1204 // frame lock related 1205 // only main can select FB/FBL because panel output timing depends on main window, sub will always use FB 1206 MS_BOOL bFBL; ///<whether it's framebufferless case 1207 MS_BOOL bFastFrameLock; ///<whether framelock is enabled or not 1208 MS_BOOL bDoneFPLL; ///<whether the FPLL is done 1209 MS_BOOL bEnableFPLL; ///<enable FPLL or not 1210 MS_BOOL bFPLL_LOCK; ///<whether FPLL is locked (in specific threshold.) 1211 1212 // Capture_Memory 1213 MS_U32 u32IPMBase0; ///<IPM base 0 1214 MS_U32 u32IPMBase1; ///<IPM base 1 1215 MS_U32 u32IPMBase2; ///<IPM base 2 1216 MS_U16 u16IPMOffset; ///<IPM offset 1217 MS_U32 u16IPMFetch; ///<IPM fetch 1218 }XC_ApiStatus; 1219 1220 /// XC API status 1221 typedef struct 1222 { 1223 MS_U32 u32ApiStatusEx_Version; ///<Version of current structure. Please always set to "PANEL_INFO_EX_VERSION" as input 1224 MS_U16 u16ApiStatusEX_Length; ///<Length of this structure, u16PanelInfoEX_Length=sizeof(XC_PANEL_INFO_EX) 1225 1226 //---------------------- 1227 // Customer setting 1228 //---------------------- 1229 INPUT_SOURCE_TYPE_t enInputSourceType; ///< Input source type 1230 1231 //---------------------- 1232 // Window 1233 //---------------------- 1234 MS_WINDOW_TYPE stCapWin; ///<Capture window 1235 MS_WINDOW_TYPE stDispWin; ///<Display window 1236 MS_WINDOW_TYPE stCropWin; ///<Crop window 1237 1238 //---------------------- 1239 // Timing 1240 //---------------------- 1241 MS_BOOL bInterlace; ///<Interlaced or Progressive 1242 MS_BOOL bHDuplicate; ///<flag for vop horizontal duplicate, for MVD, YPbPr, indicate input double sampled or not 1243 MS_U16 u16InputVFreq; ///<Input V Frequency, VFreqx10, for calculate output panel timing 1244 MS_U16 u16InputVTotal; ///<Input Vertical total, for calculate output panel timing 1245 MS_U16 u16DefaultHtotal; ///<Default Htotal for VGA/YPbPr input 1246 MS_U8 u8DefaultPhase; ///<Obsolete, use u16DefaultPhase instead 1247 1248 //---------------------- 1249 // Post customized scaling 1250 //---------------------- 1251 MS_BOOL bHCusScaling; ///<assign H customized scaling instead of using XC scaling 1252 MS_U16 u16HCusScalingSrc; ///<H customized scaling src width 1253 MS_U16 u16HCusScalingDst; ///<H customized scaling dst width 1254 MS_BOOL bVCusScaling; ///<assign V manuel scaling instead of using XC scaling 1255 MS_U16 u16VCusScalingSrc; ///<V customized scaling src height 1256 MS_U16 u16VCusScalingDst; ///<V customized scaling dst height 1257 1258 //-------------- 1259 // 9 lattice 1260 //-------------- 1261 MS_BOOL bDisplayNineLattice; ///<used to indicate where to display in panel and where to put in frame buffer 1262 1263 //---------------------- 1264 // XC internal setting 1265 //---------------------- 1266 1267 /* scaling ratio */ 1268 MS_U16 u16H_SizeAfterPreScaling; ///<Horizontal size after prescaling 1269 MS_U16 u16V_SizeAfterPreScaling; ///<Vertical size after prescaling 1270 MS_BOOL bPreV_ScalingDown; ///<define whether it's pre-Vertical scaling down 1271 1272 /* real crop win in memory */ 1273 MS_WINDOW_TYPE ScaledCropWin; 1274 1275 /* others */ 1276 MS_U32 u32Op2DclkSet; ///<OP to Dot clock set 1277 1278 /* Video screen status */ 1279 MS_BOOL bBlackscreenEnabled; ///<Black screen status 1280 MS_BOOL bBluescreenEnabled; ///<Blue screen status 1281 MS_U16 u16VideoDark; ///<Video dark 1282 1283 MS_U16 u16V_Length; ///<for MDrv_Scaler_SetFetchNumberLimit 1284 MS_U16 u16BytePerWord; ///<BytePerWord in Scaler 1285 MS_U16 u16OffsetPixelAlignment; ///<Pixel alignment of Offset (including IPM/OPM) 1286 MS_U8 u8BitPerPixel; ///<Bits number Per Pixel 1287 MS_DEINTERLACE_MODE eDeInterlaceMode; ///<De-interlace mode 1288 MS_U8 u8DelayLines; ///<delay lines 1289 MS_BOOL bMemFmt422; ///<whether memory format is 422, for easy usage 1290 MS_IMAGE_STORE_FMT eMemory_FMT; ///<memory format 1291 MS_BOOL bForceNRoff; ///<Force NR off 1292 MS_BOOL bEn3DNR; ///<whether it's 3DNR enabled 1293 MS_BOOL bUseYUVSpace; ///< color format before 3x3 matrix 1294 MS_BOOL bMemYUVFmt; ///< memroy color format 1295 MS_BOOL bForceRGBin; ///<Force set format in memory as RGB (only for RGB input source) 1296 MS_BOOL bLinearMode; ///<Is current memory format LinearMode? 1297 1298 // frame lock related 1299 // only main can select FB/FBL because panel output timing depends on main window, sub will always use FB 1300 MS_BOOL bFBL; ///<whether it's framebufferless case 1301 MS_BOOL bFastFrameLock; ///<whether framelock is enabled or not 1302 MS_BOOL bDoneFPLL; ///<whether the FPLL is done 1303 MS_BOOL bEnableFPLL; ///<enable FPLL or not 1304 MS_BOOL bFPLL_LOCK; ///<whether FPLL is locked (in specific threshold.) 1305 1306 // Capture_Memory 1307 MS_U32 u32IPMBase0; ///<IPM base 0 1308 MS_U32 u32IPMBase1; ///<IPM base 1 1309 MS_U32 u32IPMBase2; ///<IPM base 2 1310 MS_U16 u16IPMOffset; ///<IPM offset 1311 MS_U32 u16IPMFetch; ///<IPM fetch 1312 1313 //---------------------- 1314 // Pre customized scaling 1315 //---------------------- 1316 MS_BOOL bPreHCusScaling; ///<assign H customized scaling instead of using XC scaling 1317 MS_U16 u16PreHCusScalingSrc; ///<H customized scaling src width 1318 MS_U16 u16PreHCusScalingDst; ///<H customized scaling dst width 1319 MS_BOOL bPreVCusScaling; ///<assign V manuel scaling instead of using XC scaling 1320 MS_U16 u16PreVCusScalingSrc; ///<V customized scaling src height 1321 MS_U16 u16PreVCusScalingDst; ///<V customized scaling dst height 1322 1323 MS_BOOL bPQSetHSD;///<H_SizeAfterPreScaling is changed manually, which will skip PQ HSD sampling and filter 1324 1325 MS_U16 u16DefaultPhase; ///<Default Phase for VGA/YPbPr input 1326 MS_BOOL bIsHWDepthAdjSupported; ///<Is hw depth adjustment for real 3d supported or not 1327 MS_BOOL bIs2LineMode; ///<Is 2 line mode or not 1328 MS_BOOL bIsPNLYUVOutput; ///<Is Scaler YUV output 1329 1330 MS_U8 u8HDMIPixelRepetition; ///<the HDMI pixel repetition info 1331 1332 MS_U32 u32FRCMBase0; ///<FRCM base 0 1333 MS_U32 u32FRCMBase1; ///<FRCM base 1 1334 MS_U32 u32FRCMBase2; ///<FRCM base 2 1335 }XC_ApiStatusEx; 1336 1337 /// Define the set timing information 1338 typedef struct 1339 { 1340 MS_U32 u32HighAccurateInputVFreq; ///<high accurate input V frequency 1341 MS_U16 u16InputVFreq; ///<input V frequency 1342 MS_U16 u16InputVTotal; ///<input vertical total 1343 MS_BOOL bMVOPSrc; ///<MVOP source 1344 MS_BOOL bFastFrameLock; ///<whether it's fast frame lock case 1345 MS_BOOL bInterlace; ///<whether it's interlace 1346 }XC_SetTiming_Info; 1347 1348 //------------------------------ 1349 // XC Auto 1350 //------------------------------ 1351 1352 /// internal calibration 1353 typedef struct 1354 { 1355 MS_U16 u16CH_AVG[3]; 1356 } MS_AUTOADC_TYPE; 1357 1358 /// get IP1 report min/max R/G/B 1359 typedef enum 1360 { 1361 AUTO_MIN_R , 1362 AUTO_MIN_G , 1363 AUTO_MIN_B , 1364 AUTO_MAX_R , 1365 AUTO_MAX_G , 1366 AUTO_MAX_B , 1367 }AUTO_GAIN_TYPE; 1368 1369 /// the tming types for internal calibration 1370 typedef enum 1371 { 1372 E_XC_OFF, 1373 E_XC_480P, 1374 E_XC_576P, 1375 E_XC_720P, 1376 E_XC_1080P, 1377 E_XC_480I, 1378 E_XC_576I, 1379 E_XC_720I, 1380 E_XC_1080I, 1381 }XC_Internal_TimingType; 1382 1383 //------------------------------ 1384 // Software Reset 1385 //------------------------------ 1386 /// software reset type 1387 typedef enum 1388 { 1389 REST_SCALER_ALL = _BIT(0), 1390 REST_IP_F1 = _BIT(1), 1391 REST_IP_F2 = _BIT(2), 1392 REST_OP = _BIT(3), 1393 REST_IP_ALL = _BIT(4), 1394 REST_CLK = (_BIT(6)|_BIT(3)), 1395 }SOFTWARE_REST_TYPE_t; 1396 1397 /// Detect Europe HDTV status type 1398 typedef enum 1399 { 1400 EURO_AUS_HDTV_NORMAL = 0, ///<not detected Euro or Aus HDTV 1401 EURO_HDTV_DETECTED, ///<Euro HDTV detected 1402 AUSTRALIA_HDTV_DETECTED, ///<Aus HDTV detected 1403 }MS_DETECT_EURO_HDTV_STATUS_TYPE; 1404 1405 1406 //Capture_Memory 1407 1408 /// Define the rectangle information 1409 typedef struct 1410 { 1411 MS_S16 s16X_Start; ///<rectangle start x 1412 MS_S16 s16Y_Start; ///<rectangle start x 1413 MS_S16 s16X_Size; ///<rectangle horizontal size 1414 MS_S16 s16Y_Size; ///<rectangle vertical size 1415 1416 MS_U8 *pRect; ///<the buffer address for the rectangle 1417 MS_U32 u32RectPitch; ///<rectangle pitch 1418 MS_U16 u16PointSize; ///<point size, consider the memory size 1419 } MS_RECT_INFO; 1420 1421 /// Define for format of pixel 24 bit 1422 typedef struct 1423 { 1424 MS_U8 R_Cr; 1425 MS_U8 G_Y; 1426 MS_U8 B_Cb; 1427 } MS_PIXEL_24BIT; 1428 1429 /// Define for format of pixel 32 bit 1430 typedef struct 1431 { 1432 MS_U32 B_Cb :10; 1433 MS_U32 G_Y :10; 1434 MS_U32 R_Cr :10; 1435 MS_U32 u8Dummy:2; 1436 }MS_PIXEL_32BIT; 1437 1438 /// Define for format of pixel 16 bit 1439 typedef struct 1440 { 1441 MS_U8 u8G_Y; 1442 MS_U8 u8BR_CbCr; 1443 } MS_PIXEL_422_8BIT; 1444 1445 typedef enum 1446 { 1447 E_XC_OUTPUTDATA_RGB10BITS = 0x00, ///< Dummy[31:30] R[29:20] G[19:10] B[9:0] 1448 E_XC_OUTPUTDATA_RGB8BITS = 0x01, ///< R[23:16] G[15:8] B[7:0] 1449 E_XC_OUTPUTDATA_4228BITS = 0x03, ///< CbCr[15:8] Y[7:0] 1450 1451 E_XC_OUTPUTDATA_FRC_RGB10BITS = 0x04, ///< Dummy[31:30] R[29:20] G[19:10] B[9:0] 1452 E_XC_OUTPUTDATA_FRC_RGB8BITS = 0x05, ///< R[23:16] G[15:8] B[7:0] 1453 E_XC_OUTPUTDATA_FRC_4228BITS = 0x06, ///< CbCr[15:8] Y[7:0] 1454 }E_XC_OUTPUTDATA_TYPE; 1455 1456 typedef enum 1457 { 1458 E_XC_INPUTDATA_RGB10BITS = 0x00, ///< Dummy[31:30] R[29:20] G[19:10] B[9:0] 1459 E_XC_INPUTDATA_RGB8BITS = 0x01, ///< R[23:16] G[15:8] B[7:0] 1460 E_XC_INPUTDATA_4228BITS = 0x03, ///< CbCr[15:8] Y[7:0] 1461 }E_XC_INPUTDATA_TYPE; 1462 1463 1464 /// define for the auto calbration window type 1465 typedef struct 1466 { 1467 MS_U16 u16X; ///<window start x 1468 MS_U16 u16Xsize; ///<window horizontal size 1469 MS_U16 u16Y; ///<window start y 1470 MS_U16 u16Ysize; ///<window vertical size 1471 }MS_AUTO_CAL_WINDOW_t; 1472 1473 typedef struct 1474 { 1475 MS_IMAGE_STORE_FMT eStoreFmt; ///<image store format 1476 MS_AUTO_CAL_WINDOW_t eCal_Win_Size; ///<auto calbration window type 1477 MS_AUTOADC_TYPE pixelMax; ///<maximum value among the pixels 1478 MS_AUTOADC_TYPE pixelMin; ///<minimum value among the pixels 1479 MS_AUTOADC_TYPE pixelAverage; ///<average value among the pixels 1480 } MS_IMAGE_MEM_INFO; 1481 1482 /// defined channel select for contrast adjusting. 1483 typedef enum 1484 { 1485 XC_VOP_CHR = 0, ///< Channel R 1486 XC_VOP_CHG, ///< Channel G 1487 XC_VOP_CHB, ///< Channel B 1488 XC_VOP_ALL, ///< All Channel 1489 }MS_XC_VOP_CHANNEL_t; 1490 1491 /// Define Scaler GOP IP setting. 1492 typedef enum 1493 { 1494 MS_IP0_SEL_GOP0, 1495 MS_IP0_SEL_GOP1, 1496 MS_IP0_SEL_GOP2, 1497 MS_NIP_SEL_GOP0, 1498 MS_NIP_SEL_GOP1, 1499 MS_NIP_SEL_GOP2, 1500 MS_MVOP_SEL, 1501 }MS_XC_IPSEL_GOP; 1502 1503 /// Define Scaler memory format 1504 typedef enum 1505 { 1506 E_MS_XC_MEM_FMT_AUTO = 0, 1507 E_MS_XC_MEM_FMT_444 = 1, 1508 E_MS_XC_MEM_FMT_422 = 2, 1509 }MS_XC_MEM_FMT; 1510 1511 /// Define the PQ path information 1512 /** 1513 * The active Window for PQ function to takes place. 1514 */ 1515 typedef enum 1516 { 1517 /// Main window 1518 PQ_MAIN_WINDOW=0, 1519 /// Sub window 1520 PQ_SUB_WINDOW=1, 1521 /// The max support window of PQ 1522 PQ_MAX_WINDOW 1523 }PQ_WIN; 1524 1525 typedef enum 1526 { 1527 PQ_XC_ID_0, 1528 PQ_XC_ID_1, 1529 PQ_XC_ID_NUM, 1530 }PQ_XC_ID; 1531 1532 /** 1533 * FOURCE COLOR FMT 1534 */ 1535 typedef enum 1536 { 1537 /// Default 1538 PQ_FOURCE_COLOR_DEFAULT, 1539 /// RGB 1540 PQ_FOURCE_COLOR_RGB, 1541 /// YUV 1542 PQ_FOURCE_COLOR_YUV, 1543 }PQ_FOURCE_COLOR_FMT; 1544 1545 /** 1546 * PQ DEINTERLACE MODE 1547 */ 1548 typedef enum 1549 { 1550 /// off 1551 PQ_DEINT_OFF=0, 1552 /// 2DDI BOB 1553 PQ_DEINT_2DDI_BOB, 1554 /// 2DDI AVG 1555 PQ_DEINT_2DDI_AVG, 1556 /// 3DDI History(24 bit) 1557 PQ_DEINT_3DDI_HISTORY, 1558 /// 3DDI(16 bit) 1559 PQ_DEINT_3DDI, 1560 } PQ_DEINTERLACE_MODE; 1561 /** 1562 * Video data information to supply when in PQ mode. 1563 */ 1564 typedef struct 1565 { 1566 /// is FBL or not 1567 MS_BOOL bFBL; 1568 /// is interlace mode or not 1569 MS_BOOL bInterlace; 1570 /// input Horizontal size 1571 MS_U16 u16input_hsize; 1572 /// input Vertical size 1573 MS_U16 u16input_vsize; 1574 /// input Vertical total 1575 MS_U16 u16input_vtotal; 1576 /// input Vertical frequency 1577 MS_U16 u16input_vfreq; 1578 /// output Vertical frequency 1579 MS_U16 u16ouput_vfreq; 1580 /// Display Horizontal size 1581 MS_U16 u16display_hsize; 1582 /// Display Vertical size 1583 MS_U16 u16display_vsize; 1584 }MS_PQ_Mode_Info; 1585 /** 1586 * INPUT SOURCE TYPE 1587 */ 1588 typedef enum 1589 { 1590 /// VGA 1591 PQ_INPUT_SOURCE_VGA, 1592 /// TV 1593 PQ_INPUT_SOURCE_TV, 1594 1595 /// CVBS 1596 PQ_INPUT_SOURCE_CVBS, 1597 1598 /// S-video 1599 PQ_INPUT_SOURCE_SVIDEO, 1600 1601 /// Component 1602 PQ_INPUT_SOURCE_YPBPR, 1603 /// Scart 1604 PQ_INPUT_SOURCE_SCART, 1605 1606 1607 /// HDMI 1608 PQ_INPUT_SOURCE_HDMI, 1609 1610 /// DTV 1611 PQ_INPUT_SOURCE_DTV, 1612 1613 /// DVI 1614 PQ_INPUT_SOURCE_DVI, 1615 1616 // Application source 1617 /// Storage 1618 PQ_INPUT_SOURCE_STORAGE, 1619 /// KTV 1620 PQ_INPUT_SOURCE_KTV, 1621 /// JPEG 1622 PQ_INPUT_SOURCE_JPEG, 1623 1624 /// The max support number of PQ input source 1625 PQ_INPUT_SOURCE_NUM, 1626 /// None 1627 PQ_INPUT_SOURCE_NONE = PQ_INPUT_SOURCE_NUM, 1628 } PQ_INPUT_SOURCE_TYPE; 1629 1630 1631 // PQ Function 1632 typedef enum 1633 { 1634 E_PQ_IOCTL_NONE = 0x00000000, 1635 E_PQ_IOCTL_HSD_SAMPLING = 0x00000001, 1636 E_PQ_IOCTL_PREVSD_BILINEAR = 0x00000002, 1637 E_PQ_IOCTL_ADC_SAMPLING = 0x00000003, 1638 E_PQ_IOCTL_RFBL_CTRL = 0x00000004, 1639 E_PQ_IOCTL_PQ_SUGGESTED_FRAMENUM = 0x00000008, 1640 E_PQ_IOCTL_SET_UCFEATURE = 0x00000010, 1641 E_PQ_IOCTL_PQ_SUGGESTED_FRCMFRAMENUM = 0x00000020, 1642 1643 E_PQ_IOCTL_NUM, 1644 }PQ_IOCTL_FLAG_TYPE; 1645 1646 typedef struct s_PQ_Function 1647 { 1648 1649 void (* pq_disable_filmmode)(PQ_WIN eWindow, MS_BOOL bOn); 1650 1651 MS_BOOL (* pq_load_scalingtable)(PQ_WIN eWindow, MS_U8 eXRuleType, MS_BOOL bPreV_ScalingDown, 1652 MS_BOOL bInterlace, MS_BOOL bColorSpaceYUV, MS_U16 u16InputSize, MS_U16 u16SizeAfterScaling); 1653 1654 MS_BOOL (* pq_set_csc)(PQ_WIN eWindow, PQ_FOURCE_COLOR_FMT enFourceColor); 1655 1656 PQ_DEINTERLACE_MODE (* pq_set_memformat)(PQ_WIN eWindow, MS_BOOL bMemFmt422, MS_BOOL bFBL, MS_U8 *u8BitsPerPixel); 1657 1658 void (* pq_set_420upsampling)(PQ_WIN eWindow, MS_BOOL bFBL, MS_BOOL bPreV_ScalingDown, MS_U16 u16V_CropStart); 1659 1660 void (* pq_set_modeInfo)(PQ_WIN eWindow, PQ_INPUT_SOURCE_TYPE enInputSourceType, MS_PQ_Mode_Info *pstPQModeInfo); 1661 1662 void (* pq_deside_srctype)(PQ_WIN eWindow, PQ_INPUT_SOURCE_TYPE enInputSourceType); 1663 1664 MS_BOOL (* pq_get_memyuvfmt)(PQ_WIN eWindow, PQ_FOURCE_COLOR_FMT enFourceColor); 1665 1666 MS_BOOL (* pq_ioctl)(PQ_WIN eWindow, MS_U32 u32Flag, void *pBuf, MS_U32 u32BufSize); 1667 1668 void (* pq_disable_filmmode_ex)(PQ_XC_ID eXCID, PQ_WIN eWindow, MS_BOOL bOn); 1669 1670 MS_BOOL (* pq_load_scalingtable_ex)(PQ_XC_ID eXCID, PQ_WIN eWindow, MS_U8 eXRuleType, MS_BOOL bPreV_ScalingDown, 1671 MS_BOOL bInterlace, MS_BOOL bColorSpaceYUV, MS_U16 u16InputSize, MS_U16 u16SizeAfterScaling); 1672 1673 MS_BOOL (* pq_set_csc_ex)(PQ_XC_ID eXCID, PQ_WIN eWindow, PQ_FOURCE_COLOR_FMT enFourceColor); 1674 1675 PQ_DEINTERLACE_MODE (* pq_set_memformat_ex)(PQ_XC_ID eXCID, PQ_WIN eWindow, MS_BOOL bMemFmt422, MS_BOOL bFBL, MS_U8 *u8BitsPerPixel); 1676 1677 void (* pq_set_420upsampling_ex)(PQ_XC_ID eXCID, PQ_WIN eWindow, MS_BOOL bFBL, MS_BOOL bPreV_ScalingDown, MS_U16 u16V_CropStart); 1678 1679 void (* pq_set_modeInfo_ex)(PQ_XC_ID eXCID, PQ_WIN eWindow, PQ_INPUT_SOURCE_TYPE enInputSourceType, MS_PQ_Mode_Info *pstPQModeInfo); 1680 1681 void (* pq_deside_srctype_ex)(PQ_XC_ID eXCID, PQ_WIN eWindow, PQ_INPUT_SOURCE_TYPE enInputSourceType); 1682 1683 MS_BOOL (* pq_get_memyuvfmt_ex)(PQ_XC_ID eXCID, PQ_WIN eWindow, PQ_FOURCE_COLOR_FMT enFourceColor); 1684 1685 MS_BOOL (* pq_ioctl_ex)(PQ_XC_ID eXCID, PQ_WIN eWindow, MS_U32 u32Flag, void *pBuf, MS_U32 u32BufSize); 1686 }PQ_Function_Info; 1687 1688 typedef struct 1689 { 1690 MS_U32 u32ratio; 1691 MS_BOOL bADVMode; 1692 }PQ_HSD_SAMPLING_INFO; 1693 1694 typedef struct 1695 { 1696 PQ_INPUT_SOURCE_TYPE enPQSourceType; 1697 MS_PQ_Mode_Info stPQModeInfo; 1698 MS_U16 u16ratio; 1699 }PQ_ADC_SAMPLING_INFO; 1700 1701 //Display information 1702 typedef struct 1703 { 1704 MS_U32 VDTOT; //Output vertical total 1705 MS_U32 DEVST; //Output DE vertical start 1706 MS_U32 DEVEND;//Output DE Vertical end 1707 MS_U32 HDTOT;// Output horizontal total 1708 MS_U32 DEHST; //Output DE horizontal start 1709 MS_U32 DEHEND;// Output DE horizontal end 1710 MS_BOOL bInterlaceMode; 1711 MS_BOOL bYUVInput; 1712 } MS_XC_DST_DispInfo; 1713 1714 typedef enum 1715 { 1716 ///IP2 path. 1717 E_GOP_XCDST_IP2=0, 1718 1719 /// IP man path. 1720 E_GOP_XCDST_IP1_MAIN=1, 1721 1722 ///IP sub path. 1723 E_GOP_XCDST_IP1_SUB=2, 1724 1725 /// op1 main path. 1726 E_GOP_XCDST_OP1_MAIN=3, 1727 1728 MAX_GOP_XCDST_SUPPORT 1729 1730 } EN_GOP_XCDST_TYPE; 1731 1732 /// Set data mux to VE 1733 typedef enum 1734 { 1735 /// GOP mux0 to VE 1736 E_VOP_SEL_OSD_BLEND0, 1737 /// GOP mux1 to VE 1738 E_VOP_SEL_OSD_BLEND1, 1739 /// GOP mux2 to VE 1740 E_VOP_SEL_OSD_BLEND2, 1741 /// mux from XC MACE 1742 E_VOP_SEL_MACE_RGB, 1743 1744 E_VOP_SEL_OSD_NONE, 1745 /// Last GOP mux to VE 1746 E_VOP_SEL_OSD_LAST = 0x80, 1747 } EN_VOP_SEL_OSD_XC2VE_MUX; 1748 1749 // 3D info 1750 typedef enum 1751 { 1752 //range [0000 ~ 1111] reserved for hdmi 3D spec 1753 E_XC_3D_INPUT_FRAME_PACKING = 0x00, //0000 1754 E_XC_3D_INPUT_FIELD_ALTERNATIVE = 0x01, //0001 1755 E_XC_3D_INPUT_LINE_ALTERNATIVE = 0x02, //0010 1756 E_XC_3D_INPUT_SIDE_BY_SIDE_FULL = 0x03, //0011 1757 E_XC_3D_INPUT_L_DEPTH = 0x04, //0100 1758 E_XC_3D_INPUT_L_DEPTH_GRAPHICS_GRAPHICS_DEPTH = 0x05, //0101 1759 E_XC_3D_INPUT_TOP_BOTTOM = 0x06, //0110 1760 E_XC_3D_INPUT_SIDE_BY_SIDE_HALF = 0x08, //1000 1761 1762 E_XC_3D_INPUT_CHECK_BORAD = 0x09, //1001 1763 1764 //user defined 1765 E_XC_3D_INPUT_MODE_USER = 0x10, 1766 E_XC_3D_INPUT_MODE_NONE = E_XC_3D_INPUT_MODE_USER, 1767 E_XC_3D_INPUT_FRAME_ALTERNATIVE, 1768 E_XC_3D_INPUT_SIDE_BY_SIDE_HALF_INTERLACE, 1769 // optimize for format: in:E_XC_3D_INPUT_FRAME_PACKING, out:E_XC_3D_OUTPUT_TOP_BOTTOM,E_XC_3D_OUTPUT_SIDE_BY_SIDE_HALF 1770 E_XC_3D_INPUT_FRAME_PACKING_OPT, 1771 // optimize for format: in:E_XC_3D_INPUT_TOP_BOTTOM, out:E_XC_3D_OUTPUT_SIDE_BY_SIDE_HALF 1772 E_XC_3D_INPUT_TOP_BOTTOM_OPT, 1773 E_XC_3D_INPUT_NORMAL_2D, 1774 E_XC_3D_INPUT_NORMAL_2D_INTERLACE, 1775 E_XC_3D_INPUT_NORMAL_2D_INTERLACE_PTP, 1776 E_XC_3D_INPUT_SIDE_BY_SIDE_HALF_INTERLACE_OPT, 1777 E_XC_3D_INPUT_NORMAL_2D_HW, //for hw 2D to 3D use 1778 E_XC_3D_INPUT_PIXEL_ALTERNATIVE, 1779 } E_XC_3D_INPUT_MODE; 1780 1781 1782 typedef enum 1783 { 1784 E_XC_3D_OUTPUT_MODE_NONE, 1785 E_XC_3D_OUTPUT_LINE_ALTERNATIVE , 1786 E_XC_3D_OUTPUT_TOP_BOTTOM, 1787 E_XC_3D_OUTPUT_SIDE_BY_SIDE_HALF, 1788 E_XC_3D_OUTPUT_FRAME_ALTERNATIVE, //25-->50,30-->60,24-->48,50-->100,60-->120----FRC 1:2 1789 E_XC_3D_OUTPUT_FRAME_L, 1790 E_XC_3D_OUTPUT_FRAME_R, 1791 E_XC_3D_OUTPUT_FRAME_ALTERNATIVE_NOFRC, //50->50, 60->60-------------------------------FRC 1:1 1792 E_XC_3D_OUTPUT_CHECKBOARD_HW, //for hw 2d to 3d use 1793 E_XC_3D_OUTPUT_LINE_ALTERNATIVE_HW, //for hw 2d to 3d use 1794 E_XC_3D_OUTPUT_PIXEL_ALTERNATIVE_HW, //for hw 2d to 3d use 1795 E_XC_3D_OUTPUT_FRAME_L_HW, //for hw 2d to 3d use 1796 E_XC_3D_OUTPUT_FRAME_R_HW, //for hw 2d to 3d use 1797 E_XC_3D_OUTPUT_FRAME_ALTERNATIVE_HW, //for hw 2d to 3d use 1798 E_XC_3D_OUTPUT_TOP_BOTTOM_HW, //for hw 2d to 3d use, it based on E_XC_3D_OUTPUT_TOP_BOTTOM implement 1799 E_XC_3D_OUTPUT_SIDE_BY_SIDE_HALF_HW, //for hw 2d to 3d use, it based on E_XC_3D_OUTPUT_SIDE_BY_SIDE_HALF implement 1800 E_XC_3D_OUTPUT_FRAME_PACKING, 1801 E_XC_3D_OUTPUT_FRAME_ALTERNATIVE_LLRR,//for 4k0.5k@240 3D 1802 E_XC_3D_OUTPUT_FRAME_ALTERNATIVE_LLRR_HW//for HW 2Dto3D 4k0.5k@240 3D 1803 } E_XC_3D_OUTPUT_MODE; 1804 1805 typedef enum 1806 { 1807 E_XC_3D_OUTPUT_FI_MODE_NONE , 1808 E_XC_3D_OUTPUT_FI_1920x1080 , 1809 E_XC_3D_OUTPUT_FI_960x1080 , 1810 E_XC_3D_OUTPUT_FI_1920x540 , 1811 1812 E_XC_3D_OUTPUT_FI_1280x720 , 1813 } E_XC_3D_OUTPUT_FI_MODE; 1814 1815 typedef enum 1816 { 1817 E_XC_3D_AUTODETECT_SW, 1818 E_XC_3D_AUTODETECT_HW, 1819 E_XC_3D_AUTODETECT_HW_COMPATIBLE, 1820 E_XC_3D_AUTODETECT_MAX 1821 }E_XC_3D_AUTODETECT_METHOD; 1822 1823 typedef enum 1824 { 1825 E_XC_3D_PANEL_NONE, 1826 E_XC_3D_PANEL_SHUTTER, //240hz panel, which can process updown, leftright,vertical or horizontal line weave 1827 E_XC_3D_PANEL_PELLICLE, //120hz panel, which can only process horizontal line weave 1828 E_XC_3D_PANEL_4K1K_SHUTTER, //120hz 4K1K panel, which can process updown, leftright,vertical or horizontal line weave 1829 E_XC_3D_PANEL_MAX, 1830 } E_XC_3D_PANEL_TYPE; 1831 1832 //hw 2d to 3d para 1833 typedef struct __attribute__((packed)) 1834 { 1835 MS_U32 u32Hw2dTo3dPara_Version; 1836 MS_U16 u16Concave; 1837 MS_U16 u16Gain; 1838 MS_U16 u16Offset; 1839 MS_U16 u16ArtificialGain; 1840 MS_U16 u16EleSel; 1841 MS_U16 u16ModSel; 1842 MS_U16 u16EdgeBlackWidth; 1843 } MS_XC_3D_HW2DTO3D_PARA; 1844 1845 //detect 3d format para 1846 typedef struct 1847 { 1848 MS_U32 u32Detect3DFormatPara_Version; //version control, back compatible 1849 //////////////////obsolete field begin/////////////////////////////////////////////////////////////////////////////////////////////////////////// 1850 MS_U16 u16HorSearchRange; //the horizontal range for find the similar pixel at R image 1851 MS_U16 u16VerSearchRange; //the vertical range for find the similar pixel at R image 1852 MS_U16 u16GYPixelThreshold; //g/y pixel threshold for define the similar pixel 1853 MS_U16 u16RCrPixelThreshold; //r/cr pixel threshold for define the similar pixel 1854 MS_U16 u16BCbPixelThreshold; //b/cb pixel threshold for define the similar pixel 1855 MS_U16 u16HorSampleCount; //the horizontal sample count, the total checked pixel will be u16HorSampleCount*u16VerSampleCount 1856 MS_U16 u16VerSampleCount; //the vertical sample count, the total checked pixel will be u16HorSampleCount*u16VerSampleCount 1857 MS_U16 u16MaxCheckingFrameCount; //the max checking frame count 1858 MS_U16 u16HitPixelPercentage; //the percentage about hit pixel in one frame total checked pixel, for example: 70%, need set as 70 1859 //////////////////obsolete field end///////////////////////////////////////////////////////////////////////////////////////////////////////////// 1860 MS_BOOL bEnableOverscan; //detect 3d format for considering overscan shift 1861 } MS_XC_3D_DETECT3DFORMAT_PARA; 1862 1863 //define 3d fp info para 1864 typedef struct 1865 { 1866 MS_U32 u32FPInfoPara_Version; //version control, back compatible 1867 MS_U16 u16HBlank; //horizontal blank 1868 MS_BOOL bEnableUserSetting; //enable user setting 1869 } MS_XC_3D_FPINFO_PARA; 1870 1871 typedef enum 1872 { 1873 DBG_FPLL_MODE_DISABLE_ALL = 0, 1874 DBG_FPLL_MODE_DISABLE = 1, 1875 DBG_FPLL_MODE_ENABLE = 2, 1876 DBG_FPLL_MODE_MAX, 1877 }EN_FPLL_DBG_MODE;//For debug purpose only! 1878 1879 typedef enum 1880 { 1881 DBG_FPLL_FLAG_PHASELIMIT = 0, 1882 DBG_FPLL_FLAG_D5D6D7 = 1, 1883 DBG_FPLL_FLAG_IGAIN = 2, 1884 DBG_FPLL_FLAG_PGAIN = 3, 1885 DBG_FPLL_FLAG_INITSETSTEP = 4, 1886 DBG_FPLL_FLAG_INITSETDELAY= 5, 1887 DBG_FPLL_FLAG_MAX, 1888 }EN_FPLL_DBG_FLAG;//For debug purpose only! 1889 1890 typedef enum 1891 { 1892 E_FPLL_MODE_DISABLE_ALL = 0, /// Disable all current FPLL customer setting(then scaler will auto decide it) 1893 E_FPLL_MODE_DISABLE = 1, /// Disable the specified(by other function parameter) FPLL customer setting 1894 E_FPLL_MODE_ENABLE = 2, /// Enable the specified(by other function parameter) FPLL customer setting 1895 E_FPLL_MODE_MAX, 1896 }EN_FPLL_MODE; 1897 1898 typedef enum 1899 { 1900 E_FPLL_FLAG_PHASELIMIT = 0, ///Set customer setting of PHASE limit 1901 E_FPLL_FLAG_D5D6D7 = 1,///Set customer setting of D5D6D7 limit 1902 E_FPLL_FLAG_IGAIN = 2,///Set customer setting of IGAIN 1903 E_FPLL_FLAG_PGAIN = 3,///Set customer setting of PGAIN 1904 E_FPLL_FLAG_INITSETSTEP = 4, ///steps to set DCLK 1905 E_FPLL_FLAG_INITSETDELAY= 5, ///delay between steps when setting DCLK 1906 E_FPLL_FLAG_MAX, 1907 }EN_FPLL_FLAG; 1908 1909 typedef enum 1910 { 1911 E_MLOAD_UNSUPPORTED = 0, 1912 E_MLOAD_DISABLED = 1, 1913 E_MLOAD_ENABLED = 2, 1914 }MLOAD_TYPE; 1915 1916 typedef enum 1917 { 1918 E_MLG_UNSUPPORTED = 0, 1919 E_MLG_DISABLED = 1, 1920 E_MLG_ENABLED = 2, 1921 }MLG_TYPE; 1922 1923 typedef enum 1924 { 1925 HDMI_SYNC_DE, 1926 HDMI_SYNC_HV, 1927 } E_HDMI_SYNC_TYPE; 1928 1929 typedef enum 1930 { 1931 MS_FRC_1_1 = 0, 1932 MS_FRC_1_2 = 1, 1933 MS_FRC_5_12 = 2, 1934 MS_FRC_2_5 = 3, 1935 MS_FRC_1_4 = 4, 1936 1937 MS_FRC_2_1 = 8, 1938 } MS_FRC_TYPE; 1939 1940 // scaler FRC table 1941 typedef struct __attribute__((packed)) 1942 { 1943 MS_U16 u16LowerBound; 1944 MS_U16 u16HigherBound; 1945 MS_U8 u8Padding; 1946 MS_U8 u8FRC_In; // ivs 1947 MS_U8 u8FRC_Out; // ovs 1948 MS_FRC_TYPE eFRC_Type; 1949 } SC_FRC_SETTING; 1950 1951 typedef enum 1952 { 1953 E_PQ_IOCTL_GET_HSD_SAMPLING, 1954 E_PQ_IOCTL_MAX, 1955 }E_PQ_IOCTL_FLAG; 1956 1957 1958 typedef enum 1959 { 1960 E_GET_PIXEL_RET_FAIL = 0, ///<Fail 1961 E_GET_PIXEL_RET_OK, ///<OK 1962 E_GET_PIXEL_RET_OUT_OF_RANGE, ///< out of range 1963 } E_APIXC_GET_PixelRGB_ReturnValue; 1964 1965 1966 typedef enum 1967 { 1968 E_XC_GET_PIXEL_STAGE_AFTER_DLC = 0x01, 1969 E_XC_GET_PIXEL_STAGE_PRE_GAMMA = 0x02, 1970 E_XC_GET_PIXEL_STAGE_AFTER_OSD = 0x03, 1971 E_XC_GET_PIXEL_STAGE_MAX = 0xFF, 1972 }EN_XC_GET_PIXEL_RGB_STAGE; 1973 1974 typedef struct 1975 { 1976 EN_XC_GET_PIXEL_RGB_STAGE enStage; 1977 MS_U16 u16x; 1978 MS_U16 u16y; 1979 MS_U32 u32r; 1980 MS_U32 u32g; 1981 MS_U32 u32b; 1982 }XC_Get_Pixel_RGB; 1983 1984 typedef struct 1985 { 1986 MS_U32 u32ReportPixelInfo_Version; ///<Input: Version of current structure. Please always set to "XC_REPORT_PIXELINFO_VERSION" as input 1987 MS_U16 u16ReportPixelInfo_Length; ///<Input: Length of this structure, u16ReportPixelInfo_Length=sizeof(MS_XC_REPORT_PIXELINFO) 1988 EN_XC_GET_PIXEL_RGB_STAGE enStage; ///<Input: Pixel info report stage 1989 MS_U16 u16RepWinColor; ///<Input:Report window Color 1990 MS_U16 u16XStart; ///<Input: X start location of report window 1991 MS_U16 u16XEnd; ///<Input: X end location of report window 1992 MS_U16 u16YStart; ///<Input: Y start location of report window 1993 MS_U16 u16YEnd; ///<Input: Y end location of report window 1994 MS_U16 u16RCrMin; ///<Output:R or Cr min value 1995 MS_U16 u16RCrMax; ///<Output:R or Cr max value 1996 MS_U16 u16GYMin; ///<Output:G or Y min value 1997 MS_U16 u16GYMax; ///<Output:G or Y max value 1998 MS_U16 u16BCbMin; ///<Output:B or Cb min value 1999 MS_U16 u16BCbMax; ///<Output:B or Cb max value 2000 MS_U32 u32RCrSum; ///<Output:R or Cr sum value 2001 MS_U32 u32GYSum; ///<Output:G or Y sum value 2002 MS_U32 u32BCbSum; ///<Output:B or Cb sum value 2003 MS_BOOL bShowRepWin; ///<Input: Show report window or not 2004 }MS_XC_REPORT_PIXELINFO; 2005 2006 // scaler interrupt sources 2007 typedef enum 2008 { 2009 // 0x00, first 4 bits are unused 2010 SC_INT_DIPW = 1, //DIPW write one frame done interrupt 2011 SC_INT_START = 4, 2012 SC_INT_RESERVED1 = SC_INT_START, // before is SC_INT_TUNE_FAIL_P, FBL line buffer overrun/underrun 2013 // scaler dosen't have this interrupt now, 2014 2015 SC_INT_VSINT, // output Vsync interrupt, can select polarity with BK0_04[1] 2016 SC_INT_F2_VTT_CHG, // main window, HDMI mute or Vsync polarity changed, Vtt change exceed BK1_1D[11:8] 2017 SC_INT_F1_VTT_CHG, 2018 SC_INT_F2_VS_LOSE, // didn't received Vsync for a while or Vtt count BK1_1F[10:0] exceed max value 2019 SC_INT_F1_VS_LOSE, 2020 SC_INT_F2_JITTER, // H/V start/end didn't be the same with privous value, usually used in HDMI/DVI input 2021 SC_INT_F1_JITTER, 2022 SC_INT_F2_IPVS_SB, // input V sync interrupt, can select which edge to trigger this interrupt with BK0_04[0] 2023 SC_INT_F1_IPVS_SB, 2024 SC_INT_F2_IPHCS_DET, // input H sync interrupt 2025 SC_INT_F1_IPHCS_DET, 2026 2027 // 0x10 2028 SC_INT_PWM_RP_L_INT, // pwm rising edge of left frame 2029 SC_INT_PWM_FP_L_INT, // pwm falling edge of left frame 2030 SC_INT_F2_HTT_CHG, // Hsync polarity changed or Hperiod change exceed BK1_1D[5:0] 2031 SC_INT_F1_HTT_CHG, 2032 SC_INT_F2_HS_LOSE, // didn't received H sync for a while or Hperiod count BK1_20[13:0] exceed max value 2033 SC_INT_F1_HS_LOSE, 2034 SC_INT_PWM_RP_R_INT, // pwm rising edge of right frame 2035 SC_INT_PWM_FP_R_INT, // pwm falling edge of right frame 2036 SC_INT_F2_CSOG, // composite sync or SoG input signal type changed (for example, SoG signal from none -> valid, valid -> none) 2037 SC_INT_F1_CSOG, 2038 SC_INT_F2_RESERVED2, // scaler dosen't have this interrupt now, before is SC_INT_F2_ATS_READY 2039 SC_INT_F1_RESERVED2, // scaler dosen't have this interrupt now, before is SC_INT_F1_ATS_READY 2040 SC_INT_F2_ATP_READY, // auto phase ready interrupt 2041 SC_INT_F1_ATP_READY, 2042 SC_INT_F2_RESERVED3, // scaler dosen't have this interrupt now, before is SC_INT_F2_ATG_READY 2043 SC_INT_F1_RESERVED3, // scaler dosen't have this interrupt now, before is SC_INT_F1_ATG_READY 2044 2045 MAX_SC_INT, 2046 } SC_INT_SRC; 2047 2048 typedef enum 2049 { 2050 // 0x00, first 4 bits are unused 2051 XC_INT_RESERVED1 = 4, ///< scaler dosen't have this interrupt now 2052 XC_INT_VSINT, ///< output Vsync interrupt 2053 XC_INT_F2_VTT_CHG, ///< main window, HDMI mute or Vsync polarity changed, Vtt change exceed BK1_1D[11:8] 2054 XC_INT_F1_VTT_CHG, 2055 XC_INT_F2_VS_LOSE, ///< didn't received Vsync for a while or Vtt count BK1_1F[10:0] exceed max value 2056 XC_INT_F1_VS_LOSE, 2057 XC_INT_F2_JITTER, ///< H/V start/end didn't be the same with privous value, usually used in HDMI/DVI input 2058 XC_INT_F1_JITTER, 2059 XC_INT_F2_IPVS_SB, ///< input V sync interrupt 2060 XC_INT_F1_IPVS_SB, 2061 XC_INT_F2_IPHCS_DET, ///< input H sync interrupt 2062 XC_INT_F1_IPHCS_DET, 2063 2064 // 0x10 2065 XC_INT_PWM_RP_L_INT, ///< pwm rising edge of left frame, please use MDrv_XC_InterruptAvaliable() to check if avalible or not 2066 XC_INT_PWM_FP_L_INT, ///< pwm falling edge of left frame, please use MDrv_XC_InterruptAvaliable() to check if avalible or not 2067 XC_INT_F2_HTT_CHG, ///< Hsync polarity changed or Hperiod change exceed BK1_1D[5:0] 2068 XC_INT_F1_HTT_CHG, 2069 XC_INT_F2_HS_LOSE, ///< didn't received H sync for a while or Hperiod count BK1_20[13:0] exceed max value 2070 XC_INT_F1_HS_LOSE, 2071 XC_INT_PWM_RP_R_INT, ///< pwm rising edge of right frame, please use MDrv_XC_InterruptAvaliable() to check if avalible or not 2072 XC_INT_PWM_FP_R_INT, ///< pwm falling edge of right frame, please use MDrv_XC_InterruptAvaliable() to check if avalible or not 2073 XC_INT_F2_CSOG, ///< composite sync or SoG input signal type changed (for example, SoG signal from none -> valid, valid -> none) 2074 XC_INT_F1_CSOG, 2075 XC_INT_F2_RESERVED2, ///< scaler dosen't have this interrupt now 2076 XC_INT_F1_RESERVED2, 2077 XC_INT_F2_ATP_READY, ///< auto phase ready interrupt 2078 XC_INT_F1_ATP_READY, 2079 XC_INT_F2_RESERVED3, ///< scaler dosen't have this interrupt now 2080 XC_INT_F1_RESERVED3, 2081 } XC_INT_SRC; 2082 2083 /// OP2 Video/GOP layer switch 2084 typedef enum 2085 { 2086 E_VOP_LAYER_VIDEO_MUX1_MUX2 = 0, ///<0: Video->GOP1->GOP2 (GOP2 is one pipe later than GOP1) 2087 E_VOP_LAYER_FRAME_VIDEO_MUX1_MUX2, ///<1: FrameColor->Video->GOP1->GOP2 (GOP1/GOP2 smae pipe) 2088 E_VOP_LAYER_FRAME_VIDEO_MUX2_MUX1, ///<2: FrameColor->Video->GOP2->GOP1 (GOP1/GOP2 smae pipe) 2089 E_VOP_LAYER_FRAME_MUX1_VIDEO_MUX2, ///<3: FrameColor->GOP1->Video->GOP2 (GOP1/GOP2 smae pipe) 2090 E_VOP_LAYER_FRAME_MUX1_MUX2_VIDEO, ///<4: FrameColor->GOP1->GOP2->Video (GOP1/GOP2 smae pipe) 2091 E_VOP_LAYER_FRAME_MUX2_VIDEO_MUX1, ///<5: FrameColor->GOP2->Video->GOP1 (GOP1/GOP2 smae pipe) 2092 E_VOP_LAYER_FRAME_MUX2_MUX1_VIDEO, ///<6: FrameColor->GOP2->GOP1->Video (GOP1/GOP2 smae pipe) 2093 E_VOP_LAYER_RESERVED, 2094 } E_VOP_OSD_LAYER_SEL; 2095 2096 /// OP2VOP de select 2097 typedef enum 2098 { 2099 E_OP2VOPDE_MAINWINDOW = 0, ///<0: capture main display window, no osd 2100 E_OP2VOPDE_SUBWINDOW, ///<1: capture sub display window, no osd 2101 E_OP2VOPDE_WHOLEFRAME, ///<2: Whole frame of panel DE, no osd 2102 E_OP2VOPDE_WHOLEFRAME_WITHOSD, ///<3: Whole frame of panel DE, with osd 2103 } E_OP2VOP_DE_SEL; 2104 2105 typedef void (*SC_InterruptCb) (SC_INT_SRC enIntNum, void *pParam); ///< Interrupt callback function 2106 2107 2108 //Define Output Frame control 2109 typedef struct 2110 { 2111 MS_U32 u32XC_version; ///<Version of current structure. 2112 MS_U16 u16InVFreq; ///<input V frequency 2113 MS_U16 u16OutVFreq; ///<output V frequncy 2114 MS_BOOL bInterlace; ///<whether it's interlace 2115 2116 }XC_OUTPUTFRAME_Info; 2117 2118 /// Define XC Init MISC 2119 /// please enum use BIT0 = 1, BIT1 = 2, BIT3 = 4 2120 typedef enum 2121 { 2122 E_XC_INIT_MISC_A_NULL = 0, 2123 E_XC_INIT_MISC_A_IMMESWITCH = 1, 2124 E_XC_INIT_MISC_A_IMMESWITCH_DVI_POWERSAVING = 2, 2125 E_XC_INIT_MISC_A_DVI_AUTO_EQ = 4, 2126 E_XC_INIT_MISC_A_FRC_INSIDE = 8, 2127 2128 E_XC_INIT_MISC_A_OSD_TO_HSLVDS = 0x10, 2129 E_XC_INIT_MISC_A_FRC_INSIDE_60HZ = 0x20, // for 60Hz FRC case 2130 E_XC_INIT_MISC_A_FRC_INSIDE_240HZ = 0x40, // for 240Hz FRC case 2131 E_XC_INIT_MISC_A_FRC_INSIDE_4K1K_120HZ = 0x80, // for 4K1K 120Hz FRC case 2132 2133 E_XC_INIT_MISC_A_ADC_AUTO_SCART_SV = 0x100, // Support S-Video Auto Switch on SCART 2134 E_XC_INIT_MISC_A_FRC_INSIDE_KEEP_OP_4K2K = 0x200, // always keep OP timing as 4K2K 2135 E_XC_INIT_MISC_A_FRC_INSIDE_4K_HALFK_240HZ = 0x400, // for 4K 0.5K 240Hz FRC case 2136 E_XC_INIT_MISC_A_FCLK_DYNAMIC_CONTROL = 0x800, // for Dynamic FCLK control 2137 2138 E_XC_INIT_MISC_A_SKIP_UC_DOWNLOAD = 0x1000, // for iframe case skip UC 2139 E_XC_INIT_MISC_A_SKIP_VIP_PEAKING_CONTROL = 0x2000, // for skipping VIP peaking control related unnecesary timing change 2140 E_XC_INIT_MISC_A_FAST_GET_VFREQ = 0x4000,//for get freq fast 2141 E_XC_INIT_MISC_A_LEGACY_MODE = 0x8000, // for monaco mode 2142 E_XC_INIT_MISC_A_SAVE_MEM_MODE = 0x10000, // for muji save memory 2143 E_XC_INIT_MISC_A_FRC_DUAL_MIU = 0x20000, // for Manhattan FRC MEMC dual-MUU 2144 } XC_INIT_MISC_A; 2145 2146 typedef enum 2147 { 2148 E_XC_INIT_MISC_B_NULL = 0, 2149 E_XC_INIT_MISC_B_PQ_SKIP_PCMODE_NEWFLOW = 1, 2150 E_XC_INIT_MISC_B_SKIP_SR = 2, 2151 } XC_INIT_MISC_B; 2152 2153 typedef enum 2154 { 2155 E_XC_INIT_MISC_C_NULL = 0, 2156 } XC_INIT_MISC_C; 2157 2158 2159 typedef enum 2160 { 2161 E_XC_INIT_MISC_D_NULL = 0, 2162 } XC_INIT_MISC_D; 2163 2164 2165 /// Define the initial MISC for XC 2166 typedef struct 2167 { 2168 MS_U32 u32XCMISC_version; ///<Version of current structure. 2169 MS_U32 u32MISC_A; 2170 MS_U32 u32MISC_B; 2171 MS_U32 u32MISC_C; 2172 MS_U32 u32MISC_D; 2173 } XC_INITMISC; 2174 2175 typedef enum 2176 { 2177 E_XC_FLOCK_DIV_OFF = 0, 2178 E_XC_FLOCK_DIV_ON, 2179 E_XC_FLOCK_FPLL_ON, 2180 2181 }E_XC_FLOCK_TYPE; 2182 2183 typedef struct __attribute__((packed)) 2184 { 2185 // memory 2186 MS_PHY u32FRC_MEMC_MemAddr; 2187 MS_PHY u32FRC_MEMC_MemSize; 2188 MS_PHY u32FRC_OD_MemAddr; 2189 MS_PHY u32FRC_OD_MemSize; 2190 MS_PHY u32FRC_LD_MemAddr; 2191 MS_PHY u32FRC_LD_MemSize; 2192 MS_PHY u32FRC_ME1_MemAddr; 2193 MS_PHY u32FRC_ME1_MemSize; 2194 MS_PHY u32FRC_ME2_MemAddr; 2195 MS_PHY u32FRC_ME2_MemSize; 2196 MS_PHY u32FRC_2D3D_Render_MemAddr; 2197 MS_PHY u32FRC_2D3D_Render_MemSize; 2198 MS_PHY u32FRC_2D3D_Render_Detection_MemAddr; 2199 MS_PHY u32FRC_2D3D_Render_Detection_MemSize; 2200 MS_PHY u32FRC_Halo_MemAddr; 2201 MS_PHY u32FRC_Halo_MemSize; 2202 MS_PHY u32FRC_R2_MemAddr; 2203 MS_PHY u32FRC_R2_MemSize; 2204 MS_PHY u32FRC_ADL_MemAddr; 2205 MS_PHY u32FRC_ADL_MemSize; 2206 2207 MS_PHY u32FRC_FrameSize; 2208 2209 MS_PHY u16FB_YcountLinePitch; 2210 MS_U16 u16PanelWidth; 2211 MS_U16 u16PanelHeigh; 2212 MS_U8 u8FRC3DPanelType; 2213 MS_U8 u83Dmode; 2214 MS_U8 u8IpMode; 2215 MS_U8 u8MirrorMode; 2216 MS_U8 u83D_FI_out; 2217 MS_BOOL bFRC; 2218 2219 } FRC_INFO_t, *PFRC_INFO_t; 2220 2221 typedef struct __attribute__((packed)) 2222 { 2223 MS_U32 u32XC_PREINIT_version; ///<Version of current structure. 2224 // FRC control info 2225 FRC_INFO_t FRCInfo; 2226 2227 MS_U16 u16VTrigX; 2228 MS_U16 u16VTrigY; 2229 2230 /////////////////////////////////////////////// 2231 // panel timing spec. 2232 /////////////////////////////////////////////// 2233 // sync related 2234 MS_U8 u8PanelHSyncWidth; ///< VOP_01[7:0], PANEL_HSYNC_WIDTH 2235 MS_U8 u8PanelHSyncBackPorch; ///< PANEL_HSYNC_BACK_PORCH, no register setting, provide value for query only 2236 2237 ///< not support Manuel VSync Start/End now 2238 ///< VOP_02[10:0] VSync start = Vtt - VBackPorch - VSyncWidth 2239 ///< VOP_03[10:0] VSync end = Vtt - VBackPorch 2240 MS_U8 u8PanelVSyncWidth; ///< define PANEL_VSYNC_WIDTH 2241 MS_U8 u8PanelVSyncBackPorch; ///< define PANEL_VSYNC_BACK_PORCH 2242 2243 } XC_PREINIT_INFO_t, *p_XC_PREINIT_INFO_t; 2244 2245 typedef enum 2246 { 2247 E_XC_PREINIT_NULL = 0x00, 2248 E_XC_PREINIT_FRC = 0x01, 2249 E_XC_PREINIT_FRC_3D_TYPE = 0x02, 2250 E_XC_PREINIT_NUM, 2251 2252 }E_XC_PREINIT_t; 2253 2254 typedef enum 2255 { 2256 MIRROR_NORMAL, 2257 MIRROR_H_ONLY, 2258 MIRROR_V_ONLY, 2259 MIRROR_HV, 2260 MIRROR_MAX, 2261 } MirrorMode_t; 2262 2263 typedef enum 2264 { 2265 E_XC_MEMORY_IP_READ_REQUEST, ///< memory request for IP read 2266 E_XC_MEMORY_IP_WRITE_REQUEST, ///< memory request for IP write 2267 E_XC_MEMORY_OP_READ_REQUEST, ///< memory request for OP read 2268 E_XC_MEMORY_OP_WRITE_REQUEST, ///< memory request for OP write 2269 E_XC_MEMORY_REQUEST_MAX, ///< Invalid request 2270 } E_XC_MEMORY_REQUEST_TYPE; 2271 2272 2273 /// OP2 Video/GOP layer switch 2274 typedef enum 2275 { 2276 E_VIDEO_ON_OSD_LAYER_DEAFULT = 0, ///< video -> osd layer 0 -> osd layer 1 -> osd layer 2 -> osd layer 3 -> osd layer 4 2277 E_VIDEO_ON_OSD_LAYER_0 = 1, ///< osd layer 0 -> video -> osd layer 1 -> osd layer 2 -> osd layer 3 -> osd layer 4 2278 E_VIDEO_ON_OSD_LAYER_1 = 2, ///< osd layer 0 -> osd layer 1 -> video -> osd layer 2 -> osd layer 3 -> osd layer 4 2279 E_VIDEO_ON_OSD_LAYER_2 = 3, ///< osd layer 0 -> osd layer 1 -> osd layer 2 -> video -> osd layer 3 -> osd layer 4 2280 E_VIDEO_ON_OSD_LAYER_3 = 4, ///< osd layer 0 -> osd layer 1 -> osd layer 2 -> osd layer 3 -> video -> osd layer 4 2281 E_VIDEO_ON_OSD_LAYER_4 = 5, ///< osd layer 0 -> osd layer 1 -> osd layer 2 -> osd layer 3 -> osd layer 4 -> video 2282 E_VIDEO_ON_OSD_LAYER_NUM, 2283 } E_VIDEO_ON_OSD_LAYER; 2284 2285 /// Osd Index 2286 typedef enum 2287 { 2288 E_XC_OSD_0 = 0, ///< osd0 2289 E_XC_OSD_1 = 1, ///< osd1 2290 E_XC_OSD_2 = 2, ///< osd2 2291 E_XC_OSD_3 = 3, ///< osd3 2292 E_XC_OSD_4 = 4, ///< osd3 2293 E_XC_OSD_NUM, 2294 } E_XC_OSD_INDEX; 2295 2296 /// Osd Index 2297 typedef enum 2298 { 2299 E_XC_OSD_BlENDING_MODE0 = 0, ///< a*OSD + (1-a)*Video 2300 E_XC_OSD_BlENDING_MODE1 = 1, ///< OSD + (1-a)*Video 2301 E_XC_OSD_BlENDING_TYPE_NUM, 2302 } E_XC_OSD_BlENDING_TYPE; 2303 2304 /// Scaling type 2305 typedef enum 2306 { 2307 E_XC_PRE_SCALING = 0, 2308 E_XC_POST_SCALING, 2309 E_XC_BOTH_SCALING, 2310 }E_XC_SCALING_TYPE; 2311 2312 /// HV Vector type 2313 typedef enum 2314 { 2315 E_XC_H_VECTOR = 0, 2316 E_XC_V_VECTOR, 2317 E_XC_HV_VECTOR, 2318 }E_XC_VECTOR_TYPE; 2319 2320 /// Define MCDI buffer type 2321 typedef enum 2322 { 2323 E_XC_MCDI_ME1 = 0, ///< Main MDCI ME1 2324 E_XC_MCDI_ME2 = 1, ///< Main MDCI ME2 2325 E_XC_MCDI_BOTH, ///< Main MDCI ME1+ME2 2326 E_XC_MCDI_SUB_ME1, ///< Sub MDCI ME1 2327 E_XC_MCDI_SUB_ME2, ///< Sub MDCI ME2 2328 E_XC_MCDI_SUB_BOTH, ///< Sub MDCI ME1+ME2 2329 E_XC_MCDI_MAX, 2330 }E_XC_MCDI_TYPE; 2331 2332 typedef struct 2333 { 2334 MS_U8 p1; 2335 MS_U8 p2; 2336 MS_U8 p3; 2337 MS_U8 p4; 2338 MS_U8 p5; 2339 MS_U8 p6; 2340 MS_U8 p7; 2341 MS_U8 p8; 2342 } FRC_R2_CMD_PARAMETER_t, *p_FRC_R2_CMD_PARAMETER_t; 2343 2344 typedef enum 2345 { 2346 E_XC_FRC_MB_CMD_NONE = 0x00, 2347 E_XC_FRC_MB_CMD_TEST = 0x01, // Print parameter 2348 E_XC_FRC_MB_CMD_GET_SW_VERSION = 0x02, // ParaCnt=0, return 2 Byte, P0=Main, P1=Minor 2349 E_XC_FRC_MB_CMD_GET_CMD_VERSION = 0x03, // ParaCnt=0, return 2 Byte, P0=Low byte, P1=High byte 2350 E_XC_FRC_MB_CMD_INIT = 0x10, // ParaCnt=5, P0 = Panel 3D type(0=2D, 1=passive, 2=active, 3=PDP) 2351 // P1 = Panel max V Freq, 60/120/240, but 240 Hz is not supported 2352 // P2 = LocalDimming panel type, (0=LG32inch_LR10, 1=LG37inch_LR10, 2=LG42inch_LR16, 3=LG47inch_LR16, 4=LG55inch_LR16, 2353 // 5=TOSHIBA_LR16, 6=TOSHIBA_TB16, 8=LG50inchCinema_TB32, 9=LG60inchCinema_TB32, A=LG47inch_Direct72, B=LG55inch_Direct96, C=LG72inch_Direct480) 2354 // P3 = ChipRevision (0=U01, 1=U02, 2=U03, etc.) 2355 // P4 = Is60HzPackage (0=FALSE, 1=TRUE) 2356 E_XC_FRC_MB_CMD_SET_TIMING = 0x11, // ParaCnt=2, P0 = Input V Freq, P1 = Output V Freq 2357 E_XC_FRC_MB_CMD_SET_INPUT_FRAME_SIZE = 0x12, // ParaCnt=4, P0 = Width[15:8], P1 = width[7:0], P2 = height[15:8], P3 = height[7:0] 2358 E_XC_FRC_MB_CMD_SET_OUTPUT_FRAME_SIZE = 0x13,// ParaCnt=4, P0 = Width[15:8], P1 = width[7:0], P2 = height[15:8], P3 = height[7:0] 2359 E_XC_FRC_MB_CMD_SET_INPUT_3D_FORMAT = 0x14, // ParaCnt=2, P0 = input 3D format(0=2D, 1=Side-by-side, 2=Top-Down, 3=Check-Board, 4=Frame-interleave, 6=Line alternative, 7=Frame-packing) 2360 // P1 = 3DModeConfig(0=Normal, 1=L/R Swap, 2=L-Only, 3=R-Only) 2361 E_XC_FRC_MB_CMD_SET_3D_DEPTH_OFFSET = 0x15, // ParaCnt=2, P0 = Enable3DDepthOffset(0=Disable, 1=Enable) 2362 // P1 = 3DDepthOffset(0~255) 2363 E_XC_FRC_MB_CMD_SET_FPLL_LOCK_DONE = 0x16, // ParaCnt=1, P0 = FPLL lock done(0: free run or not locked yet, 1: Locked) 2364 E_XC_FRC_MB_CMD_SET_MFC_MDOE = 0x20, // ParaCnt=3, P0 = MFCMode(0=ff, 1=Low, 2=Mid, 3=High, 4=User, 5=55 pull down, 6=64 pull down) 2365 // P1 = DeJudderLevel(0~10) [for User mode only] 2366 // P2 = DeBlurLevel(0~10) [for User mode only] 2367 E_XC_FRC_MB_CMD_SET_MFC_DEMO_MODE = 0x21, // ParaCnt=1, P0 = DemoModeEnable(0=Disable,1=Enable) 2368 E_XC_FRC_MB_CMD_SET_LOCAL_DIMMING_MODE = 0x30, // ParaCnt=1, P0 = LocalDimmingMode(0=Off, 1=Low, 2=Mid, 3=High, 4=Demo) 2369 E_XC_FRC_MB_CMD_SET_2D_TO_3D_MODE = 0x40, // ParaCnt=5, P0 = 2D to 3D ConversionMode(0=Disable, 1=Enable) 2370 // P1 = 2D to 3D Depth Gain(0~31) 2371 // P2 = 2D to 3D Depth Offset(0~127) 2372 // P3 = Artificial Gain(0~15) 2373 // P4 = L/R Swap (0=Normal, 1=L/R Swap) 2374 ///* the value is not decided yet 2375 E_XC_FRC_MB_CMD_SET_PWM_ENABLE = 0x50, // ParaCnt=1, P0 = PWM Enable(0=Disable, 1=Enable) 2376 E_XC_FRC_MB_CMD_SET_PWM_DUTY_PHASE = 0x51, // ParaCnt=6, P0 = PWM No.(0, 1, 3) 2377 // P1 P2 = PWMX_DutyPercentX100(0~65536) 2378 // P3 P4 = PWMX_360DegreeX100(0~65536) 2379 // P5 = PWMX_Polarity(0=not invert, 1=invert) 2380 E_XC_FRC_MB_CMD_SET_PWM_FREQ = 0x52, // ParaCnt=4, P0 = PWM No.(0, 1, 3) 2381 // P1 = PWMX_FreqMul 2382 // P2 = PWMX_FreqDiv 2383 // P3 = PWMX_VsorHsRST 2384 // P4 = PWMX_SyncRstCnt 2385 E_XC_FRC_MB_CMD_SET_FORCE_PWM = 0x53, // ParaCnt=0 2386 E_XC_FRC_MB_CMD_SET_IR_EMMITER_LR_SHIFT = 0x54, // ParaCnt=3, P0 = Select the CMD(0=Lo, 1=Lc, 2=Ro, 3=Rc) 2387 // P2 P1= Pulse time shift(0~65536) 2388 E_XC_FRC_MB_CMD_SET_IR_EMMITER_LR_MODE = 0x55, // ParaCnt=1, P0 = CMD Shift(0=Lo Lc, 1=Lc Ro, 2=Ro Rc, 3=Rc Lo) 2389 /* 2390 E_XC_FRC_MB_CMD_SET_IR_EMMITER_LR_MODE = 0x55, // ParaCnt=4, P0 = Action Pattern Selection(0=Action Pattern 1, 1=Action Pattern 2) 2391 // P1 = L frame CMD(0=Lo Lc, 1=Lc Ro, 2=Ro Rc, 3=Rc Lo for Pattern 1; 0=Lo Rc, 1=Rc Ro, 2=Ro Lc, 3=Lc Lo for Pattern 2) 2392 // P2 = First CMD shift(0~255) 2393 // P3 = Second CMD shift(0~255) 2394 */ 2395 /* 2396 E_XC_FRC_MB_CMD_SET_PWM_CMD_MODE = 0x56, // ParaCnt=4, P0 = Action Pattern Selection(0=Action Pattern 1, 1=Action Pattern 2) 2397 // P1 = L frame CMD(0=Lo Lc, 1=Lc Ro, 2=Ro Rc, 3=Rc Lo for Pattern 1; 0=Lo Rc, 1=Rc Ro, 2=Ro Lc, 3=Lc Lo for Pattern 2) 2398 // P2 = First CMD shift(0~255) 2399 // P3 = Second CMD shift(0~255) 2400 */ 2401 } E_XC_FRC_MAILBOX_CMD; 2402 2403 //LD 2404 2405 typedef enum 2406 { 2407 E_LD_PANEL_LG32inch_LR10 = 0x0, 2408 E_LD_PANEL_LG37inch_LR10 = 0x1, 2409 E_LD_PANEL_LG42inch_LR16 = 0x2, 2410 E_LD_PANEL_LG47inch_LR16 = 0x3, 2411 E_LD_PANEL_LG55inch_LR16 = 0x4, 2412 E_LD_PANEL_LG55inch_LR12 = 0x5, 2413 E_LD_PANEL_CMO42inch_LR16 = 0x6, 2414 E_LD_PANEL_LG50inch_4K2K_VB1 = 0x7, 2415 E_LD_PANEL_DEFAULT, 2416 E_LD_PANEL_NUMS, 2417 }EN_LD_PANEL_TYPE; 2418 2419 typedef enum 2420 { 2421 E_LD_MODE_OFF = 0, 2422 E_LD_MODE_LOW = 1, 2423 E_LD_MODE_MID = 2, 2424 E_LD_MODE_HIGH = 3, 2425 }EN_LD_MODE; 2426 2427 //parameters for detecting nine lattice 2428 typedef struct 2429 { 2430 MS_U16 u16PixelStep; // distance between sample points 2431 MS_U8 u8ColorThreshold; // max color difference 2432 MS_U8 u8TryTimes; // max times for detecting 2433 MS_U16 u16LinearDiff; // difference for every 3 lattice in a line 2434 }ST_DETECTNL_PARA; 2435 2436 #define FRC_PATHCTRL_ALLOFF (0x0000) 2437 #define FRC_PATHCTRL_OP2COLORMATRIX (0x0001) 2438 #define FRC_PATHCTRL_OP2CSCDITHER (0x0002) 2439 #define FRC_PATHCTRL_OP2BRIGHTNESS (0x0004) 2440 #define FRC_PATHCTRL_OP2CONTRAST (0x0008) 2441 #define FRC_PATHCTRL_OP2NOISEROUND (0x0010) 2442 2443 // OSDC TIMING GEN 2444 typedef struct 2445 { 2446 MS_U16 u16OC_Tgen_HTotal; 2447 MS_U16 u16OC_Tgen_VTotal; 2448 2449 MS_U16 u16OC_Tgen_Hsync_Start; 2450 MS_U16 u16OC_Tgen_Hsync_End; 2451 MS_U16 u16OC_Tgen_HframDE_Start; 2452 MS_U16 u16OC_Tgen_HframDE_End; 2453 2454 MS_U16 u16OC_Tgen_Vsync_Start; 2455 MS_U16 u16OC_Tgen_Vsync_End; 2456 MS_U16 u16OC_Tgen_VframDE_Start; 2457 MS_U16 u16OC_Tgen_VframDE_End; 2458 }MS_XC_OSDC_TGEN_INFO; 2459 2460 // OSDC MISC Control 2461 typedef struct 2462 { 2463 MS_BOOL bOC_ClK_En; 2464 MS_BOOL bOC_Mixer_Bypass_En; 2465 MS_BOOL bOC_Mixer_InvAlpha_En; 2466 MS_BOOL bOC_Mixer_Hsync_Vfde_Out; // 1:hs_out = hs&vfde 2467 MS_BOOL bOC_Mixer_Hfde_Vfde_Out; // 1:hs_out = de(hfde)&vfde 2468 MS_U16 u16OC_Lpll_type; 2469 MS_U8 u8OC_OutputFormat; // output bit order 2470 }MS_XC_OSDC_CTRL_INFO; 2471 2472 typedef enum 2473 { 2474 E_XC_OSDC_TGEN_MANUAL = 0, 2475 E_XC_OSDC_TGEN_1366x768, 2476 E_XC_OSDC_TGEN_1920x1080, 2477 E_XC_OSDC_TGEN_3840x2160, 2478 E_XC_OSDC_TGEN_3840x1080, 2479 2480 E_XC_OSDC_TGEN_MAX, 2481 }E_XC_OSDC_TGEN_Type; 2482 2483 typedef enum 2484 { 2485 E_XC_OSDC_INIT = 0, 2486 E_XC_OSDC_CTRL_TGEN, 2487 E_XC_OSDC_CTRL_MISC, 2488 E_XC_OSDC_CTRL_OUTPUT_FORMAT, 2489 }E_XC_OSDC_CTRL_TYPE; 2490 2491 //OSDC Display information 2492 typedef struct 2493 { 2494 MS_U32 ODSC_DISPInfo_Version; ///<Version of current structure. Please always set to "u32Osdc_dispinfo_Version" as input 2495 2496 MS_U32 VDTOT; //Output vertical total 2497 MS_U32 DEVST; //Output DE Vertical start 2498 MS_U32 DEVEND; //Output DE Vertical end 2499 MS_U32 HDTOT; // Output horizontal total 2500 MS_U32 DEHST; //Output DE horizontal start 2501 MS_U32 DEHEND; // Output DE horizontal end 2502 2503 MS_U32 SYNCHST; 2504 MS_U32 SYNCHEND; 2505 MS_U32 SYNCVST; 2506 MS_U32 SYNCVEND; 2507 2508 MS_BOOL bCLK_EN; // OUTPUT ENABLE 2509 MS_BOOL bMIXER_BYPASS_EN; // MIXER BYPASS ENABLE 2510 MS_BOOL bMIXER_INVALPHA_EN; 2511 MS_BOOL bMIXER_HSTVFDEOUT_EN;// 1:hs_out = hs&vfde 2512 MS_BOOL bMIXER_HFDEVFDEOUT_EN;// 1:hs_out = de(hfde)&vfde 2513 2514 } MS_OSDC_DST_DispInfo; 2515 2516 //select the input for bypass mode. 2517 typedef enum 2518 { 2519 E_XC_BYPASS_HDMI = 0, 2520 E_XC_BYPASS_DC_MAIN, 2521 E_XC_BYPASS_DC_SUB, 2522 }E_XC_BYPASS_InputSource; 2523 2524 2525 // For HW internal test pattern 2526 typedef enum 2527 { 2528 E_XC_OP1_PATGEN_DISP_LB_MODE, // pattern gen on display line buffer, can't support post-sclaing 2529 E_XC_OP1_PATGEN_OPM_MODE, // pattern gen before post scaling engine, can support post-scaling, but not implement now 2530 }EN_XC_OP1_PATGEN_MODE; 2531 2532 typedef enum{ 2533 E_XC_OP1_PATTERN_OFF = 0, 2534 E_XC_OP1_WB_PATTERN, // 1: 2535 E_XC_OP1_PURE_RED_PATTERN, // 2: red 2536 E_XC_OP1_PURE_GREEN_PATTERN, // 3: green 2537 E_XC_OP1_PURE_BLUE_PATTERN, // 4: blue 2538 E_XC_OP1_PURE_WHITE_PATTERN, // 5: white 2539 E_XC_OP1_PURE_BLACK_PATTERN, // 6: black 2540 E_XC_OP1_PURE_GREY_PATTERN, // 7: gray 2541 E_XC_OP1_PURE_COLOR_V_BAR_PATTERN, // 8: vertical color-bar 2542 E_XC_OP1_PURE_COLOR_H_BAR_PATTERN, // 9: horizontal color-bar 2543 E_XC_OP1_PURE_GREY_BAR_16_PATTERN, // 10: 16 vertical gray-bar 2544 E_XC_OP1_PURE_GREY_BAR_32_PATTERN, // 11: 32 vertical gray-bar 2545 E_XC_OP1_PURE_GREY_BAR_64_PATTERN, // 12: 64 vertical gray-bar 2546 E_XC_OP1_PURE_GREY_RGB_32_PATTERN, // 13: 32 vertical 4 color bar 2547 E_XC_OP1_PURE_RGB_CHECKERBOARD_PATTERN, // 14: 3x3 checkerboard R/B/G 2548 E_XC_OP1_DOAFADE_GRAY_PATTERN, // 15: dotfade gary 2549 E_XC_OP1_CALIBRATION_COLOR_DOTFADE_PATTERN, // 16: checkerboard + dotfade gary 2550 E_XC_OP1_CALIBRATION_PATTERN, // 17: checkerboard 2551 E_XC_OP1_PATTERN_1, // 18 2552 E_XC_OP1_PATTERN_2, // 19: 2553 E_XC_OP1_PATTERN_3, // 20: same as pattern2, but not full screen 2554 E_XC_OP1_3D_PATTERN, // 21: side-by-side, if enable 3D effect, can see the word "3D" 2555 E_XC_OP1_PURE_RED_100IRE_PATTERN, // 22: red 2556 E_XC_OP1_PURE_GREEN_100IRE_PATTERN, // 23: green 2557 E_XC_OP1_PURE_BLUE_100IRE_PATTERN, // 24: blue 2558 E_XC_OP1_PURE_RED_70IRE_PATTERN, // 25 2559 E_XC_OP1_PURE_GREEN_70IRE_PATTERN, // 26 2560 E_XC_OP1_PURE_BLUE_70IRE_PATTERN, // 27 2561 E_XC_OP1_PURE_RED_40IRE_PATTERN, // 28 2562 E_XC_OP1_PURE_GREEN_40IRE_PATTERN, // 29 2563 E_XC_OP1_PURE_BLUE_40IRE_PATTERN, // 30 2564 E_XC_OP1_PURE_RED_20IRE_PATTERN, // 31 2565 E_XC_OP1_PURE_GREEN_20IRE_PATTERN, // 32 2566 E_XC_OP1_PURE_BLUE_20IRE_PATTERN, // 33 2567 E_XC_OP1_PURE_RED_10IRE_PATTERN, // 34 2568 E_XC_OP1_PURE_GREEN_10IRE_PATTERN, // 35 2569 E_XC_OP1_PURE_BLUE_10IRE_PATTERN, // 36 2570 E_XC_OP1_PURE_WHITE_100IRE_PATTERN, // 37 2571 E_XC_OP1_PURE_WHITE_90IRE_PATTERN, // 38 2572 E_XC_OP1_PURE_WHITE_80IRE_PATTERN, // 39 2573 E_XC_OP1_PURE_WHITE_70IRE_PATTERN, // 40 2574 E_XC_OP1_PURE_WHITE_60IRE_PATTERN, // 41 2575 E_XC_OP1_PURE_WHITE_50IRE_PATTERN, // 42 2576 E_XC_OP1_PURE_WHITE_40IRE_PATTERN, // 43 2577 E_XC_OP1_PURE_WHITE_30IRE_PATTERN, // 44 2578 E_XC_OP1_PURE_WHITE_20IRE_PATTERN, // 45 2579 E_XC_OP1_PURE_WHITE_10IRE_PATTERN, // 46 2580 E_XC_OP1_PURE_GAMMA_GREY1_PATTERN, // 47: gray 2581 E_XC_OP1_PURE_GAMMA_GREY2_PATTERN, // 48: gray 2582 E_XC_OP1_PURE_RGB_CHECKERBOARD_PATTERN_2, // 49: 3x3 checkerboard R/G/B 2583 }EN_XC_OP1_PATTERN; 2584 2585 //white balance pattern mode 2586 typedef enum 2587 { 2588 E_XC_OP1_PATTERN_MODE, // OP1 tset Pattern 2589 E_XC_OP2_PATTERN_MODE, // OP2 tset Pattern 2590 }EN_XC_WB_PATTERN_MODE; 2591 2592 2593 typedef struct 2594 { 2595 // Output timing 2596 MS_U16 u16HStart; ///< DE H start 2597 MS_U16 u16VStart; ///< DE V start 2598 MS_U16 u16Width; ///< DE H width 2599 MS_U16 u16Height; ///< DE V height 2600 MS_U16 u16HTotal; ///< H total 2601 MS_U16 u16VTotal; ///< V total 2602 2603 MS_U16 u16DefaultVFreq; ///< Panel output Vfreq., used in free run 2604 2605 // sync 2606 MS_U8 u8HSyncWidth; ///< H sync width 2607 MS_U16 u16VSyncStart; ///< V sync start = Vtotal - backporch - VSyncWidth 2608 MS_U8 u8VSyncWidth; ///< V sync width 2609 MS_BOOL bManuelVSyncCtrl; ///< enable manuel V sync control 2610 2611 // output control 2612 MS_U16 u16OCTRL; ///< Output control such as Swap port, etc. 2613 MS_U16 u16OSTRL; ///< Output control sync as Invert sync/DE, etc. 2614 MS_U16 u16ODRV; ///< Driving current 2615 MS_U16 u16DITHCTRL; ///< Dither control 2616 2617 } MS_XC_VOP_Data; 2618 2619 2620 typedef enum 2621 { 2622 /* 2623 __________________________________________________________________________________________________________________________________________ 2624 |Vby1 Output Format|D0|D1|D2|D3|D4|D5|D6|D7|D8|D9|D10|D11|D12|D13|D14|D15|D16|D17|D18|D19|D20|D21|D22|D23|D24|D25|D26|D27|D28|D29|D30|D31| 2625 |------------------|--|--|--|--|--|--|--|--|--|--|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| 2626 | ARGB 1 |R0|R1|R2|R3|R4|R5|R6|R7|G0|G1|G2 |G3 |G4 |G5 |G6 |G7 |B0 |B1 |B2 |B3 |B4 |B5 |B6 |B7 |A1 |A0 |A2 |A3 |A4 |A5 |A6 |A7 | 2627 |------------------|--|--|--|--|--|--|--|--|--|--|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| 2628 | ARGB 2 |R2|R3|R4|R5|R6|R7|A6|A7|G2|G3|G4 |G5 |G6 |G7 |A4 |A5 |B2 |B3 |B4 |B5 |B6 |B7 |A2 |A3 |A0 |A1 |B0 |B1 |G0 |G1 |R0 |R1 | 2629 ------------------------------------------------------------------------------------------------------------------------------------------ 2630 */ 2631 E_XC_OSDC_OUTPUT_FORMAT_VBY1_ARGB1, 2632 E_XC_OSDC_OUTPUT_FORMAT_VBY1_ARGB2, 2633 } E_XC_OSDC_OUTPUT_FORMAT; 2634 2635 typedef struct 2636 { 2637 MS_PHYADDR u32FBSize[2]; 2638 MS_U16 u16VBox_Htotal[2]; 2639 MS_U16 u16VBox_Vtotal[2]; 2640 MS_U16 u16VBox_PanelHsize; 2641 MS_U16 u16VBox_PanelVsize; 2642 MS_U16 u16Vfreq[2]; 2643 MS_BOOL bInterface[2]; 2644 }XC_VBOX_INFO; 2645 2646 typedef enum 2647 { 2648 E_XC_BWD_UPDATE_BWR_CONFIG = 0, // Update bwr configuration 2649 } E_XC_BWD_CONFIG_TYPE; 2650 2651 #ifdef UFO_XC_TEST_PATTERN 2652 //xc test pattern type 2653 typedef enum 2654 { 2655 E_XC_ADC_PATTERN_MODE, //adc test pattern 2656 E_XC_IPMUX_PATTERN_MODE, // ipmux test Pattern 2657 E_XC_IP1_PATTERN_MODE, // ip test Pattern 2658 E_XC_OP_PATTERN_MODE, // op test Pattern 2659 E_XC_VOP_PATTERN_MODE, // vop test Pattern 2660 E_XC_VOP2_PATTERN_MODE, // vop2 test Pattern 2661 E_XC_MOD_PATTERN_MODE, // mod test Pattern 2662 }EN_XC_TEST_PATTERN_MODE; 2663 2664 //adc test pattern 2665 typedef struct 2666 { 2667 MS_U8 u8EnableADCType; 2668 MS_U16 u16Ramp; 2669 } XC_SET_ADC_TESTPATTERN_t, *p_XC_SET_ADC_TESTPATTERN_t; 2670 2671 //ipmux test Pattern 2672 typedef struct 2673 { 2674 MS_BOOL bEnable; 2675 MS_U16 u16R_CR_Data; 2676 MS_U16 u16G_Y_Data; 2677 MS_U16 u16B_CB_Data; 2678 } XC_SET_IPMUX_TESTPATTERN_t, *p_XC_SET_IPMUX_TESTPATTERN_t; 2679 2680 //ip test Pattern 2681 typedef struct 2682 { 2683 MS_U16 u16Enable; 2684 MS_U32 u32Pattern_type; 2685 SCALER_WIN eWindow; 2686 } XC_SET_IP1_TESTPATTERN_t, *p_XC_SET_IP1_TESTPATTERN_t; 2687 2688 //op test Pattern 2689 typedef struct 2690 { 2691 MS_BOOL bMiuLineBuff; 2692 MS_BOOL bLineBuffHVSP; 2693 } XC_SET_OP_TESTPATTERN_t, *p_XC_SET_OP_TESTPATTERN_t; 2694 2695 //vop test Pattern 2696 typedef struct 2697 { 2698 MS_BOOL bEnable; 2699 } XC_SET_VOP_TESTPATTERN_t, *p_XC_SET_VOP_TESTPATTERN_t; 2700 2701 //vop2 test Pattern 2702 typedef struct 2703 { 2704 MS_BOOL bEnable; 2705 MS_U16 u16R_CR_Data; 2706 MS_U16 u16G_Y_Data; 2707 MS_U16 u16B_CB_Data; 2708 } XC_SET_VOP2_TESTPATTERN_t, *p_XC_SET_VOP2_TESTPATTERN_t; 2709 2710 //mod test Pattern 2711 typedef struct 2712 { 2713 MS_BOOL bEnable; 2714 MS_U16 u16R_CR_Data; 2715 MS_U16 u16G_Y_Data; 2716 MS_U16 u16B_CB_Data; 2717 } XC_SET_MOD_TESTPATTERN_t, *p_XC_SET_MOD_TESTPATTERN_t; 2718 #endif 2719 2720 //------------------------------------------------------------------------------------------------- 2721 //MApi_XC_VideoPlaybackController enum of cmd 2722 //------------------------------------------------------------------------------------------------- 2723 typedef enum 2724 { 2725 E_XC_VPC_MULTI_SPEED_PLAYBACK_CTRL, 2726 }E_XC_VIDEO_PLAYBACK_CTRL_ID; 2727 //------------------------------------------------------------------------------------------------- 2728 //MApi_XC_VideoPlaybackController struct of cmd 2729 //------------------------------------------------------------------------------------------------- 2730 typedef struct 2731 { 2732 MS_BOOL bEnable; 2733 SCALER_WIN eWindow; 2734 }ST_XC_VPC_MULTI_SPEED_PLAYBACK_CTRL; 2735 //------------------------------------------------------------------------------------------------- 2736 2737 2738 //////////////////////////////////////////// 2739 2740 //------------------------------------------------------------------------------------------------- 2741 // Function and Variable 2742 //------------------------------------------------------------------------------------------------- 2743 2744 2745 //---------------------------- 2746 // Must have functions 2747 //---------------------------- 2748 //------------------------------------------------------------------------------------------------- 2749 /// Get XC library version 2750 /// @ingroup XC_INFO 2751 /// @param ppVersion \b OUT: store the version in this member 2752 /// @return @ref E_APIXC_ReturnValue 2753 //------------------------------------------------------------------------------------------------- 2754 // E_APIXC_ReturnValue MApi_XC_GetLibVer(const MSIF_Version **ppVersion); 2755 2756 //------------------------------------------------------------------------------------------------- 2757 /// Get XC Information 2758 /// @ingroup XC_ToBeRemove 2759 /// @return @ref XC_ApiInfo returnthe XC information in this member 2760 //------------------------------------------------------------------------------------------------- 2761 const XC_ApiInfo * MApi_XC_GetInfo(void); 2762 2763 //------------------------------------------------------------------------------------------------- 2764 /// Get XC Status of specific window(Main/Sub) 2765 /// @ingroup XC_ToBeRemove 2766 /// @param pDrvStatus \b OUT: store the status 2767 /// @param eWindow \b IN: which window(Main/Sub) is going to get status 2768 /// @return @ref MS_BOOL 2769 //------------------------------------------------------------------------------------------------- 2770 MS_BOOL MApi_XC_GetStatus(XC_ApiStatus *pDrvStatus, SCALER_WIN eWindow); 2771 2772 //------------------------------------------------------------------------------------------------- 2773 /// Extended interface to Get XC Status of specific window(Main/Sub) with version info 2774 /// usage: 2775 /// XC_ApiStatusEx stXCStatus; 2776 /// memset(&stXCStatus, 0, sizeof(XC_ApiStatusEx)); 2777 /// stXCStatus.u16ApiStatusEX_Length = sizeof(XC_ApiStatusEx); 2778 /// stXCStatus.u32ApiStatusEx_Version = API_STATUS_EX_VERSION; 2779 /// if(MApi_XC_GetStatusEx(&stXCStatusEx, MAIN_WINDOW) == sizeof(XC_ApiStatusEx)) 2780 /// { 2781 /// ...... 2782 /// } 2783 /// @ingroup XC_INFO 2784 /// @param pDrvStatusEx \b OUT: store the status 2785 /// @param eWindow \b IN: which window(Main/Sub) is going to get status 2786 /// @return @ref MS_U16 return the copied length of input structure 2787 //------------------------------------------------------------------------------------------------- 2788 MS_U16 MApi_XC_GetStatusEx(XC_ApiStatusEx *pDrvStatusEx, SCALER_WIN eWindow); 2789 2790 //------------------------------- 2791 // Set Debug Level 2792 /// @ingroup XC_INFO 2793 // @para u16DbgSwitch: XC_DBGLEVEL_OFF,XC_DBGLEVEL_SETWINDOW,XC_DBGLEVEL_SETTIMING,XC_DBGLEVEL_SYNCDETECT,XC_DBGLEVEL_MUX 2794 // currently, only used XC_DBGLEVEL_OFF,XC_DBGLEVEL_SETTIMING 2795 //------------------------------- 2796 MS_BOOL MApi_XC_SetDbgLevel(MS_U16 u16DbgSwitch); 2797 2798 //For debug purpose only! 2799 //------------------------------- 2800 // Set Debug Mode for scaler framelock 2801 /// @ingroup XC_INFO 2802 // @para DbgMode: Disable/Enable debug 2803 // @para DbgFlag: The debug item 2804 // @para u32Data: The debug data 2805 //------------------------------- 2806 // void MApi_XC_FPLLDbgMode(EN_FPLL_DBG_MODE DbgMode, EN_FPLL_DBG_FLAG DbgFlag, MS_U32 u32Data); 2807 2808 //------------------------------- 2809 // Set customer mode for scaler framelock 2810 /// @ingroup XC_SCALER 2811 // @para eMode: Disable/Enable customer mode 2812 // @para eFlag: The customer item 2813 // @para u32Data: The customer data 2814 //------------------------------- 2815 void MApi_XC_FPLLCustomerMode(EN_FPLL_MODE eMode, EN_FPLL_FLAG eFlag, MS_U32 u32Data); 2816 2817 //---------------------------- 2818 // Initialize 2819 //---------------------------- 2820 MS_BOOL MDrv_XC_SetIOMapBase(void); 2821 //------------------------------------------------------------------------------------------------- 2822 2823 /// Initialize the XC 2824 /// @ingroup XC_INIT 2825 /// @param pXC_InitData \b IN: the Initialized Data 2826 /// @param u32InitDataLen \b IN: the length of the initialized data 2827 /// @return @ref MS_BOOL 2828 //------------------------------------------------------------------------------------------------- 2829 MS_BOOL MApi_XC_Init(XC_INITDATA *pXC_InitData, MS_U32 u32InitDataLen); 2830 2831 //------------------------------------------------------------------------------------------------- 2832 /// Initialize the XC MISC 2833 /// @ingroup XC_INIT 2834 /// @param pXC_Init_Misc \b IN: the Initialized XC MISC 2835 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 2836 //------------------------------------------------------------------------------------------------- 2837 E_APIXC_ReturnValue MApi_XC_Init_MISC(XC_INITMISC *pXC_Init_Misc, MS_U32 u32InitMiscDataLen); 2838 2839 2840 //------------------------------------------------------------------------------------------------- 2841 /// Get XC Init MISC Status 2842 /// @ingroup XC_INFO 2843 /// @param pXC_Init_Misc \b OUT: store the status 2844 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 2845 //------------------------------------------------------------------------------------------------- 2846 E_APIXC_ReturnValue MApi_XC_GetMISCStatus(XC_INITMISC *pXC_Init_Misc); 2847 2848 2849 //------------------------------------------------------------------------------------------------- 2850 /// Get XC Capability 2851 /// @ingroup XC_ToBeRemove 2852 /// @param u32Id (you can get detail from E_XC_CAPABILITY enum) 2853 /// @return output data for each query item. 2854 //------------------------------------------------------------------------------------------------- 2855 MS_U32 MApi_XC_GetCapability(MS_U32 u32Id); 2856 2857 //------------------------------------------------------------------------------------------------- 2858 /// Get XC Capability 2 2859 /// @ingroup XC_INFO 2860 /// @param eCapType \b IN: u32Id (you can get detail from E_XC_CAPABILITY enum) 2861 /// @param pRet \b IN: -- 2862 /// @param ret_size \b IN: -- 2863 /// @return @E_APIXC_ReturnValue 2864 //------------------------------------------------------------------------------------------------- 2865 E_APIXC_ReturnValue MApi_XC_GetChipCaps(E_XC_CAPS eCapType, MS_U32* pRet, MS_U32 ret_size); 2866 //------------------------------------------------------------------------------------------------- 2867 /// Exit the XC 2868 /// @ingroup XC_INIT 2869 /// @return @ref MS_BOOL 2870 //------------------------------------------------------------------------------------------------- 2871 MS_BOOL MApi_XC_Exit(void); 2872 2873 //------------------------------- 2874 // Set Window & Scaling 2875 //------------------------------- 2876 2877 //------------------------------------------------------------------------------------------------- 2878 /// Set Dynamic Scaling 2879 /// @ingroup XC_DS 2880 /// @param pstDSInfo \b IN: the information of Dynamic Scaling 2881 /// @param u32DSInforLen \b IN: the length of the pstDSInfo 2882 /// @param eWindow \b IN: which window we are going to set 2883 /// @return @ref MS_BOOL 2884 //------------------------------------------------------------------------------------------------- 2885 MS_BOOL MApi_XC_SetDynamicScaling(XC_DynamicScaling_Info *pstDSInfo, MS_U32 u32DSInfoLen, SCALER_WIN eWindow); 2886 2887 //------------------------------------------------------------------------------------------------- 2888 /// Set Dynamic Scaling flag 2889 /// @ingroup XC_DS 2890 /// @param bEnable \b IN: enable or disable Dynamic Scaling 2891 //------------------------------------------------------------------------------------------------- 2892 void MApi_XC_Set_DynamicScalingFlag(MS_BOOL bEnable); 2893 2894 //------------------------------------------------------------------------------------------------- 2895 /// Get Dynamic Scaling Status 2896 /// @ingroup XC_DS 2897 /// @return @ref MS_BOOL TRUE: dynamic scaling is enabled; FALSE: dynamic scaling is not enabled. 2898 //------------------------------------------------------------------------------------------------- 2899 MS_BOOL MApi_XC_GetDynamicScalingStatus(void); 2900 2901 //------------------------------------------------------------------------------------------------- 2902 /// Get DNR Base offset 2903 /// @ingroup XC_SCALER 2904 /// @param eWindow \b IN: which window we are going to set 2905 /// @return @ref MS_U32 return the DNR Base offset 2906 //------------------------------------------------------------------------------------------------- 2907 MS_U32 MApi_XC_Get_DNRBaseOffset(SCALER_WIN eWindow); 2908 2909 //------------------------------------------------------------------------------------------------- 2910 /// Get the FrameStoreNum's factor number, which is usually to calcuate buffer offset 2911 /// @ingroup XC_SCALER 2912 /// @param eWindow \b IN: which window we are going to set 2913 /// @return @ref MS_U8 return the store frame number factor 2914 //------------------------------------------------------------------------------------------------- 2915 #define MApi_XC_Get_StoreFrameNum MApi_XC_Get_FrameNumFactor 2916 MS_U8 MApi_XC_Get_FrameNumFactor(SCALER_WIN eWindow); 2917 2918 //------------------------------------------------------------------------------------------------- 2919 /// Get the FRCM FrameStoreNum's factor number, which is usually to calcuate buffer offset 2920 /// @param eWindow \b IN: which window we are going to set 2921 /// @return @ref MS_U8 return the store frame number factor 2922 //------------------------------------------------------------------------------------------------- 2923 // MS_U8 MApi_XC_Get_FRCMFrameNum(SCALER_WIN eWindow); 2924 2925 //------------------------------------------------------------------------------------------------- 2926 /// Set the specific window 2927 /// @ingroup XC_SCALER 2928 /// @param pstXC_SetWin_Info \b IN: the information of the window setting 2929 /// @param u32InitDataLen \b IN: the length of the pstXC_SetWin_Info 2930 /// @param eWindow \b IN: which window we are going to set 2931 /// @return @ref MS_BOOL 2932 //------------------------------------------------------------------------------------------------- 2933 MS_BOOL MApi_XC_SetWindow(XC_SETWIN_INFO *pstXC_SetWin_Info, MS_U32 u32InitDataLen, SCALER_WIN eWindow); 2934 2935 //------------------------------------------------------------------------------------------------- 2936 /// Set main and sub window 2937 /// @ingroup XC_SCALER 2938 /// @param pstXC_SetWin_Info_Main \b IN: the information of the main window setting 2939 /// @param pstXC_SetWin_Info_Sub \b IN: the information of the sub window setting 2940 /// @return @ref MS_BOOL 2941 //------------------------------------------------------------------------------------------------- 2942 MS_BOOL MApi_XC_SetDualWindow(XC_SETWIN_INFO *pstXC_SetWin_Info_Main, XC_SETWIN_INFO *pstXC_SetWin_Info_Sub); 2943 2944 //------------------------------------------------------------------------------------------------- 2945 /// Set the specific window for traveling mode(VE capture function) 2946 /// @ingroup XC_SCALER 2947 /// @param pstXC_SetWin_Info \b IN: the information of the window setting 2948 /// @param u32InitDataLen \b IN: the length of the pstXC_SetWin_Info 2949 /// @param eWindow \b IN: which window we are going to set 2950 /// @return @ref MS_BOOL 2951 //------------------------------------------------------------------------------------------------- 2952 MS_BOOL MApi_XC_SetTravelingWindow(XC_SETWIN_INFO *pstXC_SetWin_Info, MS_U32 u32InitDataLen, SCALER_WIN eWindow); 2953 2954 //------------------------------- 2955 // Mode Related 2956 //------------------------------- 2957 //------------------------------------------------------------------------------------------------- 2958 /// Set input source type 2959 /// @ingroup XC_SCALER 2960 /// @param enInputSourceType \b IN: which input source typewe are going to set 2961 /// @param eWindow \b IN: which window we are going to set 2962 /// @return void 2963 //------------------------------------------------------------------------------------------------- 2964 void MApi_XC_SetInputSource( INPUT_SOURCE_TYPE_t enInputSourceType, SCALER_WIN eWindow ); 2965 2966 //------------------------------------------------------------------------------------------------- 2967 /// check whether the specific window is YUV space 2968 /// @ingroup XC_SCALER 2969 /// @param eWindow \b IN: which window we are going to set 2970 /// @return @ref MS_BOOL 2971 //------------------------------------------------------------------------------------------------- 2972 MS_BOOL MApi_XC_IsYUVSpace(SCALER_WIN eWindow); 2973 2974 //------------------------------------------------------------------------------------------------- 2975 /// check whether specific window is memory format 422 2976 /// @ingroup XC_SCALER 2977 /// @param eWindow \b IN: which window we are going to query 2978 /// @return @ref MS_BOOL 2979 //------------------------------------------------------------------------------------------------- 2980 MS_BOOL MApi_XC_IsMemoryFormat422(SCALER_WIN eWindow); 2981 2982 //------------------------------------------------------------------------------------------------- 2983 /// Enable/Disable force RGB in 2984 /// @ingroup XC_SCALER 2985 /// @param bEnable \b IN: enable or disable 2986 /// @param eWindow \b IN: which window we are going to enable or disable 2987 //------------------------------------------------------------------------------------------------- 2988 void MApi_XC_EnableForceRGBin(MS_BOOL bEnable, SCALER_WIN eWindow); 2989 2990 //------------------------------------------------------------------------------------------------- 2991 /// Set XC mirror mode for main or sub window 2992 /// @ingroup XC_SCALER 2993 /// @param eMirrorMode \b IN: enable or disable XC mirror mode 2994 /// @param eWindow \b IN: main or sub window 2995 /// @return @ref MS_BOOL 2996 //------------------------------------------------------------------------------------------------- 2997 MS_BOOL MApi_XC_EnableMirrorModeEx( MirrorMode_t eMirrorMode, SCALER_WIN eWindow); 2998 2999 //------------------------------------------------------------------------------------------------- 3000 /// Get XC mirror mode for main or sub window 3001 /// @ingroup XC_SCALER 3002 /// @param eWindow \b IN: main or sub window 3003 /// @return @ref MirrorMode_t 3004 //------------------------------------------------------------------------------------------------- 3005 MirrorMode_t MApi_XC_GetMirrorModeTypeEx(SCALER_WIN eWindow); 3006 3007 3008 //------------------------------------------------------------------------------------------------- 3009 /// Get whether support SWDS or not 3010 /// @ingroup XC_SCALER 3011 /// @return @ref MS_BOOL 3012 //------------------------------------------------------------------------------------------------- 3013 MS_BOOL MApi_XC_Is_SupportSWDS(void); 3014 3015 //------------------------------------------------------------------------------------------------- 3016 /// Set DS info to XC global variable/// 3017 //------------------------------------------------------------------------------------------------- 3018 void SYMBOL_WEAK MApi_XC_SetDSInfo(XC_DS_INFO *pstSetDSInfo, MS_U32 u32DSInfoLen, SCALER_WIN eWindow); 3019 3020 //------------------------------- 3021 // Timing detect 3022 //------------------------------- 3023 3024 //------------------------------------------------------------------------------------------------- 3025 /// Get the specific window's sync status 3026 /// @ingroup XC_TIMING_DETECT 3027 /// @param eCurrentSrc \b IN: the current input source 3028 /// @param sXC_Sync_Status \b OUT:store the sync status 3029 /// @param eWindow \b IN: which window we are going to get 3030 //------------------------------------------------------------------------------------------------- 3031 void MApi_XC_GetSyncStatus(INPUT_SOURCE_TYPE_t eCurrentSrc , XC_IP_SYNC_STATUS *sXC_Sync_Status, SCALER_WIN eWindow); 3032 3033 //------------------------------------------------------------------------------------------------- 3034 /// wait for output sync 3035 /// @ingroup XC_TIMING_DETECT 3036 /// @param u8NumVSyncs \b IN: the number of VSync we are going to wait 3037 /// @param u16Timeout \b IN: time out 3038 /// @return @ref MS_U8 retun the number of left Vsync if timeout 3039 //------------------------------------------------------------------------------------------------- 3040 MS_U8 MApi_XC_WaitOutputVSync(MS_U8 u8NumVSyncs, MS_U16 u16Timeout, SCALER_WIN eWindow); 3041 3042 //------------------------------------------------------------------------------------------------- 3043 /// wait for input sync 3044 /// @ingroup XC_TIMING_DETECT 3045 /// @param u8NumVSyncs \b IN: the number of VSync we are going to wait 3046 /// @param u16Timeout \b IN: time out 3047 /// @return @ref MS_U8 retun the number of left Vsync if timeout 3048 //------------------------------------------------------------------------------------------------- 3049 MS_U8 MApi_XC_WaitInputVSync(MS_U8 u8NumVSyncs, MS_U16 u16Timeout, SCALER_WIN eWindow); 3050 3051 //------------------------------------------------------------------------------------------------- 3052 /// Set HDMI detect mode. (HDMI has DE and HV mode. You can set what you want to use.) 3053 /// @ingroup XC_TIMING_DETECT 3054 /// @param esynctype \b IN: HDMI detect mode 3055 //------------------------------------------------------------------------------------------------- 3056 void MApi_XC_SetHdmiSyncMode(E_HDMI_SYNC_TYPE esynctype); 3057 3058 //------------------------------------------------------------------------------------------------- 3059 /// Set HDMI detect mode. (HDMI has DE and HV mode. You can set what you want to use.) 3060 /// @ingroup XC_TIMING_DETECT 3061 /// @return @ref E_HDMI_SYNC_TYPE Get current HDMI sync type 3062 //------------------------------------------------------------------------------------------------- 3063 E_HDMI_SYNC_TYPE MApi_XC_GetHdmiSyncMode(void); 3064 3065 //------------------------------- 3066 // Display control 3067 //------------------------------- 3068 //------------------------------------------------------------------------------------------------- 3069 /// Set report window 3070 /// @ingroup XC_SCALER 3071 /// @param bEnable \b IN: enable or disable report window 3072 /// @param Window \b IN: the window position and size 3073 /// @param u8Color \b IN: report window's color 3074 //------------------------------------------------------------------------------------------------- 3075 // void MApi_XC_SetRepWindow(MS_BOOL bEnable,MS_WINDOW_TYPE Window,MS_U8 u8Color); 3076 3077 //------------------------------------------------------------------------------------------------- 3078 /// update the _bSkipDisableOPWriteOffInFPLL variable status 3079 /// if TRUE, disable OPWriteOff in FPLL will be skipped 3080 /// @ingroup XC_SCALER 3081 /// @param bEnable \b IN: disable OPWriteOff in FPLL will be skipped or not. 3082 /// @param eWindow \b IN: Main or sub window 3083 //------------------------------------------------------------------------------------------------- 3084 // void MApi_XC_SetSkipDisableOPWriteOffInFPLL(MS_BOOL bEnable, SCALER_WIN eWindow); 3085 3086 //------------------------------------------------------------------------------------------------- 3087 /// update the OPWriteOff variable status instead of direcly modifying the register itself 3088 /// instead, the state machine will take care of modifying the register by checking this status. 3089 /// @ingroup XC_SCALER 3090 /// @param bMCNRPQSetting \b IN: MCNR PQ status enable or not. 3091 /// @param eWindow \b IN: Main or sub window 3092 //------------------------------------------------------------------------------------------------- 3093 void MApi_XC_Set_OPWriteOffEnable(MS_BOOL bEnable, SCALER_WIN eWindow); 3094 3095 //------------------------------------------------------------------------------------------------- 3096 /// update the OPWriteOff variable status, set force flag, and direcly modifying the register 3097 /// @ingroup XC_SCALER 3098 /// @param bMCNRPQSetting \b IN: MCNR PQ status enable or not. 3099 /// @param eWindow \b IN: Main or sub window 3100 //------------------------------------------------------------------------------------------------- 3101 // void MApi_XC_ForceSet_OPWriteOffEnable(MS_BOOL bEnable ,SCALER_WIN eWindow); 3102 3103 //------------------------------------------------------------------------------------------------- 3104 /// update the OPWriteOff variable status and also direcly modifying the register itself 3105 /// @ingroup XC_SCALER 3106 /// @param bMCNRPQSetting \b IN: MCNR PQ status enable or not. 3107 /// @param eWindow \b IN: Main or sub window 3108 //------------------------------------------------------------------------------------------------- 3109 void MApi_XC_Set_OPWriteOffEnableToReg(MS_BOOL bEnable, SCALER_WIN eWindow); 3110 3111 //------------------------------------------------------------------------------------------------- 3112 /// get the OPWriteOff variable status 3113 /// @ingroup XC_SCALER 3114 /// @param eWindow \b IN: Main or sub window 3115 /// @return @ref MS_BOOL 3116 //------------------------------------------------------------------------------------------------- 3117 // MS_BOOL MApi_XC_Get_OPWriteOffEnable(SCALER_WIN eWindow); 3118 3119 //------------------------------------------------------------------------------------------------- 3120 /// skip the opwrite off operation in setwindow 3121 /// zoom no need to set panel timing, so skip the opwriteoff to save time 3122 /// @ingroup XC_SCALER 3123 /// @param bEnable \b IN: TRUE: skip, FALSE: don's skip 3124 /// @param eWindow \b IN: Main or sub window 3125 //------------------------------------------------------------------------------------------------- 3126 void MApi_XC_SkipOPWriteOffInSetWindow(MS_BOOL bEnable, SCALER_WIN eWindow); 3127 3128 //------------------------------------------------------------------------------------------------- 3129 /// return the status of skip the opwrite off operation in setwindow 3130 /// @ingroup XC_SCALER 3131 /// @param eWindow \b IN: Main or sub window 3132 /// @return @ref MS_BOOL 3133 //------------------------------------------------------------------------------------------------- 3134 // MS_BOOL MApi_XC_GetSkipOPWriteOffInSetWindow(SCALER_WIN eWindow); 3135 3136 //------------------------------------------------------------------------------------------------- 3137 /// update display window registers with input window 3138 /// note: 3139 /// driver will update pstDspwin to hw directly, no any transform 3140 /// for ap user: should call MApi_XC_Is2K2KToFrcMode first to check whether xc under 2K2K mode or not, 3141 /// if TURE, need cut pstDspwin's x and width by half(x=x/2; width=width/2), and then pass through to this API 3142 /// @ingroup XC_SCALER 3143 /// @param eWindow \b IN: Main or sub window 3144 /// @param pdspwin \b IN: window info that will be setted to registers 3145 //------------------------------------------------------------------------------------------------- 3146 void MApi_XC_SetDispWinToReg(MS_WINDOW_TYPE *pstDspwin, SCALER_WIN eWindow); 3147 3148 //------------------------------------------------------------------------------------------------- 3149 /// get current display window registers setting 3150 /// note: 3151 /// driver will return pstDspwin from hw directly, no any transform 3152 /// for ap user: should call MApi_XC_Is2K2KToFrcMode first to check whether xc under 2K2K mode or not, 3153 /// if TURE, need double pstDspwin's x and width(x=x*2; width=width*2) from this API 3154 /// @ingroup XC_SCALER 3155 /// @param eWindow \b IN : Main or sub window 3156 /// @param pdspwin \b OUT: Pointer for ouput disp window register 3157 //------------------------------------------------------------------------------------------------- 3158 void MApi_XC_GetDispWinFromReg(MS_WINDOW_TYPE *pstDspwin, SCALER_WIN eWindow); 3159 3160 //------------------------------------------------------------------------------------------------- 3161 /// let display video freeze by disable scaler buffer write 3162 /// @ingroup XC_SCALER 3163 /// @param bEnable \b IN: TRUE: enable, FALSE: otherwise 3164 /// @param eWindow \b IN: which window we are going to set 3165 //------------------------------------------------------------------------------------------------- 3166 void MApi_XC_FreezeImg(MS_BOOL bEnable, SCALER_WIN eWindow); 3167 3168 //------------------------------------------------------------------------------------------------- 3169 /// Query whether the specific window is freeze image status or not 3170 /// @ingroup XC_SCALER 3171 /// @param eWindow \b IN: which window we are going to query 3172 /// @return @ref MS_BOOL 3173 //------------------------------------------------------------------------------------------------- 3174 MS_BOOL MApi_XC_IsFreezeImg(SCALER_WIN eWindow); 3175 3176 //------------------------------------------------------------------------------------------------- 3177 /// This function will enable/diable output black pattern 3178 /// @ingroup XC_SCALER 3179 /// @param bEnable \b IN: TRUE: enable, FALSE: otherwise 3180 //------------------------------------------------------------------------------------------------- 3181 void MApi_XC_GenerateBlackVideoForBothWin( MS_BOOL bEnable); 3182 3183 //------------------------------------------------------------------------------------------------- 3184 /// This function will enable/diable output black pattern 3185 /// @ingroup XC_SCALER 3186 /// @param bEnable \b IN: TRUE: enable, FALSE: otherwise 3187 //------------------------------------------------------------------------------------------------- 3188 void MApi_XC_Set_BLSK(MS_BOOL bEnable); 3189 3190 //------------------------------------------------------------------------------------------------- 3191 /// This function will enable/diable output black pattern 3192 /// @ingroup XC_SCALER 3193 /// @param bEnable \b IN: TRUE: enable, FALSE: otherwise 3194 //------------------------------------------------------------------------------------------------- 3195 void MApi_XC_GenerateBlackVideo(MS_BOOL bEnable, SCALER_WIN eWindow); 3196 3197 //------------------------------------------------------------------------------------------------- 3198 /// Query whether current XC is black video enabled or not 3199 /// @ingroup XC_SCALER 3200 /// @return @ref MS_BOOL 3201 //------------------------------------------------------------------------------------------------- 3202 MS_BOOL MApi_XC_IsBlackVideoEnable(SCALER_WIN eWindow); 3203 3204 //------------------------------------------------------------------------------------------------- 3205 /// This function will enable/diable framebufferless mode 3206 /// @ingroup XC_SCALER 3207 /// @param bEnable \b IN: TRUE: enable, FALSE: otherwise 3208 //------------------------------------------------------------------------------------------------- 3209 void MApi_XC_EnableFrameBufferLess(MS_BOOL bEnable); 3210 3211 //------------------------------------------------------------------------------------------------- 3212 /// Query whether current XC is framebufferless or not 3213 /// @ingroup XC_SCALER 3214 /// @return @ref MS_BOOL 3215 //------------------------------------------------------------------------------------------------- 3216 MS_BOOL MApi_XC_IsCurrentFrameBufferLessMode(void); 3217 3218 3219 //------------------------------------------------------------------------------------------------- 3220 /// This function will enable/diable request framebufferless mode 3221 /// @ingroup XC_SCALER 3222 /// @param bEnable \b IN: TRUE: enable, FALSE: otherwise 3223 //------------------------------------------------------------------------------------------------- 3224 void MApi_XC_EnableRequest_FrameBufferLess(MS_BOOL bEnable); 3225 3226 //------------------------------------------------------------------------------------------------- 3227 /// Query whether current XC is request framebufferless or not 3228 /// @ingroup XC_SCALER 3229 /// @return @ref MS_BOOL 3230 //------------------------------------------------------------------------------------------------- 3231 MS_BOOL MApi_XC_IsCurrentRequest_FrameBufferLessMode(void); 3232 3233 //------------------------------- 3234 // 3D control 3235 //------------------------------- 3236 //------------------------------------------------------------------------------------------------------ 3237 /// MApi_XC_Get_3D_HW_Version 3238 /// @ingroup XC_3D 3239 /// @return MS_BOOL \b OUT: yes or not 3240 //------------------------------------------------------------------------------------------------------ 3241 MS_U16 MApi_XC_Get_3D_HW_Version(void); 3242 3243 //------------------------------------------------------------------------------------------------------ 3244 /// MApi_XC_Get_3D_IsSupportedHW2DTo3D 3245 /// @ingroup XC_3D 3246 /// @return MS_BOOL \b OUT: yes or not 3247 //------------------------------------------------------------------------------------------------------ 3248 MS_BOOL MApi_XC_Get_3D_IsSupportedHW2DTo3D(void); 3249 3250 //------------------------------------------------------------------------------------------------------ 3251 /// MApi_XC_Set_3D_Mode 3252 /// @ingroup XC_3D 3253 /// @param e3dInputMode \b IN: 3d input format 3254 /// @param e3dOutputMode \b IN: 3d output format 3255 /// @param e3dPanelType \b IN: 3d panel type 3256 /// @param eWindow \b IN: main or sub 3257 /// @return MS_BOOL \b OUT: success or not 3258 //------------------------------------------------------------------------------------------------------ 3259 MS_BOOL MApi_XC_Set_3D_Mode(E_XC_3D_INPUT_MODE e3dInputMode, 3260 E_XC_3D_OUTPUT_MODE e3dOutputMode, 3261 E_XC_3D_PANEL_TYPE e3dPanelType, 3262 SCALER_WIN eWindow); 3263 //------------------------------------------------------------------------------------------------------ 3264 /// MApi_XC_Set_3D_MainWin_FirstMode 3265 /// @ingroup XC_3D 3266 /// @param bMainFirst \b IN: main first or not 3267 /// @return MS_BOOL \b OUT: success or not 3268 //------------------------------------------------------------------------------------------------------ 3269 // MS_BOOL MApi_XC_Set_3D_MainWin_FirstMode(MS_BOOL bMainFirst); 3270 3271 //------------------------------------------------------------------------------------------------------ 3272 /// MApi_XC_Set_3D_LR_Frame_Exchg 3273 /// @ingroup XC_3D 3274 /// @param eWindow \b IN: main or sub 3275 /// @return MS_BOOL \b OUT: yes or no 3276 //------------------------------------------------------------------------------------------------------ 3277 MS_BOOL MApi_XC_Set_3D_LR_Frame_Exchg(SCALER_WIN eWindow); 3278 3279 //------------------------------------------------------------------------------------------------------ 3280 /// MApi_XC_3D_Is_LR_Frame_Exchged 3281 /// @ingroup XC_3D 3282 /// @param eWindow \b IN: main or sub 3283 /// @return MS_BOOL \b OUT: yes or no 3284 //------------------------------------------------------------------------------------------------------ 3285 MS_BOOL MApi_XC_3D_Is_LR_Frame_Exchged(SCALER_WIN eWindow); 3286 3287 //------------------------------------------------------------------------------------------------------ 3288 /// MApi_XC_Get_3D_Input_Mode 3289 /// @ingroup XC_ToBeModified 3290 /// @param eWindow \b IN: main or sub 3291 /// @return E_XC_3D_INPUT_MODE \b OUT: 3D input mode 3292 //------------------------------------------------------------------------------------------------------ 3293 E_XC_3D_INPUT_MODE MApi_XC_Get_3D_Input_Mode(SCALER_WIN eWindow); 3294 3295 //------------------------------------------------------------------------------------------------------ 3296 /// MApi_XC_Get_3D_Output_Mode 3297 /// @ingroup XC_ToBeModified 3298 /// @return E_XC_3D_OUTPUT_MODE \b OUT: 3D output mode 3299 //------------------------------------------------------------------------------------------------------ 3300 E_XC_3D_OUTPUT_MODE MApi_XC_Get_3D_Output_Mode(void); 3301 3302 //------------------------------------------------------------------------------------------------------ 3303 /// MApi_XC_Get_3D_Panel_Type 3304 /// @ingroup XC_ToBeModified 3305 /// @return E_XC_3D_PANEL_TYPE \b OUT: 3D panel type 3306 //------------------------------------------------------------------------------------------------------ 3307 E_XC_3D_PANEL_TYPE MApi_XC_Get_3D_Panel_Type(void); 3308 3309 //------------------------------------------------------------------------------------------------------ 3310 /// MApi_XC_Get_3D_MainWin_First 3311 /// @ingroup XC_3D 3312 /// @return MS_BOOL \b OUT: yes or no 3313 //------------------------------------------------------------------------------------------------------ 3314 // MS_BOOL MApi_XC_Get_3D_MainWin_First(void); 3315 3316 //------------------------------------------------------------------------------------------------------ 3317 /// MApi_XC_3DMainSub_IPSync 3318 /// @ingroup XC_3D 3319 /// @return MS_BOOL \b OUT: yes or no 3320 //------------------------------------------------------------------------------------------------------ 3321 MS_BOOL MApi_XC_3DMainSub_IPSync(void); 3322 3323 //------------------------------------------------------------------------------------------------------ 3324 /// MApi_XC_Set_3D_VerVideoOffset 3325 /// @ingroup XC_3D 3326 /// @param u163DVerVideoOffset \b IN: 3d offset 3327 /// @return MS_BOOL \b OUT: success or not 3328 //------------------------------------------------------------------------------------------------------ 3329 // MS_BOOL MApi_XC_Set_3D_VerVideoOffset(MS_U16 u163DVerVideoOffset); 3330 3331 //------------------------------------------------------------------------------------------------------ 3332 /// MApi_XC_Get_3D_VerVideoOffset 3333 /// @ingroup XC_3D 3334 /// @return MS_U16 \b OUT: H shift value 3335 //------------------------------------------------------------------------------------------------------ 3336 MS_U16 MApi_XC_Get_3D_VerVideoOffset(void); 3337 3338 //------------------------------------------------------------------------------------------------------ 3339 /// MApi_XC_Is3DFormatSupported 3340 /// @ingroup XC_3D 3341 /// @param e3dInputMode \b IN: input format 3342 /// @param e3dOutputMode \b IN: output format 3343 /// @return MS_BOOL \b OUT: success or not 3344 //------------------------------------------------------------------------------------------------------ 3345 MS_BOOL MApi_XC_Is3DFormatSupported(E_XC_3D_INPUT_MODE e3dInputMode, 3346 E_XC_3D_OUTPUT_MODE e3dOutputMode); 3347 //------------------------------------------------------------------------------------------------------ 3348 /// MApi_XC_Set_3D_HShift 3349 /// @ingroup XC_3D 3350 /// @param u16HShift \b IN: setup H shift value 3351 /// @return MS_BOOL \b OUT: success or not 3352 //------------------------------------------------------------------------------------------------------ 3353 MS_BOOL MApi_XC_Set_3D_HShift(MS_U16 u16HShift); 3354 //------------------------------------------------------------------------------------------------------ 3355 /// MApi_XC_Enable_3D_LR_Sbs2Line 3356 /// @ingroup XC_3D 3357 /// @param bEnable \b IN: Enable feature 3358 /// @return MS_BOOL \b OUT: success or not 3359 //------------------------------------------------------------------------------------------------------ 3360 MS_BOOL MApi_XC_Enable_3D_LR_Sbs2Line(MS_BOOL bEnable); 3361 //------------------------------------------------------------------------------------------------------ 3362 /// MApi_XC_Get_3D_HShift 3363 /// @ingroup XC_3D 3364 /// @return MS_U16 \b OUT: H shift value 3365 //------------------------------------------------------------------------------------------------------ 3366 // MS_U16 MApi_XC_Get_3D_HShift(void); 3367 3368 //------------------------------------------------------------------------------------------------------ 3369 /// MApi_XC_Set_3D_HW2DTo3D_Buffer 3370 /// @ingroup XC_3D 3371 /// @param u32HW2DTO3D_DD_Buf \b IN: DD physical address for 2D3D 3372 /// @param u32HW2DTO3D_DR_Buf \b IN: DR physical address for 2D3D 3373 /// @return MS_BOOL \b OUT: success or not 3374 //------------------------------------------------------------------------------------------------------ 3375 MS_BOOL MApi_XC_Set_3D_HW2DTo3D_Buffer(MS_PHY u32HW2DTO3D_DD_Buf, MS_PHY u32HW2DTO3D_DR_Buf); 3376 //------------------------------------------------------------------------------------------------------ 3377 /// MApi_XC_Set_3D_HW2DTo3D_Parameters 3378 /// @ingroup XC_ToBeModified 3379 /// @param st3DHw2DTo3DPara \b IN: 2D3D parameter 3380 /// @return MS_BOOL \b OUT: success or not 3381 //------------------------------------------------------------------------------------------------------ 3382 MS_BOOL MApi_XC_Set_3D_HW2DTo3D_Parameters(MS_XC_3D_HW2DTO3D_PARA st3DHw2DTo3DPara); 3383 3384 //------------------------------------------------------------------------------------------------------ 3385 /// MApi_XC_Get_3D_HW2DTo3D_Parameters 3386 /// @ingroup XC_ToBeRemove 3387 /// @param st3DHw2DTo3DPara \b IN: 2D3D parameter 3388 /// @return MS_BOOL \b OUT: success or not 3389 //------------------------------------------------------------------------------------------------------ 3390 MS_BOOL MApi_XC_Get_3D_HW2DTo3D_Parameters(MS_XC_3D_HW2DTO3D_PARA *pst3DHw2DTo3DPara); 3391 3392 //------------------------------------------------------------------------------------------------------ 3393 /// MApi_XC_Set_3D_Detect3DFormat_Parameters 3394 /// @ingroup XC_3D 3395 /// @param pstDetect3DFormatPara \b IN: 3D format parameter 3396 /// @return E_XC_3D_INPUT_MODE \b OUT: 3D input format 3397 //------------------------------------------------------------------------------------------------------ 3398 MS_BOOL MApi_XC_Set_3D_Detect3DFormat_Parameters(MS_XC_3D_DETECT3DFORMAT_PARA *pstDetect3DFormatPara); 3399 3400 //------------------------------------------------------------------------------------------------------ 3401 /// MApi_XC_Get_3D_Detect3DFormat_Parameters 3402 /// @ingroup XC_ToBeRemove 3403 /// @param pstDetect3DFormatPara \b IN: 3D format parameter 3404 /// @return E_XC_3D_INPUT_MODE \b OUT: 3D input format 3405 //------------------------------------------------------------------------------------------------------ 3406 MS_BOOL MApi_XC_Get_3D_Detect3DFormat_Parameters(MS_XC_3D_DETECT3DFORMAT_PARA *pstDetect3DFormatPara); 3407 3408 //------------------------------------------------------------------------------------------------------ 3409 /// MApi_XC_3D_PostPQSetting 3410 /// @ingroup XC_3D 3411 /// @param eWindow \b IN: select main or sub window 3412 /// @return E_XC_3D_INPUT_MODE \b OUT: 3D input format 3413 //------------------------------------------------------------------------------------------------------ 3414 E_XC_3D_INPUT_MODE MApi_XC_Detect3DFormatByContent(SCALER_WIN eWindow); 3415 3416 //------------------------------------------------------------------------------------------------------ 3417 /// MApi_XC_DetectNL 3418 /// @ingroup XC_SCALER 3419 /// @param eWindow \b IN: select main or sub window 3420 /// @param pstDetectNLatticePara \b IN: Nine lattice parameter 3421 /// @return MS_BOOL \b OUT: TRUE: enabled FALSE: is not enabled 3422 //------------------------------------------------------------------------------------------------------ 3423 // MS_BOOL MApi_XC_DetectNL(SCALER_WIN eWindow, ST_DETECTNL_PARA* pstDetectNLatticePara); 3424 3425 //------------------------------------------------------------------------------------------------------ 3426 /// MApi_XC_3D_PostPQSetting 3427 /// @ingroup XC_3D 3428 /// @param eWindow \b IN: select main or sub window 3429 /// @return MS_BOOL \b OUT: TRUE: enabled FALSE: is not enabled 3430 //------------------------------------------------------------------------------------------------------ 3431 MS_BOOL MApi_XC_3D_PostPQSetting(SCALER_WIN eWindow); 3432 3433 //------------------------------------------------------------------------------------------------------ 3434 /// MApi_XC_Set_3D_FPInfo 3435 /// @ingroup XC_3D 3436 /// @param pstFPInfoPara \b IN: Frame packing info 3437 /// @return MS_BOOL \b OUT: TRUE: enabled FALSE: is not enabled 3438 //------------------------------------------------------------------------------------------------------ 3439 MS_BOOL MApi_XC_Set_3D_FPInfo(MS_XC_3D_FPINFO_PARA *pstFPInfoPara); 3440 3441 //------------------------------------------------------------------------------------------------------ 3442 /// MApi_XC_EnableAutoDetect3D 3443 /// @ingroup XC_3D 3444 /// @param bEnable \b IN: TRUE: enable, FALSE: disable 3445 /// @param enDetectMethod \b IN: select auto detect mode 3446 /// @return MS_BOOL \b OUT: TRUE: enabled FALSE: is not enabled 3447 //------------------------------------------------------------------------------------------------------ 3448 MS_BOOL MApi_XC_EnableAutoDetect3D(MS_BOOL bEnable, E_XC_3D_AUTODETECT_METHOD enDetectMethod); 3449 3450 //------------------------------------------------------------------------------------------------------ 3451 /// MApi_XC_GetAutoDetect3DFlag 3452 /// @ingroup XC_3D 3453 /// @param penDetectMethod \b IN: select auto detect mode 3454 /// @param pbEnable \b IN: TRUE: enable, FALSE: disable 3455 /// @return MS_BOOL \b OUT: TRUE: enabled FALSE: is not enabled 3456 //------------------------------------------------------------------------------------------------------ 3457 MS_BOOL MApi_XC_GetAutoDetect3DFlag(E_XC_3D_AUTODETECT_METHOD *penDetectMethod, MS_BOOL *pbEnable); 3458 3459 //------------------------------------------------------------------------------------------------------ 3460 /// MApi_XC_Set_3D_SubWinClk 3461 /// @ingroup XC_3D 3462 /// @return MS_BOOL \b OUT: TRUE: enabled FALSE: is not enabled 3463 //------------------------------------------------------------------------------------------------------ 3464 MS_BOOL MApi_XC_Set_3D_SubWinClk(void); 3465 3466 //------------------------------------------------------------------------------------------------------ 3467 /// Is 3D reg_3dlr_side2line_en enabled or not 3468 /// @ingroup XC_3D 3469 /// @return MS_BOOL \b OUT: TRUE: enabled FALSE: is not enabled 3470 //------------------------------------------------------------------------------------------------------ 3471 MS_BOOL MApi_XC_3D_Is_LR_Sbs2Line(void); 3472 3473 //------------------------------------------------------------------------------------------------- 3474 /// This function will get the skip status of default flag 3475 /// @ingroup XC_3D 3476 /// @return @ref MS_BOOL return the the skip status of default flag 3477 //------------------------------------------------------------------------------------------------- 3478 // MS_BOOL MApi_SC_3D_Is_Skip_Default_LR_Flag(void); 3479 3480 //------------------------------------------------------------------------------------------------- 3481 /// This function will enable/diable skip default LR flag 3482 /// @ingroup XC_3D 3483 /// @param bEnable \b IN: TRUE: enable, FALSE: otherwise 3484 /// @return @ref MS_BOOL TRUE: Success, FALSE: Failed 3485 //------------------------------------------------------------------------------------------------- 3486 MS_BOOL MApi_XC_3D_Enable_Skip_Default_LR_Flag(MS_BOOL bEnable); 3487 3488 //------------------------------- 3489 // Mux control 3490 //------------------------------- 3491 #define MAX_SYNC_DATA_PATH_SUPPORTED (6) // (3),3 is not enough, because Main+SUB+Scart 1+Scart 2 =4, but in order to support off-line det + DWIN, modify to 6 first 3492 #define MAX_ASYNC_DATA_PATH_SUPPORTED (2) 3493 #define MAX_DATA_PATH_SUPPORTED (MAX_SYNC_DATA_PATH_SUPPORTED+MAX_ASYNC_DATA_PATH_SUPPORTED) 3494 3495 //------------------------------------------------------------------------------------------------- 3496 /// Initialize Mux before using Mux controller 3497 /// @ingroup XC_MUX 3498 /// @param input_source_to_input_port \b IN: a function to map from input source to input port 3499 //------------------------------------------------------------------------------------------------- 3500 void MApi_XC_Mux_Init(void (*input_source_to_input_port)(INPUT_SOURCE_TYPE_t src_ids , E_MUX_INPUTPORT* port_ids , MS_U8* u8port_count ) ); 3501 3502 //------------------------------------------------------------------------------------------------- 3503 /// Monitor the source of Mux 3504 /// @ingroup XC_MUX 3505 /// @param bRealTimeMonitorOnly \b IN: define whether do the monitor routine only for real time 3506 //------------------------------------------------------------------------------------------------- 3507 void MApi_XC_Mux_SourceMonitor(MS_BOOL bRealTimeMonitorOnly); 3508 3509 //------------------------------------------------------------------------------------------------- 3510 /// Create a path in Mux Controller. 3511 /// @ingroup XC_MUX 3512 /// @param Path_Info \b IN: the information of the path 3513 /// @param u32InitDataLen \b IN: the length of the Path_Info 3514 /// @return @ref MS_S16 return the path id, or -1 when any error is happened 3515 //------------------------------------------------------------------------------------------------- 3516 MS_S16 MApi_XC_Mux_CreatePath(XC_MUX_PATH_INFO* Path_Info, MS_U32 u32InitDataLen); 3517 3518 //------------------------------------------------------------------------------------------------- 3519 /// delete a path from Mux Controller. 3520 /// @ingroup XC_MUX 3521 /// @param src \b IN: Type of input source of a path you want to delete 3522 /// @param dest \b IN: Type of destination of a path you want to delete 3523 /// @return 1 if delete successfuly. Return -1 if delete fail 3524 //------------------------------------------------------------------------------------------------- 3525 MS_S16 MApi_XC_Mux_DeletePath(INPUT_SOURCE_TYPE_t src, E_DEST_TYPE dest); 3526 3527 //------------------------------------------------------------------------------------------------- 3528 /// A path is disabled after creating it (\ref MApi_XC_Mux_CreatePath) 3529 /// If a path is not enabled, \ref MApi_XC_Mux_SourceMonitor will bypass it. 3530 /// @ingroup XC_MUX 3531 /// @param PathId \b IN: PathId The Path you want to enable 3532 /// @return 1 if enable successfuly. Return -1 if enable fail 3533 //------------------------------------------------------------------------------------------------- 3534 MS_S16 MApi_XC_Mux_EnablePath(MS_U16 PathId); 3535 3536 //------------------------------------------------------------------------------------------------- 3537 /// Trigger Sync Event on Mux Controller. 3538 /// The Mux Controller will pass src and *para to each Sync Event Handler (refer synchronous_event_handler of MUX_DATA_PATH also). 3539 /// ( Delegate Function: 3540 /// Send necessary parameter to SyncEventHandler of each synchronous_path which source is 'src' ) 3541 /// @ingroup XC_MUX 3542 /// @param src \b IN: The input source which triggers Sync Event 3543 /// @param para \b IN: A pointer points to parameters which need to pass to Event Handler 3544 //------------------------------------------------------------------------------------------------- 3545 void MApi_XC_Mux_TriggerPathSyncEvent( INPUT_SOURCE_TYPE_t src , void* para); 3546 3547 //------------------------------------------------------------------------------------------------- 3548 /// Set the specific window 3549 /// @ingroup XC_MUX 3550 /// @param src \b IN: the source type for handler 3551 /// @param para \b IN: A pointer points to parameters which need to pass to Event Handler 3552 //------------------------------------------------------------------------------------------------- 3553 void MApi_XC_Mux_TriggerDestOnOffEvent( INPUT_SOURCE_TYPE_t src , void* para); 3554 3555 //------------------------------------------------------------------------------------------------- 3556 /// This function was used to enable/disable the destination periodic handler 3557 /// After enabled periodic hander, Mux Controller will pass the parameters to this handler and execute it periodically 3558 /// @ingroup XC_MUX 3559 /// @param src \b IN: the source type for handler 3560 /// @param bEnable \b IN: Enable/Disable the priodic handler. 3561 /// @return 1 if successfuly. Return -1 if failed. 3562 //------------------------------------------------------------------------------------------------- 3563 MS_S16 MApi_XC_Mux_OnOffPeriodicHandler( INPUT_SOURCE_TYPE_t src, MS_BOOL bEnable); 3564 3565 //------------------------------------------------------------------------------------------------- 3566 /// Get Paths in driver. 3567 /// @ingroup XC_MUX 3568 /// @param Paths \b OUT: Path information 3569 /// @return @ref MS_U8 3570 //------------------------------------------------------------------------------------------------- 3571 MS_U8 MApi_XC_Mux_GetPathInfo(XC_MUX_PATH_INFO* Paths); // Return current all path info. Max path number is MAX_DATA_PATH_SUPPORTED 3572 3573 //------------------------------------------------------------------------------------------------- 3574 /// Set Support MHL Path Info 3575 /// @ingroup XC_MUX 3576 /// @param u8MhlSupportInfo \b IN: MHL Support Info 3577 ///@return @ref MS_BOOL True if query success. 3578 //------------------------------------------------------------------------------------------------- 3579 E_APIXC_ReturnValue MApi_XC_Mux_SetSupportMhlPathInfo(MS_U8 u8MhlSupportInfo); 3580 3581 //------------------------------------------------------------------------------------------------- 3582 /// Set MHL Hot Plug Inverse Info 3583 /// @ingroup XC_MUX 3584 /// @param bIsMhlHotPlugInverse \b IN: MHL Hot Plug Inverse Info 3585 ///@return @ref MS_BOOL True if query success. 3586 //------------------------------------------------------------------------------------------------- 3587 E_APIXC_ReturnValue MApi_XC_Mux_SetMhlHotPlugInverseInfo(MS_BOOL bIsMhlHotPlugInverse); 3588 3589 //------------------------------------------------------------------------------------------------- 3590 /// Get input port from input HDMI source type 3591 /// @ingroup XC_MUX 3592 /// @param src \b IN: the query based on the input HDMI type 3593 /// @return @ref E_MUX_INPUTPORT 3594 //------------------------------------------------------------------------------------------------- 3595 E_MUX_INPUTPORT MApi_XC_Mux_GetHDMIPort( INPUT_SOURCE_TYPE_t src ); 3596 3597 //------------------------------------------------------------------------------------------------- 3598 /// Map input source to VD Ymux port 3599 /// @ingroup XC_MUX 3600 /// @param u8InputSourceType \b IN: input source type 3601 /// @return @ref MS_U8 3602 //------------------------------------------------------------------------------------------------- 3603 // MS_U8 MApi_XC_MUX_MapInputSourceToVDYMuxPORT( INPUT_SOURCE_TYPE_t u8InputSourceType ); 3604 3605 //------------------------------ 3606 /// MApi_XC_Set_NR 3607 /// @ingroup XC_PQ 3608 /// @param bEn \b IN: enable 3609 /// @param eWindow \b IN: main or sub 3610 //------------------------------ 3611 void MApi_XC_Set_NR(MS_BOOL bEn, SCALER_WIN eWindow); 3612 3613 //------------------------------ 3614 /// MApi_XC_FilmMode_P 3615 /// @ingroup XC_PQ 3616 //------------------------------ 3617 // void MApi_XC_FilmMode_P(void); 3618 3619 //------------------------------------------------------------------------------------------------- 3620 /// Check if UC is enabled 3621 /// @ingroup XC_PQ 3622 /// @param eWindow \b IN: which window(main or sub) to get 3623 /// @return MS_BOOL TRUE: UC enabled, FALSE: UC disabled 3624 //------------------------------------------------------------------------------------------------- 3625 MS_BOOL MApi_XC_GetUCEnabled(SCALER_WIN eWindow); 3626 3627 //------------------------------ 3628 /// MApi_XC_GenSpecificTiming 3629 /// @ingroup XC_TEST_PATTERN 3630 /// @param timingtype \b IN: internal timing gen 3631 //------------------------------ 3632 // void MApi_XC_GenSpecificTiming(XC_Internal_TimingType timingtype); 3633 3634 //------------------------------ 3635 // Scaler IP Related 3636 //------------------------------ 3637 // DE-Bypass Mode 3638 //------------------------------------------------------------------------------------------------- 3639 /// This function get DE-Bypass Mode 3640 /// @ingroup XC_TIMING_DETECT 3641 /// @param eWindow \b IN: which window(main or sub) to get 3642 /// @return @ref MS_BOOL 3643 //------------------------------------------------------------------------------------------------- 3644 // MS_BOOL MApi_XC_GetDEBypassMode(SCALER_WIN eWindow); 3645 3646 // Data enable 3647 //------------------------------------------------------------------------------------------------- 3648 /// This function get DE window 3649 /// @ingroup XC_TIMING_DETECT 3650 /// @param psWin \b OUT: window info to get 3651 /// @param eWindow \b IN: which window(main or sub) to get 3652 //------------------------------------------------------------------------------------------------- 3653 void MApi_XC_GetDEWindow(MS_WINDOW_TYPE *psWin, SCALER_WIN eWindow); 3654 3655 //------------------------------------------------------------------------------------------------- 3656 /// This function get DE window in DE ByPass Mode. (T12 / T13 can not support HDMI HV mode. So DE window from BK1 can not be retrieved if set to HV mode.) 3657 /// We Bypass pre-scaling and get H/V size from BK2 MDrv_SC_get_vsd_line_count & MDrv_SC_get_hsd_pixel_count. 3658 /// Prepare this function for using in the feature. 3659 /// @ingroup XC_TIMING_DETECT 3660 /// @param psWin \b OUT: window info to get 3661 /// @param eWindow \b IN: which window(main or sub) to get 3662 //------------------------------------------------------------------------------------------------- 3663 void MApi_XC_GetDEWidthHeightInDEByPassMode(MS_U16* pu16Width,MS_U16* pu16Height ,SCALER_WIN eWindow); 3664 3665 //Get Capture Window 3666 //------------------------------------------------------------------------------------------------- 3667 /// Get the capture window for specific window 3668 /// @ingroup XC_SCALER 3669 /// @param capture_win \b OUT: the window info to get 3670 /// @param eWindow \b IN: which window(main or sub) to get 3671 //------------------------------------------------------------------------------------------------- 3672 void MApi_XC_GetCaptureWindow(MS_WINDOW_TYPE* capture_win, SCALER_WIN eWindow); 3673 3674 3675 //Set Capture Window 3676 //------------------------------------------------------------------------------------------------- 3677 /// Set the Vertical start of capture window for specific window 3678 /// @ingroup XC_SCALER 3679 /// @param u16Vstart \b IN: the window info to get 3680 /// @param eWindow \b IN: which window(main or sub) to set 3681 //------------------------------------------------------------------------------------------------- 3682 void MApi_XC_SetCaptureWindowVstart(MS_U16 u16Vstart , SCALER_WIN eWindow); 3683 3684 //------------------------------------------------------------------------------------------------- 3685 /// Set the horizontal start of capture window for specific window 3686 /// @ingroup XC_SCALER 3687 /// @param u16Hstart \b IN: the window info to get 3688 /// @param eWindow \b IN: which window(main or sub) to set 3689 //------------------------------------------------------------------------------------------------- 3690 void MApi_XC_SetCaptureWindowHstart(MS_U16 u16Hstart , SCALER_WIN eWindow); 3691 3692 //------------------------------------------------------------------------------------------------- 3693 /// Set the Vertical size of capture window for specific window 3694 /// @ingroup XC_SCALER 3695 /// @param u16Vsize \b IN: the window info to get 3696 /// @param eWindow \b IN: which window(main or sub) to set 3697 //------------------------------------------------------------------------------------------------- 3698 void MApi_XC_SetCaptureWindowVsize(MS_U16 u16Vsize , SCALER_WIN eWindow); 3699 3700 //------------------------------------------------------------------------------------------------- 3701 /// Set the Horizontal size of capture window for specific window 3702 /// @ingroup XC_SCALER 3703 /// @param u16Hsize \b IN: the window info to get 3704 /// @param eWindow \b IN: which window(main or sub) to set 3705 //------------------------------------------------------------------------------------------------- 3706 void MApi_XC_SetCaptureWindowHsize(MS_U16 u16Hsize , SCALER_WIN eWindow); 3707 3708 // Utility 3709 //------------------------------------------------------------------------------------------------- 3710 /// do the software reset for the specific window 3711 /// @ingroup XC_UTILITY 3712 /// @param u8Reset \b IN: reset IP @ref SOFTWARE_REST_TYPE_t 3713 /// @param eWindow \b IN: which window we are going to set 3714 //------------------------------------------------------------------------------------------------- 3715 void MApi_XC_SoftwareReset(MS_U8 u8Reset, SCALER_WIN eWindow); 3716 3717 //------------------------------------------------------------------------------------------------- 3718 /// This function will calculate and return H Frequency x 10 3719 /// @ingroup XC_UTILITY 3720 /// @param u16HPeriod \b IN: Horizontal period 3721 /// @return MS_U16: H Frequency x 10 3722 //------------------------------------------------------------------------------------------------- 3723 MS_U16 MApi_XC_CalculateHFreqx10(MS_U16 u16HPeriod); 3724 3725 //------------------------------------------------------------------------------------------------- 3726 /// This function will calculate and return H Frequency x 1000 3727 /// @ingroup XC_UTILITY 3728 /// @param u16HPeriod \b IN: Horizontal period 3729 /// @return MS_U32: H Frequency x 1000 3730 //------------------------------------------------------------------------------------------------- 3731 // MS_U32 MApi_XC_CalculateHFreqx1K(MS_U16 u16HPeriod); 3732 3733 //------------------------------------------------------------------------------------------------- 3734 /// This function will calculate and return V Frequency x 10 3735 /// @ingroup XC_UTILITY 3736 /// @param u16HFreqx10 \b IN: Horizontal frequency x 10 3737 /// @param u16VTotal \b IN: Vertical Total, usually the scan lines counts of a frame 3738 /// @return MS_U16: V Frequency x 10 3739 //------------------------------------------------------------------------------------------------- 3740 MS_U16 MApi_XC_CalculateVFreqx10(MS_U16 u16HFreqx10, MS_U16 u16VTotal); 3741 3742 //------------------------------------------------------------------------------------------------- 3743 /// This function will calculate and return V Frequency x 1000 3744 /// @ingroup XC_UTILITY 3745 /// @param u32HFreqx1K \b IN: Horizontal frequency x 1000 3746 /// @param u16VTotal \b IN: Vertical Total, usually the scan lines counts of a frame 3747 /// @return MS_U32: V Frequency x 1000 3748 //------------------------------------------------------------------------------------------------- 3749 // MS_U32 MApi_XC_CalculateVFreqx1K(MS_U32 u32HFreqx1K, MS_U16 u16VTotal); 3750 3751 //------------------------------------------------------------------------------------------------- 3752 /// Attach a Call back function info Interrupt. 3753 /// @ingroup XC_UTILITY 3754 /// @param eIntNum \b IN: The interrupt type (@ref SC_INT_SRC) 3755 /// @param pIntCb \b IN: Call back function prototype. 3756 /// @param pParam \b IN: Parameter for IntCb 3757 /// @return MS_BOOL True: Success , False: Fail 3758 //------------------------------------------------------------------------------------------------- 3759 MS_BOOL MApi_XC_InterruptAttach(SC_INT_SRC enIntNum, SC_InterruptCb pIntCb, void * pParam); 3760 3761 //------------------------------------------------------------------------------------------------- 3762 /// DeAttach a Call back function info Interrupt. 3763 /// @ingroup XC_UTILITY 3764 /// @param eIntNum \b IN: The interrupt type (@ref SC_INT_SRC) 3765 /// @param pIntCb \b IN: Call back function prototype. 3766 /// @param pParam \b IN: Parameter for IntCb 3767 /// @return MS_BOOL True: Success , False: Fail 3768 //------------------------------------------------------------------------------------------------- 3769 MS_BOOL MApi_XC_InterruptDeAttach(SC_INT_SRC enIntNum, SC_InterruptCb pIntCb, void * pParam); 3770 3771 //------------------------------------------------------------------------------------------------- 3772 /// This function will disable input source 3773 /// @ingroup XC_UTILITY 3774 /// @param bDisable \b IN: TRUE : Disable; FALSE: Enable 3775 //------------------------------------------------------------------------------------------------- 3776 void MApi_XC_DisableInputSource(MS_BOOL bDisable, SCALER_WIN eWidnow); 3777 3778 //------------------------------------------------------------------------------------------------- 3779 /// This function will check is input source disabled or not 3780 /// @ingroup XC_UTILITY 3781 /// @param eWindow \b IN: which window(main or sub) to set 3782 /// @return MS_BOOL True: inputsource is disabled, False: inputsource is not disabled 3783 //------------------------------------------------------------------------------------------------- 3784 MS_BOOL MApi_XC_IsInputSourceDisabled(SCALER_WIN eWindow); 3785 3786 //------------------------------------------------------------------------------------------------- 3787 /// This function will change panel type dynamically 3788 /// @ingroup XC_SCALER 3789 /// @param pstPanelInfo \b IN: the new panel type 3790 //------------------------------------------------------------------------------------------------- 3791 void MApi_XC_ChangePanelType(XC_PANEL_INFO *pstPanelInfo); 3792 3793 //------------------------------------------------------------------------------------------------- 3794 /// MApi_XC_GetCurrentReadBank 3795 /// Attention! This function should only be used in the xc interrupt!!! 3796 /// @ingroup XC_SCALER 3797 /// This function will tell the current read bank 3798 /// @param eWindow \b IN: Window 3799 /// @return MS_U16 Current read bank 3800 //------------------------------------------------------------------------------------------------- 3801 MS_U16 MApi_XC_GetCurrentReadBank(SCALER_WIN eWindow); 3802 3803 //------------------------------------------------------------------------------------------------- 3804 /// MApi_XC_GetCurrentWriteBank 3805 /// Attention! This function should only be used in the xc interrupt!!! 3806 /// @ingroup XC_SCALER 3807 /// This function will tell the current write bank 3808 /// @param eWindow \b IN: Window 3809 /// @return MS_U16 Current write bank 3810 //------------------------------------------------------------------------------------------------- 3811 // MS_U16 MApi_XC_GetCurrentWriteBank(SCALER_WIN eWindow); 3812 3813 //------------------------------------------------------------------------------------------------- 3814 /// 1. calculate H/V pre-scaling down ratio accroding to frame buffer size 3815 /// 2. must be called after MApi_XC_SetFrameBufferAddress() and before MApi_XC_SetWindow() 3816 /// @ingroup XC_SCALER 3817 /// @param bEnable \b IN: Enable auto pre scaling 3818 /// @param eWindow \b IN: Window 3819 //------------------------------------------------------------------------------------------------- 3820 // void MApi_XC_SetAutoPreScaling(MS_BOOL bEnable, SCALER_WIN eWindow); 3821 3822 //------------------------------------------------------------------------------------------------- 3823 /// Get V sync width of current input source. 3824 /// @ingroup XC_SCALER 3825 /// @param eWindow \b IN: The Vsync width of specific window. 3826 /// @return MS_U8 Sync width of input V sync 3827 //------------------------------------------------------------------------------------------------- 3828 MS_U8 MApi_XC_GetVSyncWidth(SCALER_WIN eWindow); 3829 3830 //------------------------------------------------------------------------------ 3831 /// Set blanding point of GOP in Scaler. 3832 /// @ingroup XC_OSD 3833 /// @param MaxGOP \b IN: The mux number. 3834 /// @param UseNum \b IN: GOP selection. 3835 /// @param u8MuxNum \b IN: The mux number. 3836 /// @param bEnable \b IN: Enable GOP 3837 /// @return MS_BOOL TRUE: Success FALSE: Fail 3838 //------------------------------------------------------------------------------ 3839 // MS_BOOL MApi_XC_set_GOP_Enable(MS_U8 MaxGOP, MS_U8 UseNum, MS_U8 u8MuxNum, MS_BOOL bEnable); 3840 3841 //------------------------------------------------------------------------------ 3842 /// Set blanding point of GOP in Scaler. 3843 /// @ingroup XC_OSD 3844 /// @param u8MuxNum \b IN: The mux number. 3845 /// @param ipSelGop \b IN: GOP selection. 3846 //------------------------------------------------------------------------------ 3847 // void MApi_XC_ip_sel_for_gop(MS_U8 u8MuxNum , MS_XC_IPSEL_GOP ipSelGop); 3848 3849 //------------------------------------------------------------------------------ 3850 /// Set Scaler VOP New blending level 3851 /// @ingroup XC_OSD 3852 //------------------------------------------------------------------------------ 3853 // void MApi_XC_SetVOPNBL(void); 3854 3855 //------------------------------------------------------------------------------ 3856 /// XC IP0 Get Destination Information for GOP mixer 3857 /// @ingroup XC_OSD 3858 /// @param pDstInfo \b IN: destination info 3859 /// @param u32SizeofDstInfo \b IN: size of destination info 3860 /// @param XCDstType \b IN: destination type 3861 /// @return @ref MS_BOOL 3862 //------------------------------------------------------------------------------ 3863 MS_BOOL MApi_XC_GetDstInfo(MS_XC_DST_DispInfo *pDstInfo, MS_U32 u32SizeofDstInfo, EN_GOP_XCDST_TYPE XCDstType); 3864 3865 //------------------------------------------------------------------------------------------------- 3866 /// Allow decoder to control Field R / W bank status of scaler. 3867 /// @ingroup XC_SCALER 3868 /// @param u8Enable \b IN: True: Decoder can control the R/W bank status. False: Decoder can not control the R/W bank status 3869 /// @param eWindow \b IN: @ref SCALER_WIN 3870 //------------------------------------------------------------------------------------------------- 3871 void MApi_XC_set_FD_Mask_byWin(MS_BOOL bEnable, SCALER_WIN eWindow); 3872 3873 //------------------------------------------------------------------------------------------------- 3874 /// Get XC FD_Mask status. 3875 /// @ingroup XC_SCALER 3876 /// @param eWindow \b IN: @ref SCALER_WIN 3877 /// @return TRUE/FALSE 3878 //------------------------------------------------------------------------------------------------- 3879 MS_BOOL MApi_XC_Get_FD_Mask_byWin(SCALER_WIN eWindow); 3880 3881 //------------------------------------------------------------------------------------------------- 3882 /// Auto create input timing. To use this feature, the system must provide clock to scaler. 3883 /// @ingroup XC_TEST_PATTERN 3884 /// @param timingtype \b IN: the timing type. 3885 //------------------------------------------------------------------------------------------------- 3886 // void MApi_XC_InitIPForInternalTiming(XC_Internal_TimingType timingtype); 3887 3888 //------------------------------------------------------------------------------------------------- 3889 /// Set Main window IP mux directly. 3890 /// @ingroup XC_MUX 3891 /// @param u8Val \b IN: The value need to be set into register 3892 //------------------------------------------------------------------------------------------------- 3893 // void MApi_XC_SetIPMux(MS_U8 u8Val); 3894 3895 /// status of input H/V sync 3896 //------------------------------------------------------------------------------------------------- 3897 /// Return true if input H sync of scaler is exist. 3898 /// @ingroup XC_INFO 3899 /// @param eWindow \b IN: @ref SCALER_WIN 3900 /// @return @ref MS_BOOL TRUE: Exist FALSE: not Exist 3901 //------------------------------------------------------------------------------------------------- 3902 MS_BOOL MApi_XC_Is_H_Sync_Active(SCALER_WIN eWindow); 3903 3904 //------------------------------------------------------------------------------------------------- 3905 /// Return true if input V sync of scaler is exist. 3906 /// @ingroup XC_INFO 3907 /// @param eWindow \b IN: @ref SCALER_WIN 3908 /// @return @ref MS_BOOL TRUE: Exist FALSE: not Exist 3909 //------------------------------------------------------------------------------------------------- 3910 MS_BOOL MApi_XC_Is_V_Sync_Active(SCALER_WIN eWindow); 3911 3912 //------------------------------------------------------------------------------------------------- 3913 /// get auto position window with the corresponding valid data threshold 3914 /// @ingroup XC_INFO 3915 /// @param u8ValidData \b IN: valid data threshold 3916 /// @param eWindow \b IN: which window we are going to get 3917 /// @param pstAutoPositionWindow \b OUT: auto position window parameters 3918 /// @return MS_BOOL TRUE: auto position window is valid FALSE: auto position window is invalid 3919 //------------------------------------------------------------------------------------------------- 3920 // MS_BOOL MApi_XC_GetAutoPositionWindow(MS_U8 u8ValidData, SCALER_WIN eWindow, MS_WINDOW_TYPE *pstAutoPositionWindow); 3921 3922 3923 //------------------------------ 3924 // Scaler & Memory 3925 //------------------------------ 3926 //------------------------------------------------------------------------------------------------- 3927 /// Set Frame buffer address and size for scaler. 3928 /// @ingroup XC_SCALER 3929 /// @param u32FBAddress \b IN: Start address of frame buffer. 3930 /// @param u32FBSize \b IN: Frame buffer size for Scaler 3931 /// @param eWindow \b IN: @ref SCALER_WIN 3932 //------------------------------------------------------------------------------------------------- 3933 void MApi_XC_SetFrameBufferAddress(MS_PHY u32FBAddress, MS_PHY u32FBSize, SCALER_WIN eWindow); 3934 3935 //------------------------------ 3936 // Scaler FRCM Memory // monaco mode 3937 //------------------------------ 3938 //------------------------------------------------------------------------------------------------- 3939 /// Set FRCM Frame buffer address and size for scaler. 3940 /// @ingroup XC_SCALER 3941 /// @param u32FBAddress \b IN: Start address of frame buffer. 3942 /// @param u32FBSize \b IN: Frame buffer size for Scaler 3943 /// @param eWindow \b IN: @ref SCALER_WIN 3944 //------------------------------------------------------------------------------------------------- 3945 // void MApi_XC_SetFRCMFrameBufferAddress(MS_PHY u32FBAddress, MS_PHY u32FBSize, SCALER_WIN eWindow); 3946 3947 //------------------------------------------------------------------------------------------------- 3948 /// Check if the buffer size is enough or not. 3949 /// @ingroup XC_SCALER 3950 /// @param pstXC_SetWin_Info \b IN: @ref E_XC_MEMORY_REQUEST_TYPE 3951 /// @param eWindow \b IN: @ref SCALER_WIN 3952 /// @return @ref MS_BOOL TRUE: Buffer size is enough FALSE: Buffer is not enough 3953 //------------------------------------------------------------------------------------------------- 3954 // MS_BOOL MApi_XC_IsFrameBufferEnoughForCusScaling(XC_SETWIN_INFO *pstXC_SetWin_Info, SCALER_WIN eWindow); 3955 3956 //------------------------------------------------------------------------------------------------- 3957 /// Enable or disable scaler memory read/write request 3958 /// @ingroup XC_SCALER 3959 /// @param bEnable \b IN: TURE=Enable memory request of 'eType'; FALSE= Disable memory request of 'eType' 3960 /// @param eType \b IN: @ref E_XC_MEMORY_REQUEST_TYPE 3961 /// @param eWindow \b IN: @ref SCALER_WIN 3962 /// @return @ref E_APIXC_ReturnValue 3963 //------------------------------------------------------------------------------------------------- 3964 E_APIXC_ReturnValue MApi_XC_SetScalerMemoryRequest(MS_BOOL bEnable, E_XC_MEMORY_REQUEST_TYPE eType, SCALER_WIN eWindow); 3965 3966 //Capture_Memory 3967 3968 //------------------------------------------------------------------------------------------------- 3969 /// Get pixel data specify by u16CorX and u16CorY. 3970 /// This pixel data is catured after scaler memory (not after OSD or gamma). And it will latch 20ms for retrieving data. 3971 /// Also note the x , y coordinate should be small or equel to input source size. (not panel size) 3972 /// @ingroup XC_SCALER 3973 /// @param u16CorX \b IN: X coordinate 3974 /// @param u16CorY \b IN: Y coordinate. 3975 /// @param eWindow \b IN: @ref SCALER_WIN 3976 /// @return void 3977 //------------------------------------------------------------------------------------------------- 3978 void MApi_XC_Get_PixelData(MS_U16 u16CorX, MS_U16 u16CorY, MS_PIXEL_32BIT* pixel); 3979 3980 //------------------------------------------------------------------------------------------------- 3981 /// calc widht or height based on existed dnr buffer and byte/pixel 3982 /// Fomula : Scaler buffer size / u8FBNum / (byte / pixel) / InputSize 3983 /// @ingroup XC_SCALER 3984 /// @param eWindow \b IN: The window need to be calc 3985 /// @param u8FBNum \b IN: frame cout 3986 /// @param u32InputSize \b IN: The input source size. 3987 /// @return MS_U32 The size of frames. 3988 //------------------------------------------------------------------------------------------------- 3989 // MS_U32 MApi_XC_GetAvailableSize(SCALER_WIN eWindow, MS_U8 u8FBNum, MS_U32 u32InputSize); 3990 3991 //------------------------------ 3992 // Display & Output 3993 //------------------------------ 3994 // Display related 3995 3996 //------------------------------------------------------------------------------------------------- 3997 /// Set Scaler Frame color 3998 /// @ingroup XC_TEST_PATTERN 3999 /// @param u32aRGB \b IN: the 4 bytes in aRGB are "a: no use, R 23:16, G 15:8, B 7:0" (B is in LSB) 4000 //------------------------------------------------------------------------------------------------- 4001 void MApi_XC_SetFrameColor(MS_U32 u32aRGB); 4002 4003 //------------------------------------------------------------------------------------------------- 4004 /// Set color of main / sub window. This color will be shown when black screen enabled. 4005 /// @ingroup XC_TEST_PATTERN 4006 /// @param u8Color \b IN: format in a byte => R 7:5, G 4:2, B 1:0 4007 /// @param eWindow \b IN: The window which need to be set. 4008 //------------------------------------------------------------------------------------------------- 4009 void MApi_XC_SetDispWindowColor(MS_U8 u8Color, SCALER_WIN eWindow); 4010 4011 //------------------------------------------------------------------------------------------------- 4012 /// Query the capability of scaler about source to Video encoder(VE) 4013 /// @ingroup XC_VE 4014 /// @param OutputCapability \b OUT: Which part of scaler can output data to Video Encoder (VE). 4015 ///Check E_XC_SOURCE_TO_VE for capability bit. Take an example, if bit0 of OutputCapability equal to 1, 4016 ///Scaler can output data to ve from its E_XC_IP(IP) 4017 ///@return @ref MS_BOOL True if query success. 4018 //------------------------------------------------------------------------------------------------- 4019 E_APIXC_ReturnValue MApi_XC_SupportSourceToVE(MS_U16* pOutputCapability); 4020 4021 //------------------------------------------------------------------------------------------------- 4022 /// Enable output capture for output data to VE. Return False if current platform does not support E_XC_SOURCE_TO_VE 4023 /// Note: this source is not only for VE, but Scaler IP or DIP 4024 /// @ingroup XC_VE 4025 /// @param bEnable \b IN: Enable output capture function 4026 /// @param eSourceToVE \b IN: Specific output source. The source listed in E_XC_SOURCE_TO_VE is a "point" which can be retrieve data. 4027 //------------------------------------------------------------------------------------------------- 4028 E_APIXC_ReturnValue MApi_XC_SetOutputCapture(MS_BOOL bEnable,E_XC_SOURCE_TO_VE eSourceToVE); 4029 4030 //------------------------------------------------------------------------------------------------- 4031 /// Setup Gamma function ON/OFF 4032 /// @ingroup XC_GAMMA 4033 /// @param bEnable \b IN: Enable or Disable 4034 //------------------------------------------------------------------------------------------------- 4035 void MApi_XC_SetGammaOnOff (MS_BOOL bEnable); 4036 4037 //------------------------------------------------------------------------------------------------- 4038 /// Set VOP Gain for Main Window(after 3x3 before Gamma) 4039 /// @ingroup XC_GAMMA 4040 /// @param eVop_Channel \b IN: Select VOP R/G/B 4041 /// @param u16Val \b IN: Set value 4042 //------------------------------------------------------------------------------------------------- 4043 void MApi_XC_SetPreGammaGain(SCALER_WIN eWindow, MS_XC_VOP_CHANNEL_t eVop_Channel, MS_U16 u16Val); 4044 4045 //------------------------------------------------------------------------------------------------- 4046 /// Set VOP Offset for Main Window(after 3x3 before Gamma) 4047 /// @ingroup XC_GAMMA 4048 /// @param eVop_Channel \b IN: Select VOP R/G/B 4049 /// @param u16Val \b IN: Set value 4050 //------------------------------------------------------------------------------------------------- 4051 void MApi_XC_SetPreGammaOffset(SCALER_WIN eWindow, MS_XC_VOP_CHANNEL_t eVop_Channel, MS_U16 u16Val); 4052 4053 //------------------------------------------------------------------------------------------------- 4054 // Output timing related 4055 //------------------------------------------------------------------------------------------------- 4056 //------------------------------------------------------------------------------------------------- 4057 /// Setup panel timing (output DCLK)/FRC/FramePLL, and enable input source 4058 /// @ingroup XC_DISPLAY 4059 /// @param pTimingInfo \b IN: the information of the timing to set @ref XC_SetTiming_Info 4060 //------------------------------------------------------------------------------------------------- 4061 void MApi_XC_SetPanelTiming(XC_SetTiming_Info *pTimingInfo, SCALER_WIN eWindow); 4062 4063 //------------------------------------------------------------------------------------------------- 4064 /// Set current output type. This is set in Panel structure. You can adjust it here. 4065 /// @ingroup XC_DISPLAY 4066 /// @param enPnl_Out_Timing_Mode \b IN: The output type 4067 //------------------------------------------------------------------------------------------------- 4068 // void MApi_XC_SetOutTimingMode(E_XC_PNL_OUT_TIMING_MODE enPnl_Out_Timing_Mode); 4069 4070 //------------------------------------------------------------------------------------------------- 4071 /// set free run display window timing 4072 /// @ingroup XC_DISPLAY 4073 /// @return void Output type. 4074 //------------------------------------------------------------------------------------------------- 4075 void MApi_XC_SetFreeRunTiming(void); 4076 4077 //------------------------------------------------------------------------------------------------- 4078 /// Adjust V sync FrontPorch , Sync Width for specific output frame rate (You can adjust in advance by using MApi_XC_SetExPanelInfo) 4079 /// @ingroup XC_DISPLAY 4080 /// @param u16FrontPorch \b IN: Front porch of output Vsync 4081 /// @param u16SyncWidth \b IN: Sync width of output Vsync 4082 /// @param u16OutputVfreq \b IN: The output frame rate you want to adjust. 4083 /// @return MS_BOOL True: Success False : Fail 4084 //------------------------------------------------------------------------------------------------- 4085 // MS_BOOL MApi_XC_Set_CustomerSyncInfo(MS_U16 u16FrontPorch, MS_U16 u16SyncWidth, MS_U16 u16OutputVfreq); 4086 4087 //------------------------------------------------------------------------------------------------- 4088 /// Wait FPLL finished 4089 /// @ingroup XC_DISPLAY 4090 /// @return @ref MS_BOOL indicate FPLL finished or not (frame lock finished or not) 4091 //------------------------------------------------------------------------------------------------- 4092 MS_BOOL MApi_XC_WaitFPLLDone(void); 4093 4094 //------------------------------------------------------------------------------------------------- 4095 /// Get scaler output vertical frequency 4096 /// @ingroup XC_DISPLAY 4097 /// @return @ref MS_U16 return output vertical frequency x 100 4098 //------------------------------------------------------------------------------------------------- 4099 MS_U16 MApi_XC_GetOutputVFreqX100(void); 4100 4101 //------------------------------------------------------------------------------------------------- 4102 /// Get scaler output vertical frequency 4103 /// @ingroup XC_DISPLAY 4104 /// @return @ref MS_U16 return output vertical frequency x 100 4105 //------------------------------------------------------------------------------------------------- 4106 MS_U16 MApi_XC_GetOP1OutputVFreqX100(void); 4107 4108 //------------------------------------------------------------------------------------------------- 4109 /// Frame Lock Check 4110 /// @ingroup XC_DISPLAY 4111 /// @ref MS_BOOL TURE=Frame Lock ; FALSE= Not Frame Lock 4112 //------------------------------------------------------------------------------------------------- 4113 // MS_BOOL MApi_XC_FrameLockCheck(void); 4114 4115 //------------------------------------------------------------------------------------------------- 4116 /// Set a customize FRC table into driver 4117 /// You can customize frc table in driver. The max number of FRC setting is 5 (Can be changed in driver layer). 4118 /// 4119 /// Here is an example of 5 FRC items with 6 maximal number of FRC setting. 4120 /// Please fill {0xFFFF, 0xFFFF, 1, 1, MS_FRC_1_1} at unused FRC item slot. 4121 /// 4122 /// {0, 160, 1, 4, MS_FRC_1_4}, <-- FRC item 0 4123 /// {160, 245, 2, 5, MS_FRC_2_5}, <-- FRC item 1 4124 /// {245, 260, 1, 2, MS_FRC_1_2}, <-- FRC item 2 4125 /// {260, 400, 1, 2, MS_FRC_1_2}, <-- FRC item 3 4126 /// {400, 0xFFFF, 1, 1, MS_FRC_1_1}, <-- FRC item 4 4127 /// {0xFFFF, 0xFFFF, 1, 1, MS_FRC_1_1} <-- FRC item 5 (Unused) 4128 /// @ingroup XC_DISPLAY 4129 /// @param stFRCTable \b IN: The pointer which point to a FRC table. You can refer above description. 4130 /// if pass NULL, driver will use default frc table. 4131 /// @return @ref E_APIXC_ReturnValue Return status. 4132 //------------------------------------------------------------------------------------------------- 4133 E_APIXC_ReturnValue MApi_XC_CustomizeFRCTable(SC_FRC_SETTING* stFRCTable); 4134 4135 //------------------------------------------------------------------------------------------------- 4136 /// Set specific in / out framerate control (Using in Box proejct only.) 4137 /// @ingroup XC_DISPLAY 4138 /// @param bEnable \b IN: TRUE: Enable ouput frame control 4139 /// @param pPanelInfoEx \b IN: The information about in / out framerate. 4140 /// @param pPanelInfoEx \b IN: The window which need to be controlled. 4141 /// @return @ref E_APIXC_ReturnValue return type. 4142 //------------------------------------------------------------------------------------------------- 4143 E_APIXC_ReturnValue MApi_XC_OutputFrameCtrl(MS_BOOL bEnable,XC_OUTPUTFRAME_Info * stOutFrameInfo,SCALER_WIN eWindow); 4144 4145 //------------------------------------------------------------------------------------------------- 4146 /// Set the FPLL mode: 4147 /// @ingroup XC_DISPLAY 4148 /// @param bTrue \b IN: True: FSM mode, False: Non FSM mode 4149 //------------------------------------------------------------------------------------------------- 4150 void MApi_SC_Enable_FPLL_FSM(MS_BOOL bTrue); 4151 4152 //------------------------------------------------------------------------------------------------- 4153 /// This function will force freerun in MDrv_Scaler_SetPanelTiming(), 4154 /// otherwise MDrv_Scaler_SetPanelTiming() will decide to do framelock or not by itself. 4155 /// 4156 /// Note: this function is difference with MDrv_SC_set_fpll() which is used to 4157 /// unlock framelock after MDrv_Scaler_SetPanelTiming(). 4158 /// But this function is used to affect MDrv_Scaler_SetPanelTiming()'s behavior. 4159 /// @ingroup XC_DISPLAY 4160 /// @param bEnable \b IN: TRUE: Enable force freerun. FALSE: disable force free run. 4161 //------------------------------------------------------------------------------------------------- 4162 void MApi_SC_ForceFreerun(MS_BOOL bEnable); 4163 4164 //------------------------------------------------------------------------------------------------- 4165 /// Get Force freerun status. 4166 /// @ingroup XC_DISPLAY 4167 /// @return @ref MS_BOOL True: Current is in Force freerun mode. False: Current is not in Force Freerun mode 4168 //------------------------------------------------------------------------------------------------- 4169 MS_BOOL MApi_SC_IsForceFreerun(void); 4170 4171 //------------------------------------------------------------------------------------------------- 4172 /// Set specific in / out framerate control (Using in Box proejct only.) 4173 /// @ingroup XC_DISPLAY 4174 /// @param bEnable \b IN: TRUE: Enable ouput frame control 4175 /// @param pPanelInfoEx \b IN: The information about in / out framerate. 4176 /// @param pPanelInfoEx \b IN: The window which need to be controlled. 4177 /// @return @ref E_APIXC_ReturnValue return type. 4178 //------------------------------------------------------------------------------------------------- 4179 void MApi_SC_SetFreerunVFreq(E_VFREQ_SEL VFreq); 4180 4181 //------------------------------------------------------------------------------------------------- 4182 /// Set external panel info for output 4183 /// Currently, only support setting of two different vfreqs at same time 4184 /// The set ExPanelInfo will take effect after running of function MApi_XC_SetPanelTiming 4185 /// @ingroup XC_DISPLAY 4186 /// @param bEnable \b IN: TRUE: Enable this XC_PANEL_INFO_EX, FALSE: Disable this XC_PANEL_INFO_EX 4187 /// @param pPanelInfoEx \b IN: The extern panel information to set @ref XC_PANEL_INFO_EX 4188 /// @return @ref MS_BOOL TRUE: Success, FALSE: Failed 4189 //------------------------------------------------------------------------------------------------- 4190 MS_BOOL MApi_XC_SetExPanelInfo(MS_BOOL bEnable, XC_PANEL_INFO_EX *pPanelInfoEx); 4191 4192 //------------------------------------------------------------------------------------------------- 4193 /// Set the FPLL thresh mode: 4194 /// @ingroup XC_DISPLAY 4195 /// @param bEnable \b IN: TRUE: Thresh mode, FALSE: Non-Thresh mode 4196 //------------------------------------------------------------------------------------------------- 4197 // void MApi_XC_Enable_FPLL_Thresh_Mode(MS_BOOL bEnable); 4198 4199 //------------------------------------------------------------------------------------------------- 4200 /// Get the FPLL Thresh mode: 4201 /// @ingroup XC_DISPLAY 4202 /// @return TRUE: Thresh mode, FALSE: Non-Thresh mode 4203 //------------------------------------------------------------------------------------------------- 4204 // MS_BOOL MApi_XC_Get_FPLL_Thresh_Mode(void); 4205 4206 //------------------------------------------------------------------------------------------------- 4207 /// Enable auto no signal mode 4208 /// @ingroup XC_TIMING_DETECT 4209 /// @param bEnable \b IN: True: Enable auto no signal mode. 4210 /// @eWindow \b IN: The window (main or sub) which need to be controled. 4211 /// @return @ref E_APIXC_ReturnValue TRUE: eWindow is in auto no signal mode. FALSE: eWindow is not in auto no signal mode 4212 //------------------------------------------------------------------------------------------------- 4213 E_APIXC_ReturnValue MApi_XC_EnableIPAutoNoSignal(MS_BOOL bEnable, SCALER_WIN eWindow ); 4214 4215 //------------------------------------------------------------------------------------------------- 4216 /// Return true is current is in auto nosignal mode. 4217 /// @ingroup XC_TIMING_DETECT 4218 /// @param eWindow \b IN: IP auto nosignal in specific window 4219 /// @return @ref MS_BOOL TRUE: eWindow is in auto no signal mode. FALSE: eWindow is not in auto no signal mode 4220 //------------------------------------------------------------------------------------------------- 4221 MS_BOOL MApi_XC_GetIPAutoNoSignal(SCALER_WIN eWindow ); 4222 4223 //------------------------------------------------------------------------------------------------- 4224 /// Enable or disable IP auto coast 4225 /// @ingroup XC_TIMING_DETECT 4226 /// @param bEnable \b IN: Enable or Disable 4227 //------------------------------------------------------------------------------------------------- 4228 // void MApi_XC_EnableIPAutoCoast(MS_BOOL bEnable); 4229 4230 //------------------------------------------------------------------------------------------------- 4231 /// Enable IP auto Coast debounce (the debounce time is 1 (default) in driver) 4232 /// @ingroup XC_TIMING_DETECT 4233 //------------------------------------------------------------------------------------------------- 4234 // void MApi_XC_EnableIPCoastDebounce(void); 4235 4236 //------------------------------------------------------------------------------------------------- 4237 /// Clear IP auto Coast debounce 4238 /// @ingroup XC_TIMING_DETECT 4239 //------------------------------------------------------------------------------------------------- 4240 // void MApi_XC_ClearIPCoastStatus(void); 4241 4242 //------------------------------------------------------------------------------------------------- 4243 /// Enable FPLL related settings not by program but by user's setting from TV tool 4244 /// @ingroup XC_DISPLAY 4245 /// Including PhaseLimit, limitD5D6D7_RK 4246 /// @param bEnable @ref MS_BOOL \b IN: enable or not 4247 //------------------------------------------------------------------------------------------------- 4248 // void MApi_XC_EnableFpllManualSetting(MS_BOOL bEnable); // debug purpose 4249 4250 //-------------------------------------------------------------------------------------------------------------------- 4251 /// Test if panel output is ok by changing output DClk, this is to test max range that FPLL can do 4252 /// @ingroup XC_DISPLAY 4253 /// @param u32FpllSetOffset @ref MS_U32 \b IN: the offset to be add/minus the typical DClk output, unit is SET 4254 /// @param u16TestCnt @ref MS_U16 \b IN: the times to do boundary test 4255 //-------------------------------------------------------------------------------------------------------------------- 4256 // void MApi_XC_FpllBoundaryTest(MS_U32 u32FpllSetOffset, MS_U16 u16TestCnt); // debug purpose 4257 4258 //------------------------------ 4259 // Offline signal detection related 4260 //------------------------------ 4261 //----------------------------------------------------------------------------- 4262 /// Set the source need to be detect in offline detection. 4263 /// @ingroup XC_TIMING_DETECT 4264 /// @param INPUT_SOURCE_TYPE_t \b IN: The source need to be monitor 4265 //------------------------------------------------------------------------------------------------- 4266 void MApi_XC_SetOffLineDetection (INPUT_SOURCE_TYPE_t); 4267 //------------------------------------------------------------------------------------------------- 4268 /// Get Offline detection status to specific input source 4269 /// @ingroup XC_TIMING_DETECT 4270 /// @param u8InputSourceType \b IN: the specific input source type to do offline detection 4271 /// @return @ref MS_U8 TRUE: Success, FALSE: Failed 4272 //------------------------------------------------------------------------------------------------- 4273 MS_U8 MApi_XC_GetOffLineDetection( INPUT_SOURCE_TYPE_t); 4274 //------------------------------------------------------------------------------------------------- 4275 /// Set Offline detection Sog Threshold 4276 /// @ingroup XC_TIMING_DETECT 4277 /// @param u8Threshold \b IN: threshold value t2,u3,u4: 0~31 other chip: 0~255 4278 /// @Return TRUE: Successful FALSE: Fail 4279 //------------------------------------------------------------------------------------------------- 4280 // MS_BOOL MApi_XC_SetOffLineSogThreshold(MS_U8 u8Threshold); //t2,u3,u4: 0~31 other chip: 0~255 4281 //------------------------------------------------------------------------------------------------- 4282 /// Set Offline Detection Sog filter bandwidth 4283 /// @ingroup XC_TIMING_DETECT 4284 /// @param u8BW \b IN: bandwidth value t2,u3,u4: 0~7 other chip: 0~31 4285 /// @Return TRUE: Successful FALSE: Fail 4286 //------------------------------------------------------------------------------------------------- 4287 // MS_BOOL MApi_XC_SetOffLineSogBW(MS_U8 u8BW); 4288 4289 //----------------------------------------------------------------------------- 4290 /// Initial offline detect procedure. 4291 /// @ingroup XC_TIMING_DETECT 4292 /// @return @ref MS_BOOL TRUE: Success, FALSE: Failed 4293 //----------------------------------------------------------------------------- 4294 MS_BOOL MApi_XC_OffLineInit(void); 4295 4296 //------------------------------ 4297 // PIP 4298 //------------------------------ 4299 //------------------------------------------------------------------------------------------------- 4300 /// Set Extra fetch number. (This setting is usually used in PIP mode. Please set carefully) 4301 /// @ingroup XC_SCALER 4302 /// @param u8val \b IN: The extra fetch number. 4303 //------------------------------------------------------------------------------------------------- 4304 void MApi_XC_Set_Extra_fetch_adv_line(MS_U8 u8val); 4305 4306 //------------------------------------------------------------------------------------------------- 4307 /// Set the VGA SOG on or off 4308 /// @ingroup XC_INFO 4309 /// @param bEnable \b IN: bEnable =1, Turn on the VGA SOG; bEnable =0, Turn off the VGA SOG 4310 //------------------------------------------------------------------------------------------------- 4311 // E_APIXC_ReturnValue MApi_XC_SetVGASogEn(MS_BOOL bVGASogEn); 4312 4313 //------------------------------------------------------------------------------------------------- 4314 /// Control the output window(Main/Sub) on or off 4315 /// @ingroup XC_SCALER 4316 /// @param bEnable \b IN: bEnable =1, Turn on the window; bEnable =0, Turn off the window 4317 /// @param eWindow \b IN: eWindow =0, for MAIN; eWindow =1, for SUB; 4318 //------------------------------------------------------------------------------------------------- 4319 void MApi_XC_EnableWindow(MS_BOOL bEnable, SCALER_WIN eWindow); 4320 4321 //------------------------------------------------------------------------------------------------- 4322 /// whether sub window is enable 4323 /// @ingroup XC_SCALER 4324 /// @param void \b IN: none 4325 //------------------------------------------------------------------------------------------------- 4326 MS_BOOL MApi_XC_Is_SubWindowEanble(void); 4327 4328 //------------------------------------------------------------------------------------------------- 4329 /// Set Border format 4330 /// @ingroup XC_SCALER 4331 /// @param u8WidthIn \b IN: In-box width 4332 /// @param u8WidthOut \b IN: Out-box width 4333 /// @param u8color \b IN: border color 4334 /// @param eWindow \b IN: which window we are going to set 4335 //------------------------------------------------------------------------------------------------- 4336 // void MApi_XC_SetBorderFormat( MS_U8 u8Left, MS_U8 u8Right, MS_U8 u8Up, MS_U8 u8Down, MS_U8 u8color, SCALER_WIN eWindow ); 4337 4338 //------------------------------------------------------------------------------------------------- 4339 /// enable or disable Border 4340 /// @ingroup XC_SCALER 4341 /// @param bEnable \b IN: Enable or Disable 4342 /// @param eWindow \b IN: which window we are going to set 4343 //------------------------------------------------------------------------------------------------- 4344 void MApi_XC_EnableBorder(MS_BOOL bEnable, SCALER_WIN eWindow); 4345 4346 //------------------------------------------------------------------------------------------------- 4347 /// Set Z-order main window first or not 4348 /// @ingroup XC_SCALER 4349 /// @param bMainFirst \b IN: TRUE: Main window first; FALSE: Sub window first 4350 //------------------------------------------------------------------------------------------------- 4351 void MApi_XC_ZorderMainWindowFirst(MS_BOOL bMainFirst); 4352 4353 //------------------------------ 4354 // PQ Load Function 4355 //------------------------------ 4356 //------------------------------------------------------------------------------------------------- 4357 /// Create a function for PQ in SC. 4358 /// @ingroup XC_PQ 4359 /// @param PQ_Function_Info \b IN: the information of the function 4360 /// @param u32InitDataLen \b IN: the length of the PQ_Function_Info 4361 //------------------------------------------------------------------------------------------------- 4362 void MApi_XC_PQ_LoadFunction(PQ_Function_Info* function_Info , MS_U32 u32InitDataLen); 4363 //------------------------------------------------------------------------------------------------- 4364 /// Return true if current status is H nonlinear scaling 4365 /// @ingroup XC_PQ 4366 /// @param u32InitDataLen \b IN: the length of the PQ_Function_Info 4367 /// @return @ref MS_U8 True: Using HNonLinearScaling False: Not in Nonlinear status 4368 //------------------------------------------------------------------------------------------------- 4369 // MS_BOOL MApi_XC_Check_HNonLinearScaling(void); 4370 4371 //------------------------------ 4372 // EURO Function 4373 //------------------------------ 4374 4375 // Enable/Disable Euro/Australia Hdtv Detection support in driver 4376 //----------------------------------------------------------------------------- 4377 /// Enable/Disable Euro/Australia Hdtv Detection support in driver 4378 /// @ingroup XC_TIMING_DETECT 4379 /// @param bEnable: 4380 /// - ENABLE : enable support 4381 /// - DISABLE : disable disable 4382 /// @return None. 4383 //----------------------------------------------------------------------------- 4384 // void MApi_XC_EnableEuroHdtvSupport(MS_BOOL bEnable); 4385 4386 //----------------------------------------------------------------------------- 4387 /// Enable Euro/Australia Hdtv Detection 4388 /// @ingroup XC_TIMING_DETECT 4389 /// @param bEnable: 4390 /// - ENABLE : enable detection 4391 /// - DISABLE : disable detection 4392 /// @return None. 4393 //----------------------------------------------------------------------------- 4394 void MApi_XC_EnableEuroHdtvDetection(MS_BOOL bEnable, SCALER_WIN eWindow); 4395 4396 //------------------------------ 4397 // Genenal R/W Function 4398 //------------------------------ 4399 4400 //------------------------------------------------------------------------------------------------- 4401 /// General Read Byte Function 4402 /// @ingroup XC_UTILITY 4403 /// @param u32Reg \b IN: which value shouldn't contain xc sub bank and address 4404 /// @return @ref MS_U8 4405 //------------------------------------------------------------------------------------------------- 4406 MS_U8 MApi_XC_ReadByte(MS_U32 u32Reg); 4407 4408 //------------------------------------------------------------------------------------------------- 4409 /// General Write Byte Function 4410 /// @ingroup XC_UTILITY 4411 /// @param u32Reg \b IN: which value shouldn't contain xc sub bank and address 4412 /// @return @ref MS_U8 4413 //------------------------------------------------------------------------------------------------- 4414 void MApi_XC_WriteByte(MS_U32 u32Reg, MS_U8 u8Val); 4415 4416 //------------------------------------------------------------------------------------------------- 4417 /// General Write Byte Function 4418 /// @ingroup XC_UTILITY 4419 /// @param u32Reg \b IN: which value shouldn't contain xc sub bank and address 4420 /// @param u8Val \b IN: setting value 4421 /// @param u8Msk \b IN: setting value 4422 //------------------------------------------------------------------------------------------------- 4423 void MApi_XC_WriteByteMask(MS_U32 u32Reg, MS_U8 u8Val, MS_U8 u8Msk); 4424 4425 //------------------------------------------------------------------------------------------------- 4426 /// General 2 Write Byte Function 4427 /// @ingroup XC_UTILITY 4428 /// @param u32Reg \b IN: which value shouldn't contain xc sub bank and address 4429 /// @param u16Val \b IN: setting value 4430 /// @param u16Msk \b IN: setting value 4431 //------------------------------------------------------------------------------------------------- 4432 void MApi_XC_Write2ByteMask(MS_U32 u32Reg, MS_U16 u16val, MS_U16 u16Mask); 4433 4434 //------------------------------ 4435 // XC R/W Function, using mutex to protect 4436 //------------------------------ 4437 4438 //------------------------------------------------------------------------------------------------- 4439 /// Scaler Write 2 Byte Function, and use mutex to protect while switch bank and write address 4440 /// @ingroup XC_UTILITY 4441 /// @param u32Reg \b IN: which value contain xc sub bank and address 4442 /// @param u16Val \b IN: setting value 4443 //------------------------------------------------------------------------------------------------- 4444 void MApi_XC_W2BYTE(MS_U32 u32Reg, MS_U16 u16Val); 4445 4446 //------------------------------------------------------------------------------------------------- 4447 /// Scaler Read 2 Byte Function, and use mutex to protect while switch bank and write address 4448 /// @ingroup XC_UTILITY 4449 /// @param u32Reg \b IN: which value contain xc sub bank and address 4450 /// @return @ref MS_U16 4451 //------------------------------------------------------------------------------------------------- 4452 MS_U16 MApi_XC_R2BYTE(MS_U32 u32Reg); 4453 4454 //------------------------------------------------------------------------------------------------- 4455 /// Scaler Write 4 Byte Function, and use mutex to protect while switch bank and write address 4456 /// @ingroup XC_UTILITY 4457 /// @param u32Reg \b IN: which value contain xc sub bank and address 4458 /// @param u32Val \b IN: setting value 4459 //------------------------------------------------------------------------------------------------- 4460 // void MApi_XC_W4BYTE(MS_U32 u32Reg, MS_U32 u32Val); 4461 4462 //------------------------------------------------------------------------------------------------- 4463 /// Scaler Read 4 Byte Function, and use mutex to protect while switch bank and write address 4464 /// @ingroup XC_UTILITY 4465 /// @param u32Reg \b IN: which value contain xc sub bank and address 4466 /// @return @ref MS_U32 4467 //------------------------------------------------------------------------------------------------- 4468 MS_U32 MApi_XC_R4BYTE(MS_U32 u32Reg); 4469 4470 //------------------------------------------------------------------------------------------------- 4471 /// Scaler Read 2 Byte Mask Function, and use mutex to protect while switch bank and write address 4472 /// @ingroup XC_UTILITY 4473 /// @param u32Reg \b IN: which value contain xc sub bank and address 4474 /// @param u16mask \b IN: decide which bit is valied 4475 /// @return @ref MS_U16 4476 //------------------------------------------------------------------------------------------------- 4477 MS_U16 MApi_XC_R2BYTEMSK(MS_U32 u32Reg, MS_U16 u16Mask); 4478 4479 //------------------------------------------------------------------------------------------------- 4480 /// Scaler Write 2 Byte Mask Function, and use mutex to protect while switch bank and write address 4481 /// @ingroup XC_UTILITY 4482 /// @param u32Reg \b IN: which value contain xc sub bank and address 4483 /// @param u16Val \b IN: Setting value 4484 /// @param u16mask \b IN: decide which bit is valied 4485 //------------------------------------------------------------------------------------------------- 4486 void MApi_XC_W2BYTEMSK(MS_U32 u32Reg, MS_U16 u16Val, MS_U16 u16Mask); 4487 4488 //------------------------------ 4489 // MLoad Function, xc command burst 4490 //------------------------------ 4491 //------------------------------------------------------------------------------------------------- 4492 /// Initialize the Menuload 4493 /// @ingroup XC_UTILITY 4494 /// @param PhyAddr \b IN: the physical address for the menuload 4495 /// @param u32BufByteLen \b IN: the buffer length of the menu load commands 4496 //------------------------------------------------------------------------------------------------- 4497 void MApi_XC_MLoad_Init(MS_PHY PhyAddr, MS_U32 u32BufByteLen); 4498 4499 //------------------------------------------------------------------------------------------------- 4500 /// Enable/Disable the MLoad 4501 /// @ingroup XC_UTILITY 4502 /// @return void 4503 //------------------------------------------------------------------------------------------------- 4504 void MApi_XC_MLoad_Enable(MS_BOOL bEnable); 4505 4506 //------------------------------------------------------------------------------------------------- 4507 /// Get the status of MLoad 4508 /// @ingroup XC_UTILITY 4509 /// @return @ref MLOAD_TYPE 4510 //------------------------------------------------------------------------------------------------- 4511 MLOAD_TYPE MApi_XC_MLoad_GetStatus(void); 4512 4513 //------------------------------------------------------------------------------------------------- 4514 /// write signal command to Mload and fire 4515 /// @ingroup XC_UTILITY 4516 /// @param u32Addr \b IN: register 4517 /// @param u16Data \b IN: value 4518 /// @param u16Mask \b IN: mask 4519 /// @return @ref MS_BOOL 4520 //------------------------------------------------------------------------------------------------- 4521 MS_BOOL MApi_XC_MLoad_WriteCmd_And_Fire(MS_U32 u32Addr, MS_U16 u16Data, MS_U16 u16Mask); 4522 4523 //------------------------------------------------------------------------------------------------- 4524 /// write multi commands to Mload and fire 4525 /// @ingroup XC_UTILITY 4526 /// @param pu32Addr \b IN: buffer of register 4527 /// @param pu16Data \b IN: buffer of value 4528 /// @param pu16Mask \b IN: buffer of mask 4529 /// @param u16CmdCnt \b IN: counter of command 4530 //------------------------------------------------------------------------------------------------- 4531 MS_BOOL MApi_XC_MLoad_WriteCmds_And_Fire(MS_U32 *pu32Addr, MS_U16 *pu16Data, MS_U16 *pu16Mask, MS_U16 u16CmdCnt); 4532 4533 //------------------------------ 4534 // Menuload Gamma Function 4535 //------------------------------ 4536 //------------------------------------------------------------------------------------------------- 4537 /// Initialize the Menuload Gamma 4538 /// @ingroup XC_UTILITY 4539 /// @param PhyAddr \b IN: the physical address for the menuload 4540 /// @param u32BufByteLen \b IN: the buffer length of the menu load commands 4541 //------------------------------------------------------------------------------------------------- 4542 void MApi_XC_MLG_Init(MS_PHY PhyAddr, MS_U32 u32BufByteLen); 4543 4544 //------------------------------------------------------------------------------------------------- 4545 /// Enable/Disable the Menuload Gamma 4546 /// @ingroup XC_UTILITY 4547 /// @return void 4548 //------------------------------------------------------------------------------------------------- 4549 void MApi_XC_MLG_Enable(MS_BOOL bEnable); 4550 4551 //------------------------------------------------------------------------------------------------- 4552 /// Get the caps of Menuload Gamma 4553 /// @ingroup XC_UTILITY 4554 /// @return TRUE if succeed, FALSE if failed 4555 //------------------------------------------------------------------------------------------------- 4556 // MS_BOOL MApi_XC_MLG_GetCaps(void); 4557 4558 //------------------------------------------------------------------------------------------------- 4559 /// Get the status of MLoad 4560 /// @ingroup XC_UTILITY 4561 /// @return @ref MLG_TYPE 4562 //------------------------------------------------------------------------------------------------- 4563 MLG_TYPE MApi_XC_MLG_GetStatus(void); 4564 4565 //------------------------------ 4566 // For U4 set VOP data mux to VE 4567 //------------------------------ 4568 //------------------------------------------------------------------------------------------------- 4569 /// Select the source which need to connect to VE. 4570 /// @ingroup XC_OSD 4571 /// @param eVOPSelOSD_MUX \b IN: The source need to connect to VE. 4572 //------------------------------------------------------------------------------------------------- 4573 void MApi_XC_SetOSD2VEMode(EN_VOP_SEL_OSD_XC2VE_MUX eVOPSelOSD_MUX); 4574 4575 //------------------------------------------------------------------------------------------------- 4576 /// Enable or disable prefilter in Scaler. 4577 /// @ingroup XC_SCALER 4578 /// @param bEnable \b IN: True: Enable: pre-filter. Disable: pre-filter 4579 //------------------------------------------------------------------------------------------------- 4580 // void MApi_XC_IP2_PreFilter_Enable(MS_BOOL bEnable); 4581 4582 //------------------------------------------------------------------------------------------------- 4583 /// Get pixel data with RGB format. 4584 /// @ingroup XC_SCALER 4585 /// @param u16x \b IN: X coordinate 4586 /// @param u16Y \b IN: Y coordinate 4587 /// @param eWindow \b IN: The window for retrieving data. 4588 /// @return @ref u32r return the R data 4589 /// @return @ref u32g return the G data 4590 /// @return @ref u32b return the B data 4591 //------------------------------------------------------------------------------------------------- 4592 E_APIXC_GET_PixelRGB_ReturnValue MApi_XC_Get_Pixel_RGB(XC_Get_Pixel_RGB *pData, SCALER_WIN eWindow); 4593 4594 //------------------------------------------------------------------------------------------------- 4595 /// During retrieve pixel data, system have a cursor on the screen. This function can keep the cursor on the screen. 4596 /// @ingroup XC_SCALER 4597 /// @param bEnable \b IN: Enable if you want to keep cursor on the screen 4598 //------------------------------------------------------------------------------------------------- 4599 // void MApi_XC_KeepPixelPointerAppear(MS_BOOL bEnable); 4600 4601 //------------------------------------------------------------------------------------------------- 4602 /// @param eMemFmt \b IN: the format of memory 4603 /// @ingroup XC_SCALER 4604 /// Set memory format 4605 /// @ref MS_BOOL 4606 //------------------------------------------------------------------------------------------------- 4607 MS_BOOL MApi_XC_Set_MemFmtEx(MS_XC_MEM_FMT eMemFmt, SCALER_WIN eWindow); 4608 4609 //------------------------------------------------------------------------------------------------- 4610 /// Get frame buffer less mode status 4611 /// @ingroup XC_SCALER 4612 /// @return @ref MS_BOOL retun the status about FrameBufferLess mode 4613 //------------------------------------------------------------------------------------------------- 4614 // MS_BOOL MApi_XC_IsRequestFrameBufferLessMode(void); 4615 4616 //------------------------------------------------------------------------------------------------- 4617 /// Set Flag to bypass software reset in MApi_XC_Init() 4618 /// @ingroup XC_SCALER 4619 /// @param bFlag \b TRUE: initialize XC by skipping SW reset; FALSE: initialize XC in normal case 4620 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 4621 //------------------------------------------------------------------------------------------------- 4622 E_APIXC_ReturnValue MApi_XC_SkipSWReset(MS_BOOL bFlag); 4623 4624 //------------------------------------------------------------------------------------------------- 4625 /// MApi_XC_EnableRepWindowForFrameColor 4626 /// @ingroup XC_SCALER 4627 /// @param bEnable \b IN: enable 4628 //------------------------------------------------------------------------------------------------- 4629 void MApi_XC_EnableRepWindowForFrameColor(MS_BOOL bEnable); 4630 4631 //------------------------------------------------------------------------------------------------- 4632 /// Set VOP Video and OSD Laler 4633 //------------------------------------------------------------------------------------------------- 4634 //------------------------------------------------------------------------------------------------- 4635 /// Set OSD Layer in Box Project ( In TV chips, please use MApi_XC_SetVideoOnOSD) 4636 /// @ingroup XC_OSD 4637 /// @param eVOPOSDLayer \b IN: OSD and Video layer selection 4638 /// @param eWindow \b IN: The window The alpha value of current window. 4639 //------------------------------------------------------------------------------------------------- 4640 E_APIXC_ReturnValue MApi_XC_SetOSDLayer(E_VOP_OSD_LAYER_SEL eVOPOSDLayer, SCALER_WIN eWindow); 4641 //------------------------------------------------------------------------------------------------- 4642 /// Get OSD Layer in Box Project 4643 /// @ingroup XC_OSD 4644 /// @param eWindow \b IN: The window The alpha value of current window. 4645 //------------------------------------------------------------------------------------------------- 4646 E_VOP_OSD_LAYER_SEL MApi_XC_GetOSDLayer(SCALER_WIN eWindow); 4647 4648 //------------------------------------------------------------------------------------------------- 4649 /// Set Constant Alpha of Video 4650 //------------------------------------------------------------------------------------------------- 4651 //------------------------------------------------------------------------------------------------- 4652 /// Set alpha value of video (now only support in box) 4653 /// @ingroup XC_SCALER 4654 /// @param u8Val \b IN: The alpha value of video with specific window 4655 /// @param eWindow \b IN: The window which need to be adjust 4656 //------------------------------------------------------------------------------------------------- 4657 E_APIXC_ReturnValue MApi_XC_SetVideoAlpha(MS_U8 u8Val, SCALER_WIN eWindow); 4658 4659 //------------------------------------------------------------------------------------------------- 4660 /// Get alpha value of video (now only support in box) 4661 /// @ingroup XC_SCALER 4662 /// @param pu8Val \b IN: The alpha value of video with specific window 4663 /// @param eWindow \b IN: The alpha value of a window. 4664 //------------------------------------------------------------------------------------------------- 4665 E_APIXC_ReturnValue MApi_XC_GetVideoAlpha(MS_U8 *pu8Val, SCALER_WIN eWindow); 4666 4667 //------------------------------------------------------------------------------------------------- 4668 /// Skip Wait Vsync 4669 /// @ingroup XC_UTILITY 4670 /// @param eWindow \b IN: Enable 4671 /// @param Skip wait Vsync \b IN: Disable wait Vsync 4672 //------------------------------------------------------------------------------------------------- 4673 E_APIXC_ReturnValue MApi_XC_SkipWaitVsync( MS_BOOL eWindow,MS_BOOL bIsSkipWaitVsyn); 4674 4675 //------------------------------------------------------------------------------------------------- 4676 /// Set XC CMA Heap ID 4677 /// @param u8CMAHeapID \b IN: CMA Heap ID 4678 /// @param eWindow \b IN: which window we are going to set 4679 //------------------------------------------------------------------------------------------------- 4680 // E_APIXC_ReturnValue MApi_XC_SetCMAHeapID(MS_U8 u8CMAHeapID, SCALER_WIN eWindow); 4681 4682 //------------------------------------------------------------------------------------------------- 4683 /// Select which DE to vop 4684 /// @ingroup XC_SCALER 4685 /// @param bFlag \b IN: @ref E_OP2VOP_DE_SEL 4686 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 4687 //------------------------------------------------------------------------------------------------- 4688 E_APIXC_ReturnValue MApi_XC_OP2VOPDESel(E_OP2VOP_DE_SEL eVopDESel); 4689 4690 //------------------------------------------------------------------------------------------------- 4691 /// Set FRC Window 4692 /// @ingroup XC_FRC 4693 /// @param e3dInputMode \b IN: @ref E_XC_3D_INPUT_MODE 4694 /// @param e3dOutputMode \b IN: @ref E_XC_3D_OUTPUT_MODE 4695 /// @param e3dPanelType \b IN: @ref E_XC_3D_PANEL_TYPE 4696 //------------------------------------------------------------------------------------------------- 4697 void MApi_XC_FRC_SetWindow(E_XC_3D_INPUT_MODE e3dInputMode, E_XC_3D_OUTPUT_MODE e3dOutputMode, E_XC_3D_PANEL_TYPE e3dPanelType); 4698 4699 //------------------------------------------------------------------------------------------------- 4700 /// XC update bwd configuration 4701 /// @param eType \b IN: bwd configuration type 4702 /// @param pstParam \b IN: data 4703 /// @param eWindow \b IN: window type 4704 /// @return result of power state control. 4705 //------------------------------------------------------------------------------------------------- 4706 #ifdef SUPPORT_BWD 4707 MS_BOOL SYMBOL_WEAK MApi_XC_SetBwdConfig(E_XC_BWD_CONFIG_TYPE eType, void *pstParam, SCALER_WIN eWindow); 4708 #endif 4709 //------------------------------------------------------------------------------------------------- 4710 /// XC config cma configuration 4711 /// @param pstXC_CMA_Config \b IN: XC_CMA_CONFIG cma config struct 4712 /// @param enCmaClient \b IN: cma client 4713 /// @param u32DataLen \b IN: data len 4714 /// @param eWindow \b IN: window type 4715 //------------------------------------------------------------------------------------------------- 4716 MS_BOOL MApi_XC_ConfigCMA(XC_CMA_CONFIG *pstXC_CMA_Config, XC_CMA_CLIENT enCmaClient, MS_U32 u32DataLen, SCALER_WIN eWindow); 4717 4718 //------------------------------------------------------------------------------------------------- 4719 /// Set two initial factors mode to improve quality in FBL 4720 /// @ingroup XC_PQ 4721 /// @param bEnable \b IN: enable or disable two initial factors mode 4722 /// @param eWindow \b IN: @ref SCALER_WIN 4723 //------------------------------------------------------------------------------------------------- 4724 MS_BOOL MApi_XC_Enable_TwoInitFactor(MS_BOOL bEnable, SCALER_WIN eWindow); 4725 4726 //------------------------------------------------------------------------------------------------- 4727 /// Get field packing mode support status 4728 /// @ingroup XC_3D 4729 /// @return TRUE(success) or FALSE(fail) 4730 //------------------------------------------------------------------------------------------------- 4731 MS_BOOL MApi_XC_IsFieldPackingModeSupported(void); 4732 4733 //------------------------------------------------------------------------------------------------- 4734 /// Pre Init before XC Init 4735 /// @ingroup XC_INIT 4736 /// @param u16Type \b IN: @ref E_OP2VOP_DE_SEL 4737 /// @param para \b IN: parameter 4738 /// @param u32Length \b IN: size of parameter 4739 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 4740 //------------------------------------------------------------------------------------------------- 4741 E_APIXC_ReturnValue MApi_XC_PreInit( E_XC_PREINIT_t eType ,void* para, MS_U32 u32Length); 4742 4743 //------------------------------------------------------------------------------------------------- 4744 /// Get RGB data from memory buffer 4745 /// @ingroup XC_SCALER 4746 /// @param eBufType \b IN: get RGB 8 bits or 10 bits format data 4747 /// @param pRect \b IN: the widnow for getting data area in memory, need to refer to pre-scaling 4748 /// @param pRectBuf \b IN: the buffer for getting data, the buffer typs must be the same as eBufType 4749 /// @param eWindow \b IN: get main or sub video data from memory 4750 //------------------------------------------------------------------------------------------------- 4751 void MApi_XC_Get_BufferData(E_XC_OUTPUTDATA_TYPE eBufType, MS_WINDOW_TYPE *pRect, void *pRectBuf, SCALER_WIN eWindow); 4752 4753 //------------------------------------------------------------------------------------------------- 4754 /// Set RGB data to memory buffer 4755 /// @ingroup XC_SCALER 4756 /// @param eBufType \b IN: set RGB 8 bits or 10 bits format data 4757 /// @param pDstRect \b IN: the widnow for setting data area in memory, need to refer to pre-scaling 4758 /// @param pSrcBuf \b IN: the buffer with RGB data for setting to memory, the buffer typs must be the same as eBufType 4759 /// @param pSrcRect \b IN: the widnow for picking data area in pSrcBuf 4760 /// @param eWindow \b IN: set main or sub video data to memory 4761 //------------------------------------------------------------------------------------------------- 4762 void MApi_XC_Set_BufferData(E_XC_INPUTDATA_TYPE eBufType, MS_WINDOW_TYPE *pDstRect, void *pSrcBuf, MS_WINDOW_TYPE *pSrcRect, SCALER_WIN eWindow); 4763 4764 //------------------------------------------------------------------------------------------------- 4765 /// Control the main window on or off 4766 /// @ingroup XC_ToBeModified 4767 /// @param bEnable \b IN: bEnable =1, Turn on the window; bEnable =0, Turn off the window 4768 //------------------------------------------------------------------------------------------------- 4769 void MApi_XC_EnableMainWindow(MS_BOOL bEnable); // Turn on/off main/sub window 4770 4771 //------------------------------------------------------------------------------------------------- 4772 /// Enable sub window and control the window size 4773 /// @ingroup XC_ToBeRemove 4774 /// @param *pstDispWin \b IN: Window type 4775 //------------------------------------------------------------------------------------------------- 4776 void MApi_XC_EnableSubWindow(MS_WINDOW_TYPE *pstDispWin); 4777 4778 //------------------------------------------------------------------------------------------------- 4779 /// Disable sub window 4780 /// @ingroup XC_ToBeRemove 4781 /// @param void \b IN: none 4782 //------------------------------------------------------------------------------------------------- 4783 void MApi_XC_DisableSubWindow(void); 4784 4785 //------------------------------------------------------------------------------------------------- 4786 /// Set pixel shift 4787 /// @ingroup XC_DISPLAY 4788 /// @param s8H \b IN: pixel shift H 4789 /// @param s8V \b IN: pixel shift V 4790 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 4791 //------------------------------------------------------------------------------------------------- 4792 E_APIXC_ReturnValue MApi_XC_SetPixelShift(MS_S8 s8H, MS_S8 s8V); 4793 4794 //------------------------------------------------------------------------------------------------- 4795 /// Set Pixel Shift Features 4796 /// @ingroup XC_DISPLAY 4797 /// @param u16HPixelShiftRange \b IN: horizontal shift range, if it is +/- 4, please assign 4 to this parameter 4798 /// @param u16VPixelShiftRange \b IN: vertical shift range, if it is +/- 3, please assign 3 to this parameter 4799 /// @param ePixelShiftFeature \b IN: decide which feature to be used, use "|" for multiple features 4800 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 4801 //------------------------------------------------------------------------------------------------- 4802 E_APIXC_ReturnValue MApi_XC_SetPixelShiftFeatures(MS_U16 u16HPixelShiftRange, 4803 MS_U16 u16VPixelShiftRange, 4804 PIXEL_SHIFT_FEATURE ePixelShiftFeature); 4805 //------------------------------------------------------------------------------------------------- 4806 /// MApi_XC_Combine_MLoadEn 4807 /// @ingroup XC_UTILITY 4808 /// @param bEnable \b IN: whether to menuload 4809 /// Do an example when you want to menuload OSDLayer : 4810 /// MApi_XC_Combine_MLoadEn(TRUE) 4811 /// xc function 4812 /// MApi_XC_Combine_MLoadEn(FALSE) 4813 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 4814 //------------------------------------------------------------------------------------------------- 4815 E_APIXC_ReturnValue MApi_XC_Combine_MLoadEn(MS_BOOL bEn); 4816 4817 //------------------------------------------------------------------------------------------------- 4818 /// MApi_XC_SetVideoOnOSD 4819 /// @ingroup XC_OSD 4820 /// @param E_VDO_ON_OSD_LAYER \b IN: set video show on which osd layer 4821 /// @param eWindow \b IN: set main or sub video data to memory 4822 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 4823 //------------------------------------------------------------------------------------------------- 4824 E_APIXC_ReturnValue MApi_XC_SetVideoOnOSD(E_VIDEO_ON_OSD_LAYER enlayer, SCALER_WIN eWindow); 4825 4826 //------------------------------------------------------------------------------------------------- 4827 /// MApi_XC_SetOSDLayerBlending 4828 /// @ingroup XC_OSD 4829 /// @param u8Layer \b IN: which osd layer will blend 4830 /// @param bEnable \b IN: whether to blend 4831 /// @param eWindow \b IN: which window blend with 4832 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 4833 //------------------------------------------------------------------------------------------------- 4834 E_APIXC_ReturnValue MApi_XC_SetOSDLayerBlending(MS_U8 u8Layer, MS_BOOL bEnable, SCALER_WIN eWindow); 4835 4836 //------------------------------------------------------------------------------------------------- 4837 /// MApi_XC_SetOSDLayerAlpha 4838 /// @ingroup XC_OSD 4839 /// @param u8Layer \b IN: which osd layer will blend 4840 /// @param u8Alpha \b IN: blending alpha 4841 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 4842 //------------------------------------------------------------------------------------------------- 4843 E_APIXC_ReturnValue MApi_XC_SetOSDLayerAlpha(MS_U8 u8Layer, MS_U8 u8Alpha); 4844 4845 //------------------------------------------------------------------------------------------------- 4846 /// MApi_XC_SetOSDBlendingFormula 4847 /// @ingroup XC_OSD 4848 /// @param enOsdIndex \b IN: osd index 4849 /// @param enType \b IN: osd blending type 4850 /// @param eWindow \b IN: blending with main or sub video 4851 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 4852 //------------------------------------------------------------------------------------------------- 4853 E_APIXC_ReturnValue MApi_XC_SetOSDBlendingFormula(E_XC_OSD_INDEX enOsdIndex, E_XC_OSD_BlENDING_TYPE enType, SCALER_WIN eWindow); 4854 4855 //------------------------------------------------------------------------------------------------- 4856 // usage: 4857 // MS_XC_REPORT_PIXELINFO stRepPixInfo; 4858 // memset(&stRepPixInfo, 0, sizeof(MS_XC_REPORT_PIXELINFO)); 4859 // stRepPixInfo.u32ReportPixelInfo_Version = XC_REPORT_PIXELINFO_VERSION; 4860 // stRepPixInfo.u16ReportPixelInfo_Length = sizeof(MS_XC_REPORT_PIXELINFO); 4861 // stRepPixInfo.enStage = E_XC_GET_PIXEL_STAGE_AFTER_OSD; 4862 // stRepPixInfo.u16XStart = xxxx; 4863 // stRepPixInfo.u16XEnd = xxxx; 4864 // stRepPixInfo.u16YStart = xxxx; 4865 // stRepPixInfo.u16YEnd = xxxx; 4866 // MApi_XC_ReportPixelInfo(&stRepPixInfo); 4867 // 4868 /// Report Pixel Info 4869 /// @ingroup XC_SCALER 4870 /// @param pstRepPixInfo \b IN: pointer to struct MS_XC_REPORT_PIXELINFO 4871 /// @return TRUE if succeed, FALSE if failed 4872 //------------------------------------------------------------------------------------------------- 4873 MS_BOOL MApi_XC_ReportPixelInfo(MS_XC_REPORT_PIXELINFO *pstRepPixInfo); 4874 4875 //------------------------------------------------------------------------------------------------- 4876 /// MApi_XC_SetScaling 4877 /// @ingroup XC_SCALER 4878 /// @param bEnable \b IN: set enable or disable 4879 /// @param eScaling_type \b IN: set scaling type, pre-scaling, post-scaling, both-scaling 4880 /// @param eVector_type \b IN: set H vector, v vector, and HV vector 4881 /// @param eWindow \b IN: set main or sub video data to memory 4882 //------------------------------------------------------------------------------------------------- 4883 void MApi_XC_SetScaling( MS_BOOL bEnable, E_XC_SCALING_TYPE eScaling_type, E_XC_VECTOR_TYPE eVector_type, SCALER_WIN eWindow ); 4884 4885 //------------------------------------------------------------------------------------------------- 4886 /// MApi_XC_SetMCDIBufferAddress 4887 /// @ingroup XC_PQ 4888 /// @param u32FBAddress \b IN: frame buffer base addr 4889 /// @param u32FBSize \b IN: frame buffer size 4890 /// @param eType \b IN: set frame buffer for MCDI ME1 or ME2 4891 //------------------------------------------------------------------------------------------------- 4892 void MApi_XC_SetMCDIBufferAddress(MS_PHY u32FBAddress, MS_PHY u32FBSize, E_XC_MCDI_TYPE eType); 4893 4894 //------------------------------------------------------------------------------------------------- 4895 /// MApi_XC_EnableMCDI 4896 /// @ingroup XC_PQ 4897 /// @param bEnable \b IN: enable/disable MCDI 4898 /// @param eType \b IN: control MCDI ME1 or ME2 or both 4899 //------------------------------------------------------------------------------------------------- 4900 void MApi_XC_EnableMCDI(MS_BOOL bEnable, E_XC_MCDI_TYPE eType); 4901 4902 4903 //------------------------------------------------------------------------------------------------- 4904 /// MApi_XC_SendCmdToFRC 4905 /// @ingroup XC_FRC 4906 /// @param u8Cmd \b IN: CMD 4907 /// @param count \b IN: parameter Counter 4908 /// @param pFRC_R2_Para \b IN: input parameter 4909 /// @return TRUE if succeed, FALSE if failed 4910 //------------------------------------------------------------------------------------------------- 4911 MS_BOOL MApi_XC_SendCmdToFRC( MS_U8 u8Cmd, MS_U8 count, FRC_R2_CMD_PARAMETER_t pFRC_R2_Para ); 4912 4913 //------------------------------------------------------------------------------------------------- 4914 /// MApi_XC_GetMsgFromFRC 4915 /// @ingroup XC_FRC 4916 /// @param u8Cmd \b IN: CMD 4917 /// @param pu8ParaCount \b IN: Counter 4918 /// @param pu8Para \b IN: input parameter 4919 /// @return TRUE if succeed, FALSE if failed 4920 //------------------------------------------------------------------------------------------------- 4921 // MS_BOOL MApi_XC_GetMsgFromFRC(MS_U8* pu8Cmd, MS_U8* pu8ParaCount, MS_U8* pu8Para); 4922 4923 //------------------------------------------------------------------------------------------------- 4924 /// Enable/Disable RW bank auto 4925 /// @ingroup XC_SCALER 4926 /// @param bEnable \b IN: enable or disable 4927 /// @param eWindow \b IN: which window we are going to enable or disable 4928 //------------------------------------------------------------------------------------------------- 4929 // void MApi_XC_EnableRWBankAuto(MS_BOOL bEnable, SCALER_WIN eWindow); 4930 4931 //------------------------------------------------------------------------------------------------- 4932 /// Set XC W/R Bank Mapping Number 4933 /// @ingroup XC_SCALER 4934 /// @param u8Val \b IN: W/R bank mapping value 4935 /// @param eWindow \b IN: which window we are going to set 4936 //------------------------------------------------------------------------------------------------- 4937 void MApi_XC_SetWRBankMappingNum(MS_U8 u8Val, SCALER_WIN eWindow); 4938 4939 //------------------------------------------------------------------------------------------------- 4940 /// Get XC W/R Bank Mapping Number 4941 /// @ingroup XC_SCALER 4942 /// @param eWindow \b IN: which window we are going to get 4943 /// @return MS_U8 W/R bank mapping number 4944 //------------------------------------------------------------------------------------------------- 4945 MS_U8 MApi_XC_GetWRBankMappingNum(SCALER_WIN eWindow); 4946 4947 //------------------------------------------------------------------------------------------------- 4948 /// Get XC W/R Bank Mapping Number for Zap (including UC effect) 4949 /// @ingroup XC_SCALER 4950 /// @param eWindow \b IN: which window we are going to get 4951 /// @return MS_U8 W/R bank mapping number 4952 //------------------------------------------------------------------------------------------------- 4953 // MS_U8 MApi_XC_GetWRBankMappingNumForZap(SCALER_WIN eWindow); 4954 4955 //------------------------------------------------------------------------------------------------- 4956 /// Set BOB mode 4957 /// @ingroup XC_PQ 4958 /// @param bEnable \b IN: Enable BOB mode or not 4959 /// @param eWindow \b IN: which window we are going to set 4960 /// @return TRUE - succeed, FALSE - fail 4961 //------------------------------------------------------------------------------------------------- 4962 MS_BOOL MApi_XC_SetBOBMode(MS_BOOL bEnable, SCALER_WIN eWindow); 4963 4964 //------------------------------------------------------------------------------------------------- 4965 /// Set XC force read bank 4966 /// @ingroup XC_SCALER 4967 /// @param bEnable \b IN: Enable force read bank or not 4968 /// @param u8Bank \b IN: Force read bank index 4969 /// @param eWindow \b IN: which window we are going to set 4970 //------------------------------------------------------------------------------------------------- 4971 void MApi_XC_SetForceReadBank(MS_BOOL bEnable, MS_U8 u8Bank, SCALER_WIN eWindow); 4972 4973 //------------------------------------------------------------------------------------------------- 4974 /// Set XC lock point 4975 /// @ingroup XC_SCALER 4976 /// @param u16LockPoint \b IN: lock point count 4977 /// @param eWindow \b IN: which window we are going to set 4978 //------------------------------------------------------------------------------------------------- 4979 // void MApi_XC_SetLockPoint(MS_U16 u16LockPoint, SCALER_WIN eWindow); 4980 4981 //------------------------------ 4982 // LD 4983 //------------------------------------------------------------------------------------------------- 4984 /// LD set panel type 4985 /// @ingroup XC_LD 4986 /// @param eLdPanelType \b IN: panel type 4987 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 4988 //------------------------------------------------------------------------------------------------- 4989 MS_BOOL MApi_XC_LD_Init(EN_LD_PANEL_TYPE eLDPanelType ); 4990 //------------------------------------------------------------------------------------------------- 4991 /// LD set memory address 4992 /// @ingroup XC_LD 4993 /// @param u8MIU \b IN: MIU Select 4994 /// @param u32LDFBase0 \b IN: LDF memeory0 address 4995 /// @param u32LDFBase1 \b IN: LDF memeory1 address 4996 /// @param u32LDBBase0 \b IN: LDB memeory0 address 4997 /// @param u32LDBBase1 \b IN: LDB memeory1 address 4998 /// @param u32EDGE2DBase \b IN: EDGE2D memeory address 4999 /// @param u32LEDoffset \b IN: LED data offset 5000 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 5001 //------------------------------------------------------------------------------------------------- 5002 MS_BOOL MApi_XC_LD_SetMemoryAddress(MS_U8 u8MIU ,MS_PHY u32LDFBase0,MS_PHY u32LDFBase1,MS_PHY u32LDBBase0,MS_PHY u32LDBBase1,MS_PHY u32EDGE2DBase,MS_PHY u32LEDoffset); 5003 5004 //------------------------------------------------------------------------------------------------- 5005 /// Get LD value 5006 /// @ingroup XC_LD 5007 /// @param pu8LDValue @ref MS_U8 \b OUT: get the LD back light value (The amount is u8WSize x u8HSize) 5008 /// @param u8WSize @ref MS_U8 \b IN: set the LD back light width 5009 /// @param u8HSize @ref MS_U8 \b IN: set the LD back light height 5010 /// @Return TRUE: Successful FALSE: Fail 5011 //------------------------------------------------------------------------------------------------- 5012 // MS_BOOL MApi_XC_LD_Get_Value(MS_U8 *pu8LDValue, MS_U8 u8WSize, MS_U8 u8HSize); 5013 5014 //------------------------------------------------------------------------------------------------- 5015 /// set LD Level 5016 /// @ingroup XC_LD 5017 /// @param eMode \b IN: LD level 5018 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 5019 //------------------------------------------------------------------------------------------------- 5020 MS_BOOL MApi_XC_LD_SetLevel(EN_LD_MODE eMode); 5021 //------------------------------------------------------------------------------------------------- 5022 /// set LD backlight is zero flags 5023 /// @ingroup XC_LD 5024 /// @param eMode \b IN: backlight is zero flags 5025 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 5026 //------------------------------------------------------------------------------------------------- 5027 // MS_BOOL MApi_Set_TurnoffLDBL(MS_BOOL bturnoffbl); 5028 //------------------------------------------------------------------------------------------------- 5029 /// set not update SPI data Flags 5030 /// @ingroup XC_LD 5031 /// @param brefreshSpidata \b IN: refresh Spi data flags 5032 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 5033 //------------------------------------------------------------------------------------------------- 5034 // MS_BOOL MApi_Set_notUpdateSPIDataFlags(MS_BOOL brefreshSpidata); 5035 //------------------------------------------------------------------------------------------------- 5036 /// set User mode LD Flags 5037 /// @ingroup XC_LD 5038 /// @param buserLDFlags \b IN: User mode LD Flags 5039 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 5040 //------------------------------------------------------------------------------------------------- 5041 // MS_BOOL MApi_Set_UsermodeLDFlags(MS_BOOL buserLDFlags); 5042 //------------------------------------------------------------------------------------------------- 5043 /// set LD backlight level 5044 /// @ingroup XC_LD 5045 /// @param u8BLLeve \b IN: backlight level 5046 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 5047 //------------------------------------------------------------------------------------------------- 5048 // MS_BOOL MApi_Set_BLLevel(MS_U8 u8BLLeve); 5049 5050 //------------------------------------------------------------------------------------------------- 5051 /// set XC bandwidth saving X-mode 5052 /// @ingroup XC_PQ 5053 /// @param bEnable \b IN: enable or disable 5054 /// @param eWindow \b IN: which window we are going to enable or disable 5055 //------------------------------------------------------------------------------------------------- 5056 void MApi_XC_Set_BWS_Mode(MS_BOOL bEnable, SCALER_WIN eWindow); 5057 5058 //------------------------------------------------------------------------------------------------- 5059 /// set FRC ColorPathCtrl 5060 /// @ingroup XC_FRC 5061 /// @param epath_type \b IN: Select one of path in the FRC_COLOR_PATH_TYPE 5062 /// @param bEnable \b IN: enable or disable 5063 //------------------------------------------------------------------------------------------------- 5064 // void MApi_XC_FRC_ColorPathCtrl(MS_U16 u16Path_sel, MS_BOOL bEnable); 5065 5066 //------------------------------------------------------------------------------------------------- 5067 /// set FRC_OP2 SetRGBGain 5068 /// @ingroup XC_FRC 5069 /// @param u16RedGain \b IN: Red Gain 5070 /// @param u16GreenGain \b IN: Green Gain 5071 /// @param u16BlueGain \b IN: Blue Gain 5072 //------------------------------------------------------------------------------------------------- 5073 // void MApi_XC_FRC_OP2_SetRGBGain(MS_U16 u16RedGain, MS_U16 u16GreenGain, MS_U16 u16BlueGain); 5074 5075 //------------------------------------------------------------------------------------------------- 5076 /// set FRC_OP2 SetRGBOffset 5077 /// @ingroup XC_FRC 5078 /// @param u16RedOffset \b IN: Red Offset 5079 /// @param u16GreenOffset \b IN: Green Offset 5080 /// @param u16BlueOffset \b IN: Blue Offset 5081 //------------------------------------------------------------------------------------------------- 5082 // void MApi_XC_FRC_OP2_SetRGBOffset(MS_U16 u16RedOffset, MS_U16 u16GreenOffset, MS_U16 u16BlueOffset); 5083 5084 //------------------------------------------------------------------------------------------------- 5085 /// set FRC_OP2 SetDither 5086 /// @ingroup XC_FRC 5087 /// @param u16dither \b IN: Dither setting 5088 //------------------------------------------------------------------------------------------------- 5089 // void MApi_XC_FRC_OP2_SetDither(MS_U16 u16dither); 5090 5091 //------------------------------------------------------------------------------------------------- 5092 /// set XC Bypass MFC 5093 /// @ingroup XC_FRC 5094 /// @param eEnable \b IN: Enable or Disable 5095 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 5096 //------------------------------------------------------------------------------------------------- 5097 // MS_BOOL MApi_XC_FRC_BypassMFC(MS_BOOL bEnable); 5098 5099 //------------------------------------------------------------------------------------------------- 5100 /// set XC FRC Mute 5101 /// @ingroup XC_FRC 5102 /// @param bEnable \b IN: Enable or Disable 5103 //------------------------------------------------------------------------------------------------- 5104 void MApi_XC_FRC_Mute(MS_BOOL bEnable); 5105 5106 //------------------------------------------------------------------------------------------------- 5107 /// MApi_XC_ForceReadFrame 5108 /// @ingroup XC_SCALER 5109 /// @param bEnable \b IN: enable/disable keep specified frame 5110 /// @param u16FrameIndex \b IN: control specified frame to show 5111 //------------------------------------------------------------------------------------------------- 5112 E_APIXC_ReturnValue MApi_XC_ForceReadFrame(MS_BOOL bEnable, MS_U16 u16FrameIndex); 5113 //------------------------------------------------------------------------------------------------- 5114 /// MApi_XC_SetCsc 5115 /// @ingroup XC_PQ 5116 /// @param bEnable \b IN: enable/disable keep specified frame 5117 /// @param eWindow \b IN: which window we are going to enable or disable 5118 //------------------------------------------------------------------------------------------------- 5119 void MApi_XC_SetCsc( MS_BOOL bEnable, SCALER_WIN eWindow ); 5120 5121 //------------------------------------------------------------------------------------------------- 5122 /// Register PQ Set FPLL thresh mode function 5123 /// @ingroup XC_DISPLAY 5124 /// @param fpPQCB \b IN: function pointer of PQ set FPLL thresh mode 5125 //------------------------------------------------------------------------------------------------- 5126 // void MApi_XC_RegisterPQSetFPLLThreshMode(void (*fpPQCB)(MS_U8 u8PQWin)); 5127 5128 //------------------------------------------------------------------------------------------------- 5129 /// Get XC free run status 5130 /// @ingroup XC_DISPLAY 5131 /// @return TRUE if it is free run, FALSE if not 5132 //------------------------------------------------------------------------------------------------- 5133 // MS_BOOL MApi_XC_GetFreeRunStatus(void); 5134 5135 //------------------------------------------------------------------------------------------------- 5136 /// MApi_XC_Get_DSForceIndexSupported 5137 /// @ingroup XC_DS 5138 /// @param eWindow \b IN: which window we are going to enable or disable 5139 //------------------------------------------------------------------------------------------------- 5140 // E_APIXC_ReturnValue MApi_XC_Get_DSForceIndexSupported(SCALER_WIN eWindow); 5141 5142 //------------------------------------------------------------------------------------------------- 5143 /// MApi_XC_Set_DSForceIndex 5144 /// @ingroup XC_DS 5145 /// @param bEnable \b IN: ENABLE/DISABLE force DS index or not 5146 /// @param u8Index \b IN: the index that needs to be forced in. 5147 /// @param eWindow \b IN: which window we are going to enable or disable 5148 //------------------------------------------------------------------------------------------------- 5149 E_APIXC_ReturnValue MApi_XC_Set_DSForceIndex(MS_BOOL bEnable, MS_U8 u8Index, SCALER_WIN eWindow); 5150 5151 //------------------------------------------------------------------------------------------------- 5152 /// MApi_XC_Set_DSIndexSourceSelect 5153 /// @ingroup XC_DS 5154 /// @param eDSIdxSrc \b IN: choose where the DS index comes from. 5155 /// @param eWindow \b IN: which window we are going to enable or disable 5156 //------------------------------------------------------------------------------------------------- 5157 E_APIXC_ReturnValue MApi_XC_Set_DSIndexSourceSelect(E_XC_DS_INDEX_SOURCE eDSIdxSrc, SCALER_WIN eWindow); 5158 5159 5160 5161 //------------------------------------------------------------------------------------------------- 5162 /// MApi_XC_Set_DSForceIndex 5163 /// @ingroup XC_OSD 5164 /// @param bEnable \b IN: ENABLE/DISABLE force DS index or not 5165 /// @param u8Index \b IN: the index that needs to be forced in. 5166 /// @param eWindow \b IN: which window we are going to enable or disable 5167 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 5168 //------------------------------------------------------------------------------------------------- 5169 E_APIXC_ReturnValue MApi_XC_OSDC_InitSetting(E_XC_OSDC_TGEN_Type E_XC_OSDC_TGEN_Type, 5170 MS_XC_OSDC_TGEN_INFO *pstOC_Tgen_Cus, 5171 MS_XC_OSDC_CTRL_INFO *pstOC_Ctrl); 5172 //------------------------------------------------------------------------------------------------- 5173 /// MApi_XC_Set_DSForceIndex 5174 /// @ingroup XC_OSD 5175 /// @param eCtrl_type \b IN: ENABLE/DISABLE force DS index or not 5176 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 5177 //------------------------------------------------------------------------------------------------- 5178 E_APIXC_ReturnValue MApi_XC_OSDC_Control(MS_U32 eCtrl_type); 5179 5180 //------------------------------------------------------------------------------------------------- 5181 /// MApi_XC_OSDC_GetDstInfo 5182 /// @ingroup XC_OSD 5183 /// @param pDstInfo \b IN: get the Desternation info 5184 /// @param u32SizeofDstInfo \b IN: size check 5185 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 5186 //------------------------------------------------------------------------------------------------- 5187 E_APIXC_ReturnValue MApi_XC_OSDC_GetDstInfo(MS_OSDC_DST_DispInfo *pDstInfo, MS_U32 u32SizeofDstInfo); 5188 5189 //------------------------------------------------------------------------------------------------- 5190 /// MApi_XC_OSDC_SetOutVfreqx10 5191 /// @ingroup XC_OSD 5192 /// @param u16Vfreq \b IN: output V freq x10 5193 //------------------------------------------------------------------------------------------------- 5194 void MApi_XC_OSDC_SetOutVfreqx10(MS_U16 u16Vfreq); 5195 5196 //------------------------------------------------------------------------------------------------- 5197 /// MApi_XC_SetByPassOSDVsyncPos 5198 /// @ingroup XC_OSD 5199 /// @param u16VsyncStart \b IN: OSD vsync start 5200 /// @param u16VsyncEnd \b IN: OSD vsync end 5201 //------------------------------------------------------------------------------------------------- 5202 // void MApi_XC_BYPASS_SetOSDVsyncPos(MS_U16 u16VsyncStart, MS_U16 u16VsyncEnd); 5203 5204 //------------------------------------------------------------------------------------------------- 5205 /// MApi_XC_BYPASS_SetInputSrc 5206 /// @ingroup XC_SCALER 5207 /// @param bEnable \b IN: ENABLE/DISABLE bypass mode 5208 /// @param input \b IN: Select the input source for bypass mode 5209 //------------------------------------------------------------------------------------------------- 5210 // void MApi_XC_BYPASS_SetInputSrc(MS_BOOL bEnable,E_XC_BYPASS_InputSource input); 5211 5212 //------------------------------------------------------------------------------------------------- 5213 /// MApi_XC_BYPASS_SetCSC 5214 /// @ingroup XC_SCALER 5215 /// @param bEnable \b IN: ENABLE/DISABLE the color space convert 5216 //------------------------------------------------------------------------------------------------- 5217 // void MApi_XC_BYPASS_SetCSC(MS_BOOL bEnable); 5218 5219 //------------------------------------------------------------------------------------------------- 5220 /// MApi_XC_SetSeamlessZapping 5221 /// @ingroup XC_UTILITY 5222 /// @param eWindow \b IN: which window we are going to enable or disable 5223 /// @param bEnable \b IN: ENABLE/DISABLE seamless zapping 5224 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 5225 //------------------------------------------------------------------------------------------------- 5226 E_APIXC_ReturnValue MApi_XC_SetSeamlessZapping(SCALER_WIN eWindow, MS_BOOL bEnable); 5227 5228 //------------------------------------------------------------------------------------------------- 5229 /// MApi_XC_GetSeamlessZappingStatus 5230 /// @ingroup XC_UTILITY 5231 /// @ingroup XC_SCALER 5232 /// @param eWindow \b IN: which window we are going to get status 5233 /// @param pbEnable \b IN: get current seamless zapping status 5234 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 5235 //------------------------------------------------------------------------------------------------- 5236 E_APIXC_ReturnValue MApi_XC_GetSeamlessZappingStatus(SCALER_WIN eWindow, MS_BOOL* pbEnable); 5237 5238 //------------------------------------------------------------------------------------------------- 5239 /// MApi_XC_Vtrack_SetPayloadData 5240 /// @ingroup XC_PQ 5241 /// @param u16Timecode \b IN: The time code is coded on 16 bits. It is calculated based on the number of days from January 1st. 5242 /// @param u8ID \b IN: Operator ID 5243 //------------------------------------------------------------------------------------------------- 5244 // E_APIXC_ReturnValue MApi_XC_Vtrack_SetPayloadData(MS_U16 u16Timecode, MS_U8 u8OperatorID); 5245 5246 5247 //------------------------------------------------------------------------------------------------- 5248 /// MApi_XC_Vtrack_SetUserDefindedSetting 5249 /// @ingroup XC_PQ 5250 /// @param bEnable \b IN: ENABLE/DISABLE Customized Setting 5251 /// @param pu8Setting \b IN: pointer to targert user definded setting data (include setting1 to setting3) 5252 //------------------------------------------------------------------------------------------------- 5253 // E_APIXC_ReturnValue MApi_XC_Vtrack_SetUserDefindedSetting(MS_BOOL bUserDefinded, MS_U8 *pu8Setting); 5254 5255 5256 //------------------------------------------------------------------------------------------------- 5257 /// MApi_XC_Vtrack_Enable 5258 /// @ingroup XC_PQ 5259 /// @param u8FrameRate \b IN: ENABLE/DISABLE The FrameRateIn is based on the output format of the box 5260 /// @param bEnable \b IN: ENABLE/DISABLE Vtrack 5261 //------------------------------------------------------------------------------------------------- 5262 // E_APIXC_ReturnValue MApi_XC_Vtrack_Enable(MS_U8 u8FrameRate, MS_BOOL bEnable); 5263 5264 //------------------------------------------------------------------------------------------------- 5265 /// Pre-set the specific window with PQ info 5266 /// @ingroup XC_PQ 5267 /// @param pstXC_SetWin_Info \b IN: the information of the window setting 5268 /// @param eWindow \b IN: which window we are going to set 5269 //------------------------------------------------------------------------------------------------- 5270 void MApi_XC_PreSetPQInfo(XC_SETWIN_INFO *pstXC_SetWin_Info, SCALER_WIN eWindow); 5271 5272 5273 //------------------------------------------------------------------------------------------------- 5274 /// Mapi_XC_Is_OP1_TestPattern_Enabled 5275 /// @ingroup XC_TEST_PATTERN 5276 /// @return MS_BOOL: TRUE - enabled, FALSED - disabled 5277 //------------------------------------------------------------------------------------------------- 5278 // MS_BOOL MApi_XC_Is_OP1_TestPattern_Enabled(void); 5279 5280 //------------------------------------------------------------------------------------------------- 5281 /// MApi_XC_Set_OP1_TestPattern 5282 /// @ingroup XC_TEST_PATTERN 5283 /// @param ePattern \b IN: select test pattern 5284 /// @param eMode \b IN: choose the patgen mode (only support E_XC_OP1_PATGEN_DISP_LB_MODE now) 5285 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL or E_APIXC_RET_FAIL_FUN_NOT_SUPPORT 5286 //------------------------------------------------------------------------------------------------- 5287 E_APIXC_ReturnValue MApi_XC_Set_OP1_TestPattern(EN_XC_OP1_PATTERN ePattern, EN_XC_OP1_PATGEN_MODE eMode); 5288 5289 //------------------------------------------------------------------------------------------------- 5290 /// MApi_XC_CheckWhiteBalancePatternModeSupport 5291 /// @ingroup XC_TEST_PATTERN 5292 /// @param eWBPatternMode \b IN: White balance Pattern gen Mode 5293 /// @return MS_BOOL: TRUE - support, FALSED - unsupport 5294 //------------------------------------------------------------------------------------------------- 5295 MS_BOOL MApi_XC_CheckWhiteBalancePatternModeSupport(EN_XC_WB_PATTERN_MODE enWBPatternMode); 5296 5297 //------------------------------------------------------------------------------------------------- 5298 /// MApi_XC_SetHLinearScaling 5299 /// @ingroup XC_PQ 5300 /// @param bEnable \b IN: enable or disalbe h linear scaling 5301 /// @param bSign \b IN: sign of delta 5302 /// @param u16Delta \b IN: the slop of scaling 5303 /// @param eWindow \b IN: which window we are going to set 5304 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL or E_APIXC_RET_FAIL_FUN_NOT_SUPPORT 5305 //------------------------------------------------------------------------------------------------- 5306 E_APIXC_ReturnValue MApi_XC_SetHLinearScaling(MS_BOOL bEnable, MS_BOOL bSign, MS_U16 u16Delta, SCALER_WIN eWindow); 5307 5308 //------------------------------------------------------------------------------------------------- 5309 /// XC power state control for fastboot 5310 /// @ingroup XC_UTILITY 5311 /// @param u16PowerState \b IN: power state 5312 /// @return result of power state control. 5313 //------------------------------------------------------------------------------------------------- 5314 MS_U32 MApi_XC_SetPowerState(EN_POWER_MODE enPowerState); 5315 5316 //------------------------------------------------------------------------------------------------- 5317 /// MApi_XC_EnableT3D 5318 /// @ingroup XC_3D 5319 /// @param bEnable \b IN: enable or disalbe T3D 5320 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL or E_APIXC_RET_FAIL_FUN_NOT_SUPPORT 5321 //------------------------------------------------------------------------------------------------- 5322 E_APIXC_ReturnValue MApi_XC_EnableT3D(MS_BOOL bEnable); 5323 5324 5325 //------------------------------------------------------------------------------------------------- 5326 /// MApi_XC_Set_FRC_InputTiming 5327 /// @ingroup XC_FRC 5328 /// @param enFRC_InputTiming \b IN: FRC input timing 5329 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL or E_APIXC_RET_FAIL_FUN_NOT_SUPPORT 5330 //------------------------------------------------------------------------------------------------- 5331 E_APIXC_ReturnValue MApi_XC_Set_FRC_InputTiming(E_XC_FRC_InputTiming enFRC_InputTiming); 5332 5333 //------------------------------------------------------------------------------------------------- 5334 /// MApi_XC_Get_FRC_InputTiming 5335 /// @ingroup XC_FRC 5336 /// @param penFRC_InputTiming \b IN: FRC input timing 5337 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL or E_APIXC_RET_FAIL_FUN_NOT_SUPPORT 5338 //------------------------------------------------------------------------------------------------- 5339 E_APIXC_ReturnValue MApi_XC_Get_FRC_InputTiming(E_XC_FRC_InputTiming *penFRC_InputTiming); 5340 5341 //------------------------------------------------------------------------------------------------- 5342 /// MApi_XC_Get_VirtualBox_Info 5343 /// @ingroup XC_SCALER 5344 /// @param pstXC_VboxInfo \b IN: virtual box info 5345 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL or E_APIXC_RET_FAIL_FUN_NOT_SUPPORT 5346 //------------------------------------------------------------------------------------------------- 5347 E_APIXC_ReturnValue MApi_XC_Get_VirtualBox_Info(XC_VBOX_INFO *pstXC_VboxInfo); 5348 5349 5350 5351 //------------------------------------------------------------------------------------------------- 5352 /// MApi_XC_Set_OSD_Detect 5353 /// @ingroup XC_OSD 5354 /// @param bEnable \b IN: enable or disalbe OSD detect 5355 /// @param Threhold \b IN: setup the threashold 5356 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL or E_APIXC_RET_FAIL_FUN_NOT_SUPPORT 5357 //------------------------------------------------------------------------------------------------- 5358 E_APIXC_ReturnValue MApi_XC_Set_OSD_Detect(MS_BOOL bEnable, MS_U32 Threhold); 5359 //------------------------------------------------------------------------------------------------- 5360 /// MApi_XC_Get_OSD_Detect 5361 /// @ingroup XC_OSD 5362 /// @param bEnable \b IN: enable or disalbe OSD detect 5363 /// @param Threhold \b IN: setup the threashold 5364 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL or E_APIXC_RET_FAIL_FUN_NOT_SUPPORT 5365 //------------------------------------------------------------------------------------------------- 5366 E_APIXC_ReturnValue MApi_XC_Get_OSD_Detect(MS_BOOL *pbOSD); 5367 5368 //------------------------------------------------------------------------------------------------- 5369 /// Get XC work mode: 2K2K mode or normal mode 5370 /// @ingroup XC_FRC 5371 /// @return MS_BOOL: TRUE - 2K2K mode, FALSE - Normal mode 5372 //------------------------------------------------------------------------------------------------- 5373 MS_BOOL MApi_XC_Is2K2KToFrcMode(void); 5374 5375 //------------------------------------------------------------------------------------------------- 5376 /// Set XC work mode: 2P mode or 4K2K@50/60Hz 5377 /// @return MS_BOOL: TRUE - Success, FALSE - Fail 5378 //------------------------------------------------------------------------------------------------- 5379 //MS_BOOL MApi_XC_Set_2P_Mode(MS_BOOL bEnable,SCALER_WIN eWindow); 5380 5381 #ifdef UFO_XC_TEST_PATTERN 5382 //------------------------------------------------------------------------------------------------- 5383 /// To generate designated test pattern,you should follow the following example 5384 /// Ex: 5385 /// XC_SET_IPMUX_TESTPATTERN_t ipmux_test_pattern; 5386 /// ipmux_test_pattern.bEnable = TRUE; 5387 /// ipmux_test_pattern.u16R_CR_Data = xxx; 5388 /// ipmux_test_pattern.u16G_Y_Data = xxx; 5389 /// ipmux_test_pattern.u16B_CB_Data = xxx; 5390 /// MApi_XC_GenerateTestPattern(E_XC_IPMUX_PATTERN_MODE,(void *)&ipmux_test_pattern,sizeof(XC_SET_IPMUX_TESTPATTERN_t)); 5391 /// ------------------------------------------------------------------------------------------------ 5392 /// @param ePatternMode \b IN: pattern type 5393 /// @param para \b IN: test pattern struct point 5394 /// @param u16Length \b IN: data length 5395 /// ePatternMode = E_XC_ADC_PATTERN_MODE; para = p_XC_SET_ADC_TESTPATTERN_t struct point; 5396 /// ePatternMode = E_XC_IPMUX_PATTERN_MODE; para = p_XC_SET_IPMUX_TESTPATTERN_t struct point; 5397 /// ePatternMode = E_XC_IP1_PATTERN_MODE; para = p_XC_SET_IP1_TESTPATTERN_t struct point; 5398 /// ePatternMode = E_XC_OP_PATTERN_MODE; para = p_XC_SET_OP_TESTPATTERN_t struct point; 5399 /// ePatternMode = E_XC_VOP_PATTERN_MODE; para = p_XC_SET_VOP_TESTPATTERN_t struct point; 5400 /// ePatternMode = E_XC_VOP2_PATTERN_MODE; para = p_XC_SET_VOP2_TESTPATTERN_t struct point; 5401 /// ePatternMode = E_XC_MOD_PATTERN_MODE; para = p_XC_SET_MOD_TESTPATTERN_t struct point; 5402 //------------------------------------------------------------------------------------------------- 5403 void SYMBOL_WEAK MApi_XC_GenerateTestPattern (EN_XC_TEST_PATTERN_MODE ePatternMode,void* para, MS_U16 u16Length); 5404 #endif 5405 5406 //================================ Obsolete Function Start ======================================= 5407 //------------------------------------------------------------------------------------------------- 5408 /// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Alert !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 5409 /// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Alert !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 5410 /// !!! below function will be "REMOVED" or "REFACTORING" later, please do not use it !!!!!!!!! 5411 //------------------------------------------------------------------------------------------------- 5412 5413 //------------------------------------------------------------------------------------------------- 5414 /// mvideo_sc_get_output_vfreq 5415 /// @ingroup XC_ToBeRemove 5416 //------------------------------------------------------------------------------------------------- 5417 // MS_U16 mvideo_sc_get_output_vfreq(void); //Replaced by MApi_XC_GetOutputVFreqX100 5418 //------------------------------------------------------------------------------------------------- 5419 /// MApi_XC_Get_Current_OutputVFreqX100 5420 /// @ingroup XC_ToBeRemove 5421 //------------------------------------------------------------------------------------------------- 5422 MS_U32 MApi_XC_Get_Current_OutputVFreqX100(void); //Replaced by MApi_XC_GetOutputVFreqX100 5423 //------------------------------------------------------------------------------------------------- 5424 /// MApi_XC_SetMemoryWriteRequest 5425 /// @ingroup XC_ToBeRemove 5426 //------------------------------------------------------------------------------------------------- 5427 E_APIXC_ReturnValue MApi_XC_SetMemoryWriteRequest(MS_BOOL bEnable); //Replaced by MApi_XC_SetScalerMemoryRequest 5428 //------------------------------------------------------------------------------------------------- 5429 /// MApi_XC_Set_MemFmt 5430 /// @ingroup XC_ToBeRemove 5431 //------------------------------------------------------------------------------------------------- 5432 // MS_BOOL MApi_XC_Set_MemFmt(MS_XC_MEM_FMT eMemFmt); 5433 //------------------------------------------------------------------------------------------------- 5434 /// MApi_XC_SetOutputAdjustSetting 5435 /// @ingroup XC_ToBeRemove 5436 //------------------------------------------------------------------------------------------------- 5437 // E_APIXC_ReturnValue MApi_XC_SetOutputAdjustSetting(XC_OUTPUT_TIMING_ADJUST_SETTING *stAdjSetting); // Replaced by MApi_XC_SetExPanelInfo 5438 //------------------------------------------------------------------------------------------------- 5439 /// msAPI_Scaler_FPLL_FSM 5440 /// @ingroup XC_ToBeRemove 5441 //------------------------------------------------------------------------------------------------- 5442 // void msAPI_Scaler_FPLL_FSM(SCALER_WIN eWindow); 5443 //------------------------------------------------------------------------------------------------- 5444 /// MApi_XC_EnableMirrorMode 5445 /// @ingroup XC_ToBeRemove 5446 //------------------------------------------------------------------------------------------------- 5447 void MApi_XC_EnableMirrorMode( MS_BOOL bEnable ); 5448 //------------------------------------------------------------------------------------------------- 5449 /// MApi_XC_EnableMirrorMode2 5450 /// @ingroup XC_ToBeRemove 5451 //------------------------------------------------------------------------------------------------- 5452 void MApi_XC_EnableMirrorMode2( MirrorMode_t eMirrorMode ); 5453 //------------------------------------------------------------------------------------------------- 5454 /// MApi_XC_GetMirrorModeType 5455 /// @ingroup XC_ToBeRemove 5456 //------------------------------------------------------------------------------------------------- 5457 MirrorMode_t MApi_XC_GetMirrorModeType( void ); 5458 //------------------------------------------------------------------------------------------------- 5459 /// MApi_XC_set_FD_Mask 5460 /// @ingroup XC_ToBeRemove 5461 //------------------------------------------------------------------------------------------------- 5462 void MApi_XC_set_FD_Mask(MS_BOOL bEnable); 5463 //------------------------------------------------------------------------------------------------- 5464 /// MApi_XC_Get_FD_Mask 5465 /// @ingroup XC_ToBeRemove 5466 //------------------------------------------------------------------------------------------------- 5467 MS_BOOL MApi_XC_Get_FD_Mask(void); 5468 //------------------------------------------------------------------------------------------------- 5469 /// MApi_XC_GetAccurateVFreqx1K is obsolete, please use MApi_XC_CalculateVFreqx10 instead! 5470 /// the return vfreq of this function is not accurate when signal is not stable or have noise, so it's not 5471 /// suitable as interface for Ap use at any time. 5472 /// @ingroup XC_ToBeRemove 5473 //------------------------------------------------------------------------------------------------- 5474 5475 //------------------------------------------------------------------------------------------------- 5476 MS_U32 MApi_XC_GetAccurateVFreqx1K(SCALER_WIN eWindow); 5477 //================================ Obsolete Function End ======================================= 5478 5479 //------------------------------------------------------------------------------------------------- 5480 /// MApi_XC_IsSupport2StepScaling 5481 /// @return MS_BOOL: TRUE - Support 2 Step Scaling, FALSE - Not Support 2 Step Scaling 5482 //------------------------------------------------------------------------------------------------- 5483 MS_BOOL MApi_XC_IsSupport2StepScaling(void); 5484 5485 //------------------------------------------------------------------------------------------------- 5486 /// Set Scaler IP input test pattern. 5487 /// @ingroup XC_TEST_PATTERN 5488 /// @param u8Enable \b IN: Set 1 to enable. Bit(0) is horizontal pattern and Bit(1) is vertical pattern 5489 /// @param u6Pattern_type \b IN: The pattern type. (the width of each pattern) 5490 /// @param eWindow \b IN: @ref SCALER_WIN 5491 //------------------------------------------------------------------------------------------------- 5492 void MApi_XC_SetIP1TestPattern(MS_U8 u8Enable, MS_U16 u6Pattern_type, SCALER_WIN eWindow); 5493 5494 //------------------------------------------------------------------------------------------------- 5495 /// MApi_XC_Set_OP2_Pattern 5496 /// @ingroup XC_TEST_PATTERN 5497 /// @param bEnable \b IN: enable/disable OP2 pattern 5498 /// @param u16R_Data \b IN: when enable OP2 patter ,Data Generator for r_cr constant 5499 /// @param u16G_Data \b IN: when enable OP2 patter ,Data Generator for g_y constant 5500 /// @param u16B_Data \b IN: when enable OP2 patter ,Data Generator for b_cb constant 5501 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL or E_APIXC_RET_FAIL_FUN_NOT_SUPPORT 5502 //------------------------------------------------------------------------------------------------- 5503 E_APIXC_ReturnValue MApi_XC_Set_OP2_Pattern(MS_BOOL bEnable, MS_U16 u16R_Data, MS_U16 u16G_Data ,MS_U16 u16B_Data); 5504 5505 //------------------------------------------------------------------------------------------------- 5506 /// When the muteType is enabled, the vsync will be skipped and the registers will be written directly 5507 /// @param enMuteType \b IN: the mute type could be MainWindow, SubWindow and Panel 5508 /// @param bIsForceWrite \b IN: Force write or not 5509 //------------------------------------------------------------------------------------------------- 5510 E_APIXC_ReturnValue SYMBOL_WEAK MApi_XC_SetForceWrite( EN_MUTE_TYPE enMuteType, MS_BOOL bIsForceWrite); 5511 5512 //------------------------------------------------------------------------------------------------- 5513 /// Get the status of enMuteType which is writen directly or not. 5514 /// @param enMuteType \b IN: the mute type could be MainWindow, SubWindow and Panel 5515 //------------------------------------------------------------------------------------------------- 5516 MS_BOOL SYMBOL_WEAK MApi_XC_GetForceWrite( EN_MUTE_TYPE enMuteType); 5517 5518 //------------------------------------------------------------------------------------------------- 5519 /// Video Playback Controller. 5520 /// @param u32Cmd \b IN:cmd type 5521 /// @param pbuf \b IN:input value depend on cmd type 5522 /// @param u32Cmd \b IN:input structure size for validatition 5523 /// @return E_APIXC_RET_OK or E_APIXC_RET_FAIL 5524 //------------------------------------------------------------------------------------------------- 5525 E_APIXC_ReturnValue SYMBOL_WEAK MApi_XC_VideoPlaybackCtrl(MS_U32 u32Cmd,void *pCmdArgs,MS_U32 u32CmdArgsSize); 5526 5527 5528 #ifdef __cplusplus 5529 } 5530 #endif 5531 5532 #endif /* _API_XC_H_ */ 5533 5534 5535