xref: /utopia/UTPA2-700.0.x/mxlib/include/drvMVOP.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
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   drvMVOP.h
98 /// @brief  MVOP Driver Interface
99 /// @author MStar Semiconductor Inc.
100 ///////////////////////////////////////////////////////////////////////////////////////////////////
101 
102 /*!
103  \defgroup MVOP MVOP interface (drvMVOP.h)
104  \ingroup VDEC
105 
106  <b> MVOP api flow </b> \n
107    \image html drvMVOP_flow.png
108 
109  \defgroup MVOP MVOP module
110  \ingroup  MVOP
111  \defgroup MVOP_Basic MVOP_Basic
112  \ingroup MVOP
113  \defgroup MVOP_SetCommand MVOP SetCommand
114  \ingroup MVOP
115  \defgroup MVOP_GetCommand MVOP GetCommand
116  \ingroup MVOP
117  \defgroup MVOP_Debug MVOP Debug
118  \ingroup MVOP
119 */
120 
121 #ifndef _DRV_MVOP_H_
122 #define _DRV_MVOP_H_
123 
124 #ifdef __cplusplus
125 extern "C"
126 {
127 #endif
128 #include "MsDevice.h"
129 #include "UFO.h"
130 
131 //-------------------------------------------------------------------------------------------------
132 //  Driver Capability
133 //-------------------------------------------------------------------------------------------------
134 
135 
136 //-------------------------------------------------------------------------------------------------
137 //  Macro and Define
138 //-------------------------------------------------------------------------------------------------
139 /// Version string.
140 #define MSIF_MVOP_LIB_CODE              {'M','V','O','P'}    //Lib code
141 #define MSIF_MVOP_LIBVER                {'1','0'}            //LIB version
142 #define MSIF_MVOP_BUILDNUM              {'4','2'}            //Build Number
143 #define MSIF_MVOP_CHANGELIST            {'0','0','7','0','2','3','8','3'} //P4 ChangeList Number
144 
145 #define MVOP_DRV_VERSION                /* Character String for DRV/API version             */  \
146     MSIF_TAG,                           /* 'MSIF'                                           */  \
147     MSIF_CLASS,                         /* '00'                                             */  \
148     MSIF_CUS,                           /* 0x0000                                           */  \
149     MSIF_MOD,                           /* 0x0000                                           */  \
150     MSIF_CHIP,                                                                                  \
151     MSIF_CPU,                                                                                   \
152     MSIF_MVOP_LIB_CODE,                 /* IP__                                             */  \
153     MSIF_MVOP_LIBVER,                   /* 0.0 ~ Z.Z                                        */  \
154     MSIF_MVOP_BUILDNUM,                 /* 00 ~ 99                                          */  \
155     MSIF_MVOP_CHANGELIST,               /* CL#                                              */  \
156     MSIF_OS
157 
158 
159 #define _SUPPORT_IMG_OFFSET_
160 #define ENABLE_UTOPIA2_INTERFACE   1
161 #define ENABLE_MUTEX                1
162 
163 //-------------------------------------------------------------------------------------------------
164 //  Type and Structure
165 //-------------------------------------------------------------------------------------------------
166 typedef enum
167 {
168     E_MVOP_OK            = 0,
169     E_MVOP_FAIL          = 1,
170     E_MVOP_INVALID_PARAM = 2,
171     E_MVOP_NOT_INIT      = 3,
172     E_MVOP_UNSUPPORTED   = 4
173 } MVOP_Result;
174 
175 /// MVOP tile format
176 typedef enum
177 {
178     E_MVOP_TILE_8x32  = 0,
179     E_MVOP_TILE_16x32 = 1,
180     E_MVOP_TILE_NONE  = 2,
181     E_MVOP_TILE_32x16 = 3,
182     E_MVOP_TILE_32x32 = 4
183 } MVOP_TileFormat;
184 
185 /// MVOP RGB format
186 typedef enum
187 {
188     E_MVOP_RGB_565  = 0,
189     E_MVOP_RGB_888  = 1,
190     E_MVOP_RGB_NONE = 0xff
191 } MVOP_RgbFormat;
192 
193 /// MVOP input mode
194 typedef enum
195 {
196     VOPINPUT_HARDWIRE = 0,        //!< hardwire mode (MVD)
197     VOPINPUT_HARDWIRECLIP = 1,    //!< hardware clip mode (MVD)
198     VOPINPUT_MCUCTRL = 2,         //!< MCU control mode (M4VD, JPG)
199     VOPINPUT_IFRAME = 3,          //!< MCU control mode (MVD)
200 } VOPINPUTMODE;
201 
202 /// MVOP input mode
203 typedef enum
204 {
205     E_VOPMIRROR_VERTICAL      = 1,
206     E_VOPMIRROR_HORIZONTALL   =  2,
207     E_VOPMIRROR_HVBOTH       =  3,
208     E_VOPMIRROR_NONE         =  4,
209 } MVOP_DrvMirror;
210 
211 /// MVOP repeat field mode
212 typedef enum
213 {
214     E_MVOP_RPTFLD_NONE = 0,     //!< normal display top and bottom fields
215     E_MVOP_RPTFLD_TOP  = 1,     //!< top field
216     E_MVOP_RPTFLD_BOT  = 2,     //!< bottom field
217 } MVOP_RptFldMode;
218 
219 /// MVOP Output 3D Type
220 typedef enum
221 {
222     E_MVOP_OUTPUT_3D_NONE, //!< Output 2D
223     E_MVOP_OUTPUT_3D_TB,   //!< Output Top Bottom
224     E_MVOP_OUTPUT_3D_SBS,  //!< Output Side By Side
225     E_MVOP_OUTPUT_3D_LA,   //!< Output Line Alternative
226     E_MVOP_OUTPUT_3D_MAXNUM,
227 }EN_MVOP_Output_3D_TYPE;
228 
229 typedef enum
230 {
231     MVOP_MPEG4 = 0,
232     MVOP_MJPEG,
233     MVOP_H264,
234     // <ATV MM>
235     MVOP_RM, //jyliu.rm
236     MVOP_TS,
237     MVOP_MPG,
238     MVOP_UNKNOW,
239     // </ATV MM>
240 }MVOP_VIDEO_TYPE;
241 
242 
243 /// MVOP input parameter
244 typedef struct DLL_PACKED
245 {
246     MS_PHY u32YOffset;
247     MS_PHY u32UVOffset;
248     MS_U16 u16HSize;
249     MS_U16 u16VSize;
250     MS_U16 u16StripSize;
251 
252     MS_BOOL bYUV422;    //!< YUV422 or YUV420
253     MS_BOOL bSD;        //!< SD or HD
254     MS_BOOL bProgressive;   //!< Progressive or Interlace
255 
256     // in func MDrv_MVOP_Input_Mode(), bSD is used to set dc_strip[7:0].
257     // in func MDrv_MVOP_Input_Mode_Ext(), bSD is don't care and
258     //    dc_strip[7:0] is set according to Hsize
259     MS_BOOL bUV7bit;        // +S3, UV 7 bit or not
260     MS_BOOL bDramRdContd;   // +S3, continue read out or jump 32
261     MS_BOOL bField;         // +S3, Field 0 or 1 //(stbdc)for u4 bottom field enabled when bfield is true
262     MS_BOOL b422pack;       // +S3, YUV422 pack mode
263     MS_U16 u16CropX;
264     MS_U16 u16CropY;
265     MS_U16 u16CropWidth;
266     MS_U16 u16CropHeight;
267     MVOP_VIDEO_TYPE enVideoType;
268 } MVOP_InputCfg;
269 
270 
271 typedef struct DLL_PACKED
272 {
273     MS_U16 u16V_TotalCount;        ///< Vertical total count
274     MS_U16 u16H_TotalCount;        ///< Horizontal total count
275     MS_U16 u16VBlank0_Start;       ///< Vertical blank 0 start
276     MS_U16 u16VBlank0_End;         ///< Vertical blank 0 End
277     MS_U16 u16VBlank1_Start;       ///< Vertical blank 1 start
278     MS_U16 u16VBlank1_End;         ///< Vertical blank 1 End
279     MS_U16 u16TopField_Start;      ///< Top field start
280     MS_U16 u16BottomField_Start;   ///< bottom field start
281     MS_U16 u16TopField_VS;         ///< top field vsync
282     MS_U16 u16BottomField_VS;      ///< bottom field vsync
283     MS_U16 u16HActive_Start;       ///< Horizontal disaply start
284 
285     MS_BOOL bInterlace;            ///< interlace or not
286     MS_U8 u8Framerate;             ///< frame rate
287     MS_U16 u16H_Freq ;             ///< horizontal frequency
288     MS_U16 u16Num;                 ///< MVOP SYNTHESIZER numerator
289     MS_U16 u16Den;                 ///< MVOP SYNTHESIZER denumerator
290     MS_U8 u8MvdFRCType;            ///< flag for frame rate convert
291 
292     MS_U16 u16ExpFrameRate;        ///< Frame Rate
293     MS_U16 u16Width;               ///< Width
294     MS_U16 u16Height;              ///< Height
295     MS_U16 u16HImg_Start;          ///< Horizontal disaply start
296     MS_U16 u16VImg_Start0;         ///< Vertical disaply start
297     MS_U16 u16VImg_Start1;         ///< Vertical disaply start
298     MS_BOOL bHDuplicate;           ///< flag for vop horizontal duplicate
299 } MVOP_Timing;
300 
301 //Display information For GOP
302 typedef struct DLL_PACKED
303 {
304     MS_U32 VDTOT; //Output vertical total
305     MS_U32 DEVST; //Output DE vertical start
306     MS_U32 DEVEND;//Output DE Vertical end
307     MS_U32 HDTOT;// Output horizontal total
308     MS_U32 DEHST; //Output DE horizontal start
309     MS_U32 DEHEND;// Output DE horizontal end
310     MS_BOOL bInterlaceMode;
311 }MVOP_DST_DispInfo;
312 
313 //MVOP timing information from mvop registers
314 typedef struct
315 {
316     MS_U16 u16V_TotalCount;        ///< Vertical total count
317     MS_U16 u16H_TotalCount;        ///< Horizontal total count
318     MS_U16 u16VBlank0_Start;       ///< Vertical blank 0 start
319     MS_U16 u16VBlank0_End;         ///< Vertical blank 0 End
320     MS_U16 u16VBlank1_Start;       ///< Vertical blank 1 start
321     MS_U16 u16VBlank1_End;         ///< Vertical blank 1 End
322     MS_U16 u16TopField_Start;      ///< Top field start
323     MS_U16 u16BottomField_Start;   ///< bottom field start
324     MS_U16 u16TopField_VS;         ///< top field vsync
325     MS_U16 u16BottomField_VS;      ///< bottom field vsync
326     MS_U16 u16HActive_Start;       ///< Horizontal disaply start
327     MS_BOOL bInterlace;            ///< interlace or not
328     MS_BOOL bEnabled;              ///< MVOP is enabled or not
329 }MVOP_TimingInfo_FromRegisters;
330 
331 typedef enum
332 {
333     MVOP_PATTERN_NORMAL     = 0,
334     MVOP_PATTERN_COLORBAR   = 1,
335     MVOP_PATTERN_FRAMECOLOR = 2,
336     MVOP_PATTERN_YCBCR      = 3,
337     MVOP_PATTERN_Y          = 4,
338     MVOP_PATTERN_CB         = 5,
339     MVOP_PATTERN_CR         = 6,
340     MVOP_PATTERN_DEFAULT    = 7   //new pattern = (last parrtern + 1) % MVOP_PATTERN_DEFAULT
341 } MVOP_Pattern;
342 
343 typedef enum
344 {
345     MVOP_INPUT_DRAM = 0,
346     MVOP_INPUT_H264 = 1,    //SVD for T2
347     MVOP_INPUT_MVD  = 2,
348     MVOP_INPUT_RVD  = 3,
349     MVOP_INPUT_CLIP = 4,
350     MVOP_INPUT_JPD  = 5,
351     MVOP_INPUT_HVD_3DLR = 6,    ///< HVD 3D L/R mode
352     MVOP_INPUT_MVD_3DLR = 7,    ///< MVD 3D L/R mode
353     MVOP_INPUT_DRAM_3DLR= 8,
354     MVOP_INPUT_EVD = 9,
355     MVOP_INPUT_EVD_3DLR = 10,
356     MVOP_INPUT_VP9 = 11,
357     MVOP_INPUT_EVD_DV = 12,
358     MVOP_INPUT_H264_DV = 13,
359     MVOP_INPUT_UNKNOWN = -1
360 } MVOP_InputSel;
361 
362 /// MVOP VideoStat data structure
363 typedef struct DLL_PACKED
364 {
365     MS_U16 u16HorSize;
366     MS_U16 u16VerSize;
367     MS_U16 u16FrameRate;
368     MS_U8 u8AspectRate;
369     MS_U8 u8Interlace;
370     MS_U16 u16HorOffset;
371     MS_U16 u16VerOffset;
372 } MVOP_VidStat;
373 
374 /// MVOP driver info.
375 typedef struct DLL_PACKED _MVOP_DrvInfo
376 {
377     MS_U32 u32MaxSynClk;
378     MS_U32 u32MinSynClk;
379     MS_U32 u32MaxFreerunClk;
380 } MVOP_DrvInfo;
381 
382 ///MVOP driver status
383 typedef struct DLL_PACKED _MVOP_DrvStatus
384 {
385     MS_BOOL bIsInit;
386     MS_BOOL bIsEnable;
387     MS_BOOL bIsUVShift;
388     MS_BOOL bIsBlackBG;
389     MS_BOOL bIsMonoMode;
390     MS_BOOL bIsSetTiming;
391 } MVOP_DrvStatus;
392 
393 ///MVOP module enum
394 typedef enum
395 {
396     E_MVOP_MODULE_MAIN = 0,
397     E_MVOP_MODULE_SUB  = 1,
398     E_MVOP_MODULE_MAX
399 } MVOP_Module;
400 
401 ///MVOP device enum
402 typedef enum
403 {
404     E_MVOP_DEV_0    = 0,    ///< Main mvop
405     E_MVOP_DEV_1    = 1,    ///< Sub mvop
406     E_MVOP_DEV_2    = 2,    ///< 3rd mvop
407     E_MVOP_DEV_NONE = 0xff
408 } MVOP_DevID;
409 
410 ///MVOP handle to carry out MVOP info.
411 typedef struct DLL_PACKED _MVOP_Handle
412 {
413     MVOP_Module eModuleNum;
414 } MVOP_Handle;
415 
416 
417 typedef enum
418 {
419     E_MVOP_MAIN_VIEW    = 0,
420     E_MVOP_2ND_VIEW     = 0x01, ///< buffer underflow
421 } MVOP_3DView;
422 
423 typedef struct DLL_PACKED
424 {
425     MVOP_3DView eView;
426     MS_PHY u32YOffset;
427     MS_PHY u32UVOffset;
428 } MVOP_BaseAddInput;
429 
430 typedef struct DLL_PACKED
431 {
432     MS_BOOL bIsEnableLuma;
433     MS_BOOL bIsEnableChroma;
434     MS_U8 u8LumaValue;
435     MS_U8 u8ChromaValue;
436 } MVOP_VC1RangeMapInfo;
437 
438 typedef struct DLL_PACKED
439 {
440     MS_PHY u32MSBYOffset;
441     MS_PHY u32MSBUVOffset;
442     MS_PHY u32LSBYOffset;
443     MS_PHY u32LSBUVOffset;
444     MS_BOOL bProgressive;
445     MS_BOOL b422Pack;
446     MS_BOOL bEnLSB;
447 } MVOP_EVDBaseAddInput;
448 
449 typedef enum
450 {
451     E_MVOP_EVD_8BIT    = 0,
452     E_MVOP_EVD_10BIT     = 0x01, ///< buffer underflow
453 } MVOP_EVDBit;
454 
455 typedef struct DLL_PACKED
456 {
457     MS_BOOL bEnableEVD;
458     MVOP_EVDBit eEVDBit[2];
459 }MVOP_EVDFeature;
460 
461 typedef enum
462 {
463     E_MVOP_MAIN_STREAM    = 0,
464     //E_MVOP_2nd_STREAM     = 1,
465 } MVOP_StreamID;
466 
467 ///MVOP set command used by MDrv_MVOP_SetCommand()
468 typedef enum
469 {
470     E_MVOP_CMD_SET_TYPE = 0x100,
471     E_MVOP_CMD_SET_VSIZE_MIN,                   ///< 0x101 Enable vsize minimum checking
472     E_MVOP_CMD_SET_STB_FD_MASK_CLR,             ///< 0x102 Force set fd_mask to low
473     E_MVOP_CMD_SET_3DLR_INST_VBLANK,            ///< 0x103 Vertical blanking lines between L & R for 3D L/R mode.
474     E_MVOP_CMD_SET_3DLR_ALT_OUT,                ///< 0x104 Alternative lines output for 3D L/R mode. If interlace output, both view output the same field.
475     E_MVOP_CMD_SET_RGB_FMT,                     ///< 0x105 RGB format input: MVOP_RgbFormat.
476     E_MVOP_CMD_SET_SW_CTRL_FIELD_ENABLE,        ///< 0x106 Force read top or bottom field.
477     E_MVOP_CMD_SET_SW_CTRL_FIELD_DSIABLE,       ///< 0x107 Disable force read control
478     E_MVOP_CMD_SET_3DLR_2ND_CFG,                ///< 0x108 Enable supporting 2nd pitch(h/vsize) for 3D L/R mode.
479     E_MVOP_CMD_SET_VSIZE_DUPLICATE,             ///< 0x109 Enable/Disable VSize duplicate.
480     E_MVOP_CMD_SET_3DLR_ALT_OUT_SBS,            ///< 0x10A Line alternative read of 3D L/R mode, side-by-side output.
481     E_MVOP_CMD_SET_FIELD_DUPLICATE,             ///< 0x10B Repeat field for interlace source. (only input one field)
482     E_MVOP_CMD_SET_VSYNC_MODE,                  ///< 0x10C Set VSync mode (0: original; 1: new)
483     E_MVOP_CMD_SET_VSIZE_X4_DUPLICATE,          ///< 0x10D Enable/Disable VSize x4 duplicate.
484     E_MVOP_CMD_SET_HSIZE_X4_DUPLICATE,          ///< 0x10E Enable/Disable VSize x4 duplicate.
485     E_MVOP_CMD_SET_BASE_ADD_MULTI_VIEW,         ///< 0x10F Set Muiltiple view Base Address for 3D L/R mode.
486     E_MVOP_CMD_SET_FIRE_MVOP,                   ///< 0x110 Force load MVOP register in.
487     E_MVOP_CMD_SET_VC1_RANGE_MAP,               ///< 0x111 Set VC1 Range Map Luma/Chroma Address
488     E_MVOP_CMD_SET_POWER_STATE,                 ///< 0x112 Set MVOP STR(suspend/resume)
489     E_MVOP_CMD_SET_420_BW_SAVING_MODE,          ///< 0X113 Set MVOP BW SAVING MODE(0:original 1:save 1/4 bw)
490     E_MVOP_CMD_SET_EVD_BASE_ADD,                ///< 0x114 Set 10bits or 8bits base addresss for EVD.
491     E_MVOP_CMD_SET_EVD_FEATURE,                 ///< 0x115 Set EVD Mode and 10bits or 8 bits Enable.
492     E_MVOP_CMD_SET_MVD_LATE_REPEAT,             ///<0x116 Set repeat previous frame if HVD/MVD can not finish vsync.
493 #if defined(UFO_PUBLIC_HEADER_300) || defined(UFO_PUBLIC_HEADER_500) || defined(UFO_PUBLIC_HEADER_500_3) || defined(UFO_PUBLIC_HEADER_700)
494     E_MVOP_CMD_SET_HANDSHAKE_MODE,              ///<0x117 TV chip support handshake mode after muji and monet.
495     E_MVOP_CMD_SET_FRC_OUTPUT,                  ///<0x118 Reset MVOP output timing.
496 #endif
497     E_MVOP_CMD_SET_XC_GEN_TIMING,               ///<0x119  Set timing from xc(true) or from mvop(false).
498 #if defined(UFO_PUBLIC_HEADER_300) || defined(UFO_PUBLIC_HEADER_500) || defined(UFO_PUBLIC_HEADER_700)
499     E_MVOP_CMD_SET_RESET_SETTING,               ///<0x11A Reset mvop setting from for exit.
500 #endif
501 #if defined(UFO_PUBLIC_HEADER_300) || defined(UFO_PUBLIC_HEADER_500)
502     E_MVOP_CMD_SET_XC_H_DOWN_SCALE,             ///<0x11B Set XC Is Hsize dowb scaling.
503 #endif
504     E_MVOP_CMD_SET_SEL_OP_FIELD,                ///<0x11B  Set mvop output filed (new for sub).
505     E_MVOP_CMD_SET_SIZE_FROM_MVD,               ///<0x11C  Set mvop output h/w size from vdec (new for sub).
506     E_MVOP_CMD_SET_CROP_START_POS,              ///<0x11D Set mvop crop start x/y (new for sub).
507     E_MVOP_CMD_SET_IMAGE_WIDTH_HEIGHT,          ///<0x11E Set mvop crop  x/y size (new for sub).
508     E_MVOP_CMD_SET_INV_OP_VS,                   ///<0x11F Set mvop vsync inverse (new for sub).
509     E_MVOP_CMD_SET_FORCE_TOP,                   ///<0x120 Set mvop OP only top field (new for sub).
510 #if defined(UFO_PUBLIC_HEADER_212)
511     E_MVOP_CMD_SET_10B_8B_DITHER,               ///<0x11E Set mvop 10 bits to 8 bits dither mode.
512     E_MVOP_CMD_SET_HANDSHAKE_MODE,              ///<0x11F TV chip support handshake mode after muji and monet.
513     E_MVOP_CMD_SET_FRC_OUTPUT,                  ///<0x120 Reset MVOP output timing.
514 #endif
515 #if defined(UFO_PUBLIC_HEADER_500)
516     E_MVOP_CMD_SET_MVOP_2P,                     ////<0x11C Set mvop 2p mode, for macan ve sw patch:2580x1440.
517 #endif
518 #if defined(UFO_PUBLIC_HEADER_500) || defined(UFO_PUBLIC_HEADER_700)
519     E_MVOP_CMD_SET_STREAM_INFO,                 ////<0x121 Set stream infomation before inputcfg and outputcfg, clear in the end of outputcfg.
520 #endif
521     E_MVOP_CMD_SET_FORCE_P_MODE,                ////<0x122 Set MVOP is force p mode for bbc ip change.
522     E_MVOP_CMD_SET_EXT_FPS,                     ////<0x123 Set MVOP is fps before setoutputcfg.
523     E_MVOP_CMD_SET_INTERLACE_FIELD_MODE,        ////<0x124
524     E_MVOP_CMD_SET_UV_SWAP,                     ////<0x125 UV Swap: enable for yvyu
525     E_MVOP_CMD_SET_MFDEC_INFO,                      ///<0x12D Set MVOP MFDEC  by MCU mode
526 
527     E_MVOP_CMD_GET_TYPE = 0x400,
528     E_MVOP_CMD_GET_3DLR_ALT_OUT,                ///< 0x401 Query if it is 3D L/R alternative lines output.
529     E_MVOP_CMD_GET_MIRROR_MODE,                 ///< 0x402 Get Mirror Mode
530     E_MVOP_CMD_GET_3DLR_2ND_CFG,                ///< 0x403 Get if 3D LR 2nd pitch is enabled.
531     E_MVOP_CMD_GET_VSIZE_DUPLICATE,             ///< 0x404 Get if VSize duplicate is enabled.
532     E_MVOP_CMD_GET_BASE_ADD_BITS,               ///< 0x405 Get bits of y/uv address.
533     E_MVOP_CMD_GET_TOTAL_MVOP_NUM,              ///<0X406 Get how many mvop in this chip.
534     E_MVOP_CMD_GET_MAXIMUM_CLK,                 ///< 0x407 Get maximum mvop(dc0) clock.
535     E_MVOP_CMD_GET_CURRENT_CLK,                 ///< 0x408 Get current mvop(dc0) clock.
536     E_MVOP_CMD_GET_BASE_ADD_MULTI_VIEW,         ///< 0x409 Get base address of main/sub view.
537     E_MVOP_CMD_GET_TOP_FIELD_IMAGE_VSTART,      ///< 0x40A Get top field vstart.
538     E_MVOP_CMD_GET_BOTTOM_FIELD_IMAGE_VSTART,   ///< 0x40B Get bot field vstart.
539     E_MVOP_CMD_GET_VCOUNT,                      ///< 0x40C Get tgen vcount.
540     E_MVOP_CMD_GET_HANDSHAKE_MODE,              ///< 0x40D Get Handshaking mode status.
541     E_MVOP_CMD_GET_MAX_FPS,                     ///< 0x40E Get mvop supporting max framerate.
542 #if defined(UFO_PUBLIC_HEADER_212)
543     E_MVOP_CMD_GET_4K2K2PMODE,                  ///< 0x40F Get mvop 4k2k 2p mode or not.
544     E_MVOP_CMD_GET_ISMVOPSENDDATA,              ///< 0x410 Get if mvop hw is sending data or not. (check 1st frame to xc)
545 #endif
546     E_MVOP_CMD_GET_CROP_FOR_XC,                 ///< 0x40F Set crop and Get crop infomation. Without set register.
547 #if defined(UFO_PUBLIC_HEADER_300) || defined(UFO_PUBLIC_HEADER_500) || defined(UFO_PUBLIC_HEADER_700)
548     E_MVOP_CMD_GET_MVOP_SW_CROP_ADD,            ///< 0x410 If hw not support crop, sw patch for base address.
549     E_MVOP_CMD_GET_IS_SW_CROP,                  ///< 0x411 If hw not support crop or not?
550     E_MVOP_CMD_GET_OUTPUT_HV_RATIO,             ///<0x412 Get mvop output HV ratio.
551 #endif
552 #if defined(UFO_PUBLIC_HEADER_212) || defined(UFO_PUBLIC_HEADER_300) || defined(UFO_PUBLIC_HEADER_700) || defined(UFO_PUBLIC_HEADER_212)
553     E_MVOP_CMD_GET_INPUT,                       ///<0x413 LG
554     E_MVOP_CMD_GET_SUB_INPUT,                   ///<0x414 LG
555 #endif
556     E_MVOP_CMD_GET_IS_XC_GEN_TIMING,            ///< 0x415 Get if timing is from xc (or from mvop).
557     E_MVOP_CMD_GET_IS_MVOP_AUTO_GEN_BLACK,      ///< 0x416 Get if mvop support auto bk background.
558 } MVOP_Command;
559 
560 typedef enum
561 {
562     E_MVOP_SYNCMODE,
563     E_MVOP_FREERUNMODE,
564     E_MVOP_27MHZ = 27000000ul,
565     E_MVOP_54MHZ = 54000000ul,
566     E_MVOP_72MHZ = 72000000ul,
567     E_MVOP_108MHZ = 108000000ul,
568     E_MVOP_123MHZ = 123000000ul,
569     E_MVOP_144MHZ = 144000000ul,
570     E_MVOP_160MHZ = 160000000ul,
571     E_MVOP_172MHZ = 172000000ul,
572     E_MVOP_192MHZ = 192000000ul,
573     E_MVOP_320MHZ = 320000000ul,
574 }MVOP_FREQUENCY;
575 
576 // Interrupt
577 typedef enum
578 {
579     E_MVOP_INT_NONE    = 0,
580     E_MVOP_INT_BUFF_UF = 0x01, ///< buffer underflow
581     E_MVOP_INT_BUFF_OF = 0x02, ///< buffer overflow
582     E_MVOP_INT_VSYNC   = 0x04, ///< Vsync interrupt
583     E_MVOP_INT_HSYNC   = 0x08, ///< Hsync interrupt
584     E_MVOP_INT_RDY     = 0x10, ///< DC ready interrupt
585     E_MVOP_INT_FDCHNG  = 0x20, ///< field change
586 } MVOP_IntType;
587 
588 typedef struct DLL_PACKED
589 {
590     MS_U8  u8StrVer;
591     MS_U8  u8Rsrvd;
592     MS_U16 u16HSize;
593     MS_U16 u16VSize;
594     MS_U16 u16Fps;
595 } MVOP_CapInput;
596 
597 typedef struct
598 {
599     MS_BOOL  bEnable3DLRALT;
600     MS_BOOL  bEnable3DLRSBS;
601     MS_BOOL  bEnableVdup;
602     MS_BOOL  bEnableVx4;
603     MS_BOOL  bEnableHx4;
604     MS_BOOL  bEnableVsyncMode;
605     MS_BOOL  bEnableHMirror;
606     MS_BOOL  bEnableVMirror;
607     MS_BOOL  bEnableBWSave;
608     MS_BOOL  bEnableRptPreVsync;
609 } MVOP_ComdFlag;
610 
611 typedef enum
612 {
613     E_MVOP_HS_NOT_SUPPORT    = 0,
614     E_MVOP_HS_ENABLE         = 0x01,
615     E_MVOP_HS_DISABLE        = 0x02,
616     E_MVOP_HS_INVALID_PARAM = 0x03,
617 
618 } MVOP_HSMode;
619 
620 typedef struct DLL_PACKED
621 {
622     MS_U32 u32Framerate;
623     MS_U16 u16HSize;
624     MS_U16 u16VSize;
625     MS_BOOL b3DTB;
626     MS_BOOL b3DSBS;
627     MS_BOOL bReserve[6];
628 } MVOP_GetMaxFps;
629 
630 #if defined(UFO_PUBLIC_HEADER_300) || defined(UFO_PUBLIC_HEADER_500) || defined(UFO_PUBLIC_HEADER_700)
631 typedef enum
632 {
633     E_MVOP_PRO                      = 0,
634     E_MVOP_INT_TB_ONE_FRAME       = 0x01,
635     E_MVOP_INT_TB_SEP_FRAME       = 0x02,
636 
637 } MVOP_OutputImodeType;
638 #endif
639 
640 typedef struct DLL_PACKED
641 {
642     MS_U16 u16XStart;
643     MS_U16 u16YStart;
644     MS_U16 u16XSize;
645     MS_U16 u16YSize;
646     MS_U32 reserve[2];
647 } MVOP_XCGetCrop;
648 
649 typedef struct
650 {
651     MS_U32 u32MSBStartY0;
652     MS_U32 u32MSBStartUV0;
653     MS_U32 u32MSBStartY1;
654     MS_U32 u32MSBStartUV1;
655 
656     MS_U32 u32LSBStartY0;
657     MS_U32 u32LSBStartUV0;
658     MS_U32 u32LSBStartY1;
659     MS_U32 u32LSBStartUV1;
660     MVOP_XCGetCrop stXCCrop;
661     MS_U16 u16XCap;
662     MS_U16 u16YCap;
663     MS_U32 reserve[4];
664     MS_U32 u32MFCodecInfo;
665     MS_U32 u32LumaMFCbitlen;
666     MS_U32 u32ChromaMFCbitlen;
667     MS_U16 u16Pitch;
668     MS_U16 u16Pitch_2bit;
669 } MVOP_XCGetCropMirAdd;
670 
671 typedef struct
672 {
673     float fHratio;
674     float fVratio;
675     float reserve0[4];
676     MS_U32 reserve1[2];
677 } MVOP_OutputHVRatio;
678 
679 typedef struct
680 {
681     MS_U16 u16Xpos;
682     MS_U16 u16Ypos;
683 } MVOP_SetCropPos;
684 
685 typedef struct
686 {
687     MS_U16 u16Width;
688     MS_U16 u16Height;
689 } MVOP_SetImageWH;
690 
691 typedef enum
692 {
693     E_MVOP_10to8_NONE               = 0,
694     E_MVOP_10to8_ROUND_TOSS         = 0x01,
695     E_MVOP_10to8_ROUND_RANDOM       = 0x02,
696     E_MVOP_10to8_ROUND_HALF         = 0x03,
697     E_MVOP_10to8_PSEU_STOP          = 0x04,
698 } MVOP_10to8Mode;
699 
700 typedef enum
701 {
702     E_MVOP_SET_SI_NONE            = 0,
703     E_MVOP_SET_SI_DV_SINGLE       = 0x01,
704     E_MVOP_SET_SI_DV_DUAL         = 0x02
705 } MVOP_SetStreamInfo;
706 
707 typedef struct DLL_PACKED
708 {
709     MS_U32 u32MCUMFD_Version;   ///<Version of current structure. Please always set to "MVOP_DMS_DIPS_A_VERSION" as input
710     MS_U16 u16MCUMFD_Length;    ///<Length of this structure, u16PanelInfoEX_Length=sizeof(MVOP_DMSCropINFO)
711 
712     MS_BOOL bMFDEC_EN;
713     MS_U8   u8MFDEC_ID;
714     MS_U32  u32UNCOMPRESS_MODE;
715     MS_PHY  u32BITLEN_FB_ADDR;         ///<0:8 bit EL y address, 1:8 bit EL uv address
716     MS_U8   u8BITLEN_FB_MIU;           ///<0:8 bit EL y address, 1:8 bit EL uv address
717     MS_U32  u32BITLEN_FB_PITCH;
718     MS_BOOL bBITLEN_SHT_8;
719 } MVOP_MCUMFDInfo;
720 //-------------------------------------------------------------------------------------------------
721 //  Function and Variable
722 //-------------------------------------------------------------------------------------------------
723 MS_BOOL MDrv_MVOP_ClearInterrupt(MS_BOOL bEnable);
724 
725 //-------------------------------------------------------------------------------------------------
726 /// Map Context for Multi Process Use.
727 /// @ingroup MVOP_Basic
728 /// @param stHd \b IN : Devide ID(main mvop or sub).
729 /// @return void
730 //-------------------------------------------------------------------------------------------------
731 void MDrv_MVOP_GetConfig (MVOP_Handle* stHd);
732 
733 // Basic Function
734 //-------------------------------------------------------------------------------------------------
735 /// Initial Main MVOP.
736 /// @ingroup MVOP_Basic
737 /// @param void \b IN : void
738 /// @return void
739 //-------------------------------------------------------------------------------------------------
740 
741 void MDrv_MVOP_Init (void);
742 
743 //-------------------------------------------------------------------------------------------------
744 /// Disable Main MVOP clock.
745 /// @ingroup MVOP_Basic
746 /// @param void \b IN : void
747 /// @return void
748 //-------------------------------------------------------------------------------------------------
749 void MDrv_MVOP_Exit(void);
750 //-------------------------------------------------------------------------------------------------
751 /// Main MVOP power switch; start to generate timing.
752 /// @ingroup MVOP_Basic
753 /// @param MS_BOOL \b IN : enable or disable MVOP.
754 /// @return void
755 //-------------------------------------------------------------------------------------------------
756 void MDrv_MVOP_Enable ( MS_BOOL bEnable );
757 //-------------------------------------------------------------------------------------------------
758 /// Set Main MVOP Input stream information and reset ex-stream status.
759 /// @ingroup MVOP_Basic
760 /// @param in \b IN : Set mvop input: Hardwire mode or MCU mode / Codec type.
761 /// @param pCfg \b IN : Set mvop input: MCU mode data format setting.
762 /// @return MVOP_Result
763 ///     - E_MVOP_OK: success
764 ///     - E_MVOP_FAIL: failed
765 ///     - E_MVOP_INVALID_PARAM: input param error.
766 ///     - E_MVOP_NOT_INIT: not initialized yet.
767 ///     - E_MVOP_UNSUPPORTED: input case not support.
768 //-------------------------------------------------------------------------------------------------
769 MVOP_Result MDrv_MVOP_SetInputCfg (MVOP_InputSel in, MVOP_InputCfg* pCfg);
770 //-------------------------------------------------------------------------------------------------
771 /// Set Main MVOP Output timing information.
772 /// @ingroup MVOP_Basic
773 /// @param pstVideoStatus \b IN : Set mvop output Timing.
774 /// @param bEnHDup \b IN : Is Hsize duplicated?
775 /// @return MVOP_Result
776 ///     - E_MVOP_OK: success
777 ///     - E_MVOP_FAIL: failed
778 ///     - E_MVOP_INVALID_PARAM: input param error.
779 ///     - E_MVOP_NOT_INIT: not initialized yet.
780 ///     - E_MVOP_UNSUPPORTED: input case not support.
781 //-------------------------------------------------------------------------------------------------
782 MVOP_Result MDrv_MVOP_SetOutputCfg(MVOP_VidStat *pstVideoStatus, MS_BOOL bEnHDup);
783 //-------------------------------------------------------------------------------------------------
784 /// Set Main MVOP Background color as black.
785 /// @ingroup MVOP_Basic
786 /// @param void \b IN : void.
787 /// @return: void.
788 //-------------------------------------------------------------------------------------------------
789 void MDrv_MVOP_EnableBlackBG ( void );
790 // SetCommand Function
791 //-------------------------------------------------------------------------------------------------
792 /// Set Main MVOP UV forwarding one line.
793 /// @ingroup MVOP_SetCommand
794 /// @param bEnable \b IN: enable or disable.
795 /// @return: void.
796 //-------------------------------------------------------------------------------------------------
797 void MDrv_MVOP_EnableUVShift(MS_BOOL bEnable);
798 //-------------------------------------------------------------------------------------------------
799 /// Set Main MVOP only Luma data(Black/white feature).
800 /// @ingroup MVOP_SetCommand
801 /// @param bEnable \b IN: enable or disable.
802 /// @return: void.
803 //-------------------------------------------------------------------------------------------------
804 void MDrv_MVOP_SetMonoMode(MS_BOOL bEnable);
805 // GetCommand Function
806 //-------------------------------------------------------------------------------------------------
807 /// Get Main MVOP source Width.
808 /// @ingroup MVOP_GetCommand
809 /// @param void \b IN : void.
810 /// @return: Width.
811 //-------------------------------------------------------------------------------------------------
812 MS_U16 MDrv_MVOP_GetHSize(void);
813 //-------------------------------------------------------------------------------------------------
814 /// Get Main MVOP source Height.
815 /// @ingroup MVOP_GetCommand
816 /// @param void \b IN : void.
817 /// @return: Height.
818 //-------------------------------------------------------------------------------------------------
819 MS_U16 MDrv_MVOP_GetVSize(void);
820 //-------------------------------------------------------------------------------------------------
821 /// Get Main MVOP the timing of xc data starting(capture win. h start).
822 /// @ingroup MVOP_GetCommand
823 /// @param void \b IN : void.
824 /// @return: timing of data start in Htt.
825 //-------------------------------------------------------------------------------------------------
826 MS_U16 MDrv_MVOP_GetHStart(void);
827 //-------------------------------------------------------------------------------------------------
828 /// Get Main MVOP the timing of xc data starting(capture win. v start).
829 /// @ingroup MVOP_GetCommand
830 /// @param void \b IN : void.
831 /// @return: timing of data start in Vtt.
832 //-------------------------------------------------------------------------------------------------
833 MS_U16 MDrv_MVOP_GetVStart(void);
834 //-------------------------------------------------------------------------------------------------
835 /// Get Main MVOP timing is interlace or not.
836 /// @ingroup MVOP_GetCommand
837 /// @param void \b IN : void.
838 /// @return: true or false.
839 //-------------------------------------------------------------------------------------------------
840 MS_BOOL MDrv_MVOP_GetIsInterlace(void);
841 //-------------------------------------------------------------------------------------------------
842 /// Get Main MVOP H data is duplicated or not.
843 /// @ingroup MVOP_GetCommand
844 /// @param void \b IN : void.
845 /// @return: true or false.
846 //-------------------------------------------------------------------------------------------------
847 MS_BOOL MDrv_MVOP_GetIsHDuplicate(void);
848 //-------------------------------------------------------------------------------------------------
849 /// Get Main MVOP is enable or not.
850 /// @ingroup MVOP_GetCommand
851 /// @param pbEnable \b IN : Is enable or not.
852 /// @return: true or false.
853 //-------------------------------------------------------------------------------------------------
854 MVOP_Result MDrv_MVOP_GetIsEnable ( MS_BOOL* pbEnable );
855 //-------------------------------------------------------------------------------------------------
856 /// Get Main MVOP output timing.
857 /// @ingroup MVOP_GetCommand
858 /// @param pMVOPTiming \b IN : the pointer of timing struc.
859 /// @return MVOP_Result
860 ///     - E_MVOP_OK: success
861 ///     - E_MVOP_FAIL: failed
862 ///     - E_MVOP_INVALID_PARAM: input param error.
863 ///     - E_MVOP_NOT_INIT: not initialized yet.
864 ///     - E_MVOP_UNSUPPORTED: input case not support.
865 //-------------------------------------------------------------------------------------------------
866 MVOP_Result MDrv_MVOP_GetOutputTiming(MVOP_Timing* pMVOPTiming);
867 //-------------------------------------------------------------------------------------------------
868 /// Get Main MVOP library version.
869 /// @ingroup MVOP_GetCommand
870 /// @param ppVersion \b IN : mvop library version no..
871 /// @return MVOP_Result
872 ///     - E_MVOP_OK: success
873 ///     - E_MVOP_FAIL: failed
874 ///     - E_MVOP_INVALID_PARAM: input param error.
875 ///     - E_MVOP_NOT_INIT: not initialized yet.
876 ///     - E_MVOP_UNSUPPORTED: input case not support.
877 //-------------------------------------------------------------------------------------------------
878 MVOP_Result MDrv_MVOP_GetLibVer(const MSIF_Version **ppVersion);
879 //-------------------------------------------------------------------------------------------------
880 /// Get Main MVOP HW capability.
881 /// @ingroup MVOP_GetCommand
882 /// @param u16HSize \b IN : input height.
883 /// @param u16VSize \b IN : input height.
884 /// @param u16Fps \b IN : input framerate.
885 /// @return MS_BOOL: support this timing or not.
886 //-------------------------------------------------------------------------------------------------
887 MS_BOOL MDrv_MVOP_CheckCapability(MS_U16 u16HSize, MS_U16 u16VSize, MS_U16 u16Fps);
888 //   Functions for the 3rd MVOP }
889 //-------------------------------------------------------------------------------------------------
890 /// Get Main MVOP maximum of horizontal offset.
891 /// @ingroup MVOP_GetCommand
892 /// @param u16HSize \b IN : input height.
893 /// @param u16VSize \b IN : input height.
894 /// @param u16Fps \b IN : input framerate.
895 /// @return MS_BOOL: maximum of horizontal offset.
896 //-------------------------------------------------------------------------------------------------
897 MS_U16 MDrv_MVOP_GetMaxHOffset(MS_U16 u16HSize, MS_U16 u16VSize, MS_U16 u16Fps);
898 //-------------------------------------------------------------------------------------------------
899 /// Get Main MVOP maximum of vertical offset.
900 /// @ingroup MVOP_GetCommand
901 /// @param u16HSize \b IN : input height.
902 /// @param u16VSize \b IN : input height.
903 /// @param u16Fps \b IN : input framerate.
904 /// @return MS_BOOL: maximum of vertical offset.
905 //-------------------------------------------------------------------------------------------------
906 MS_U16 MDrv_MVOP_GetMaxVOffset(MS_U16 u16HSize, MS_U16 u16VSize, MS_U16 u16Fps);
907 // MVOP_Debug
908 //-------------------------------------------------------------------------------------------------
909 /// Set MVOP debug level.
910 /// @ingroup MVOP_SetCommand
911 /// @param level \b IN: level.
912 /// @return: void.
913 //-------------------------------------------------------------------------------------------------
914 void MDrv_MVOP_SetDbgLevel(MS_U8 level);
915 //-------------------------------------------------------------------------------------------------
916 /// Get Main MVOP clock infomation.
917 /// @ingroup MVOP_GetCommand
918 /// @param void \b IN : void.
919 /// @return MVOP_DrvInfo: the pointer of clock information.
920 //-------------------------------------------------------------------------------------------------
921 const MVOP_DrvInfo* MDrv_MVOP_GetInfo(void);
922 //-------------------------------------------------------------------------------------------------
923 /// Get Main MVOP current setting status.
924 /// @ingroup MVOP_GetCommand
925 /// @param pMVOPStat \b IN : the pointer of mvop status.
926 /// @return MS_BOOL: get is status successful or not.
927 //-------------------------------------------------------------------------------------------------
928 MS_BOOL MDrv_MVOP_GetStatus(MVOP_DrvStatus *pMVOPStat);
929 MS_BOOL MDrv_MVOP_EnableInterrupt(MS_U8 eIntType);
930 
931 
932 //-------------------------------------------------------------------------------------------------
933 /// Set MVOP Pattern type.
934 /// @ingroup MVOP_SetCommand
935 /// @param enMVOPPattern \b IN: pattern type.
936 /// @return: void.
937 //-------------------------------------------------------------------------------------------------
938 void MDrv_MVOP_SetPattern(MVOP_Pattern enMVOPPattern);
939 //-------------------------------------------------------------------------------------------------
940 /// Set Main MVOP tile format.
941 /// @ingroup MVOP_SetCommand
942 /// @param eTileFmt \b IN: tile format.
943 /// @return: MS_BOOL: setting successfully or not.
944 //-------------------------------------------------------------------------------------------------
945 MS_BOOL MDrv_MVOP_SetTileFormat(MVOP_TileFormat eTileFmt);
946 //-------------------------------------------------------------------------------------------------
947 /// Get Main MVOP current display timing infomation from register.
948 /// @ingroup MVOP_GetCommand
949 /// @param pDstInfo \b IN : the pointer of mvop timing.
950 /// @param u32SizeofDstInfo \b IN : the size of pDstInfo.
951 /// @return MS_BOOL: get is status successful or not.
952 //-------------------------------------------------------------------------------------------------
953 MS_BOOL MDrv_MVOP_GetDstInfo(MVOP_DST_DispInfo *pDstInfo, MS_U32 u32SizeofDstInfo);
954 //-------------------------------------------------------------------------------------------------
955 /// Set Main MVOP Vtt fixed.
956 /// @ingroup MVOP_SetCommand
957 /// @param u16FixVtt \b IN: Vtt.
958 /// @return: MS_BOOL: setting successfully or not.
959 //-------------------------------------------------------------------------------------------------
960 MS_BOOL MDrv_MVOP_SetFixVtt(MS_U16 u16FixVtt);
961 //-------------------------------------------------------------------------------------------------
962 /// Set Main MVOP MMIO Map base address.
963 /// @ingroup MVOP_SetCommand
964 /// @param void \b IN: void.
965 /// @return: MS_BOOL: setting successfully or not.
966 //-------------------------------------------------------------------------------------------------
967 MS_BOOL MDrv_MVOP_SetMMIOMapBase(void);
968 //-------------------------------------------------------------------------------------------------
969 /// Set Main MVOP access which miu.
970 /// @ingroup MVOP_Basic
971 /// @param u8Miu \b IN : miu 0/1/2...
972 /// @return MVOP_Result
973 ///     - E_MVOP_OK: success
974 ///     - E_MVOP_FAIL: failed
975 ///     - E_MVOP_INVALID_PARAM: input param error.
976 ///     - E_MVOP_NOT_INIT: not initialized yet.
977 ///     - E_MVOP_UNSUPPORTED: input case not support.
978 //-------------------------------------------------------------------------------------------------
979 MVOP_Result MDrv_MVOP_MiuSwitch(MS_U8 u8Miu);
980 //-------------------------------------------------------------------------------------------------
981 /// Set Main MVOP MCU mode YUV address.
982 /// @ingroup MVOP_SetCommand
983 /// @param u32YOffset \b IN: Y address.
984 /// @param u32UVOffset \b IN: UV address.
985 /// @param bProgressive \b IN: Is progressive.
986 /// @param b422pack \b IN: Is 422 packed or not.
987 /// @return: MS_BOOL: setting successfully or not.
988 //-------------------------------------------------------------------------------------------------
989 MS_BOOL MDrv_MVOP_SetBaseAdd(MS_PHY u32YOffset, MS_PHY u32UVOffset, MS_BOOL bProgressive, MS_BOOL b422pack);
990 //-------------------------------------------------------------------------------------------------
991 /// Set Main MVOP elect output field for display one field. default: mvop t/b toggle, update one field to both t/b xc buffer.
992 /// @ingroup MVOP_SetCommand
993 /// @param void \b IN: void.
994 /// @return: MS_BOOL: setting successfully or not.
995 //-------------------------------------------------------------------------------------------------
996 void MDrv_MVOP_SEL_OP_FIELD(MS_BOOL bEnable);
997 //-------------------------------------------------------------------------------------------------
998 /// Set Main MVOP hsize/vsize from vdec DIU/WB.
999 /// @ingroup MVOP_SetCommand
1000 /// @param bEnable \b IN: Enable/Disable.
1001 /// @return: MS_BOOL: setting successfully or not.
1002 //-------------------------------------------------------------------------------------------------
1003 void MDrv_MVOP_SetRegSizeFromMVD(MS_BOOL bEnable);
1004 //-------------------------------------------------------------------------------------------------
1005 /// Set Main MVOP crop x/y start.
1006 /// @ingroup MVOP_SetCommand
1007 /// @param u16Xpos \b IN: x start.
1008 /// @param u16Ypos \b IN: y start.
1009 /// @return: void.
1010 //-------------------------------------------------------------------------------------------------
1011 void MDrv_MVOP_SetStartPos(MS_U16 u16Xpos ,MS_U16 u16Ypos);
1012 //-------------------------------------------------------------------------------------------------
1013 /// Set Main MVOP crop x/y size.
1014 /// @ingroup MVOP_SetCommand
1015 /// @param u16Width \b IN: x size.
1016 /// @param u16Height \b IN: y size.
1017 /// @return: MS_BOOL: setting successfully or not.
1018 //-------------------------------------------------------------------------------------------------
1019 MS_BOOL MDrv_MVOP_SetImageWidthHight(MS_U16 u16Width ,MS_U16 u16Height);
1020 //-------------------------------------------------------------------------------------------------
1021 /// Set Main MVOP mirror mode.
1022 /// @ingroup MVOP_SetCommand
1023 /// @param bEnable \b IN: enable/disable.
1024 /// @param eMirrorMode \b IN: mirror mode type.
1025 /// @return: void.
1026 //-------------------------------------------------------------------------------------------------
1027 void MDrv_MVOP_SetVOPMirrorMode(MS_BOOL bEnable,MVOP_DrvMirror eMirrorMode);
1028 //-------------------------------------------------------------------------------------------------
1029 /// Set Main MVOP output vsync inversed.
1030 /// @ingroup MVOP_SetCommand
1031 /// @param bEnable \b IN: enable/disable.
1032 /// @return: void.
1033 //-------------------------------------------------------------------------------------------------
1034 void MDrv_MVOP_INV_OP_VS(MS_BOOL bEnable);
1035 //-------------------------------------------------------------------------------------------------
1036 /// Set Main MVOP output only top field.
1037 /// @ingroup MVOP_SetCommand
1038 /// @param bEnable \b IN: enable/disable.
1039 /// @return: void.
1040 //-------------------------------------------------------------------------------------------------
1041 void MDrv_MVOP_FORCE_TOP(MS_BOOL bEnable);
1042 //-------------------------------------------------------------------------------------------------
1043 /// Set Main MVOP enable freerun mode.
1044 /// @ingroup MVOP_SetCommand
1045 /// @param bEnable \b IN: enable/disable.
1046 /// @return: MS_BOOL: setting successfully or not.
1047 //-------------------------------------------------------------------------------------------------
1048 MS_BOOL MDrv_MVOP_EnableFreerunMode(MS_BOOL bEnable);
1049 //-------------------------------------------------------------------------------------------------
1050 /// Get Main MVOP cuurent frame base address(MCU mode only).
1051 /// @ingroup MVOP_GetCommand
1052 /// @param u32YOffset \b IN : the pointer of Luma address.
1053 /// @param u32UVOffset \b IN : the pointer of Chroma address.
1054 /// @return void.
1055 //-------------------------------------------------------------------------------------------------
1056 void MDrv_MVOP_GetBaseAdd(MS_PHY* u32YOffset, MS_PHY* u32UVOffset);
1057 //-------------------------------------------------------------------------------------------------
1058 /// Get Sub MVOP current setting status.
1059 /// @ingroup MVOP_GetCommand
1060 /// @param pMVOPStat \b IN : the pointer of mvop status.
1061 /// @return MS_BOOL: get is status successful or not.
1062 //-------------------------------------------------------------------------------------------------
1063 MS_BOOL MDrv_MVOP_SubGetStatus(MVOP_DrvStatus *pMVOPStat);
1064 //-------------------------------------------------------------------------------------------------
1065 /// Get Sub MVOP the timing of xc data starting(capture win. h start).
1066 /// @ingroup MVOP_GetCommand
1067 /// @param void \b IN : void.
1068 /// @return: timing of data start in Htt.
1069 //-------------------------------------------------------------------------------------------------
1070 MS_U16 MDrv_MVOP_SubGetHStart(void);
1071 //-------------------------------------------------------------------------------------------------
1072 /// Get Sub MVOP the timing of xc data starting(capture win. v start).
1073 /// @ingroup MVOP_GetCommand
1074 /// @param void \b IN : void.
1075 /// @return: timing of data start in Vtt.
1076 //-------------------------------------------------------------------------------------------------
1077 MS_U16 MDrv_MVOP_SubGetVStart(void);
1078 //-------------------------------------------------------------------------------------------------
1079 /// Set Sub MVOP Pattern type.
1080 /// @ingroup MVOP_SetCommand
1081 /// @param enMVOPPattern \b IN: pattern type.
1082 /// @return: void.
1083 //-------------------------------------------------------------------------------------------------
1084 void MDrv_MVOP_SubSetPattern(MVOP_Pattern enMVOPPattern);
1085 //-------------------------------------------------------------------------------------------------
1086 /// Set Sub MVOP tile format.
1087 /// @ingroup MVOP_SetCommand
1088 /// @param eTileFmt \b IN: tile format.
1089 /// @return: MS_BOOL: setting successfully or not.
1090 //-------------------------------------------------------------------------------------------------
1091 MS_BOOL MDrv_MVOP_SubSetTileFormat(MVOP_TileFormat eTileFmt);
1092 //-------------------------------------------------------------------------------------------------
1093 /// Set Sub MVOP MMIO Map base address.
1094 /// @ingroup MVOP_SetCommand
1095 /// @param void \b IN: void.
1096 /// @return: MS_BOOL: setting successfully or not.
1097 //-------------------------------------------------------------------------------------------------
1098 MS_BOOL MDrv_MVOP_SubSetMMIOMapBase(void);
1099 //-------------------------------------------------------------------------------------------------
1100 /// Initial Sub MVOP.
1101 /// @ingroup MVOP_Basic
1102 /// @param void \b IN : void
1103 /// @return void
1104 //-------------------------------------------------------------------------------------------------
1105 void MDrv_MVOP_SubInit(void);
1106 //-------------------------------------------------------------------------------------------------
1107 /// Disable Sub MVOP clock.
1108 /// @ingroup MVOP_Basic
1109 /// @param void \b IN : void
1110 /// @return void
1111 //-------------------------------------------------------------------------------------------------
1112 void MDrv_MVOP_SubExit(void);
1113 //-------------------------------------------------------------------------------------------------
1114 /// Sub MVOP power switch; start to generate timing.
1115 /// @ingroup MVOP_Basic
1116 /// @param MS_BOOL \b IN : enable or disable MVOP.
1117 /// @return void
1118 //-------------------------------------------------------------------------------------------------
1119 void MDrv_MVOP_SubEnable(MS_BOOL bEnable);
1120 //-------------------------------------------------------------------------------------------------
1121 /// Get Sub MVOP is enable or not.
1122 /// @ingroup MVOP_GetCommand
1123 /// @param pbEnable \b IN : Is enable or not.
1124 /// @return: true or false.
1125 //-------------------------------------------------------------------------------------------------
1126 MVOP_Result MDrv_MVOP_SubGetIsEnable (MS_BOOL* pbEnable);
1127 //-------------------------------------------------------------------------------------------------
1128 /// Set Sub MVOP UV forwarding one line.
1129 /// @ingroup MVOP_SetCommand
1130 /// @param bEnable \b IN: enable or disable.
1131 /// @return: void.
1132 //-------------------------------------------------------------------------------------------------
1133 void MDrv_MVOP_SubEnableUVShift(MS_BOOL bEnable);
1134 //-------------------------------------------------------------------------------------------------
1135 /// Set Sub MVOP Background color as black.
1136 /// @ingroup MVOP_Basic
1137 /// @param void \b IN : void.
1138 /// @return: void.
1139 //-------------------------------------------------------------------------------------------------
1140 void MDrv_MVOP_SubEnableBlackBG(void);
1141 //-------------------------------------------------------------------------------------------------
1142 /// Set Sub MVOP only Luma data(Black/white feature).
1143 /// @ingroup MVOP_SetCommand
1144 /// @param bEnable \b IN: enable or disable.
1145 /// @return: void.
1146 //-------------------------------------------------------------------------------------------------
1147 void MDrv_MVOP_SubSetMonoMode(MS_BOOL bEnable);
1148 //-------------------------------------------------------------------------------------------------
1149 /// Set Sub MVOP Input stream information and reset ex-stream status.
1150 /// @ingroup MVOP_Basic
1151 /// @param in \b IN : Set mvop input: Hardwire mode or MCU mode / Codec type.
1152 /// @param pCfg \b IN : Set mvop input: MCU mode data format setting.
1153 /// @return MVOP_Result
1154 ///     - E_MVOP_OK: success
1155 ///     - E_MVOP_FAIL: failed
1156 ///     - E_MVOP_INVALID_PARAM: input param error.
1157 ///     - E_MVOP_NOT_INIT: not initialized yet.
1158 ///     - E_MVOP_UNSUPPORTED: input case not support.
1159 //-------------------------------------------------------------------------------------------------
1160 MVOP_Result MDrv_MVOP_SubSetInputCfg (MVOP_InputSel in, MVOP_InputCfg* pCfg);
1161 //-------------------------------------------------------------------------------------------------
1162 /// Set Sub MVOP Output timing information.
1163 /// @ingroup MVOP_Basic
1164 /// @param pstVideoStatus \b IN : Set mvop output Timing.
1165 /// @param bEnHDup \b IN : Is Hsize duplicated?
1166 /// @return MVOP_Result
1167 ///     - E_MVOP_OK: success
1168 ///     - E_MVOP_FAIL: failed
1169 ///     - E_MVOP_INVALID_PARAM: input param error.
1170 ///     - E_MVOP_NOT_INIT: not initialized yet.
1171 ///     - E_MVOP_UNSUPPORTED: input case not support.
1172 //-------------------------------------------------------------------------------------------------
1173 MVOP_Result MDrv_MVOP_SubSetOutputCfg(MVOP_VidStat *pstVideoStatus, MS_BOOL bEnHDup);
1174 //-------------------------------------------------------------------------------------------------
1175 /// Get Sub MVOP output timing.
1176 /// @ingroup MVOP_GetCommand
1177 /// @param pMVOPTiming \b IN : the pointer of timing struc.
1178 /// @return MVOP_Result
1179 ///     - E_MVOP_OK: success
1180 ///     - E_MVOP_FAIL: failed
1181 ///     - E_MVOP_INVALID_PARAM: input param error.
1182 ///     - E_MVOP_NOT_INIT: not initialized yet.
1183 ///     - E_MVOP_UNSUPPORTED: input case not support.
1184 //-------------------------------------------------------------------------------------------------
1185 MVOP_Result MDrv_MVOP_SubGetOutputTiming(MVOP_Timing* pMVOPTiming);
1186 //-------------------------------------------------------------------------------------------------
1187 /// Get Sub MVOP source Width.
1188 /// @ingroup MVOP_GetCommand
1189 /// @param void \b IN : void.
1190 /// @return: Width.
1191 //-------------------------------------------------------------------------------------------------
1192 MS_U16 MDrv_MVOP_SubGetHSize(void);
1193 //-------------------------------------------------------------------------------------------------
1194 /// Get Sub MVOP source Height.
1195 /// @ingroup MVOP_GetCommand
1196 /// @param void \b IN : void.
1197 /// @return: Height.
1198 //-------------------------------------------------------------------------------------------------
1199 MS_U16 MDrv_MVOP_SubGetVSize(void);
1200 //-------------------------------------------------------------------------------------------------
1201 /// Get Sub MVOP timing is interlace or not.
1202 /// @ingroup MVOP_GetCommand
1203 /// @param void \b IN : void.
1204 /// @return: true or false.
1205 //-------------------------------------------------------------------------------------------------
1206 MS_BOOL MDrv_MVOP_SubGetIsInterlace(void);
1207 //-------------------------------------------------------------------------------------------------
1208 /// Get Sub MVOP H data is duplicated or not.
1209 /// @ingroup MVOP_GetCommand
1210 /// @param void \b IN : void.
1211 /// @return: true or false.
1212 //-------------------------------------------------------------------------------------------------
1213 MS_BOOL MDrv_MVOP_SubGetIsHDuplicate(void);
1214 //-------------------------------------------------------------------------------------------------
1215 /// Get Sub MVOP HW capability.
1216 /// @ingroup MVOP_GetCommand
1217 /// @param u16HSize \b IN : input height.
1218 /// @param u16VSize \b IN : input height.
1219 /// @param u16Fps \b IN : input framerate.
1220 /// @return MS_BOOL: support this timing or not.
1221 //-------------------------------------------------------------------------------------------------
1222 MS_BOOL MDrv_MVOP_SubCheckCapability(MS_U16 u16HSize, MS_U16 u16VSize, MS_U16 u16Fps);
1223 //-------------------------------------------------------------------------------------------------
1224 /// Get Sub MVOP maximum of horizontal offset.
1225 /// @ingroup MVOP_GetCommand
1226 /// @param u16HSize \b IN : input height.
1227 /// @param u16VSize \b IN : input height.
1228 /// @param u16Fps \b IN : input framerate.
1229 /// @return MS_BOOL: maximum of horizontal offset.
1230 //-------------------------------------------------------------------------------------------------
1231 MS_U16 MDrv_MVOP_SubGetMaxHOffset(MS_U16 u16HSize, MS_U16 u16VSize, MS_U16 u16Fps);
1232 //-------------------------------------------------------------------------------------------------
1233 /// Get Sub MVOP maximum of vertical offset.
1234 /// @ingroup MVOP_GetCommand
1235 /// @param u16HSize \b IN : input height.
1236 /// @param u16VSize \b IN : input height.
1237 /// @param u16Fps \b IN : input framerate.
1238 /// @return MS_BOOL: maximum of vertical offset.
1239 //-------------------------------------------------------------------------------------------------
1240 MS_U16 MDrv_MVOP_SubGetMaxVOffset(MS_U16 u16HSize, MS_U16 u16VSize, MS_U16 u16Fps);
1241 //-------------------------------------------------------------------------------------------------
1242 /// Get Sub MVOP current display timing infomation from register.
1243 /// @ingroup MVOP_GetCommand
1244 /// @param pDstInfo \b IN : the pointer of mvop timing.
1245 /// @param u32SizeofDstInfo \b IN : the size of pDstInfo.
1246 /// @return MS_BOOL: get is status successful or not.
1247 //-------------------------------------------------------------------------------------------------
1248 MS_BOOL MDrv_MVOP_SubGetDstInfo(MVOP_DST_DispInfo *pDstInfo, MS_U32 u32SizeofDstInfo);
1249 //-------------------------------------------------------------------------------------------------
1250 /// Set Sub MVOP Vtt fixed.
1251 /// @ingroup MVOP_SetCommand
1252 /// @param u16FixVtt \b IN: Vtt.
1253 /// @return: MS_BOOL: setting successfully or not.
1254 //-------------------------------------------------------------------------------------------------
1255 MS_BOOL MDrv_MVOP_SubSetFixVtt(MS_U16 u16FixVtt);
1256 //-------------------------------------------------------------------------------------------------
1257 /// Set Sub MVOP access which miu.
1258 /// @ingroup MVOP_Basic
1259 /// @param u8Miu \b IN : miu 0/1/2...
1260 /// @return MVOP_Result
1261 ///     - E_MVOP_OK: success
1262 ///     - E_MVOP_FAIL: failed
1263 ///     - E_MVOP_INVALID_PARAM: input param error.
1264 ///     - E_MVOP_NOT_INIT: not initialized yet.
1265 ///     - E_MVOP_UNSUPPORTED: input case not support.
1266 //-------------------------------------------------------------------------------------------------
1267 MVOP_Result MDrv_MVOP_SubMiuSwitch(MS_U8 u8Miu);
1268 //-------------------------------------------------------------------------------------------------
1269 /// Set Sub MVOP mirror mode.
1270 /// @ingroup MVOP_SetCommand
1271 /// @param bEnable \b IN: enable/disable.
1272 /// @param eMirrorMode \b IN: mirror mode type.
1273 /// @return: void.
1274 //-------------------------------------------------------------------------------------------------
1275 void MDrv_MVOP_SubSetVOPMirrorMode(MS_BOOL bEnable, MVOP_DrvMirror eMirrorMode);
1276 //-------------------------------------------------------------------------------------------------
1277 /// Set Sub MVOP enable freerun mode.
1278 /// @ingroup MVOP_SetCommand
1279 /// @param bEnable \b IN: enable/disable.
1280 /// @return: MS_BOOL: setting successfully or not.
1281 //-------------------------------------------------------------------------------------------------
1282 MS_BOOL MDrv_MVOP_SubEnableFreerunMode(MS_BOOL bEnable);
1283 //-------------------------------------------------------------------------------------------------
1284 /// Set Sub MVOP MCU mode YUV address.
1285 /// @ingroup MVOP_SetCommand
1286 /// @param u32YOffset \b IN: Y address.
1287 /// @param u32UVOffset \b IN: UV address.
1288 /// @param bProgressive \b IN: Is progressive.
1289 /// @param b422pack \b IN: Is 422 packed or not.
1290 /// @return: MS_BOOL: setting successfully or not.
1291 //-------------------------------------------------------------------------------------------------
1292 MS_BOOL MDrv_MVOP_SubSetBaseAdd(MS_PHY u32YOffset, MS_PHY u32UVOffset, MS_BOOL bProgressive, MS_BOOL b422pack);
1293 //-------------------------------------------------------------------------------------------------
1294 /// Get Sub MVOP cuurent frame base address(MCU mode only).
1295 /// @ingroup MVOP_GetCommand
1296 /// @param u32YOffset \b IN : the pointer of Luma address.
1297 /// @param u32UVOffset \b IN : the pointer of Chroma address.
1298 /// @return void.
1299 //-------------------------------------------------------------------------------------------------
1300 void MDrv_MVOP_SubGetBaseAdd(MS_PHY* u32YOffset, MS_PHY* u32UVOffset);
1301 
1302 //-------------------------------------------------------------------------------------------------
1303 /// Initial Extended MVOP.
1304 /// @ingroup MVOP_Basic
1305 /// @param eID \b IN : Device ID.
1306 /// @param void \b IN : void.
1307 /// @return MVOP_Result
1308 ///     - E_MVOP_OK: success
1309 ///     - E_MVOP_FAIL: failed
1310 ///     - E_MVOP_INVALID_PARAM: input param error.
1311 ///     - E_MVOP_NOT_INIT: not initialized yet.
1312 ///     - E_MVOP_UNSUPPORTED: input case not support.
1313 //-------------------------------------------------------------------------------------------------
1314 MVOP_Result MDrv_MVOP_EX_Init(MVOP_DevID eID, MS_U32 u32InitParam);
1315 //-------------------------------------------------------------------------------------------------
1316 /// Disable Extended  MVOP clock.
1317 /// @ingroup MVOP_Basic
1318 /// @param eID \b IN : Device ID.
1319 /// @return MVOP_Result
1320 ///     - E_MVOP_OK: success
1321 ///     - E_MVOP_FAIL: failed
1322 ///     - E_MVOP_INVALID_PARAM: input param error.
1323 ///     - E_MVOP_NOT_INIT: not initialized yet.
1324 ///     - E_MVOP_UNSUPPORTED: input case not support.
1325 //-------------------------------------------------------------------------------------------------
1326 MVOP_Result MDrv_MVOP_EX_Exit(MVOP_DevID eID, MS_U32 u32ExitParam);
1327 //-------------------------------------------------------------------------------------------------
1328 /// Extended MVOP power switch; start to generate timing.
1329 /// @ingroup MVOP_Basic
1330 /// @param eID \b IN : Device ID.
1331 /// @param MS_BOOL \b IN : enable or disable MVOP.
1332 /// @return MVOP_Result
1333 ///     - E_MVOP_OK: success
1334 ///     - E_MVOP_FAIL: failed
1335 ///     - E_MVOP_INVALID_PARAM: input param error.
1336 ///     - E_MVOP_NOT_INIT: not initialized yet.
1337 ///     - E_MVOP_UNSUPPORTED: input case not support.
1338 //-------------------------------------------------------------------------------------------------
1339 MVOP_Result MDrv_MVOP_EX_Enable(MVOP_DevID eID, MS_BOOL bEnable);
1340 //-------------------------------------------------------------------------------------------------
1341 /// Set Extended  MVOP Input stream information and reset ex-stream status.
1342 /// @ingroup MVOP_Basic
1343 /// @param eID \b IN : Device ID.
1344 /// @param in \b IN : Set mvop input: Hardwire mode or MCU mode / Codec type.
1345 /// @param pCfg \b IN : Set mvop input: MCU mode data format setting.
1346 /// @return MVOP_Result
1347 ///     - E_MVOP_OK: success
1348 ///     - E_MVOP_FAIL: failed
1349 ///     - E_MVOP_INVALID_PARAM: input param error.
1350 ///     - E_MVOP_NOT_INIT: not initialized yet.
1351 ///     - E_MVOP_UNSUPPORTED: input case not support.
1352 //-------------------------------------------------------------------------------------------------
1353 MVOP_Result MDrv_MVOP_EX_SetInputCfg (MVOP_DevID eID, MVOP_InputSel in, MVOP_InputCfg* pCfg);
1354 //-------------------------------------------------------------------------------------------------
1355 /// Set Extended  MVOP Output timing information.
1356 /// @ingroup MVOP_Basic
1357 /// @param eID \b IN : Device ID.
1358 /// @param pstVideoStatus \b IN : Set mvop output Timing.
1359 /// @param bEnHDup \b IN : Is Hsize duplicated?
1360 /// @return MVOP_Result
1361 ///     - E_MVOP_OK: success
1362 ///     - E_MVOP_FAIL: failed
1363 ///     - E_MVOP_INVALID_PARAM: input param error.
1364 ///     - E_MVOP_NOT_INIT: not initialized yet.
1365 ///     - E_MVOP_UNSUPPORTED: input case not support.
1366 //-------------------------------------------------------------------------------------------------
1367 MVOP_Result MDrv_MVOP_EX_SetOutputCfg(MVOP_DevID eID, MVOP_VidStat *pstVideoStatus, MS_BOOL bEnHDup);
1368 
1369 //-------------------------------------------------------------------------------------------------
1370 /// Set Extended MVOP Pattern type.
1371 /// @ingroup MVOP_SetCommand
1372 /// @param eID \b IN : Device ID.
1373 /// @param enMVOPPattern \b IN: pattern type.
1374 /// @return MVOP_Result
1375 ///     - E_MVOP_OK: success
1376 ///     - E_MVOP_FAIL: failed
1377 ///     - E_MVOP_INVALID_PARAM: input param error.
1378 ///     - E_MVOP_NOT_INIT: not initialized yet.
1379 ///     - E_MVOP_UNSUPPORTED: input case not support.
1380 //-------------------------------------------------------------------------------------------------
1381 MVOP_Result MDrv_MVOP_EX_SetPattern(MVOP_DevID eID, MVOP_Pattern enMVOPPattern);
1382 //-------------------------------------------------------------------------------------------------
1383 /// Set Extended MVOP tile format.
1384 /// @ingroup MVOP_SetCommand
1385 /// @param eID \b IN : Device ID.
1386 /// @param eTileFmt \b IN: tile format.
1387 /// @return MVOP_Result
1388 ///     - E_MVOP_OK: success
1389 ///     - E_MVOP_FAIL: failed
1390 ///     - E_MVOP_INVALID_PARAM: input param error.
1391 ///     - E_MVOP_NOT_INIT: not initialized yet.
1392 ///     - E_MVOP_UNSUPPORTED: input case not support.
1393 //-------------------------------------------------------------------------------------------------
1394 MVOP_Result MDrv_MVOP_EX_SetTileFormat(MVOP_DevID eID, MVOP_TileFormat eTileFmt);
1395 //-------------------------------------------------------------------------------------------------
1396 /// Set Extended MVOP UV forwarding one line.
1397 /// @ingroup MVOP_SetCommand
1398 /// @param eID \b IN : Device ID.
1399 /// @param bEnable \b IN: enable or disable.
1400 /// @return MVOP_Result
1401 ///     - E_MVOP_OK: success
1402 ///     - E_MVOP_FAIL: failed
1403 ///     - E_MVOP_INVALID_PARAM: input param error.
1404 ///     - E_MVOP_NOT_INIT: not initialized yet.
1405 ///     - E_MVOP_UNSUPPORTED: input case not support.
1406 //-------------------------------------------------------------------------------------------------
1407 MVOP_Result MDrv_MVOP_EX_EnableUVShift(MVOP_DevID eID, MS_BOOL bEnable);
1408 //-------------------------------------------------------------------------------------------------
1409 /// Set Extended MVOP Background color as black.
1410 /// @ingroup MVOP_Basic
1411 /// @param eID \b IN : Device ID.
1412 /// @param void \b IN : void.
1413 /// @return: void.
1414 //-------------------------------------------------------------------------------------------------
1415 MVOP_Result MDrv_MVOP_EX_EnableBlackBG(MVOP_DevID eID);
1416 //-------------------------------------------------------------------------------------------------
1417 /// Set Extended MVOP only Luma data(Black/white feature).
1418 /// @ingroup MVOP_SetCommand
1419 /// @param eID \b IN : Device ID.
1420 /// @param bEnable \b IN: enable or disable.
1421 /// @return MVOP_Result
1422 ///     - E_MVOP_OK: success
1423 ///     - E_MVOP_FAIL: failed
1424 ///     - E_MVOP_INVALID_PARAM: input param error.
1425 ///     - E_MVOP_NOT_INIT: not initialized yet.
1426 ///     - E_MVOP_UNSUPPORTED: input case not support.
1427 //-------------------------------------------------------------------------------------------------
1428 MVOP_Result MDrv_MVOP_EX_SetMonoMode(MVOP_DevID eID, MS_BOOL bEnable);
1429 //-------------------------------------------------------------------------------------------------
1430 /// Set Extended MVOP Vtt fixed.
1431 /// @ingroup MVOP_SetCommand
1432 /// @param eID \b IN : Device ID.
1433 /// @param u16FixVtt \b IN: Vtt.
1434 /// @return MVOP_Result
1435 ///     - E_MVOP_OK: success
1436 ///     - E_MVOP_FAIL: failed
1437 ///     - E_MVOP_INVALID_PARAM: input param error.
1438 ///     - E_MVOP_NOT_INIT: not initialized yet.
1439 ///     - E_MVOP_UNSUPPORTED: input case not support.
1440 //-------------------------------------------------------------------------------------------------
1441 MVOP_Result MDrv_MVOP_EX_SetFixVtt(MVOP_DevID eID, MS_U16 u16FixVtt);
1442 //-------------------------------------------------------------------------------------------------
1443 /// Set Extended MVOP access which miu.
1444 /// @ingroup MVOP_Basic
1445 /// @param eID \b IN : Device ID.
1446 /// @param u8Miu \b IN : miu 0/1/2...
1447 /// @return MVOP_Result
1448 ///     - E_MVOP_OK: success
1449 ///     - E_MVOP_FAIL: failed
1450 ///     - E_MVOP_INVALID_PARAM: input param error.
1451 ///     - E_MVOP_NOT_INIT: not initialized yet.
1452 ///     - E_MVOP_UNSUPPORTED: input case not support.
1453 //-------------------------------------------------------------------------------------------------
1454 MVOP_Result MDrv_MVOP_EX_MiuSwitch(MVOP_DevID eID, MS_U8 u8Miu);
1455 //-------------------------------------------------------------------------------------------------
1456 /// Set Extended MVOP mirror mode.
1457 /// @ingroup MVOP_SetCommand
1458 /// @param eID \b IN : Device ID.
1459 /// @param bEnable \b IN: enable/disable.
1460 /// @param eMirrorMode \b IN: mirror mode type.
1461 /// @return MVOP_Result
1462 ///     - E_MVOP_OK: success
1463 ///     - E_MVOP_FAIL: failed
1464 ///     - E_MVOP_INVALID_PARAM: input param error.
1465 ///     - E_MVOP_NOT_INIT: not initialized yet.
1466 ///     - E_MVOP_UNSUPPORTED: input case not support.
1467 //-------------------------------------------------------------------------------------------------
1468 MVOP_Result MDrv_MVOP_EX_SetVOPMirrorMode(MVOP_DevID eID, MS_BOOL bEnable, MVOP_DrvMirror eMirrorMode);
1469 //-------------------------------------------------------------------------------------------------
1470 /// Set Extended MVOP enable freerun mode.
1471 /// @ingroup MVOP_SetCommand
1472 /// @param eID \b IN : Device ID.
1473 /// @param bEnable \b IN: enable/disable.
1474 /// @return MVOP_Result
1475 ///     - E_MVOP_OK: success
1476 ///     - E_MVOP_FAIL: failed
1477 ///     - E_MVOP_INVALID_PARAM: input param error.
1478 ///     - E_MVOP_NOT_INIT: not initialized yet.
1479 ///     - E_MVOP_UNSUPPORTED: input case not support.
1480 //-------------------------------------------------------------------------------------------------
1481 MVOP_Result MDrv_MVOP_EX_EnableFreerunMode(MVOP_DevID eID, MS_BOOL bEnable);
1482 
1483 //-------------------------------------------------------------------------------------------------
1484 /// Get Extended MVOP output timing.
1485 /// @ingroup MVOP_GetCommand
1486 /// @param eID \b IN : Device ID.
1487 /// @param pMVOPTiming \b IN : the pointer of timing struc.
1488 /// @return MVOP_Result
1489 ///     - E_MVOP_OK: success
1490 ///     - E_MVOP_FAIL: failed
1491 ///     - E_MVOP_INVALID_PARAM: input param error.
1492 ///     - E_MVOP_NOT_INIT: not initialized yet.
1493 ///     - E_MVOP_UNSUPPORTED: input case not support.
1494 //-------------------------------------------------------------------------------------------------
1495 MVOP_Result MDrv_MVOP_EX_GetOutputTiming(MVOP_DevID eID, MVOP_Timing* pMVOPTiming);
1496 //-------------------------------------------------------------------------------------------------
1497 /// Get Extended MVOP is enable or not.
1498 /// @ingroup MVOP_GetCommand
1499 /// @param eID \b IN : Device ID.
1500 /// @param pbEnable \b IN : Is enable or not.
1501 /// @return: true or false.
1502 //-------------------------------------------------------------------------------------------------
1503 MVOP_Result MDrv_MVOP_EX_GetIsEnable (MVOP_DevID eID, MS_BOOL* pbEnable);
1504 //-------------------------------------------------------------------------------------------------
1505 /// Get Extended MVOP the timing of xc data starting(capture win. h start).
1506 /// @ingroup MVOP_GetCommand
1507 /// @param eID \b IN : Device ID.
1508 /// @param void \b IN : void.
1509 /// @return: timing of data start in Htt.
1510 //-------------------------------------------------------------------------------------------------
1511 MS_U16 MDrv_MVOP_EX_GetHStart(MVOP_DevID eID);
1512 //-------------------------------------------------------------------------------------------------
1513 /// Get Extended MVOP the timing of xc data starting(capture win. v start).
1514 /// @ingroup MVOP_GetCommand
1515 /// @param eID \b IN : Device ID.
1516 /// @param void \b IN : void.
1517 /// @return: timing of data start in Vtt.
1518 //-------------------------------------------------------------------------------------------------
1519 MS_U16 MDrv_MVOP_EX_GetVStart(MVOP_DevID eID);
1520 //-------------------------------------------------------------------------------------------------
1521 /// Get Extended MVOP source Width.
1522 /// @ingroup MVOP_GetCommand
1523 /// @param eID \b IN : Device ID.
1524 /// @param void \b IN : void.
1525 /// @return: Width.
1526 //-------------------------------------------------------------------------------------------------
1527 MS_U16 MDrv_MVOP_EX_GetHSize(MVOP_DevID eID);
1528 //-------------------------------------------------------------------------------------------------
1529 /// Get Extended MVOP source Height.
1530 /// @ingroup MVOP_GetCommand
1531 /// @param eID \b IN : Device ID.
1532 /// @param void \b IN : void.
1533 /// @return: Height.
1534 //-------------------------------------------------------------------------------------------------
1535 MS_U16 MDrv_MVOP_EX_GetVSize(MVOP_DevID eID);
1536 //-------------------------------------------------------------------------------------------------
1537 /// Get Extended MVOP timing is interlace or not.
1538 /// @ingroup MVOP_GetCommand
1539 /// @param eID \b IN : Device ID.
1540 /// @param void \b IN : void.
1541 /// @return: true or false.
1542 //-------------------------------------------------------------------------------------------------
1543 MS_BOOL MDrv_MVOP_EX_GetIsInterlace(MVOP_DevID eID);
1544 //-------------------------------------------------------------------------------------------------
1545 /// Get Extended MVOP H data is duplicated or not.
1546 /// @ingroup MVOP_GetCommand
1547 /// @param eID \b IN : Device ID.
1548 /// @param void \b IN : void.
1549 /// @return: true or false.
1550 //-------------------------------------------------------------------------------------------------
1551 MS_BOOL MDrv_MVOP_EX_GetIsHDuplicate(MVOP_DevID eID);
1552 //-------------------------------------------------------------------------------------------------
1553 /// Get Extended MVOP current setting status.
1554 /// @ingroup MVOP_GetCommand
1555 /// @param eID \b IN : Device ID.
1556 /// @param pMVOPStat \b IN : the pointer of mvop status.
1557 /// @return MS_BOOL: get is status successful or not.
1558 //-------------------------------------------------------------------------------------------------
1559 MS_BOOL MDrv_MVOP_EX_GetStatus(MVOP_DevID eID, MVOP_DrvStatus *pMVOPStat);
1560 #if defined (__aarch64__)
1561 MS_BOOL MDrv_MVOP_EX_CheckCapability(MVOP_DevID eID, MS_U64 u32InParam);
1562 #else
1563 //-------------------------------------------------------------------------------------------------
1564 /// Get Extended MVOP HW capability.
1565 /// @ingroup MVOP_GetCommand
1566 /// @param eID \b IN : Device ID.
1567 /// @param u16HSize \b IN : input height.
1568 /// @param u16VSize \b IN : input height.
1569 /// @param u16Fps \b IN : input framerate.
1570 /// @return MS_BOOL: support this timing or not.
1571 //-------------------------------------------------------------------------------------------------
1572 MS_BOOL MDrv_MVOP_EX_CheckCapability(MVOP_DevID eID, MS_U32 u32InParam);
1573 #endif
1574 MS_BOOL MDrv_MVOP_EX_GetDstInfo(MVOP_DevID eID, MVOP_DST_DispInfo *pDstInfo, MS_U32 u32SizeofDstInfo);
1575 //   Functions for the 3rd MVOP }
1576 //-------------------------------------------------------------------------------------------------
1577 /// Set Main MVOP enable freerun mode.
1578 /// @ingroup MVOP_SetCommand
1579 /// @param bEnable \b IN: enable/disable.
1580 /// @return: MS_BOOL: setting successfully or not.
1581 //-------------------------------------------------------------------------------------------------
1582 MVOP_Result MDrv_MVOP_SendBlueScreen(MS_U16 u16Width, MS_U16 u16Height);
1583 //-------------------------------------------------------------------------------------------------
1584 /// Set Main MVOP by command.
1585 /// @ingroup MVOP_SetCommand
1586 /// @param stHd \b IN: device id(main/sub..).
1587 /// @param eCmd \b IN: command enum.
1588 /// @param pPara \b IN: command parameters.
1589 /// @return: void.
1590 //-------------------------------------------------------------------------------------------------
1591 MVOP_Result MDrv_MVOP_SetCommand(MVOP_Handle* stHd, MVOP_Command eCmd, void* pPara);
1592 //-------------------------------------------------------------------------------------------------
1593 /// Get Main MVOP information by command.
1594 /// @ingroup MVOP_GetCommand
1595 /// @param stHd \b IN : Devide ID(main mvop or sub).
1596 /// @param eCmd \b IN : command enum.
1597 /// @param pPara \b IN : command parameters.
1598 /// @param u32ParaSize \b IN : size of Parameter structure.
1599 /// @return MVOP_Result
1600 ///     - E_MVOP_OK: success
1601 ///     - E_MVOP_FAIL: failed
1602 ///     - E_MVOP_INVALID_PARAM: input param error.
1603 ///     - E_MVOP_NOT_INIT: not initialized yet.
1604 ///     - E_MVOP_UNSUPPORTED: input case not support.
1605 //-------------------------------------------------------------------------------------------------
1606 MVOP_Result MDrv_MVOP_GetCommand(MVOP_Handle* stHd, MVOP_Command eCmd, void* pPara, MS_U32 u32ParaSize);
1607 //-------------------------------------------------------------------------------------------------
1608 /// Set Main MVOP output clock.
1609 /// @ingroup MVOP_SetCommand
1610 /// @param eFreq \b IN: clock.
1611 /// @return: void.
1612 //-------------------------------------------------------------------------------------------------
1613 void MDrv_MVOP_SetFrequency(MVOP_FREQUENCY eFreq);
1614 //-------------------------------------------------------------------------------------------------
1615 /// Set Main MVOP STR command.
1616 /// @ingroup MVOP_Basic
1617 /// @param u16PowerState \b IN : command of STR(resume/suspend)
1618 /// @return MS_U32: utopia status.
1619 //-------------------------------------------------------------------------------------------------
1620 MS_U32 MDrv_MVOP_SetPowerState(EN_POWER_MODE u16PowerState);
1621 #ifdef __cplusplus
1622 }
1623 #endif
1624 
1625 #endif // _DRV_MVOP_H_
1626