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 /// @file apiXC_DWIN.h 97 /// @brief MStar XC_DWIN Driver Interface 98 /// @author MStar Semiconductor Inc. 99 /// @version 1.0 100 /////////////////////////////////////////////////////////////////////////////// 101 102 //------------------------------------------------- 103 /*! \defgroup Video Video modules 104 105 * \defgroup XC_DWIN XC_DWIN interface 106 * \ingroup Video 107 108 DIP is a video capture function ,the whole function block separate four part,source select, clip window, HV scaling down , output window.\n 109 110 <b> Fucntion block </b> \n 111 \image html apiXC_DWIN_pic1.png 112 113 <b> Source select </b> \n 114 \image html apiXC_DWIN_pic3.png 115 116 <b> Clip window , HV scaling down , output window</b> \n 117 \image html apiXC_DWIN_pic4.png 118 119 <b> API call flow </b> \n 120 \image html apiXC_DWIN_pic2.png 121 122 * \defgroup DIP_INIT DIP init related functions 123 * \ingroup XC_DWIN 124 125 * \defgroup DIP_RESOURCE DIP resource related functions 126 * \ingroup XC_DWIN 127 128 * \defgroup DIP_SET_WINDOW DIP set window related functions 129 * \ingroup XC_DWIN 130 131 * \defgroup DIP_SET_PROPERTY DIP set properity related functions 132 * \ingroup XC_DWIN 133 134 * \defgroup DIP_SET_COLOR_TRANSFORM DIP set color transform properity functions 135 * \ingroup XC_DWIN 136 137 * \defgroup DIP_SET_WINPROPERTY DIP set window properity related functions 138 * \ingroup XC_DWIN 139 140 * \defgroup DIP_INTERRUPT DIP interrupt related functions 141 * \ingroup XC_DWIN 142 143 * \defgroup DIP_TRIGGER DIP trigger related functions 144 * \ingroup XC_DWIN 145 146 * \defgroup DIP_GET_BUFINFO DIP get info related functions 147 * \ingroup XC_DWIN 148 149 * \defgroup DIP_POWER_STATE DIP suspend and resume related functions 150 * \ingroup XC_DWIN 151 152 * \defgroup DIP_ToBeRemove DIP api to be removed 153 * \ingroup XC_DWIN 154 155 */ 156 //------------------------------------------------- 157 158 159 160 161 #ifndef APIXC_DWIN_H 162 #define APIXC_DWIN_H 163 #ifdef __cplusplus 164 extern "C" 165 { 166 #endif 167 #include "MsCommon.h" 168 #include "mhal_cmdq.h" 169 //#include "mvideo_context.h" 170 //============================================================================== 171 172 #include "ULog.h" 173 174 // Debug Logs, level form low(INFO) to high(FATAL, always show) 175 // Function information, ex function entry 176 #define XC_INFO(x, args...) ULOGI("DIP API", x, ##args) 177 // Warning, illegal paramter but can be self fixed in functions 178 #define XC_WARN(x, args...) ULOGW("DIP API", x, ##args) 179 // Need debug, illegal paramter. 180 #define XC_DBUG(x, args...) ULOGD("DIP API", x, ##args) 181 // Error, function will be terminated but system not crash 182 #define XC_ERR(x, args...) ULOGE("DIP API", x, ##args) 183 // Critical, system crash. (ex. assert) 184 #define XC_FATAL(x, args...) ULOGF("DIP API", x, ##args) 185 186 //============================================================================== 187 #define MAX_BUFF_CNT 8UL 188 #define AUTO_BUFF_CNT 0UL 189 /// Define window type for DIP 190 typedef enum 191 { 192 DIP_WINDOW = 0, ///< DIP window 193 DWIN0_WINDOW = 1, 194 DWIN1_WINDOW = 2, 195 MAX_DIP_WINDOW /// The max support window 196 }SCALER_DIP_WIN; 197 198 typedef enum 199 { 200 E_XC_DIP_RGB_SWAPTO_BGR = 0, ///< RGB Swap to BGR 201 E_XC_DIP_RGB_SWAP_MAX ///< The max support format 202 }EN_XC_DIP_RGB_SWAP_TYPE; 203 204 /// DIP source data format 205 typedef enum 206 { 207 /// YCrYCb. 208 DIP_DATA_FMT_YUV422 = 0, 209 /// RGB domain 210 DIP_DATA_FMT_RGB565, 211 /// RGB domain 212 DIP_DATA_FMT_ARGB8888, 213 /// YUV420 HVD tile 214 DIP_DATA_FMT_YUV420, 215 /// YC separate 422 216 DIP_DATA_FMT_YC422, 217 /// YUV420 H265 tile 218 DIP_DATA_FMT_YUV420_H265, 219 /// YUV420 H265_10bits tile 220 DIP_DATA_FMT_YUV420_H265_10BITS, 221 /// YUV420 planer 222 DIP_DATA_FMT_YUV420_PLANER, 223 /// YUV420 semi planer 224 DIP_DATA_FMT_YUV420_SEMI_PLANER, 225 /// YUV422 2.5D DI Top field 226 DIP_DATA_FMT_YUV422_MED_DI_FIELDTYPE_TOP, 227 /// YUV422 2.5D DI Bottom field 228 DIP_DATA_FMT_YUV422_MED_DI_FIELDTYPE_BOTTOM, 229 /// YUV420 2.5D DI Top field 230 DIP_DATA_FMT_YUV420_MED_DI_FIELDTYPE_TOP, 231 /// YUV420 2.5D DI Bottom field 232 DIP_DATA_FMT_YUV420_MED_DI_FIELDTYPE_BOTTOM, 233 DIP_DATA_FMT_MAX 234 } EN_XC_DIP_DATA_FMT; 235 236 /// DIP tile block 237 typedef enum 238 { 239 DIP_TILE_BLOCK_R_NONE = 0x0, 240 DIP_TILE_BLOCK_W_NONE = 0x1, 241 DIP_TILE_BLOCK_R_16_32 = 0x2, 242 DIP_TILE_BLOCK_W_16_32 = 0x3, 243 DIP_TILE_BLOCK_R_32_16 = 0x4, 244 DIP_TILE_BLOCK_W_32_16 = 0x5, 245 DIP_TILE_BLOCK_R_32_32 = 0x6, 246 DIP_TILE_BLOCK_W_32_32 = 0x7, 247 }EN_XC_DIP_TILE_BLOCK; 248 /// DIP scan mode 249 typedef enum 250 { 251 /// progessive. 252 DIP_SCAN_MODE_PROGRESSIVE, 253 /// interlace. 254 DIP_SCAN_MODE_extern, 255 } EN_XC_DIP_SCAN_MODE; 256 257 typedef enum 258 { 259 DIP_CAP_NOT_EXIST = 0x0, 260 DIP_CAP_EXIST = 0x1, 261 DIP_CAP_420TILE = 0x2, 262 DIP_CAP_SCALING_DOWN = 0x4, 263 DIP_CAP_MIRROR = 0x8, 264 DIP_CAP_DIPR = 0x10, 265 DIP_CAP_R2Y = 0x20, 266 DIP_CAP_OP1_CAPTURE = 0x40, 267 //not support OP1 capture when traveling main source with PIP mode 268 DIP_CAP_OP1_CAPTURE_V1 = 0x40, 269 //support OP1 capture in all case 270 DIP_CAP_OP1_CAPTURE_V2 = 0x80, 271 DIP_CAP_SCALING_UP = 0x100, 272 DIP_CAP_OSD_BLENDING = 0x200, 273 DIP_CAP_OC_CAPTURE = 0x400, 274 DIP_CAP_SC2_NON_SCALING = 0x800, 275 }EN_XC_DIP_CAP; 276 277 typedef enum 278 { 279 E_XC_DIP_VOP2 =0x00, 280 E_XC_DIP_OP2 =0x01, 281 E_XC_DIP_VIP =0x02, 282 E_XC_DIP_BRI =0x03, 283 E_XC_DIP_NONE , 284 }EN_XC_DIP_OP_CAPTURE; 285 286 typedef enum 287 { 288 E_XC_DIP_ROTATION_270 =0x00, 289 E_XC_DIP_ROTATION_90 =0x01, 290 }EN_XC_DIP_ROTATION; 291 292 // Define DEBUG level. 293 typedef enum 294 { 295 // DIP DEBUG LEVEL LOW. Just printf error message. 296 E_XC_DIP_Debug_Level_LOW = 0, 297 // GOP DEBUG LEVEL Medium. printf warning message and error message. 298 E_XC_DIP_Debug_Level_MED = 1, 299 // GOP DEBUG LEVEL hIGH. printf all message with function. 300 E_XC_DIP_Debug_Level_HIGH = 2, 301 } EN_XC_DIP_DEBUG_LEVEL; 302 303 typedef enum 304 { 305 E_XC_DIP_CMDQ_BEGIN = 0, 306 E_XC_DIP_CMDQ_END = 1, 307 }EN_XC_DIP_CMDQ_ACTION; 308 309 typedef struct DLL_PACKED 310 { 311 MS_U8 u8BufCnt; 312 MS_PHY u32YBuf[MAX_BUFF_CNT]; 313 MS_PHY u32CBuf[MAX_BUFF_CNT]; 314 } BUFFER_INFO; 315 316 typedef struct DLL_PACKED 317 { 318 SCALER_DIP_WIN eWindow; 319 MS_U32 u32DipChipCaps; 320 } ST_XC_DIP_CHIPCAPS; 321 322 typedef struct DLL_PACKED 323 { 324 MS_U8 u8BufCnt; 325 MS_U16 u16Width; 326 MS_U16 u16Height; 327 MS_U16 u16Pitch; 328 MS_PHY u32BufStart; 329 MS_PHY u32BufEnd; 330 SCALER_DIP_SOURCE_TYPE enSource; 331 }ST_XC_DIP_WINPROPERTY; 332 333 typedef struct DLL_PACKED 334 { 335 MS_U16 u16Width; 336 MS_U16 u16Height; 337 MS_U16 u16Pitch; 338 MS_PHY u32YBufAddr; 339 MS_PHY u32CBufAddr; 340 EN_XC_DIP_DATA_FMT enDataFmt; 341 MS_PHY u32YBufAddr10Bits; 342 MS_PHY u32CBufAddr10Bits; 343 }ST_XC_DIPR_PROPERTY; 344 345 typedef struct DLL_PACKED 346 { 347 MS_U32 ID[4]; 348 } DIPRESOURCE; 349 350 // Define DIP version control 351 typedef struct DLL_PACKED 352 { 353 MS_U32 u32version; 354 MS_U32 u32size; 355 } ST_DIPR_VER_CRL; 356 357 typedef enum 358 { 359 E_DIP_MFEDC_TILE_16_32 =0x00, 360 E_DIP_MFEDC_TILE_32_16 =0x01, 361 E_DIP_MFEDC_TILE_32_32 =0x02, 362 }EN_MFDEC_TILE_MODE; 363 364 typedef enum 365 { 366 E_XC_DIP_H26X_MODE =0x00, 367 E_XC_DIP_VP9_MODE =0x01, 368 }EN_MFDEC_VP9_MODE; 369 370 // Define DIP version control for MFDec 371 typedef struct DLL_PACKED 372 { 373 MS_U32 u32version; 374 MS_U32 u32size; 375 } ST_MFDEC_HTLB_VER_CRL; 376 377 typedef struct DLL_PACKED 378 { 379 ST_MFDEC_HTLB_VER_CRL stMFDec_HTLB_VerCtl; 380 MS_PHY u32HTLBEntriesAddr; 381 MS_U8 u8HTLBEntriesSize; 382 MS_U8 u8HTLBTableId; 383 void* pHTLBInfo; 384 } ST_DIP_MFDEC_HTLB_INFO; 385 386 // Define DIP version control 387 typedef struct DLL_PACKED 388 { 389 MS_U32 u32version; 390 MS_U32 u32size; 391 } ST_MFDEC_VER_CRL; 392 393 typedef struct DLL_PACKED 394 { 395 ST_MFDEC_VER_CRL stMFDec_VerCtl; 396 MS_BOOL bMFDec_Enable; 397 MS_U8 u8MFDec_Select; 398 MS_BOOL bHMirror; 399 MS_BOOL bVMirror; 400 EN_MFDEC_TILE_MODE enMFDec_tile_mode; 401 MS_BOOL bUncompress_mode; 402 MS_BOOL bBypass_codec_mode; 403 EN_MFDEC_VP9_MODE en_MFDecVP9_mode; 404 MS_PHY phyLuma_FB_Base; 405 MS_PHY phyChroma_FB_Base; 406 MS_U16 u16FB_Pitch; 407 MS_U16 u16StartX; 408 MS_U16 u16StartY; 409 MS_U16 u16HSize; 410 MS_U16 u16VSize; 411 MS_PHY phyBitlen_Base; 412 MS_U16 u16Bitlen_Pitch; 413 ST_DIP_MFDEC_HTLB_INFO stMFDec_HTLB_Info; 414 void* pMFDecInfo; 415 } ST_DIP_MFDEC_INFO; 416 417 typedef enum 418 { 419 //one top field in one address 420 E_DIP_3DDI_TOP_SINGLE_FIELD =0x00, 421 //one bottom field in one address 422 E_DIP_3DDI_BOTTOM_SINGLE_FIELD =0x01, 423 //stagger Both field in one address, keep top field 424 E_DIP_3DDI_TOP_BOTH_FIELD_STAGGER =0x02, 425 //stagger Both field in one address, keep bottom field 426 E_DIP_3DDI_BOTTOM_BOTH_FIELD_STAGGER =0x03, 427 //stagger Both field in one address, DIP 2.5D DI top field 428 E_DIP_MED_DI_TOP_BOTH_FIELD_STAGGER =0x04, 429 //stagger Both field in one address, DIP 2.5D DI bottom field 430 E_DIP_MED_DI_BOTTOM_BOTH_FIELD_STAGGER =0x05, 431 //two field in two address, DI top field 432 E_DIP_MED_DI_TOP_BOTH_FIELD_SEPARATE =0x06, 433 //two field in two address, DI bottom field 434 E_DIP_MED_DI_BOTTOM_BOTH_FIELD_SEPARATE =0x07, 435 }EN_DIP_DI_FIELD; 436 437 typedef struct DLL_PACKED 438 { 439 MS_PHY phyDIInitAddr; 440 MS_U32 u32DIInitSize; 441 }ST_DIPR_DI_INIT_INFO; 442 443 typedef struct DLL_PACKED 444 { 445 MS_PHY phyDI_BufAddr; //DI buf address 446 MS_U32 u32DI_BufSize; //DI buf size 447 MS_U8 u8DIBufCnt; 448 }ST_DIP_DI_NWAY_BUF_INFO; 449 450 typedef struct DLL_PACKED 451 { 452 MS_BOOL bEnableDI; 453 MS_BOOL bInitDI; 454 ST_DIPR_DI_INIT_INFO stInitInfo; 455 MS_U8 u8NwayIndex; 456 EN_DIP_DI_FIELD enDI_Field; 457 MS_PHY phyBotYBufAddr; 458 MS_PHY phyBotCBufAddr; 459 MS_PHY phyBotYBufAddr10Bits; 460 MS_PHY phyBotCBufAddr10Bits; 461 MS_BOOL bEnableBob; 462 MS_BOOL bEnaNwayInfoRefresh; 463 ST_DIP_DI_NWAY_BUF_INFO *stDINwayBufInfo; 464 MS_U8 u8NwayBufCnt; 465 } ST_DIP_DI_SETTING; 466 467 // Define DIP version control 468 typedef struct DLL_PACKED 469 { 470 MS_U32 u32version; 471 MS_U32 u32size; 472 } ST_DIPR_3DDI_VER_CRL; 473 474 typedef struct DLL_PACKED 475 { 476 ST_DIPR_3DDI_VER_CRL stDipr3DDI_VerCtl; 477 void* pDIPR3DDISetting; 478 } ST_DIP_DIPR_3DDI_SETTING; 479 480 typedef struct DLL_PACKED 481 { 482 ST_DIPR_VER_CRL stDIPR_VerCtl; 483 ST_XC_DIPR_PROPERTY stDIPRProperty; 484 ST_DIP_MFDEC_INFO stDIPR_MFDecInfo; 485 ST_DIP_DIPR_3DDI_SETTING stDIPR3DDISetting; 486 void* pDIPRSetting; 487 }ST_XC_DIPR_PROPERTY_EX; 488 489 //----------------- 490 // DIP_RESOURCE 491 //----------------- 492 //------------------------------------------------------------------------------------------------- 493 /// Query DIP resource avaliable or not 494 /// @ingroup DIP_RESOURCE 495 /// @param eWindow \b IN: DIP number 496 /// @return E_APIXC_RET_OK - Success 497 /// @return E_APIXC_RET_FAIL - Failure 498 //------------------------------------------------------------------------------------------------- 499 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_QueryResource(SCALER_DIP_WIN eWindow); 500 501 502 //------------------------------------------------------------------------------------------------- 503 /// Get DIP resource 504 /// @ingroup DIP_RESOURCE 505 /// @param eWindow \b IN: DIP number 506 /// @return E_APIXC_RET_OK - Success 507 /// @return E_APIXC_RET_FAIL - Failure 508 //------------------------------------------------------------------------------------------------- 509 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_GetResource(SCALER_DIP_WIN eWindow); 510 511 512 //------------------------------------------------------------------------------------------------- 513 /// Release DIP resource 514 /// @ingroup DIP_RESOURCE 515 /// @param eWindow \b IN: DIP number 516 /// @return E_APIXC_RET_OK - Success 517 /// @return E_APIXC_RET_FAIL - Failure 518 //------------------------------------------------------------------------------------------------- 519 typedef MHAL_CMDQ_CmdqInterface_t cmd_mload_utopia_interface; 520 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_ReleaseResource(SCALER_DIP_WIN eWindow); 521 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_CMDQ_SetAction( EN_XC_DIP_CMDQ_ACTION eAction, SCALER_DIP_WIN eWindow); 522 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_CMDQ_SetOperations(cmd_mload_utopia_interface *pOps, MS_BOOL bEnable,SCALER_DIP_WIN eWindow); 523 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_InitByDIP(SCALER_DIP_WIN eWindow); 524 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetFrameBufferAddress(MS_PHY u32FBAddress, MS_PHY u32FBSize, SCALER_DIP_WIN eWindow); 525 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetInputSource(INPUT_SOURCE_TYPE_t enInputSourceType, SCALER_DIP_WIN eWindow); 526 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_GetInputSource(INPUT_SOURCE_TYPE_t *enInputSourceType, SCALER_DIP_WIN eWindow); 527 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_DisableInputSource(MS_BOOL bDisable, SCALER_DIP_WIN eWindow); 528 //----------------- 529 // DIP_SET_WINDOW 530 //----------------- 531 //------------------------------------------------------------------------------------------------- 532 /// Set DIP Clip and Scaling window 533 /// @ingroup DIP_SET_WINDOW 534 /// @param pstXC_SetWin_Info \b IN: Clip and Scaling window 535 /// @param u32InitDataLen \b IN: size of XC_SETWIN_INFO 536 /// @param eWindow \b IN: DIP number 537 /// @return E_APIXC_RET_OK - Success 538 /// @return E_APIXC_RET_FAIL - Failure 539 //------------------------------------------------------------------------------------------------- 540 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetWindow(XC_SETWIN_INFO *pstXC_SetWin_Info, MS_U32 u32InitDataLen, SCALER_DIP_WIN eWindow); 541 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_GetDEWindow(MS_WINDOW_TYPE *psWin, SCALER_DIP_WIN eWindow); 542 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetCaptureWindowVstart(MS_U16 u16Vstart, SCALER_DIP_WIN eWindow); 543 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetCaptureWindowHstart(MS_U16 u16Hstart, SCALER_DIP_WIN eWindow); 544 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetCaptureWindowVsize(MS_U16 u16Vsize, SCALER_DIP_WIN eWindow); 545 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetCaptureWindowHsize(MS_U16 u16Hsize, SCALER_DIP_WIN eWindow); 546 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_GetCaptureWindow(MS_WINDOW_TYPE* capture_win, SCALER_DIP_WIN eWindow); 547 //----------------- 548 // DIP_SET_COLOR_TRANSFORM 549 //----------------- 550 //------------------------------------------------------------------------------------------------- 551 /// Emable DIP RGB->YUV 552 /// @ingroup DIP_SET_COLOR_TRANSFORM 553 /// @param benable \b IN: Enable/Disable 554 /// @param eWindow \b IN: DIP number 555 /// @return E_APIXC_RET_OK - Success 556 /// @return E_APIXC_RET_FAIL - Failure 557 //------------------------------------------------------------------------------------------------- 558 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_EnableR2Y(MS_BOOL benable, SCALER_DIP_WIN eWindow); 559 560 //==============Set=================== 561 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SWReset(SCALER_DIP_WIN eWindow); 562 //----------------- 563 // DIP_SET_PROPERTY 564 //----------------- 565 //------------------------------------------------------------------------------------------------- 566 /// Set DIP frame rate control 567 /// @ingroup DIP_SET_PROPERTY 568 /// @param benable \b IN: Enable/Disable 569 /// @param u16In \b IN: input frame 570 /// @param u16Out \b IN: output frame 571 /// @param eWindow \b IN: DIP number 572 /// @return E_APIXC_RET_OK - Success 573 /// @return E_APIXC_RET_FAIL - Failure 574 //------------------------------------------------------------------------------------------------- 575 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_FrameRateCtrl(MS_BOOL bEnable,MS_U16 u16In,MS_U16 u16Out, SCALER_DIP_WIN eWindow); 576 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_CapOneFrame(SCALER_DIP_WIN eWindow); 577 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_CapOneFrameFast(SCALER_DIP_WIN eWindow); 578 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_ClearInt(MS_U16 u8mask, SCALER_DIP_WIN eWindow); 579 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_Ena(MS_BOOL bEnable, SCALER_DIP_WIN eWindow); 580 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_EnaInt(MS_U16 u8mask, MS_BOOL bEnable, SCALER_DIP_WIN eWindow); 581 //------------------------------------------------------------------------------------------------- 582 /// Tell DIP source is interlace or progressive 583 /// @ingroup DIP_SET_PROPERTY 584 /// @param enScanMode \b IN: interlace or progressive 585 /// @param eWindow \b IN: DIP number 586 /// @return E_APIXC_RET_OK - Success 587 /// @return E_APIXC_RET_FAIL - Failure 588 //------------------------------------------------------------------------------------------------- 589 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetSourceScanType(EN_XC_DIP_SCAN_MODE enScanMode, SCALER_DIP_WIN eWindow); 590 591 592 //------------------------------------------------------------------------------------------------- 593 /// Enable DIP write from interlace to progressive 594 /// @ingroup DIP_SET_PROPERTY 595 /// @param bEnable \b IN: Enable/Disable 596 /// @param eWindow \b IN: DIP number 597 /// @return E_APIXC_RET_OK - Success 598 /// @return E_APIXC_RET_FAIL - Failure 599 //------------------------------------------------------------------------------------------------- 600 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_EnaInterlaceWrite(MS_BOOL bEnable, SCALER_DIP_WIN eWindow); 601 602 603 //------------------------------------------------------------------------------------------------- 604 /// Set DIP output format 605 /// @ingroup DIP_SET_PROPERTY 606 /// @param fmt \b IN: output format 607 /// @param eWindow \b IN: DIP number 608 /// @return E_APIXC_RET_OK - Success 609 /// @return E_APIXC_RET_FAIL - Failure 610 //------------------------------------------------------------------------------------------------- 611 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetOutputDataFmt(EN_XC_DIP_DATA_FMT fmt, SCALER_DIP_WIN eWindow); 612 //----------------- 613 // DIP_SET_WINPROPERTY 614 //----------------- 615 //------------------------------------------------------------------------------------------------- 616 /// Set DIP input and output infomation 617 /// @ingroup DIP_SET_WINPROPERTY 618 /// @param pstDIPWinProperty \b IN: input and output infomation 619 /// @param eWindow \b IN: DIP number 620 /// @return E_APIXC_RET_OK - Success 621 /// @return E_APIXC_RET_FAIL - Failure 622 //------------------------------------------------------------------------------------------------- 623 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetDIPWinProperty(ST_XC_DIP_WINPROPERTY *pstDIPWinProperty, SCALER_DIP_WIN eWindow); 624 //------------------------------------------------------------------------------------------------- 625 /// Emable DIP YUV->RGB 626 /// @ingroup DIP_SET_COLOR_TRANSFORM 627 /// @param benable \b IN: Enable/Disable 628 /// @param eWindow \b IN: DIP number 629 /// @return E_APIXC_RET_OK - Success 630 /// @return E_APIXC_RET_FAIL - Failure 631 //------------------------------------------------------------------------------------------------- 632 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_EnableY2R(MS_BOOL bEnable, SCALER_DIP_WIN eWindow); 633 //------------------------------------------------------------------------------------------------- 634 /// Set DIP alpha value 635 /// @ingroup DIP_SET_PROPERTY_COLOR_TRANSFORM 636 /// @param u8AlphaVal \b IN: alpha value 637 /// @param eWindow \b IN: DIP number 638 /// @return E_APIXC_RET_OK - Success 639 /// @return E_APIXC_RET_FAIL - Failure 640 //------------------------------------------------------------------------------------------------- 641 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetAlpha(MS_U8 u8AlphaVal, SCALER_DIP_WIN eWindow); 642 //------------------------------------------------------------------------------------------------- 643 /// Emable DIP UV swap 644 /// @ingroup DIP_SET_COLOR_TRANSFORM 645 /// @param benable \b IN: Enable/Disable 646 /// @param eWindow \b IN: DIP number 647 /// @return E_APIXC_RET_OK - Success 648 /// @return E_APIXC_RET_FAIL - Failure 649 //------------------------------------------------------------------------------------------------- 650 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SwapUV(MS_BOOL bEnable, SCALER_DIP_WIN eWindow); 651 652 653 //------------------------------------------------------------------------------------------------- 654 /// Emable DIP YC swap 655 /// @ingroup DIP_SET_COLOR_TRANSFORM 656 /// @param benable \b IN: Enable/Disable 657 /// @param eWindow \b IN: DIP number 658 /// @return E_APIXC_RET_OK - Success 659 /// @return E_APIXC_RET_FAIL - Failure 660 //------------------------------------------------------------------------------------------------- 661 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SwapYC(MS_BOOL bEnable, SCALER_DIP_WIN eWindow); 662 663 664 //------------------------------------------------------------------------------------------------- 665 /// Emable DIP RGB swap 666 /// @ingroup DIP_SET_PROPERTY_COLOR_TRANSFORM 667 /// @param benable \b IN: Enable/Disable 668 /// @param enSwapType \b IN: RGB swap type 669 /// @param eWindow \b IN: DIP number 670 /// @return E_APIXC_RET_OK - Success 671 /// @return E_APIXC_RET_FAIL - Failure 672 //------------------------------------------------------------------------------------------------- 673 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SwapRGB(MS_BOOL bEnable, EN_XC_DIP_RGB_SWAP_TYPE enSwapType, SCALER_DIP_WIN eWindow); 674 //------------------------------------------------------------------------------------------------- 675 /// MApi_XC_DIP_SetWinProperty_Ex 676 /// @ingroup DIP_ToBeRemove 677 //------------------------------------------------------------------------------------------------- 678 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetWinProperty_Ex(MS_U8 u8BufCnt ,MS_U16 u16Width, MS_U16 u16Height, MS_PHY u32BufStart ,MS_PHY u32BufEnd, SCALER_DIP_SOURCE_TYPE eSource,SCALER_DIP_WIN eWindow); 679 //------------------------------------------------------------------------------------------------- 680 /// Set DIP capture mux when capture from OP 681 /// @ingroup DIP_SET_PROPERTY 682 /// @param bEnable \b IN: Enable/Disable 683 /// @param eOpCapture \b IN: capture mux when capture from OP 684 /// @param eWindow \b IN: DIP number 685 /// @return E_APIXC_RET_OK - Success 686 /// @return E_APIXC_RET_FAIL - Failure 687 //------------------------------------------------------------------------------------------------- 688 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetOutputCapture(MS_BOOL bEnable,EN_XC_DIP_OP_CAPTURE eOpCapture,SCALER_DIP_WIN eWindow); 689 690 691 //------------------------------------------------------------------------------------------------- 692 /// Set DIP HV mirror 693 /// @ingroup DIP_SET_PROPERTY 694 /// @param bHMirror \b IN: Enable/Disable 695 /// @param bVMirror \b IN: Enable/Disable 696 /// @param eWindow \b IN: DIP number 697 /// @return E_APIXC_RET_OK - Success 698 /// @return E_APIXC_RET_FAIL - Failure 699 //------------------------------------------------------------------------------------------------- 700 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetMirror(MS_BOOL bHMirror,MS_BOOL bVMirror,SCALER_DIP_WIN eWindow); 701 //------------------------------------------------------------------------------------------------- 702 /// Set DIP input from DRAM information 703 /// @ingroup DIP_SET_WINPROPERTY 704 /// @param pstDIPRProperty \b IN: input from DRAM information 705 /// @param eWindow \b IN: DIP number 706 /// @return E_APIXC_RET_OK - Success 707 /// @return E_APIXC_RET_FAIL - Failure 708 //------------------------------------------------------------------------------------------------- 709 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetDIPRProperty(ST_XC_DIPR_PROPERTY *pstDIPRProperty,SCALER_DIP_WIN eWindow); 710 //------------------------------------------------------------------------------------------------- 711 /// Set DIP input from DRAM or VDEC information 712 /// @ingroup DIP_SET_WINPROPERTY 713 /// @param pstDIPRProperty_ex \b IN: input from DRAM or VDEC information 714 /// @param eWindow \b IN: DIP number 715 /// @return E_APIXC_RET_OK - Success 716 /// @return E_APIXC_RET_FAIL - Failure 717 //------------------------------------------------------------------------------------------------- 718 DLL_PUBLIC SYMBOL_WEAK E_APIXC_ReturnValue MApi_XC_DIP_SetDIPRProperty_EX(ST_XC_DIPR_PROPERTY_EX *pstDIPRProperty_ex, SCALER_DIP_WIN eWindow); 719 //------------------------------------------------------------------------------------------------- 720 /// Attch interrupt call back function 721 /// @ingroup DIP_INTERRUPT 722 /// @param pIntCb \b IN: interrupt callback function 723 /// @param eWindow \b IN: DIP number 724 /// @return E_APIXC_RET_OK - Success 725 /// @return E_APIXC_RET_FAIL - Failure 726 //------------------------------------------------------------------------------------------------- 727 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_InterruptAttach(InterruptCb pIntCb,SCALER_DIP_WIN eWindow); 728 //------------------------------------------------------------------------------------------------- 729 /// De-attch interrupt call back function 730 /// @ingroup DIP_INTERRUPT 731 /// @param eWindow \b IN: DIP number 732 /// @return E_APIXC_RET_OK - Success 733 /// @return E_APIXC_RET_FAIL - Failure 734 //------------------------------------------------------------------------------------------------- 735 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_InterruptDetach(SCALER_DIP_WIN eWindow); 736 //----------------- 737 // DIP_POWER_STATE 738 //----------------- 739 //------------------------------------------------------------------------------------------------- 740 /// Set DIP suspend or resume status 741 /// @ingroup DIP_POWER_STATE 742 /// @param u16PowerState \b IN: Suspend/Resume 743 /// @return 0 - Success 744 //------------------------------------------------------------------------------------------------- 745 DLL_PUBLIC MS_U32 MApi_XC_DIP_SetPowerState(EN_POWER_MODE u16PowerState); 746 //------------------------------------------------------------------------------------------------- 747 /// Set DIP rotate 748 /// @ingroup DIP_SET_PROPERTY 749 /// @param bRotation \b IN: Enable/Disable 750 /// @param eRoDirection \b IN: rotate type 751 /// @param eTmpWindow \b IN: DIP number 752 /// @return E_APIXC_RET_OK - Success 753 /// @return E_APIXC_RET_FAIL - Failure 754 //------------------------------------------------------------------------------------------------- 755 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_Rotation(MS_BOOL bRotation,EN_XC_DIP_ROTATION eRoDirection,SCALER_DIP_WIN eTmpWindow); 756 //------------------------------------------------------------------------------------------------- 757 /// Set DIP pinpon with GOP 758 /// @ingroup DIP_SET_PROPERTY 759 /// @param bPinpon \b IN: Enable/Disable 760 /// @param u32PinponAddr \b IN: pinpon address 761 /// @param eTmpWindow \b IN: DIP number 762 /// @return E_APIXC_RET_OK - Success 763 /// @return E_APIXC_RET_FAIL - Failure 764 //------------------------------------------------------------------------------------------------- 765 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetPinpon(MS_BOOL bPinpon,MS_PHY u32PinponAddr,SCALER_DIP_WIN eWindow); 766 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_SetHVSP(MS_BOOL bSelect,SCALER_DIP_WIN eWindow); 767 DLL_PUBLIC E_APIXC_ReturnValue MApi_XC_DIP_Set420TileBlock(EN_XC_DIP_TILE_BLOCK eTileBlock,SCALER_DIP_WIN eWindow); 768 //------------------------------------------------------------------------------------------------- 769 /// Set DIP debug log level 770 /// @ingroup DIP_SET_PROPERTY 771 /// @param u8DbgLevel \b IN: EN_XC_DIP_DEBUG_LEVEL 772 /// @return E_APIXC_RET_OK - Success 773 /// @return E_APIXC_RET_FAIL - Failure 774 //------------------------------------------------------------------------------------------------- 775 DLL_PUBLIC MS_U32 MApi_XC_DIP_SetDbgLevel(EN_XC_DIP_DEBUG_LEVEL u8DbgLevel); 776 //==============Get=================== 777 //------------------------------------------------------------------------------------------------- 778 /// Get interrpt frame bit-mask status 779 /// @ingroup DIP_INTERRUPT 780 /// @param eWindow \b IN: DIP number 781 /// @return MS_U16 - interrpt frame bit-mask status 782 //------------------------------------------------------------------------------------------------- 783 DLL_PUBLIC MS_U16 MApi_XC_DIP_GetIntStatus(SCALER_DIP_WIN eWindow); 784 //----------------- 785 // DIP_GET_BUFINFO 786 //----------------- 787 //------------------------------------------------------------------------------------------------- 788 /// Get DIP buffer address and size info 789 /// @ingroup DIP_GET_BUFINFO 790 /// @param eWindow \b IN: DIP number 791 /// @return BUFFER_INFO - DIP buffer address and size info 792 //------------------------------------------------------------------------------------------------- 793 DLL_PUBLIC BUFFER_INFO MApi_XC_DIP_GetBufInfo(SCALER_DIP_WIN eWindow); 794 795 //----------------- 796 // DIP_OP TEE 797 //----------------- 798 DLL_PUBLIC MS_U32 MDrv_XC_DIP_GetResourceByPipeID(MS_U32 u32PipeID, MS_U32* U32RetResNum, DIPRESOURCE* pResource); 799 DLL_PUBLIC MS_U32 MDrv_XC_DIP_ConfigPipe(MS_U32 u32PipeID, MS_U32 u32SecureDMA, MS_U32 u32OperationMode); 800 DLL_PUBLIC MS_U32 MDrv_XC_DIP_CheckPipe(MS_U32 u32PipeID, MS_U32 u32SecureDMA, MS_U32 u32OperationMode); 801 802 #ifdef __cplusplus 803 } 804 #endif 805 #endif /* APIXC_DWIN_H */ 806 807