xref: /utopia/UTPA2-700.0.x/projects/tmplib/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
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
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
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_UNKNOWN = -1
358 } MVOP_InputSel;
359 
360 /// MVOP VideoStat data structure
361 typedef struct
362 {
363     MS_U16 u16HorSize;
364     MS_U16 u16VerSize;
365     MS_U16 u16FrameRate;
366     MS_U8 u8AspectRate;
367     MS_U8 u8Interlace;
368     MS_U16 u16HorOffset;
369     MS_U16 u16VerOffset;
370 } MVOP_VidStat;
371 
372 /// MVOP driver info.
373 typedef struct _MVOP_DrvInfo
374 {
375     MS_U32 u32MaxSynClk;
376     MS_U32 u32MinSynClk;
377     MS_U32 u32MaxFreerunClk;
378 } MVOP_DrvInfo;
379 
380 ///MVOP driver status
381 typedef struct _MVOP_DrvStatus
382 {
383     MS_BOOL bIsInit;
384     MS_BOOL bIsEnable;
385     MS_BOOL bIsUVShift;
386     MS_BOOL bIsBlackBG;
387     MS_BOOL bIsMonoMode;
388     MS_BOOL bIsSetTiming;
389 } MVOP_DrvStatus;
390 
391 ///MVOP module enum
392 typedef enum
393 {
394     E_MVOP_MODULE_MAIN = 0,
395     E_MVOP_MODULE_SUB  = 1,
396     E_MVOP_MODULE_MAX
397 } MVOP_Module;
398 
399 ///MVOP device enum
400 typedef enum
401 {
402     E_MVOP_DEV_0    = 0,    ///< Main mvop
403     E_MVOP_DEV_1    = 1,    ///< Sub mvop
404     E_MVOP_DEV_2    = 2,    ///< 3rd mvop
405     E_MVOP_DEV_NONE = 0xff
406 } MVOP_DevID;
407 
408 ///MVOP handle to carry out MVOP info.
409 typedef struct _MVOP_Handle
410 {
411     MVOP_Module eModuleNum;
412 } MVOP_Handle;
413 
414 
415 typedef enum
416 {
417     E_MVOP_MAIN_VIEW    = 0,
418     E_MVOP_2ND_VIEW     = 0x01, ///< buffer underflow
419 } MVOP_3DView;
420 
421 typedef struct
422 {
423     MVOP_3DView eView;
424     MS_PHY u32YOffset;
425     MS_PHY u32UVOffset;
426 } MVOP_BaseAddInput;
427 
428 typedef struct
429 {
430     MS_BOOL bIsEnableLuma;
431     MS_BOOL bIsEnableChroma;
432     MS_U8 u8LumaValue;
433     MS_U8 u8ChromaValue;
434 } MVOP_VC1RangeMapInfo;
435 
436 typedef struct
437 {
438     MS_PHY u32MSBYOffset;
439     MS_PHY u32MSBUVOffset;
440     MS_PHY u32LSBYOffset;
441     MS_PHY u32LSBUVOffset;
442     MS_BOOL bProgressive;
443     MS_BOOL b422Pack;
444     MS_BOOL bEnLSB;
445 } MVOP_EVDBaseAddInput;
446 
447 typedef enum
448 {
449     E_MVOP_EVD_8BIT    = 0,
450     E_MVOP_EVD_10BIT     = 0x01, ///< buffer underflow
451 } MVOP_EVDBit;
452 
453 typedef struct
454 {
455     MS_BOOL bEnableEVD;
456     MVOP_EVDBit eEVDBit[2];
457 }MVOP_EVDFeature;
458 
459 typedef enum
460 {
461     E_MVOP_MAIN_STREAM    = 0,
462     //E_MVOP_2nd_STREAM     = 1,
463 } MVOP_StreamID;
464 
465 ///MVOP set command used by MDrv_MVOP_SetCommand()
466 typedef enum
467 {
468     E_MVOP_CMD_SET_TYPE = 0x100,
469     E_MVOP_CMD_SET_VSIZE_MIN,             ///< 0x101 Enable vsize minimum checking
470     E_MVOP_CMD_SET_STB_FD_MASK_CLR,       ///< 0x102 Force set fd_mask to low
471     E_MVOP_CMD_SET_3DLR_INST_VBLANK,      ///< 0x103 Vertical blanking lines between L & R for 3D L/R mode.
472     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.
473     E_MVOP_CMD_SET_RGB_FMT,               ///< 0x105 RGB format input: MVOP_RgbFormat.
474     E_MVOP_CMD_SET_SW_CTRL_FIELD_ENABLE,  ///< 0x106 Force read top or bottom field.
475     E_MVOP_CMD_SET_SW_CTRL_FIELD_DSIABLE, ///< 0x107 Disable force read control
476     E_MVOP_CMD_SET_3DLR_2ND_CFG,          ///< 0x108 Enable supporting 2nd pitch(h/vsize) for 3D L/R mode.
477     E_MVOP_CMD_SET_VSIZE_DUPLICATE,       ///< 0x109 Enable/Disable VSize duplicate.
478     E_MVOP_CMD_SET_3DLR_ALT_OUT_SBS,      ///< 0x10A Line alternative read of 3D L/R mode, side-by-side output.
479     E_MVOP_CMD_SET_FIELD_DUPLICATE,       ///< 0x10B Repeat field for interlace source. (only input one field)
480     E_MVOP_CMD_SET_VSYNC_MODE,            ///< 0x10C Set VSync mode (0: original; 1: new)
481     E_MVOP_CMD_SET_VSIZE_X4_DUPLICATE,       ///< 0x10D Enable/Disable VSize x4 duplicate.
482     E_MVOP_CMD_SET_HSIZE_X4_DUPLICATE,       ///< 0x10E Enable/Disable VSize x4 duplicate.
483     E_MVOP_CMD_SET_BASE_ADD_MULTI_VIEW,  ///< 0x10F Set Muiltiple view Base Address for 3D L/R mode.
484     E_MVOP_CMD_SET_FIRE_MVOP,             ///< 0x110 Force load MVOP register in.
485     E_MVOP_CMD_SET_VC1_RANGE_MAP,         ///< 0x111 Set VC1 Range Map Luma/Chroma Address
486     E_MVOP_CMD_SET_POWER_STATE,           ///< 0x112 Set MVOP STR(suspend/resume)
487     E_MVOP_CMD_SET_420_BW_SAVING_MODE,   ///< 0X113 Set MVOP BW SAVING MODE(0:original 1:save 1/4 bw)
488     E_MVOP_CMD_SET_EVD_BASE_ADD,          ///< 0x114 Set 10bits or 8bits base addresss for EVD.
489     E_MVOP_CMD_SET_EVD_FEATURE,          ///< 0x115 Set EVD Mode and 10bits or 8 bits Enable.
490     E_MVOP_CMD_SET_MVD_LATE_REPEAT,      ////<0x116 Set repeat previous frame if HVD/MVD can not finish vsync.
491     E_MVOP_CMD_SET_HANDSHAKE_MODE,      ////<0x117 TV chip support handshake mode after muji and monet.
492     E_MVOP_CMD_SET_FRC_OUTPUT,          ////<0x118 Reset MVOP output timing.
493 
494     E_MVOP_CMD_GET_TYPE = 0x400,
495     E_MVOP_CMD_GET_3DLR_ALT_OUT,                ///< 0x401 Query if it is 3D L/R alternative lines output.
496     E_MVOP_CMD_GET_MIRROR_MODE,                 ///< 0x402 Get Mirror Mode
497     E_MVOP_CMD_GET_3DLR_2ND_CFG,                ///< 0x403 Get if 3D LR 2nd pitch is enabled.
498     E_MVOP_CMD_GET_VSIZE_DUPLICATE,             ///< 0x404 Get if VSize duplicate is enabled.
499     E_MVOP_CMD_GET_BASE_ADD_BITS,               ///< 0x405 Get bits of y/uv address.
500     E_MVOP_CMD_GET_TOTAL_MVOP_NUM,              ///<0X406 Get how many mvop in this chip.
501     E_MVOP_CMD_GET_MAXIMUM_CLK,                 ///< 0x407 Get maximum mvop(dc0) clock.
502     E_MVOP_CMD_GET_CURRENT_CLK,                 ///< 0x408 Get current mvop(dc0) clock.
503     E_MVOP_CMD_GET_BASE_ADD_MULTI_VIEW,        ///< 0x409 Get base address of main/sub view.
504     E_MVOP_CMD_GET_TOP_FIELD_IMAGE_VSTART,     ///< 0x40A Get top field vstart.
505     E_MVOP_CMD_GET_BOTTOM_FIELD_IMAGE_VSTART,  ///< 0x40B Get bot field vstart.
506     E_MVOP_CMD_GET_VCOUNT,                       ///< 0x40C Get tgen vcount.
507     E_MVOP_CMD_GET_HANDSHAKE_MODE,              ///< 0x40D Get Handshaking mode status.
508     E_MVOP_CMD_GET_MAX_FPS,                      ///< 0x40E Get mvop supporting max framerate.
509     E_MVOP_CMD_GET_CROP_FOR_XC,                 ///< 0x40F Set crop and Get crop infomation. Without set register.
510     E_MVOP_CMD_GET_MVOP_SW_CROP_ADD,          ///< 0x410 If hw not support crop, sw patch for base address.
511     E_MVOP_CMD_GET_IS_SW_CROP,                  ///< 0x411 If hw not support crop or not?
512     E_MVOP_CMD_GET_OUTPUT_HV_RATIO,             //<0x412 Get mvop output HV ratio.
513 } MVOP_Command;
514 
515 typedef enum
516 {
517     E_MVOP_SYNCMODE,
518     E_MVOP_FREERUNMODE,
519     E_MVOP_27MHZ = 27000000ul,
520     E_MVOP_54MHZ = 54000000ul,
521     E_MVOP_72MHZ = 72000000ul,
522     E_MVOP_108MHZ = 108000000ul,
523     E_MVOP_123MHZ = 123000000ul,
524     E_MVOP_144MHZ = 144000000ul,
525     E_MVOP_160MHZ = 160000000ul,
526     E_MVOP_172MHZ = 172000000ul,
527     E_MVOP_192MHZ = 192000000ul,
528     E_MVOP_320MHZ = 320000000ul,
529 }MVOP_FREQUENCY;
530 
531 // Interrupt
532 typedef enum
533 {
534     E_MVOP_INT_NONE    = 0,
535     E_MVOP_INT_BUFF_UF = 0x01, ///< buffer underflow
536     E_MVOP_INT_BUFF_OF = 0x02, ///< buffer overflow
537     E_MVOP_INT_VSYNC   = 0x04, ///< Vsync interrupt
538     E_MVOP_INT_HSYNC   = 0x08, ///< Hsync interrupt
539     E_MVOP_INT_RDY     = 0x10, ///< DC ready interrupt
540     E_MVOP_INT_FDCHNG  = 0x20, ///< field change
541 } MVOP_IntType;
542 
543 typedef struct
544 {
545     MS_U8  u8StrVer;
546     MS_U8  u8Rsrvd;
547     MS_U16 u16HSize;
548     MS_U16 u16VSize;
549     MS_U16 u16Fps;
550 } MVOP_CapInput;
551 
552 typedef struct
553 {
554     MS_BOOL  bEnable3DLRALT;
555     MS_BOOL  bEnable3DLRSBS;
556     MS_BOOL  bEnableVdup;
557     MS_BOOL  bEnableVx4;
558     MS_BOOL  bEnableHx4;
559     MS_BOOL  bEnableVsyncMode;
560     MS_BOOL  bEnableHMirror;
561     MS_BOOL  bEnableVMirror;
562     MS_BOOL  bEnableBWSave;
563     MS_BOOL  bEnableRptPreVsync;
564 } MVOP_ComdFlag;
565 
566 typedef enum
567 {
568     E_MVOP_HS_NOT_SUPPORT    = 0,
569     E_MVOP_HS_ENABLE         = 0x01,
570     E_MVOP_HS_DISABLE        = 0x02,
571     E_MVOP_HS_INVALID_PARAM = 0x03,
572 
573 } MVOP_HSMode;
574 
575 typedef struct
576 {
577     MS_U32 u32Framerate;
578     MS_U16 u16HSize;
579     MS_U16 u16VSize;
580     MS_BOOL b3DTB;
581     MS_BOOL b3DSBS;
582     MS_BOOL bReserve[6];
583 } MVOP_GetMaxFps;
584 
585 typedef struct
586 {
587     MS_U16 u16XStart;
588     MS_U16 u16YStart;
589     MS_U16 u16XSize;
590     MS_U16 u16YSize;
591     MS_U32 reserve[2];
592 } MVOP_XCGetCrop;
593 
594 typedef struct
595 {
596     MS_U32 u32MSBStartY0;
597     MS_U32 u32MSBStartUV0;
598     MS_U32 u32MSBStartY1;
599     MS_U32 u32MSBStartUV1;
600 
601     MS_U32 u32LSBStartY0;
602     MS_U32 u32LSBStartUV0;
603     MS_U32 u32LSBStartY1;
604     MS_U32 u32LSBStartUV1;
605     MVOP_XCGetCrop stXCCrop;
606     MS_U16 u16XCap;
607     MS_U16 u16YCap;
608     MS_U32 reserve[4];
609     MS_U32 u32MFCodecInfo;
610     MS_U32 u32LumaMFCbitlen;
611     MS_U32 u32ChromaMFCbitlen;
612     MS_U16 u16Pitch;
613     MS_U16 u16Pitch_2bit;
614 } MVOP_XCGetCropMirAdd;
615 
616 typedef struct
617 {
618     float fHratio;
619     float fVratio;
620     float reserve0[4];
621     MS_U32 reserve1[2];
622 } MVOP_OutputHVRatio;
623 
624 //-------------------------------------------------------------------------------------------------
625 //  Function and Variable
626 //-------------------------------------------------------------------------------------------------
627 
628 // Basic Function
629 //-------------------------------------------------------------------------------------------------
630 /// Initial Main MVOP.
631 /// @ingroup MVOP_Basic
632 /// @param void \b IN : void
633 /// @return void
634 //-------------------------------------------------------------------------------------------------
635 void MDrv_MVOP_Init (void);
636 //-------------------------------------------------------------------------------------------------
637 /// Disable Main MVOP clock.
638 /// @ingroup MVOP_Basic
639 /// @param void \b IN : void
640 /// @return void
641 //-------------------------------------------------------------------------------------------------
642 void MDrv_MVOP_Exit(void);
643 //-------------------------------------------------------------------------------------------------
644 /// Main MVOP power switch; start to generate timing.
645 /// @ingroup MVOP_Basic
646 /// @param MS_BOOL \b IN : enable or disable MVOP.
647 /// @return void
648 //-------------------------------------------------------------------------------------------------
649 void MDrv_MVOP_Enable ( MS_BOOL bEnable );
650 //-------------------------------------------------------------------------------------------------
651 /// Set Main MVOP Input stream information and reset ex-stream status.
652 /// @ingroup MVOP_Basic
653 /// @param in \b IN : Set mvop input: Hardwire mode or MCU mode / Codec type.
654 /// @param pCfg \b IN : Set mvop input: MCU mode data format setting.
655 /// @return MVOP_Result
656 ///     - E_MVOP_OK: success
657 ///     - E_MVOP_FAIL: failed
658 ///     - E_MVOP_INVALID_PARAM: input param error.
659 ///     - E_MVOP_NOT_INIT: not initialized yet.
660 ///     - E_MVOP_UNSUPPORTED: input case not support.
661 //-------------------------------------------------------------------------------------------------
662 MVOP_Result MDrv_MVOP_SetInputCfg (MVOP_InputSel in, MVOP_InputCfg* pCfg);
663 //-------------------------------------------------------------------------------------------------
664 /// Set Main MVOP Output timing information.
665 /// @ingroup MVOP_Basic
666 /// @param pstVideoStatus \b IN : Set mvop output Timing.
667 /// @param bEnHDup \b IN : Is Hsize duplicated?
668 /// @return MVOP_Result
669 ///     - E_MVOP_OK: success
670 ///     - E_MVOP_FAIL: failed
671 ///     - E_MVOP_INVALID_PARAM: input param error.
672 ///     - E_MVOP_NOT_INIT: not initialized yet.
673 ///     - E_MVOP_UNSUPPORTED: input case not support.
674 //-------------------------------------------------------------------------------------------------
675 MVOP_Result MDrv_MVOP_SetOutputCfg(MVOP_VidStat *pstVideoStatus, MS_BOOL bEnHDup);
676 //-------------------------------------------------------------------------------------------------
677 /// Set Main MVOP Background color as black.
678 /// @ingroup MVOP_Basic
679 /// @param void \b IN : void.
680 /// @return: void.
681 //-------------------------------------------------------------------------------------------------
682 void MDrv_MVOP_EnableBlackBG ( void );
683 // SetCommand Function
684 //-------------------------------------------------------------------------------------------------
685 /// Set Main MVOP UV forwarding one line.
686 /// @ingroup MVOP_SetCommand
687 /// @param bEnable \b IN: enable or disable.
688 /// @return: void.
689 //-------------------------------------------------------------------------------------------------
690 void MDrv_MVOP_EnableUVShift(MS_BOOL bEnable);
691 //-------------------------------------------------------------------------------------------------
692 /// Set Main MVOP only Luma data(Black/white feature).
693 /// @ingroup MVOP_SetCommand
694 /// @param bEnable \b IN: enable or disable.
695 /// @return: void.
696 //-------------------------------------------------------------------------------------------------
697 void MDrv_MVOP_SetMonoMode(MS_BOOL bEnable);
698 // GetCommand Function
699 //-------------------------------------------------------------------------------------------------
700 /// Get Main MVOP source Width.
701 /// @ingroup MVOP_GetCommand
702 /// @param void \b IN : void.
703 /// @return: Width.
704 //-------------------------------------------------------------------------------------------------
705 MS_U16 MDrv_MVOP_GetHSize(void);
706 //-------------------------------------------------------------------------------------------------
707 /// Get Main MVOP source Height.
708 /// @ingroup MVOP_GetCommand
709 /// @param void \b IN : void.
710 /// @return: Height.
711 //-------------------------------------------------------------------------------------------------
712 MS_U16 MDrv_MVOP_GetVSize(void);
713 //-------------------------------------------------------------------------------------------------
714 /// Get Main MVOP the timing of xc data starting(capture win. h start).
715 /// @ingroup MVOP_GetCommand
716 /// @param void \b IN : void.
717 /// @return: timing of data start in Htt.
718 //-------------------------------------------------------------------------------------------------
719 MS_U16 MDrv_MVOP_GetHStart(void);
720 //-------------------------------------------------------------------------------------------------
721 /// Get Main MVOP the timing of xc data starting(capture win. v start).
722 /// @ingroup MVOP_GetCommand
723 /// @param void \b IN : void.
724 /// @return: timing of data start in Vtt.
725 //-------------------------------------------------------------------------------------------------
726 MS_U16 MDrv_MVOP_GetVStart(void);
727 //-------------------------------------------------------------------------------------------------
728 /// Get Main MVOP timing is interlace or not.
729 /// @ingroup MVOP_GetCommand
730 /// @param void \b IN : void.
731 /// @return: true or false.
732 //-------------------------------------------------------------------------------------------------
733 MS_BOOL MDrv_MVOP_GetIsInterlace(void);
734 //-------------------------------------------------------------------------------------------------
735 /// Get Main MVOP H data is duplicated or not.
736 /// @ingroup MVOP_GetCommand
737 /// @param void \b IN : void.
738 /// @return: true or false.
739 //-------------------------------------------------------------------------------------------------
740 MS_BOOL MDrv_MVOP_GetIsHDuplicate(void);
741 //-------------------------------------------------------------------------------------------------
742 /// Get Main MVOP is enable or not.
743 /// @ingroup MVOP_GetCommand
744 /// @param pbEnable \b IN : Is enable or not.
745 /// @return: true or false.
746 //-------------------------------------------------------------------------------------------------
747 MVOP_Result MDrv_MVOP_GetIsEnable ( MS_BOOL* pbEnable );
748 //-------------------------------------------------------------------------------------------------
749 /// Get Main MVOP output timing.
750 /// @ingroup MVOP_GetCommand
751 /// @param pMVOPTiming \b IN : the pointer of timing struc.
752 /// @return MVOP_Result
753 ///     - E_MVOP_OK: success
754 ///     - E_MVOP_FAIL: failed
755 ///     - E_MVOP_INVALID_PARAM: input param error.
756 ///     - E_MVOP_NOT_INIT: not initialized yet.
757 ///     - E_MVOP_UNSUPPORTED: input case not support.
758 //-------------------------------------------------------------------------------------------------
759 MVOP_Result MDrv_MVOP_GetOutputTiming(MVOP_Timing* pMVOPTiming);
760 //-------------------------------------------------------------------------------------------------
761 /// Get Main MVOP library version.
762 /// @ingroup MVOP_GetCommand
763 /// @param ppVersion \b IN : mvop library version no..
764 /// @return MVOP_Result
765 ///     - E_MVOP_OK: success
766 ///     - E_MVOP_FAIL: failed
767 ///     - E_MVOP_INVALID_PARAM: input param error.
768 ///     - E_MVOP_NOT_INIT: not initialized yet.
769 ///     - E_MVOP_UNSUPPORTED: input case not support.
770 //-------------------------------------------------------------------------------------------------
771 // MVOP_Result MDrv_MVOP_GetLibVer(const MSIF_Version **ppVersion);
772 //-------------------------------------------------------------------------------------------------
773 /// Get Main MVOP HW capability.
774 /// @ingroup MVOP_GetCommand
775 /// @param u16HSize \b IN : input height.
776 /// @param u16VSize \b IN : input height.
777 /// @param u16Fps \b IN : input framerate.
778 /// @return MS_BOOL: support this timing or not.
779 //-------------------------------------------------------------------------------------------------
780 MS_BOOL MDrv_MVOP_CheckCapability(MS_U16 u16HSize, MS_U16 u16VSize, MS_U16 u16Fps);
781 //   Functions for the 3rd MVOP }
782 //-------------------------------------------------------------------------------------------------
783 /// Get Main MVOP maximum of horizontal offset.
784 /// @ingroup MVOP_GetCommand
785 /// @param u16HSize \b IN : input height.
786 /// @param u16VSize \b IN : input height.
787 /// @param u16Fps \b IN : input framerate.
788 /// @return MS_BOOL: maximum of horizontal offset.
789 //-------------------------------------------------------------------------------------------------
790 MS_U16 MDrv_MVOP_GetMaxHOffset(MS_U16 u16HSize, MS_U16 u16VSize, MS_U16 u16Fps);
791 //-------------------------------------------------------------------------------------------------
792 /// Get Main MVOP maximum of vertical offset.
793 /// @ingroup MVOP_GetCommand
794 /// @param u16HSize \b IN : input height.
795 /// @param u16VSize \b IN : input height.
796 /// @param u16Fps \b IN : input framerate.
797 /// @return MS_BOOL: maximum of vertical offset.
798 //-------------------------------------------------------------------------------------------------
799 MS_U16 MDrv_MVOP_GetMaxVOffset(MS_U16 u16HSize, MS_U16 u16VSize, MS_U16 u16Fps);
800 // MVOP_Debug
801 //-------------------------------------------------------------------------------------------------
802 /// Set MVOP debug level.
803 /// @ingroup MVOP_SetCommand
804 /// @param level \b IN: level.
805 /// @return: void.
806 //-------------------------------------------------------------------------------------------------
807 void MDrv_MVOP_SetDbgLevel(MS_U8 level);
808 //-------------------------------------------------------------------------------------------------
809 /// Get Main MVOP clock infomation.
810 /// @ingroup MVOP_GetCommand
811 /// @param void \b IN : void.
812 /// @return MVOP_DrvInfo: the pointer of clock information.
813 //-------------------------------------------------------------------------------------------------
814 // const MVOP_DrvInfo* MDrv_MVOP_GetInfo(void);
815 //-------------------------------------------------------------------------------------------------
816 /// Get Main MVOP current setting status.
817 /// @ingroup MVOP_GetCommand
818 /// @param pMVOPStat \b IN : the pointer of mvop status.
819 /// @return MS_BOOL: get is status successful or not.
820 //-------------------------------------------------------------------------------------------------
821 // MS_BOOL MDrv_MVOP_GetStatus(MVOP_DrvStatus *pMVOPStat);
822 //-------------------------------------------------------------------------------------------------
823 /// Set MVOP Pattern type.
824 /// @ingroup MVOP_SetCommand
825 /// @param enMVOPPattern \b IN: pattern type.
826 /// @return: void.
827 //-------------------------------------------------------------------------------------------------
828 void MDrv_MVOP_SetPattern(MVOP_Pattern enMVOPPattern);
829 //-------------------------------------------------------------------------------------------------
830 /// Set Main MVOP tile format.
831 /// @ingroup MVOP_SetCommand
832 /// @param eTileFmt \b IN: tile format.
833 /// @return: MS_BOOL: setting successfully or not.
834 //-------------------------------------------------------------------------------------------------
835 MS_BOOL MDrv_MVOP_SetTileFormat(MVOP_TileFormat eTileFmt);
836 //-------------------------------------------------------------------------------------------------
837 /// Get Main MVOP current display timing infomation from register.
838 /// @ingroup MVOP_GetCommand
839 /// @param pDstInfo \b IN : the pointer of mvop timing.
840 /// @param u32SizeofDstInfo \b IN : the size of pDstInfo.
841 /// @return MS_BOOL: get is status successful or not.
842 //-------------------------------------------------------------------------------------------------
843 MS_BOOL MDrv_MVOP_GetDstInfo(MVOP_DST_DispInfo *pDstInfo, MS_U32 u32SizeofDstInfo);
844 //-------------------------------------------------------------------------------------------------
845 /// Set Main MVOP Vtt fixed.
846 /// @ingroup MVOP_SetCommand
847 /// @param u16FixVtt \b IN: Vtt.
848 /// @return: MS_BOOL: setting successfully or not.
849 //-------------------------------------------------------------------------------------------------
850 MS_BOOL MDrv_MVOP_SetFixVtt(MS_U16 u16FixVtt);
851 //-------------------------------------------------------------------------------------------------
852 /// Set Main MVOP MMIO Map base address.
853 /// @ingroup MVOP_SetCommand
854 /// @param void \b IN: void.
855 /// @return: MS_BOOL: setting successfully or not.
856 //-------------------------------------------------------------------------------------------------
857 MS_BOOL MDrv_MVOP_SetMMIOMapBase(void);
858 //-------------------------------------------------------------------------------------------------
859 /// Set Main MVOP access which miu.
860 /// @ingroup MVOP_Basic
861 /// @param u8Miu \b IN : miu 0/1/2...
862 /// @return MVOP_Result
863 ///     - E_MVOP_OK: success
864 ///     - E_MVOP_FAIL: failed
865 ///     - E_MVOP_INVALID_PARAM: input param error.
866 ///     - E_MVOP_NOT_INIT: not initialized yet.
867 ///     - E_MVOP_UNSUPPORTED: input case not support.
868 //-------------------------------------------------------------------------------------------------
869 MVOP_Result MDrv_MVOP_MiuSwitch(MS_U8 u8Miu);
870 //-------------------------------------------------------------------------------------------------
871 /// Set Main MVOP MCU mode YUV address.
872 /// @ingroup MVOP_SetCommand
873 /// @param u32YOffset \b IN: Y address.
874 /// @param u32UVOffset \b IN: UV address.
875 /// @param bProgressive \b IN: Is progressive.
876 /// @param b422pack \b IN: Is 422 packed or not.
877 /// @return: MS_BOOL: setting successfully or not.
878 //-------------------------------------------------------------------------------------------------
879 MS_BOOL MDrv_MVOP_SetBaseAdd(MS_PHY u32YOffset, MS_PHY u32UVOffset, MS_BOOL bProgressive, MS_BOOL b422pack);
880 //-------------------------------------------------------------------------------------------------
881 /// Set Main MVOP elect output field for display one field. default: mvop t/b toggle, update one field to both t/b xc buffer.
882 /// @ingroup MVOP_SetCommand
883 /// @param void \b IN: void.
884 /// @return: MS_BOOL: setting successfully or not.
885 //-------------------------------------------------------------------------------------------------
886 void MDrv_MVOP_SEL_OP_FIELD(MS_BOOL bEnable);
887 //-------------------------------------------------------------------------------------------------
888 /// Set Main MVOP hsize/vsize from vdec DIU/WB.
889 /// @ingroup MVOP_SetCommand
890 /// @param bEnable \b IN: Enable/Disable.
891 /// @return: MS_BOOL: setting successfully or not.
892 //-------------------------------------------------------------------------------------------------
893 void MDrv_MVOP_SetRegSizeFromMVD(MS_BOOL bEnable);
894 //-------------------------------------------------------------------------------------------------
895 /// Set Main MVOP crop x/y start.
896 /// @ingroup MVOP_SetCommand
897 /// @param u16Xpos \b IN: x start.
898 /// @param u16Ypos \b IN: y start.
899 /// @return: void.
900 //-------------------------------------------------------------------------------------------------
901 void MDrv_MVOP_SetStartPos(MS_U16 u16Xpos ,MS_U16 u16Ypos);
902 //-------------------------------------------------------------------------------------------------
903 /// Set Main MVOP crop x/y size.
904 /// @ingroup MVOP_SetCommand
905 /// @param u16Width \b IN: x size.
906 /// @param u16Height \b IN: y size.
907 /// @return: MS_BOOL: setting successfully or not.
908 //-------------------------------------------------------------------------------------------------
909 MS_BOOL MDrv_MVOP_SetImageWidthHight(MS_U16 u16Width ,MS_U16 u16Height);
910 //-------------------------------------------------------------------------------------------------
911 /// Set Main MVOP mirror mode.
912 /// @ingroup MVOP_SetCommand
913 /// @param bEnable \b IN: enable/disable.
914 /// @param eMirrorMode \b IN: mirror mode type.
915 /// @return: void.
916 //-------------------------------------------------------------------------------------------------
917 void MDrv_MVOP_SetVOPMirrorMode(MS_BOOL bEnable,MVOP_DrvMirror eMirrorMode);
918 //-------------------------------------------------------------------------------------------------
919 /// Set Main MVOP output vsync inversed.
920 /// @ingroup MVOP_SetCommand
921 /// @param bEnable \b IN: enable/disable.
922 /// @return: void.
923 //-------------------------------------------------------------------------------------------------
924 void MDrv_MVOP_INV_OP_VS(MS_BOOL bEnable);
925 //-------------------------------------------------------------------------------------------------
926 /// Set Main MVOP output only top field.
927 /// @ingroup MVOP_SetCommand
928 /// @param bEnable \b IN: enable/disable.
929 /// @return: void.
930 //-------------------------------------------------------------------------------------------------
931 void MDrv_MVOP_FORCE_TOP(MS_BOOL bEnable);
932 //-------------------------------------------------------------------------------------------------
933 /// Set Main MVOP enable freerun mode.
934 /// @ingroup MVOP_SetCommand
935 /// @param bEnable \b IN: enable/disable.
936 /// @return: MS_BOOL: setting successfully or not.
937 //-------------------------------------------------------------------------------------------------
938 MS_BOOL MDrv_MVOP_EnableFreerunMode(MS_BOOL bEnable);
939 //-------------------------------------------------------------------------------------------------
940 /// Get Main MVOP cuurent frame base address(MCU mode only).
941 /// @ingroup MVOP_GetCommand
942 /// @param u32YOffset \b IN : the pointer of Luma address.
943 /// @param u32UVOffset \b IN : the pointer of Chroma address.
944 /// @return void.
945 //-------------------------------------------------------------------------------------------------
946 void MDrv_MVOP_GetBaseAdd(MS_PHY* u32YOffset, MS_PHY* u32UVOffset);
947 //-------------------------------------------------------------------------------------------------
948 /// Get Sub MVOP current setting status.
949 /// @ingroup MVOP_GetCommand
950 /// @param pMVOPStat \b IN : the pointer of mvop status.
951 /// @return MS_BOOL: get is status successful or not.
952 //-------------------------------------------------------------------------------------------------
953 // MS_BOOL MDrv_MVOP_SubGetStatus(MVOP_DrvStatus *pMVOPStat);
954 //-------------------------------------------------------------------------------------------------
955 /// Get Sub MVOP the timing of xc data starting(capture win. h start).
956 /// @ingroup MVOP_GetCommand
957 /// @param void \b IN : void.
958 /// @return: timing of data start in Htt.
959 //-------------------------------------------------------------------------------------------------
960 MS_U16 MDrv_MVOP_SubGetHStart(void);
961 //-------------------------------------------------------------------------------------------------
962 /// Get Sub MVOP the timing of xc data starting(capture win. v start).
963 /// @ingroup MVOP_GetCommand
964 /// @param void \b IN : void.
965 /// @return: timing of data start in Vtt.
966 //-------------------------------------------------------------------------------------------------
967 MS_U16 MDrv_MVOP_SubGetVStart(void);
968 //-------------------------------------------------------------------------------------------------
969 /// Set Sub MVOP Pattern type.
970 /// @ingroup MVOP_SetCommand
971 /// @param enMVOPPattern \b IN: pattern type.
972 /// @return: void.
973 //-------------------------------------------------------------------------------------------------
974 // void MDrv_MVOP_SubSetPattern(MVOP_Pattern enMVOPPattern);
975 //-------------------------------------------------------------------------------------------------
976 /// Set Sub MVOP tile format.
977 /// @ingroup MVOP_SetCommand
978 /// @param eTileFmt \b IN: tile format.
979 /// @return: MS_BOOL: setting successfully or not.
980 //-------------------------------------------------------------------------------------------------
981 MS_BOOL MDrv_MVOP_SubSetTileFormat(MVOP_TileFormat eTileFmt);
982 //-------------------------------------------------------------------------------------------------
983 /// Set Sub MVOP MMIO Map base address.
984 /// @ingroup MVOP_SetCommand
985 /// @param void \b IN: void.
986 /// @return: MS_BOOL: setting successfully or not.
987 //-------------------------------------------------------------------------------------------------
988 // MS_BOOL MDrv_MVOP_SubSetMMIOMapBase(void);
989 //-------------------------------------------------------------------------------------------------
990 /// Initial Sub MVOP.
991 /// @ingroup MVOP_Basic
992 /// @param void \b IN : void
993 /// @return void
994 //-------------------------------------------------------------------------------------------------
995 void MDrv_MVOP_SubInit(void);
996 //-------------------------------------------------------------------------------------------------
997 /// Disable Sub MVOP clock.
998 /// @ingroup MVOP_Basic
999 /// @param void \b IN : void
1000 /// @return void
1001 //-------------------------------------------------------------------------------------------------
1002 void MDrv_MVOP_SubExit(void);
1003 //-------------------------------------------------------------------------------------------------
1004 /// Sub MVOP power switch; start to generate timing.
1005 /// @ingroup MVOP_Basic
1006 /// @param MS_BOOL \b IN : enable or disable MVOP.
1007 /// @return void
1008 //-------------------------------------------------------------------------------------------------
1009 void MDrv_MVOP_SubEnable(MS_BOOL bEnable);
1010 //-------------------------------------------------------------------------------------------------
1011 /// Get Sub MVOP is enable or not.
1012 /// @ingroup MVOP_GetCommand
1013 /// @param pbEnable \b IN : Is enable or not.
1014 /// @return: true or false.
1015 //-------------------------------------------------------------------------------------------------
1016 MVOP_Result MDrv_MVOP_SubGetIsEnable (MS_BOOL* pbEnable);
1017 //-------------------------------------------------------------------------------------------------
1018 /// Set Sub MVOP UV forwarding one line.
1019 /// @ingroup MVOP_SetCommand
1020 /// @param bEnable \b IN: enable or disable.
1021 /// @return: void.
1022 //-------------------------------------------------------------------------------------------------
1023 // void MDrv_MVOP_SubEnableUVShift(MS_BOOL bEnable);
1024 //-------------------------------------------------------------------------------------------------
1025 /// Set Sub MVOP Background color as black.
1026 /// @ingroup MVOP_Basic
1027 /// @param void \b IN : void.
1028 /// @return: void.
1029 //-------------------------------------------------------------------------------------------------
1030 void MDrv_MVOP_SubEnableBlackBG(void);
1031 //-------------------------------------------------------------------------------------------------
1032 /// Set Sub MVOP only Luma data(Black/white feature).
1033 /// @ingroup MVOP_SetCommand
1034 /// @param bEnable \b IN: enable or disable.
1035 /// @return: void.
1036 //-------------------------------------------------------------------------------------------------
1037 void MDrv_MVOP_SubSetMonoMode(MS_BOOL bEnable);
1038 //-------------------------------------------------------------------------------------------------
1039 /// Set Sub MVOP Input stream information and reset ex-stream status.
1040 /// @ingroup MVOP_Basic
1041 /// @param in \b IN : Set mvop input: Hardwire mode or MCU mode / Codec type.
1042 /// @param pCfg \b IN : Set mvop input: MCU mode data format setting.
1043 /// @return MVOP_Result
1044 ///     - E_MVOP_OK: success
1045 ///     - E_MVOP_FAIL: failed
1046 ///     - E_MVOP_INVALID_PARAM: input param error.
1047 ///     - E_MVOP_NOT_INIT: not initialized yet.
1048 ///     - E_MVOP_UNSUPPORTED: input case not support.
1049 //-------------------------------------------------------------------------------------------------
1050 MVOP_Result MDrv_MVOP_SubSetInputCfg (MVOP_InputSel in, MVOP_InputCfg* pCfg);
1051 //-------------------------------------------------------------------------------------------------
1052 /// Set Sub MVOP Output timing information.
1053 /// @ingroup MVOP_Basic
1054 /// @param pstVideoStatus \b IN : Set mvop output Timing.
1055 /// @param bEnHDup \b IN : Is Hsize duplicated?
1056 /// @return MVOP_Result
1057 ///     - E_MVOP_OK: success
1058 ///     - E_MVOP_FAIL: failed
1059 ///     - E_MVOP_INVALID_PARAM: input param error.
1060 ///     - E_MVOP_NOT_INIT: not initialized yet.
1061 ///     - E_MVOP_UNSUPPORTED: input case not support.
1062 //-------------------------------------------------------------------------------------------------
1063 MVOP_Result MDrv_MVOP_SubSetOutputCfg(MVOP_VidStat *pstVideoStatus, MS_BOOL bEnHDup);
1064 //-------------------------------------------------------------------------------------------------
1065 /// Get Sub MVOP output timing.
1066 /// @ingroup MVOP_GetCommand
1067 /// @param pMVOPTiming \b IN : the pointer of timing struc.
1068 /// @return MVOP_Result
1069 ///     - E_MVOP_OK: success
1070 ///     - E_MVOP_FAIL: failed
1071 ///     - E_MVOP_INVALID_PARAM: input param error.
1072 ///     - E_MVOP_NOT_INIT: not initialized yet.
1073 ///     - E_MVOP_UNSUPPORTED: input case not support.
1074 //-------------------------------------------------------------------------------------------------
1075 MVOP_Result MDrv_MVOP_SubGetOutputTiming(MVOP_Timing* pMVOPTiming);
1076 //-------------------------------------------------------------------------------------------------
1077 /// Get Sub MVOP source Width.
1078 /// @ingroup MVOP_GetCommand
1079 /// @param void \b IN : void.
1080 /// @return: Width.
1081 //-------------------------------------------------------------------------------------------------
1082 MS_U16 MDrv_MVOP_SubGetHSize(void);
1083 //-------------------------------------------------------------------------------------------------
1084 /// Get Sub MVOP source Height.
1085 /// @ingroup MVOP_GetCommand
1086 /// @param void \b IN : void.
1087 /// @return: Height.
1088 //-------------------------------------------------------------------------------------------------
1089 MS_U16 MDrv_MVOP_SubGetVSize(void);
1090 //-------------------------------------------------------------------------------------------------
1091 /// Get Sub MVOP timing is interlace or not.
1092 /// @ingroup MVOP_GetCommand
1093 /// @param void \b IN : void.
1094 /// @return: true or false.
1095 //-------------------------------------------------------------------------------------------------
1096 MS_BOOL MDrv_MVOP_SubGetIsInterlace(void);
1097 //-------------------------------------------------------------------------------------------------
1098 /// Get Sub MVOP H data is duplicated or not.
1099 /// @ingroup MVOP_GetCommand
1100 /// @param void \b IN : void.
1101 /// @return: true or false.
1102 //-------------------------------------------------------------------------------------------------
1103 MS_BOOL MDrv_MVOP_SubGetIsHDuplicate(void);
1104 //-------------------------------------------------------------------------------------------------
1105 /// Get Sub MVOP HW capability.
1106 /// @ingroup MVOP_GetCommand
1107 /// @param u16HSize \b IN : input height.
1108 /// @param u16VSize \b IN : input height.
1109 /// @param u16Fps \b IN : input framerate.
1110 /// @return MS_BOOL: support this timing or not.
1111 //-------------------------------------------------------------------------------------------------
1112 MS_BOOL MDrv_MVOP_SubCheckCapability(MS_U16 u16HSize, MS_U16 u16VSize, MS_U16 u16Fps);
1113 //-------------------------------------------------------------------------------------------------
1114 /// Get Sub MVOP maximum of horizontal offset.
1115 /// @ingroup MVOP_GetCommand
1116 /// @param u16HSize \b IN : input height.
1117 /// @param u16VSize \b IN : input height.
1118 /// @param u16Fps \b IN : input framerate.
1119 /// @return MS_BOOL: maximum of horizontal offset.
1120 //-------------------------------------------------------------------------------------------------
1121 MS_U16 MDrv_MVOP_SubGetMaxHOffset(MS_U16 u16HSize, MS_U16 u16VSize, MS_U16 u16Fps);
1122 //-------------------------------------------------------------------------------------------------
1123 /// Get Sub MVOP maximum of vertical offset.
1124 /// @ingroup MVOP_GetCommand
1125 /// @param u16HSize \b IN : input height.
1126 /// @param u16VSize \b IN : input height.
1127 /// @param u16Fps \b IN : input framerate.
1128 /// @return MS_BOOL: maximum of vertical offset.
1129 //-------------------------------------------------------------------------------------------------
1130 MS_U16 MDrv_MVOP_SubGetMaxVOffset(MS_U16 u16HSize, MS_U16 u16VSize, MS_U16 u16Fps);
1131 //-------------------------------------------------------------------------------------------------
1132 /// Get Sub MVOP current display timing infomation from register.
1133 /// @ingroup MVOP_GetCommand
1134 /// @param pDstInfo \b IN : the pointer of mvop timing.
1135 /// @param u32SizeofDstInfo \b IN : the size of pDstInfo.
1136 /// @return MS_BOOL: get is status successful or not.
1137 //-------------------------------------------------------------------------------------------------
1138 MS_BOOL MDrv_MVOP_SubGetDstInfo(MVOP_DST_DispInfo *pDstInfo, MS_U32 u32SizeofDstInfo);
1139 //-------------------------------------------------------------------------------------------------
1140 /// Set Sub MVOP Vtt fixed.
1141 /// @ingroup MVOP_SetCommand
1142 /// @param u16FixVtt \b IN: Vtt.
1143 /// @return: MS_BOOL: setting successfully or not.
1144 //-------------------------------------------------------------------------------------------------
1145 MS_BOOL MDrv_MVOP_SubSetFixVtt(MS_U16 u16FixVtt);
1146 //-------------------------------------------------------------------------------------------------
1147 /// Set Sub MVOP access which miu.
1148 /// @ingroup MVOP_Basic
1149 /// @param u8Miu \b IN : miu 0/1/2...
1150 /// @return MVOP_Result
1151 ///     - E_MVOP_OK: success
1152 ///     - E_MVOP_FAIL: failed
1153 ///     - E_MVOP_INVALID_PARAM: input param error.
1154 ///     - E_MVOP_NOT_INIT: not initialized yet.
1155 ///     - E_MVOP_UNSUPPORTED: input case not support.
1156 //-------------------------------------------------------------------------------------------------
1157 MVOP_Result MDrv_MVOP_SubMiuSwitch(MS_U8 u8Miu);
1158 //-------------------------------------------------------------------------------------------------
1159 /// Set Sub MVOP mirror mode.
1160 /// @ingroup MVOP_SetCommand
1161 /// @param bEnable \b IN: enable/disable.
1162 /// @param eMirrorMode \b IN: mirror mode type.
1163 /// @return: void.
1164 //-------------------------------------------------------------------------------------------------
1165 void MDrv_MVOP_SubSetVOPMirrorMode(MS_BOOL bEnable, MVOP_DrvMirror eMirrorMode);
1166 //-------------------------------------------------------------------------------------------------
1167 /// Set Sub MVOP enable freerun mode.
1168 /// @ingroup MVOP_SetCommand
1169 /// @param bEnable \b IN: enable/disable.
1170 /// @return: MS_BOOL: setting successfully or not.
1171 //-------------------------------------------------------------------------------------------------
1172 MS_BOOL MDrv_MVOP_SubEnableFreerunMode(MS_BOOL bEnable);
1173 //-------------------------------------------------------------------------------------------------
1174 /// Set Sub MVOP MCU mode YUV address.
1175 /// @ingroup MVOP_SetCommand
1176 /// @param u32YOffset \b IN: Y address.
1177 /// @param u32UVOffset \b IN: UV address.
1178 /// @param bProgressive \b IN: Is progressive.
1179 /// @param b422pack \b IN: Is 422 packed or not.
1180 /// @return: MS_BOOL: setting successfully or not.
1181 //-------------------------------------------------------------------------------------------------
1182 MS_BOOL MDrv_MVOP_SubSetBaseAdd(MS_PHY u32YOffset, MS_PHY u32UVOffset, MS_BOOL bProgressive, MS_BOOL b422pack);
1183 //-------------------------------------------------------------------------------------------------
1184 /// Get Sub MVOP cuurent frame base address(MCU mode only).
1185 /// @ingroup MVOP_GetCommand
1186 /// @param u32YOffset \b IN : the pointer of Luma address.
1187 /// @param u32UVOffset \b IN : the pointer of Chroma address.
1188 /// @return void.
1189 //-------------------------------------------------------------------------------------------------
1190 void MDrv_MVOP_SubGetBaseAdd(MS_PHY* u32YOffset, MS_PHY* u32UVOffset);
1191 
1192 //-------------------------------------------------------------------------------------------------
1193 /// Initial Extended MVOP.
1194 /// @ingroup MVOP_Basic
1195 /// @param eID \b IN : Device ID.
1196 /// @param void \b IN : void.
1197 /// @return MVOP_Result
1198 ///     - E_MVOP_OK: success
1199 ///     - E_MVOP_FAIL: failed
1200 ///     - E_MVOP_INVALID_PARAM: input param error.
1201 ///     - E_MVOP_NOT_INIT: not initialized yet.
1202 ///     - E_MVOP_UNSUPPORTED: input case not support.
1203 //-------------------------------------------------------------------------------------------------
1204 // MVOP_Result MDrv_MVOP_EX_Init(MVOP_DevID eID, MS_U32 u32InitParam);
1205 //-------------------------------------------------------------------------------------------------
1206 /// Disable Extended  MVOP clock.
1207 /// @ingroup MVOP_Basic
1208 /// @param eID \b IN : Device ID.
1209 /// @return MVOP_Result
1210 ///     - E_MVOP_OK: success
1211 ///     - E_MVOP_FAIL: failed
1212 ///     - E_MVOP_INVALID_PARAM: input param error.
1213 ///     - E_MVOP_NOT_INIT: not initialized yet.
1214 ///     - E_MVOP_UNSUPPORTED: input case not support.
1215 //-------------------------------------------------------------------------------------------------
1216 // MVOP_Result MDrv_MVOP_EX_Exit(MVOP_DevID eID, MS_U32 u32ExitParam);
1217 //-------------------------------------------------------------------------------------------------
1218 /// Extended MVOP power switch; start to generate timing.
1219 /// @ingroup MVOP_Basic
1220 /// @param eID \b IN : Device ID.
1221 /// @param MS_BOOL \b IN : enable or disable MVOP.
1222 /// @return MVOP_Result
1223 ///     - E_MVOP_OK: success
1224 ///     - E_MVOP_FAIL: failed
1225 ///     - E_MVOP_INVALID_PARAM: input param error.
1226 ///     - E_MVOP_NOT_INIT: not initialized yet.
1227 ///     - E_MVOP_UNSUPPORTED: input case not support.
1228 //-------------------------------------------------------------------------------------------------
1229 // MVOP_Result MDrv_MVOP_EX_Enable(MVOP_DevID eID, MS_BOOL bEnable);
1230 //-------------------------------------------------------------------------------------------------
1231 /// Set Extended  MVOP Input stream information and reset ex-stream status.
1232 /// @ingroup MVOP_Basic
1233 /// @param eID \b IN : Device ID.
1234 /// @param in \b IN : Set mvop input: Hardwire mode or MCU mode / Codec type.
1235 /// @param pCfg \b IN : Set mvop input: MCU mode data format setting.
1236 /// @return MVOP_Result
1237 ///     - E_MVOP_OK: success
1238 ///     - E_MVOP_FAIL: failed
1239 ///     - E_MVOP_INVALID_PARAM: input param error.
1240 ///     - E_MVOP_NOT_INIT: not initialized yet.
1241 ///     - E_MVOP_UNSUPPORTED: input case not support.
1242 //-------------------------------------------------------------------------------------------------
1243 // MVOP_Result MDrv_MVOP_EX_SetInputCfg (MVOP_DevID eID, MVOP_InputSel in, MVOP_InputCfg* pCfg);
1244 //-------------------------------------------------------------------------------------------------
1245 /// Set Extended  MVOP Output timing information.
1246 /// @ingroup MVOP_Basic
1247 /// @param eID \b IN : Device ID.
1248 /// @param pstVideoStatus \b IN : Set mvop output Timing.
1249 /// @param bEnHDup \b IN : Is Hsize duplicated?
1250 /// @return MVOP_Result
1251 ///     - E_MVOP_OK: success
1252 ///     - E_MVOP_FAIL: failed
1253 ///     - E_MVOP_INVALID_PARAM: input param error.
1254 ///     - E_MVOP_NOT_INIT: not initialized yet.
1255 ///     - E_MVOP_UNSUPPORTED: input case not support.
1256 //-------------------------------------------------------------------------------------------------
1257 // MVOP_Result MDrv_MVOP_EX_SetOutputCfg(MVOP_DevID eID, MVOP_VidStat *pstVideoStatus, MS_BOOL bEnHDup);
1258 
1259 //-------------------------------------------------------------------------------------------------
1260 /// Set Extended MVOP Pattern type.
1261 /// @ingroup MVOP_SetCommand
1262 /// @param eID \b IN : Device ID.
1263 /// @param enMVOPPattern \b IN: pattern type.
1264 /// @return MVOP_Result
1265 ///     - E_MVOP_OK: success
1266 ///     - E_MVOP_FAIL: failed
1267 ///     - E_MVOP_INVALID_PARAM: input param error.
1268 ///     - E_MVOP_NOT_INIT: not initialized yet.
1269 ///     - E_MVOP_UNSUPPORTED: input case not support.
1270 //-------------------------------------------------------------------------------------------------
1271 // MVOP_Result MDrv_MVOP_EX_SetPattern(MVOP_DevID eID, MVOP_Pattern enMVOPPattern);
1272 //-------------------------------------------------------------------------------------------------
1273 /// Set Extended MVOP tile format.
1274 /// @ingroup MVOP_SetCommand
1275 /// @param eID \b IN : Device ID.
1276 /// @param eTileFmt \b IN: tile format.
1277 /// @return MVOP_Result
1278 ///     - E_MVOP_OK: success
1279 ///     - E_MVOP_FAIL: failed
1280 ///     - E_MVOP_INVALID_PARAM: input param error.
1281 ///     - E_MVOP_NOT_INIT: not initialized yet.
1282 ///     - E_MVOP_UNSUPPORTED: input case not support.
1283 //-------------------------------------------------------------------------------------------------
1284 // MVOP_Result MDrv_MVOP_EX_SetTileFormat(MVOP_DevID eID, MVOP_TileFormat eTileFmt);
1285 //-------------------------------------------------------------------------------------------------
1286 /// Set Extended MVOP UV forwarding one line.
1287 /// @ingroup MVOP_SetCommand
1288 /// @param eID \b IN : Device ID.
1289 /// @param bEnable \b IN: enable or disable.
1290 /// @return MVOP_Result
1291 ///     - E_MVOP_OK: success
1292 ///     - E_MVOP_FAIL: failed
1293 ///     - E_MVOP_INVALID_PARAM: input param error.
1294 ///     - E_MVOP_NOT_INIT: not initialized yet.
1295 ///     - E_MVOP_UNSUPPORTED: input case not support.
1296 //-------------------------------------------------------------------------------------------------
1297 // MVOP_Result MDrv_MVOP_EX_EnableUVShift(MVOP_DevID eID, MS_BOOL bEnable);
1298 //-------------------------------------------------------------------------------------------------
1299 /// Set Extended MVOP Background color as black.
1300 /// @ingroup MVOP_Basic
1301 /// @param eID \b IN : Device ID.
1302 /// @param void \b IN : void.
1303 /// @return: void.
1304 //-------------------------------------------------------------------------------------------------
1305 // MVOP_Result MDrv_MVOP_EX_EnableBlackBG(MVOP_DevID eID);
1306 //-------------------------------------------------------------------------------------------------
1307 /// Set Extended MVOP only Luma data(Black/white feature).
1308 /// @ingroup MVOP_SetCommand
1309 /// @param eID \b IN : Device ID.
1310 /// @param bEnable \b IN: enable or disable.
1311 /// @return MVOP_Result
1312 ///     - E_MVOP_OK: success
1313 ///     - E_MVOP_FAIL: failed
1314 ///     - E_MVOP_INVALID_PARAM: input param error.
1315 ///     - E_MVOP_NOT_INIT: not initialized yet.
1316 ///     - E_MVOP_UNSUPPORTED: input case not support.
1317 //-------------------------------------------------------------------------------------------------
1318 // MVOP_Result MDrv_MVOP_EX_SetMonoMode(MVOP_DevID eID, MS_BOOL bEnable);
1319 //-------------------------------------------------------------------------------------------------
1320 /// Set Extended MVOP Vtt fixed.
1321 /// @ingroup MVOP_SetCommand
1322 /// @param eID \b IN : Device ID.
1323 /// @param u16FixVtt \b IN: Vtt.
1324 /// @return MVOP_Result
1325 ///     - E_MVOP_OK: success
1326 ///     - E_MVOP_FAIL: failed
1327 ///     - E_MVOP_INVALID_PARAM: input param error.
1328 ///     - E_MVOP_NOT_INIT: not initialized yet.
1329 ///     - E_MVOP_UNSUPPORTED: input case not support.
1330 //-------------------------------------------------------------------------------------------------
1331 // MVOP_Result MDrv_MVOP_EX_SetFixVtt(MVOP_DevID eID, MS_U16 u16FixVtt);
1332 //-------------------------------------------------------------------------------------------------
1333 /// Set Extended MVOP access which miu.
1334 /// @ingroup MVOP_Basic
1335 /// @param eID \b IN : Device ID.
1336 /// @param u8Miu \b IN : miu 0/1/2...
1337 /// @return MVOP_Result
1338 ///     - E_MVOP_OK: success
1339 ///     - E_MVOP_FAIL: failed
1340 ///     - E_MVOP_INVALID_PARAM: input param error.
1341 ///     - E_MVOP_NOT_INIT: not initialized yet.
1342 ///     - E_MVOP_UNSUPPORTED: input case not support.
1343 //-------------------------------------------------------------------------------------------------
1344 // MVOP_Result MDrv_MVOP_EX_MiuSwitch(MVOP_DevID eID, MS_U8 u8Miu);
1345 //-------------------------------------------------------------------------------------------------
1346 /// Set Extended MVOP mirror mode.
1347 /// @ingroup MVOP_SetCommand
1348 /// @param eID \b IN : Device ID.
1349 /// @param bEnable \b IN: enable/disable.
1350 /// @param eMirrorMode \b IN: mirror mode type.
1351 /// @return MVOP_Result
1352 ///     - E_MVOP_OK: success
1353 ///     - E_MVOP_FAIL: failed
1354 ///     - E_MVOP_INVALID_PARAM: input param error.
1355 ///     - E_MVOP_NOT_INIT: not initialized yet.
1356 ///     - E_MVOP_UNSUPPORTED: input case not support.
1357 //-------------------------------------------------------------------------------------------------
1358 // MVOP_Result MDrv_MVOP_EX_SetVOPMirrorMode(MVOP_DevID eID, MS_BOOL bEnable, MVOP_DrvMirror eMirrorMode);
1359 //-------------------------------------------------------------------------------------------------
1360 /// Set Extended MVOP enable freerun mode.
1361 /// @ingroup MVOP_SetCommand
1362 /// @param eID \b IN : Device ID.
1363 /// @param bEnable \b IN: enable/disable.
1364 /// @return MVOP_Result
1365 ///     - E_MVOP_OK: success
1366 ///     - E_MVOP_FAIL: failed
1367 ///     - E_MVOP_INVALID_PARAM: input param error.
1368 ///     - E_MVOP_NOT_INIT: not initialized yet.
1369 ///     - E_MVOP_UNSUPPORTED: input case not support.
1370 //-------------------------------------------------------------------------------------------------
1371 // MVOP_Result MDrv_MVOP_EX_EnableFreerunMode(MVOP_DevID eID, MS_BOOL bEnable);
1372 
1373 //-------------------------------------------------------------------------------------------------
1374 /// Get Extended MVOP output timing.
1375 /// @ingroup MVOP_GetCommand
1376 /// @param eID \b IN : Device ID.
1377 /// @param pMVOPTiming \b IN : the pointer of timing struc.
1378 /// @return MVOP_Result
1379 ///     - E_MVOP_OK: success
1380 ///     - E_MVOP_FAIL: failed
1381 ///     - E_MVOP_INVALID_PARAM: input param error.
1382 ///     - E_MVOP_NOT_INIT: not initialized yet.
1383 ///     - E_MVOP_UNSUPPORTED: input case not support.
1384 //-------------------------------------------------------------------------------------------------
1385 // MVOP_Result MDrv_MVOP_EX_GetOutputTiming(MVOP_DevID eID, MVOP_Timing* pMVOPTiming);
1386 //-------------------------------------------------------------------------------------------------
1387 /// Get Extended MVOP is enable or not.
1388 /// @ingroup MVOP_GetCommand
1389 /// @param eID \b IN : Device ID.
1390 /// @param pbEnable \b IN : Is enable or not.
1391 /// @return: true or false.
1392 //-------------------------------------------------------------------------------------------------
1393 // MVOP_Result MDrv_MVOP_EX_GetIsEnable (MVOP_DevID eID, MS_BOOL* pbEnable);
1394 //-------------------------------------------------------------------------------------------------
1395 /// Get Extended MVOP the timing of xc data starting(capture win. h start).
1396 /// @ingroup MVOP_GetCommand
1397 /// @param eID \b IN : Device ID.
1398 /// @param void \b IN : void.
1399 /// @return: timing of data start in Htt.
1400 //-------------------------------------------------------------------------------------------------
1401 // MS_U16 MDrv_MVOP_EX_GetHStart(MVOP_DevID eID);
1402 //-------------------------------------------------------------------------------------------------
1403 /// Get Extended MVOP the timing of xc data starting(capture win. v start).
1404 /// @ingroup MVOP_GetCommand
1405 /// @param eID \b IN : Device ID.
1406 /// @param void \b IN : void.
1407 /// @return: timing of data start in Vtt.
1408 //-------------------------------------------------------------------------------------------------
1409 // MS_U16 MDrv_MVOP_EX_GetVStart(MVOP_DevID eID);
1410 //-------------------------------------------------------------------------------------------------
1411 /// Get Extended MVOP source Width.
1412 /// @ingroup MVOP_GetCommand
1413 /// @param eID \b IN : Device ID.
1414 /// @param void \b IN : void.
1415 /// @return: Width.
1416 //-------------------------------------------------------------------------------------------------
1417 // MS_U16 MDrv_MVOP_EX_GetHSize(MVOP_DevID eID);
1418 //-------------------------------------------------------------------------------------------------
1419 /// Get Extended MVOP source Height.
1420 /// @ingroup MVOP_GetCommand
1421 /// @param eID \b IN : Device ID.
1422 /// @param void \b IN : void.
1423 /// @return: Height.
1424 //-------------------------------------------------------------------------------------------------
1425 // MS_U16 MDrv_MVOP_EX_GetVSize(MVOP_DevID eID);
1426 //-------------------------------------------------------------------------------------------------
1427 /// Get Extended MVOP timing is interlace or not.
1428 /// @ingroup MVOP_GetCommand
1429 /// @param eID \b IN : Device ID.
1430 /// @param void \b IN : void.
1431 /// @return: true or false.
1432 //-------------------------------------------------------------------------------------------------
1433 // MS_BOOL MDrv_MVOP_EX_GetIsInterlace(MVOP_DevID eID);
1434 //-------------------------------------------------------------------------------------------------
1435 /// Get Extended MVOP H data is duplicated or not.
1436 /// @ingroup MVOP_GetCommand
1437 /// @param eID \b IN : Device ID.
1438 /// @param void \b IN : void.
1439 /// @return: true or false.
1440 //-------------------------------------------------------------------------------------------------
1441 // MS_BOOL MDrv_MVOP_EX_GetIsHDuplicate(MVOP_DevID eID);
1442 //-------------------------------------------------------------------------------------------------
1443 /// Get Extended MVOP current setting status.
1444 /// @ingroup MVOP_GetCommand
1445 /// @param eID \b IN : Device ID.
1446 /// @param pMVOPStat \b IN : the pointer of mvop status.
1447 /// @return MS_BOOL: get is status successful or not.
1448 //-------------------------------------------------------------------------------------------------
1449 // MS_BOOL MDrv_MVOP_EX_GetStatus(MVOP_DevID eID, MVOP_DrvStatus *pMVOPStat);
1450 #if defined (__aarch64__)
1451 // MS_BOOL MDrv_MVOP_EX_CheckCapability(MVOP_DevID eID, MS_U64 u32InParam);
1452 #else
1453 //-------------------------------------------------------------------------------------------------
1454 /// Get Extended MVOP HW capability.
1455 /// @ingroup MVOP_GetCommand
1456 /// @param eID \b IN : Device ID.
1457 /// @param u16HSize \b IN : input height.
1458 /// @param u16VSize \b IN : input height.
1459 /// @param u16Fps \b IN : input framerate.
1460 /// @return MS_BOOL: support this timing or not.
1461 //-------------------------------------------------------------------------------------------------
1462 // MS_BOOL MDrv_MVOP_EX_CheckCapability(MVOP_DevID eID, MS_U32 u32InParam);
1463 #endif
1464 // MS_BOOL MDrv_MVOP_EX_GetDstInfo(MVOP_DevID eID, MVOP_DST_DispInfo *pDstInfo, MS_U32 u32SizeofDstInfo);
1465 //   Functions for the 3rd MVOP }
1466 //-------------------------------------------------------------------------------------------------
1467 /// Set Main MVOP enable freerun mode.
1468 /// @ingroup MVOP_SetCommand
1469 /// @param bEnable \b IN: enable/disable.
1470 /// @return: MS_BOOL: setting successfully or not.
1471 //-------------------------------------------------------------------------------------------------
1472 MVOP_Result MDrv_MVOP_SendBlueScreen(MS_U16 u16Width, MS_U16 u16Height);
1473 //-------------------------------------------------------------------------------------------------
1474 /// Set Main MVOP by command.
1475 /// @ingroup MVOP_SetCommand
1476 /// @param stHd \b IN: device id(main/sub..).
1477 /// @param eCmd \b IN: command enum.
1478 /// @param pPara \b IN: command parameters.
1479 /// @return: void.
1480 //-------------------------------------------------------------------------------------------------
1481 MVOP_Result MDrv_MVOP_SetCommand(MVOP_Handle* stHd, MVOP_Command eCmd, void* pPara);
1482 //-------------------------------------------------------------------------------------------------
1483 /// Get Main MVOP information by command.
1484 /// @ingroup MVOP_GetCommand
1485 /// @param stHd \b IN : Devide ID(main mvop or sub).
1486 /// @param eCmd \b IN : command enum.
1487 /// @param pPara \b IN : command parameters.
1488 /// @param u32ParaSize \b IN : size of Parameter structure.
1489 /// @return MVOP_Result
1490 ///     - E_MVOP_OK: success
1491 ///     - E_MVOP_FAIL: failed
1492 ///     - E_MVOP_INVALID_PARAM: input param error.
1493 ///     - E_MVOP_NOT_INIT: not initialized yet.
1494 ///     - E_MVOP_UNSUPPORTED: input case not support.
1495 //-------------------------------------------------------------------------------------------------
1496 MVOP_Result MDrv_MVOP_GetCommand(MVOP_Handle* stHd, MVOP_Command eCmd, void* pPara, MS_U32 u32ParaSize);
1497 //-------------------------------------------------------------------------------------------------
1498 /// Set Main MVOP output clock.
1499 /// @ingroup MVOP_SetCommand
1500 /// @param eFreq \b IN: clock.
1501 /// @return: void.
1502 //-------------------------------------------------------------------------------------------------
1503 void MDrv_MVOP_SetFrequency(MVOP_FREQUENCY eFreq);
1504 //-------------------------------------------------------------------------------------------------
1505 /// Set Main MVOP STR command.
1506 /// @ingroup MVOP_Basic
1507 /// @param u16PowerState \b IN : command of STR(resume/suspend)
1508 /// @return MS_U32: utopia status.
1509 //-------------------------------------------------------------------------------------------------
1510 MS_U32 MDrv_MVOP_SetPowerState(EN_POWER_MODE u16PowerState);
1511 #ifdef __cplusplus
1512 }
1513 #endif
1514 
1515 #endif // _DRV_MVOP_H_
1516