xref: /utopia/UTPA2-700.0.x/modules/vdec_lite/hal/kano/mvd_lite/halMVD_EX.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 #ifndef _DEV_MVD_H_
96 #define _DEV_MVD_H_
97 #if (!defined(MSOS_TYPE_NUTTX) && !defined(MSOS_TYPE_OPTEE)) || defined(SUPPORT_X_MODEL_FEATURE)
98 
99 #include "halVPU_EX.h"
100 
101 //-------------------------------------------------------------------------------------------------
102 //  Macro and Define
103 //-------------------------------------------------------------------------------------------------
104 
105 #ifndef __MDRV_TYPES_H__
106 #define BIT0    BIT(0)
107 #define BIT1    BIT(1)
108 #define BIT2    BIT(2)
109 #define BIT3    BIT(3)
110 #define BIT4    BIT(4)
111 #define BIT5    BIT(5)
112 #define BIT6    BIT(6)
113 #define BIT7    BIT(7)
114 #endif
115 
116 #define H_DWORD(x)            (MS_U8)(((x)>>24)&0xff)
117 #define L_DWORD(x)            (MS_U8)(((x)>>16)&0xff)
118 #define H_WORD(x)             (MS_U8)(((x)>>8 )&0xff)
119 #define L_WORD(x)             (MS_U8)((x)&0xff)
120 #define COMBM16(hi,lo)        ((((MS_U16)(hi))<<8) | ((MS_U16)(lo)))
121 #define COMBU32(hh,hl,lh,ll)  ((((MS_U32)(hh))<<24) | (((MS_U32)(hl))<<16) | (((MS_U32)(lh))<<8) | ((MS_U32)(ll)))
122 #ifndef MemAlign
123 #define MemAlign(n, unit)     ( (((n)+(unit)-1)/(unit)) * (unit) )
124 #endif
125 
126 //Specify which decoder is used
127 #define SET_DECNUM(cmd, u8Num)              \
128             do {                            \
129                 cmd.Arg5 = u8Num;           \
130                } while(0)
131 
132 void HAL_MVD_RegSetBase(MS_VIRT u32Base);
133 MS_U8 HAL_MVD_RegReadByte(MS_VIRT u32Reg);
134 void HAL_MVD_RegWriteByte(MS_VIRT u32Reg, MS_U8 u8Val);
135 void HAL_MVD_RegWriteBit(MS_VIRT u32Reg, MS_BOOL bEnable, MS_U8 u8Mask);
136 void HAL_MVD_RegWriteByteMask(MS_VIRT u32Reg, MS_U8 u8Val, MS_U8 u8Msk);
137 void HAL_MVD_RegWrite4Byte(MS_VIRT u32Reg, MS_U32 u32Val);
138 
139 // Mutex function for HI interface
140 #define HAL_MVD_LockHiIfMutex()
141 #define HAL_MVD_UnlockHiIfMutex()
142 
143 #define MVD_SUPPORT_MPEG2 0x01
144 #define MVD_SUPPORT_MPEG4 0x02
145 #define MVD_SUPPORT_VC1   0x04
146 
147 #define MVD_FW_VERSION   FW_VERSION
148 
149 #define MVD_TURBO_INIT        FALSE//TRUE
150 
151 //-------------------------------------------------------------------------------------------------
152 //  Type and Structure
153 //-------------------------------------------------------------------------------------------------
154 typedef enum
155 {
156     E_MVD_MMAP_FW  = 0, //firmware
157     E_MVD_MMAP_BS  = 1, //bitstream buffer
158     E_MVD_MMAP_FB  = 2, //framebuffer
159     E_MVD_MMAP_ALL = 3,
160     E_MVD_MMAP_DRV = 4  //driver processing buffer
161 } MVD_MMAP_Type;
162 
163 
164 typedef struct _MVD_DrvCfg
165 {
166     MS_U32 u32fmVerNum;//firmware version number
167     MS_U16 u16fmSrcID; //firmware bin source id
168     MS_U8  u8fbMode;   //framebuffer mode: HD or SD
169 } MVD_DrvCfg;
170 
171 typedef enum
172 {
173     E_HAL_MVD_MAIN_STREAM,  //Support TSP/TS/File mode
174     E_HAL_MVD_SUB_STREAM,   //Only support file mode
175 #ifdef VDEC3
176     E_HAL_MVD_N_STREAM,
177 #endif
178 } HAL_MVD_StreamType;
179 
180 typedef enum
181 {
182     E_HAL_MVD_STREAM_NONE = 0x0,
183 
184     //Support TSP/TS/File mode
185     E_HAL_MVD_MAIN_STREAM_BASE = 0x10,
186     E_HAL_MVD_MAIN_STREAM0 = E_HAL_MVD_MAIN_STREAM_BASE,
187     E_HAL_MVD_MAIN_STREAM_MAX,
188 
189     //Only support file mode
190     E_HAL_MVD_SUB_STREAM_BASE = 0x20,
191     E_HAL_MVD_SUB_STREAM0 = E_HAL_MVD_SUB_STREAM_BASE,
192     //E_HAL_MVD_SUB_STREAM1,
193     E_HAL_MVD_SUB_STREAM_MAX,
194 
195 #ifdef VDEC3
196     E_HAL_MVD_N_STREAM_BASE = 0x40,
197     E_HAL_MVD_N_STREAM0 = E_HAL_MVD_N_STREAM_BASE,
198     E_HAL_MVD_N_STREAM_MAX = E_HAL_MVD_N_STREAM0 + VPU_MAX_DEC_NUM,
199 #endif
200 } HAL_MVD_StreamId;
201 
202 /// MVD clock speed
203 typedef enum
204 {
205     E_HAL_MVD_EX_CLOCK_SPEED_NONE = 0,
206     E_HAL_MVD_EX_CLOCK_SPEED_HIGHEST,
207     E_HAL_MVD_EX_CLOCK_SPEED_HIGH,
208     E_HAL_MVD_EX_CLOCK_SPEED_MEDIUM,
209     E_HAL_MVD_EX_CLOCK_SPEED_LOW,
210     E_HAL_MVD_EX_CLOCK_SPEED_LOWEST,
211     E_HAL_MVD_EX_CLOCK_SPEED_DEFAULT,
212 } HAL_MVD_EX_ClockSpeed;
213 
214 typedef struct
215 {
216     HAL_MVD_StreamId eStreamId;
217     MS_BOOL bUsed;
218     #ifdef VDEC3
219     MS_U32 u32SLQId;
220     #endif
221 } HAL_MVD_Stream;
222 
223 typedef struct
224 {
225     MS_BOOL bHWBufferReMapping;
226     MS_U32 bHWReMappingPaddingAddr;
227 } HAL_MVD_Pre_Ctrl;
228 
229 typedef enum
230 {
231     MVD_DISP_QUEUE_NOT_EMPTY = 0,
232     MVD_DISP_QUEUE_EMPTY = 1,
233     MVD_DISP_QUEUE_INVALID_ADDR = 2,
234 } E_MVD_DISP_QUEUE;
235 
236 //-------------------------------------------------------------------------------------------------
237 //  Function and Variable
238 //-------------------------------------------------------------------------------------------------
239 HAL_MVD_StreamId HAL_MVD_GetFreeStream(HAL_MVD_StreamType eStreamType);
240 MS_U8 HAL_MVD_GetCaps(void);
241 MS_U64 HAL_MVD_GetMaxPixel(MS_U32 u32Id);
242 MS_BOOL HAL_MVD_GetFrmRateIsSupported(MS_U16 u16HSize, MS_U16 u16VSize, MS_U32 u32FrmRate);
243 MS_U32 HAL_MVD_GetDrvFwVer(void);
244 void HAL_MVD_MemGetMap(MS_U8 u8Idx, MS_U8 u8type, MS_VIRT* pu32addr, MS_SIZE* pu32len);
245 MS_U32 HAL_MVD_MemRead4Byte(MS_VIRT u32Address);
246 MS_U16 HAL_MVD_MemRead2Byte(MS_VIRT u32Address);
247 MS_U8 HAL_MVD_MemReadByte(MS_VIRT u32Address);
248 MS_BOOL HAL_MVD_MemWrite4Byte(MS_VIRT u32Address, MS_U32 u32Value);
249 MS_BOOL HAL_MVD_MemWrite2Byte(MS_VIRT u32Address, MS_U16 u16Value);
250 MS_BOOL HAL_MVD_MemWriteByte(MS_VIRT u32Address, MS_U8 u8Value);
251 void HAL_MVD_SetReqMask(MS_U32 u32Id, MS_BOOL bEnMask);
252 MS_VIRT HAL_MVD_GetMiu1BaseAdd(void);
253 MS_U8 HAL_MVD_GetFWSelMiu(void);
254 MS_BOOL HAL_MVD_GetFWSelMiu1(void);
255 
256 MS_VIRT  HAL_MVD_PA2NonCacheSeg(MS_PHY u32PhyAddr);
257 MS_U32      HAL_MVD_GetTime(void);
258 void        HAL_MVD_Delayms(MS_U32 u32msecs);
259 void        HAL_MVD_CPU_Sync(void);
260 void        HAL_MVD_FlushMemory(void);
261 void        HAL_MVD_ReadMemory(void);
262 MS_PHY      HAL_MVD_GetMemOffset(MS_PHY u32PhyAdd);
263 
264 MS_BOOL HAL_MVD_Init(MS_U8 u8HalIdx,MVD_CodecType eCodecType, MS_U32 u32VpuSid);
265 MS_BOOL HAL_MVD_RstHW(MS_U32 u32Id);
266 MS_BOOL HAL_MVD_ReleaseFW(MS_U32 u32Id);
267 MS_BOOL HAL_MVD_LoadCode(MS_U8 u8Idx);
268 
269 void HAL_MVD_PowerCtrl(MS_BOOL bOn);
270 MS_BOOL HAL_MVD_TimeOut(MS_U8 u8Idx);
271 MS_BOOL HAL_MVD_MVDCommand(MS_U8 u8cmd, MVD_CmdArg *pstCmdArg);
272 MS_BOOL HAL_MVD_InitHW(MS_U32 u32Id, VPU_EX_SourceType SourceType, VPU_EX_DecoderType eDecType);
273 MS_BOOL HAL_MVD_InitFW(MS_U32 u32VpuSid);
274 MS_U32 HAL_MVD_GetFWVer(MS_U32 u32VpuSid);
275 MS_BOOL HAL_MVD_SoftRstHW(void);
276 void HAL_MVD_ClearIRQ(void);
277 MS_BOOL HAL_MVD_CreateTask(MS_U8 u8Idx, HAL_VPU_StreamId eVpuId);
278 MS_BOOL HAL_MVD_DeleteTask(MS_U8 u8Idx, HAL_VPU_StreamId eVpuId);
279 
280 MS_BOOL HAL_MVD_SetSpeed(MS_U8 u8Idx, MVD_SpeedType eSpeedType, MS_U8 u8Multiple);
281 void HAL_MVD_SetFrameBuffAddr(MS_U8 u8Idx, MS_VIRT u32addr, MS_U8 u8fbMode);
282 MS_BOOL HAL_MVD_StepDisp(MS_U8 u8Idx);
283 MS_BOOL HAL_MVD_EnableLastFrameShow(MS_U8 u8Idx, MS_BOOL bEnable);
284 MS_BOOL HAL_MVD_SeekToPTS(MS_U8 u8Idx, MS_U32 u32Pts);
285 MS_BOOL HAL_MVD_SkipToPTS(MS_U8 u8Idx, MS_U32 u32Pts);
286 MS_BOOL HAL_MVD_SetFileModeAVSync(MS_U8 u8Idx, MVD_TIMESTAMP_TYPE eSyncMode);
287 MS_BOOL HAL_MVD_SetVirtualBox(MS_U8 u8Idx, MS_U16 u16Width, MS_U16 u16Height);
288 MS_BOOL HAL_MVD_SetBlueScreen(MS_U8 u8Idx, MS_BOOL bEn);
289 MS_BOOL HAL_MVD_Resume(MS_U8 u8Idx);
290 MS_BOOL HAL_MVD_Play(MS_U8 u8Idx);
291 MS_BOOL HAL_MVD_SetFreezeDisp(MS_U8 u8Idx, MS_BOOL bEn);
292 
293 MS_BOOL HAL_MVD_GetHasInt(MS_U8 u8Idx);
294 MS_U32 HAL_MVD_GetIntState(MS_U8 u8Idx);
295 MS_U8 HAL_MVD_GetAVSyncStatus(MS_U8 u8Idx);
296 MS_BOOL HAL_MVD_SetMStreamerMode(MS_U8 u8Idx, MS_U8 u8Mode);
297 MS_BOOL HAL_MVD_IsMStreamerMode(MS_U8 u8Idx);
298 MS_BOOL HAL_MVD_SetMcuMode(MS_U8 u8Idx, MS_U8 u8Mode);
299 MS_BOOL HAL_MVD_IsMcuMode(MS_U8 u8Idx);
300 MS_BOOL HAL_MVD_FrameOpt(MS_U8 u8Idx, MS_U8 u8FrmIdx, MVD_FrmOpt eOpt);
301 MS_BOOL HAL_MVD_UpdatePts(MS_U8 u8Idx);
302 MS_BOOL HAL_MVD_FrameCapture(MS_U8 u8Idx, MS_U8 u8FrmIdx, MS_BOOL bEnable);
303 
304 MS_VIRT HAL_MVD_SetHWBuffer(MS_U8 u8Idx, MS_VIRT u32Add);
305 void HAL_MVD_SetFrameBuffNum(MS_U8 u8Idx, MS_U8 u8FrmNum,MS_U32 u32FBUsedSize);
306 
307 MS_U32 HAL_MVD_GetBitsRate(MS_U8 u8Idx);
308 MS_U8 HAL_MVD_GetVideoRange(MS_U8 u8Idx);
309 MS_BOOL HAL_MVD_GetLowDelayFlag(MS_U8 u8Idx);
310 MS_BOOL HAL_MVD_GetIs32PullDown(MS_U8 u8Idx);
311 MS_BOOL HAL_MVD_GetIsDynScalingEnabled(MS_U8 u8Idx);
312 MS_BOOL HAL_MVD_Is1stFrmRdy(MS_U8 u8Idx);
313 
314 MS_U32 HAL_MVD_GetPicCounter(MS_U8 u8Idx);
315 MS_U32 HAL_MVD_GetSkipPicCounter(MS_U8 u8Idx);
316 MVD_PicType HAL_MVD_GetPicType(MS_U8 u8Idx);
317 MS_S32 HAL_MVD_GetPtsStcDiff(MS_U8 u8Idx);
318 MS_U8 HAL_MVD_GetDecodedFrameIdx(MS_U8 u8Idx);
319 MS_U32 HAL_MVD_GetVldErrCount(MS_U8 u8Idx);
320 MS_BOOL HAL_MVD_GetValidStreamFlag(MS_U8 u8Idx);
321 MS_U8 HAL_MVD_GetIsIPicFound(MS_U8 u8Idx);
322 MS_U32 HAL_MVD_GetNextPTS(MS_U8 u8Idx);
323 MS_U32 HAL_MVD_GetChromaFormat(MS_U8 u8Idx);
324 MS_U32 HAL_MVD_GetGOPCount(MS_U8 u8Idx);
325 MS_U8 HAL_MVD_GetColorFormat(MS_U8 u8Idx);
326 MS_U8 HAL_MVD_GetMatrixCoef(MS_U8 u8Idx);
327 MS_BOOL HAL_MVD_IsStepDispDone(MS_U8 u8Idx);
328 MS_BOOL HAL_MVD_IsStep2PtsDone(MS_U8 u8Idx);
329 MS_U32 HAL_MVD_GetPayloadLen(MS_U8 u8Idx);
330 MS_BOOL HAL_MVD_GotFileEndPattern(MS_U8 u8Idx);
331 MS_BOOL HAL_MVD_IsCmdFinished(MS_U8 u8Idx, MVD_HANDSHAKE_CMD eCmd);
332 MS_BOOL HAL_MVD_ClearCmdFinished(MS_U8 u8Idx, MVD_HANDSHAKE_CMD eCmd);
333 MS_BOOL HAL_MVD_GetTimeCode(MS_U8 u8Idx, MVD_FrmInfoType eType, MVD_TimeCode* pInfo);
334 MS_U32 HAL_MVD_GetDispCnt(MS_U8 u8Idx);
335 MS_U32 HAL_MVD_GetXcLowDelayIntState(MS_U8 u8Idx);
336 void HAL_MVD_GetErrInfo(MS_U8 u8Idx, MVD_ErrCode *errCode, MVD_ErrStatus *errStatus);
337 
338 MS_BOOL HAL_MVD_SetInternalBuffAddr(MS_U8 u8Idx, MS_VIRT u32start, MS_U32 u32len);
339 void HAL_MVD_InitVar(MS_U8 u8Idx);
340 MS_BOOL HAL_MVD_CheckFrmBuffSize(MS_U8 u8Idx, MVD_FWCfg* fwCfg, MVD_MEMCfg* memCfg);
341 MS_BOOL HAL_MVD_SetCodecInfo(MS_U8 u8Idx, MVD_CodecType u8CodecType, MVD_SrcMode u8BSProviderMode, MS_U8 bDisablePESParsing, MS_U8 u8ChipECORev);
342 MS_BOOL HAL_MVD_Exit(MS_U8 u8Idx);
343 
344 void HAL_MVD_GetFrameInfo(MS_U8 u8Idx, MVD_FrameInfo *pinfo);
345 void HAL_MVD_SetFrameInfo(MS_U8 u8Idx, MVD_FrameInfo *pinfo );
346 MS_VIRT MVD_GetSlqTblESReadPtr(MS_U8 u8Idx);
347 MS_VIRT MVD_GetSlqTblESWritePtr(MS_U8 u8Idx);
348 MS_U32 HAL_MVD_GetQueueVacancy(MS_U8 u8Idx, MS_BOOL bCached);
349 E_MVD_Result HAL_MVD_PushQueue(MS_U8 u8Idx, MVD_PacketInfo* pInfo);
350 E_MVD_Result HAL_MVD_FlushQueue(MS_U8 u8Idx);
351 MS_BOOL HAL_MVD_IsAllBufferEmpty(MS_U8 u8Idx);
352 MS_BOOL HAL_MVD_SLQTblInit(MS_U8 u8Idx);
353 
354 E_MVD_Result HAL_MVD_IsDispFinish(MS_U8 u8Idx);
355 E_MVD_Result HAL_MVD_SetDynScalingParam(MS_U8 u8Idx, MS_PHY u32StAddr, MS_SIZE u32Size);
356 void HAL_MVD_GetExtDispInfo(MS_U8 u8Idx, MVD_ExtDispInfo* pInfo);
357 E_MVD_Result HAL_MVD_GetFrmInfo(MS_U8 u8Idx, MVD_FrmInfoType eType, MVD_FrmInfo* pInfo);
358 
359 MS_BOOL HAL_MVD_GetUsrDataIsAvailable(MS_U8 u8Idx);
360 MS_BOOL HAL_MVD_GetUsrDataInfo(MS_U8 u8Idx, MVD_UsrDataInfo* pUsrInfo);
361 
362 MS_BOOL HAL_MVD_DecodeIFrame(MS_U8 u8Idx, MS_PHY u32FrameBufAddr, MS_PHY u32StreamBufAddr, MS_PHY u32StreamBufEndAddr, MS_U8 u8ChipECORev);
363 
364 MS_U8 HAL_MVD_GetActiveFormat(MS_U8 u8Idx);
365 MS_BOOL HAL_MVD_EnableAVSync(MS_U8 u8Idx, MS_BOOL bEnable);
366 MS_BOOL HAL_MVD_SetAVSyncDelay(MS_U8 u8Idx, MS_U32 u32Delay);
367 MS_BOOL HAL_MVD_SetAVSyncThreshold(MS_U8 u8Idx, MS_U32 u32Th);
368 MS_BOOL HAL_MVD_SetAVSyncFreerunThreshold(MS_U8 u8Idx, MS_U32 u32Th);
369 MS_BOOL HAL_MVD_ChangeAVsync(MS_U8 u8Idx, MS_BOOL bEnable, MS_U16 u16PTS);
370 
371 MS_BOOL HAL_MVD_GetIsSyncRep(MS_U8 u8Idx);
372 MS_BOOL HAL_MVD_GetIsSyncSkip(MS_U8 u8Idx);
373 MS_U8 HAL_MVD_GetIsSyncReach(MS_U8 u8Idx);
374 MS_U8 HAL_MVD_GetDispRdy(MS_U8 u8Idx);
375 
376 MVD_DecStat HAL_MVD_GetDecodeStatus(MS_U8 u8Idx);
377 MS_U32 HAL_MVD_GetParserByteCnt(MS_U8 u8Idx);
378 
379 MS_BOOL MVD_IntHasUsrDataDisp(MS_U32 u32IntStat);
380 MS_BOOL MVD_IntHasUsrData(MS_U32 u32IntStat);
381 MS_BOOL MVD_IntIsDispRdy(MS_U32 u32IntStat);
382 MS_BOOL MVD_IntHasSeqHdr(MS_U32 u32IntStat);
383 MS_BOOL MVD_IntHas1stFrame(MS_U32 u32IntStat);
384 MS_BOOL MVD_IntHasXcLowDelay(MS_U32 u32IntStat);
385 MS_BOOL MVD_IntHasDecodeIframe(MS_U32 u32IntStat);
386 MS_BOOL MVD_IntVSyncInt(MS_U32 u32IntStat);
387 MS_BOOL MVD_IntDecOneFrmInt(MS_U32 u32IntStat);
388 MS_BOOL HAL_MVD_EnableInt(MS_U8 u8Idx, MS_U32 bEn);
389 MS_BOOL MVD_IntHasESDataInvalid(MS_U32 u32IntStat);
390 MS_BOOL MVD_IntHasDecodeErr(MS_U32 u32IntStat);
391 E_MVD_Result HAL_MVD_EnableDispOneField(MS_U8 u8Idx, MS_BOOL bEn);
392 E_MVD_Result HAL_MVD_SetFdMaskDelayCount(MS_U8 u8Idx, MS_U16 u16Cnt);
393 E_MVD_Result HAL_MVD_SetOutputFRCMode(MS_U8 u8Idx, MS_U8 u8FrameRate, MS_U8 u8Interlace);
394 E_MVD_Result HAL_MVD_SetFRCDropType(MS_U8 u8Idx, MS_U8 u8DropType);
395 E_MVD_Result HAL_MVD_SetDisableSeqChange(MS_U8 u8Idx, MS_BOOL bEnable);
396 MS_BOOL HAL_MVD_DropErrorFrame(MS_U8 u8Idx, MS_BOOL bDrop);
397 
398 void HAL_MVD_SetPTSBase(MS_U8 u8Idx, MS_U32 u32pts);
399 MS_U32 HAL_MVD_GetPTS(MS_U8 u8Idx);
400 MS_U64 HAL_MVD_GetU64PTS(MS_U8 u8Idx,MVD_PtsType eType);
401 MS_BOOL HAL_MVD_SkipData(MS_U8 u8Idx);
402 MS_BOOL HAL_MVD_DispRepeatField(MS_U8 u8Idx, MS_BOOL bEnable);
403 MS_BOOL HAL_MVD_PauseDisp(MS_U8 u8Idx);
404 MS_BOOL HAL_MVD_FlushDisplayBuf(MS_U8 u8Idx);
405 MS_VIRT HAL_MVD_GetTsFileESReadPtr(MS_U8 u8Idx);
406 MS_VIRT HAL_MVD_GetTsFileESWritePtr(MS_U8 u8Idx);
407 void HAL_MVD_SetDivXCfg(MS_U8 u8Idx, MS_U8 u8MvAdjust, MS_U8 u8IdctSel);
408 MS_VIRT HAL_MVD_GetSLQReadPtr(MS_U8 u8Idx);
409 MS_BOOL HAL_MVD_SetSLQWritePtr(MS_U8 u8Idx, MS_BOOL bCheckData);
410 
411 void HAL_MVD_SetOverflowTH(MS_U8 u8Idx, MS_U32 u32Threshold);
412 void HAL_MVD_SetUnderflowTH(MS_U8 u8Idx, MS_U32 u32Threshold);
413 MS_BOOL HAL_MVD_Stop(MS_U8 u8Idx);
414 MS_U8 HAL_MVD_GetLastCmd(MS_U8 u8Idx);
415 MS_BOOL HAL_MVD_SkipToIFrame(MS_U8 u8Idx);
416 MS_BOOL HAL_MVD_DispCtrl(MS_U8 u8Idx, MS_BOOL bDecOrder, MS_BOOL bDropErr, MS_BOOL bDropDisp, MVD_FrcMode eFrcMode);
417 MS_BOOL HAL_MVD_StepDecode(MS_U8 u8Idx);
418 MS_BOOL HAL_MVD_TrickPlay(MS_U8 u8Idx, MVD_TrickDec trickDec, MS_U8 u8DispDuration);
419 MS_BOOL HAL_MVD_GenPattern(MS_U8 u8Idx, MVD_PatternType ePattern, MS_PHY u32PAddr, MS_U32* pu32Size);
420 
421 MVD_CodecType HAL_MVD_GetCodecType(MS_U8 u8Idx);
422 MVD_SrcMode HAL_MVD_GetSrcMode(MS_U8 u8Idx);
423 MS_BOOL HAL_MVD_SetFWCfg(MS_U8 u8Idx, MVD_FWCfg* pFWCfg);
424 MS_U8 HAL_MVD_GetFBMode(MS_U8 u8Idx);
425 MVD_CtrlCfg* HAL_MVD_GetCtrlCfg(MS_U8 u8Idx);
426 MS_BOOL HAL_MVD_SetMEMCfg(MS_U8 u8Idx, MVD_MEMCfg* pMEMCfg);
427 MVD_MEMCfg* HAL_MVD_GetMEMCfg(MS_U8 u8Idx);
428 
429 E_MVD_Result HAL_MVD_DbgGetData(MS_VIRT u32Addr, MS_U32* u32Data);
430 void HAL_MVD_DbgDumpBits(MS_U8 u8Idx, MS_PHY u32base, MS_U32 u32size);
431 void HAL_MVD_DbgDump(MS_U8 u8Idx);
432 void HAL_MVD_SetDbgLevel(MS_U8 level);
433 MS_U32 HAL_MVD_CPUGetPC(void);
434 MS_U8 HAL_MVD_SidToIdx(HAL_MVD_StreamId eSID);
435 MS_BOOL HAL_MVD_ReleaseFdMask(MS_U8 u8Idx, MS_BOOL bRls);
436 MS_BOOL HAL_MVD_ParserRstDone(MS_U8 u8Idx, MS_BOOL bEnable);
437 MS_BOOL HAL_MVD_FlushPTSBuf(MS_U8 u8Idx,MS_BOOL bEnable);
438 MS_BOOL HAL_MVD_ShowDecodeOrder(MS_U8 u8Idx, MS_U8 u8Mode);
439 MS_U32 HAL_MVD_GetSLQNum(MS_U8 u8Idx);
440 MS_U32 HAL_MVD_GetDispQNum(MS_U8 u8Idx);
441 MS_BOOL HAL_MVD_SetAutoMute(MS_U8 u8Idx, MS_BOOL bEn);
442 MS_BOOL HAL_MVD_Init_Share_Mem(void);
443 MS_BOOL HAL_MVD_SetVSizeAlign(MS_U8 u8Idx, MS_BOOL bEn);
444 E_MVD_Result HAL_MVD_GetCrcValue(MS_U8 u8Idx, MVD_CrcIn *pCrcIn, MVD_CrcOut *pCrcOut);
445 E_MVD_Result HAL_MVD_EnablePTSDetector(MS_U8 u8Idx, MS_BOOL bEn);
446 E_MVD_Result HAL_MVD_DisablePBFrameMode(MS_U8 u8Idx, MS_BOOL bEn);
447 
448 MS_BOOL HAL_MVD_SuspendDynamicScale(MS_U8 u8Idx, MS_BOOL bEn);
449 MS_U8 HAL_MVD_GetSuspendDynamicScale(MS_U8 u8Idx);
450 MS_U8 HAL_MVD_GetStereoType(MS_U8 u8Idx);
451 MS_U32 HAL_MVD_GetDivxVer(MS_U8 u8Idx);
452 MS_BOOL HAL_MVD_SetIdctMode(MS_U8 u8Idx, MS_U8 u8Mode);
453 E_MVD_Result HAL_MVD_EX_SetClockSpeed(HAL_MVD_EX_ClockSpeed eClockSpeed);
454 MS_BOOL HAL_MVD_GetIsAVSyncOn(MS_U8 u8Idx);
455 MS_BOOL HAL_MVD_ShowFirstFrameDirect(MS_U8 u8Idx, MS_U8 bEnable);
456 E_MVD_Result HAL_MVD_SetXCLowDelayPara(MS_U8 u8Idx,MS_U32 u32Para);
457 MS_BOOL HAL_MVD_EnableDynamicScale(MS_U8 u8Idx,MS_U8 u8NewDS);
458 MS_U8 HAL_MVD_GetESBufferStatus(MS_U8 u8Idx);
459 MS_BOOL HAL_MVD_Field_Polarity_Display_One_field(MS_U8 u8Idx, MS_BOOL bEn,MS_U8 top_bottom);
460 MS_BOOL HAL_MVD_SetExternalDSBuff(MS_U8 u8Idx, MS_VIRT u32VPUAddr, MS_VIRT u32DrvAddr);
461 MS_BOOL HAL_MVD_SetShareMemoryBase(MS_U8 u8Idx, MS_VIRT u32base, MS_BOOL bsel);
462 MS_BOOL HAL_MVD_GetShareMemoryOffset(MS_U8 u8Idx, MS_VIRT *u32base);
463 MS_BOOL HAL_MVD_Support2ndMVOPInterface(void);
464 MS_BOOL HAL_MVD_SetExternal_CC_Buffer(MS_U8 u8Idx, MS_VIRT u32base, MS_U8 u8size, MS_U8 cc_type);
465 MS_BOOL HAL_MVD_GetPVRSeamlessInfo(MS_U8 u8Idx,void* param);
466 MS_VIRT HAL_MVD_GetVsyncBridgeAddr(MS_U8 u8Idx);
467 E_MVD_Result HAL_MVD_HWBuffer_ReMappingMode(MS_U8 u8Idx,MS_BOOL bEnable);
468 MS_BOOL HAL_MVD_SetPrebufferSize(MS_U8 u8Idx, MS_U32 size);
469 MS_VIRT HAL_MVD_GetVsyncAddrOffset(void);
470 MS_VIRT HAL_MVD_GetVsyncExtAddrOffset(void);
471 E_MVD_Result HAL_MVD_SetTimeIncPredictParam(MS_U8 u8Idx, MS_U32 u32time);
472 MS_BOOL HAL_MVD_SetDecodeTimeoutParam(MS_U8 u8Idx, MS_BOOL enable,MS_U32 u32timeout);
473 MS_BOOL HAL_MVD_SetSrcMode(MS_U8 u8Idx,MVD_SrcMode mode);
474 MS_BOOL _MVD_SetDynamicAllocateFB(MS_U8 u8Idx,MS_BOOL bEnable);
475 E_MVD_Result HAL_MVD_Set_Smooth_Rewind(MS_U8 u8Idx, MS_U8 btype);
476 E_MVD_Result HAL_MVD_IsAlive(MS_U8 u8Idx);
477 E_MVD_Result HAL_MVD_Set_Err_Tolerance(MS_U8 u8Idx, MS_U16 u16Para);
478 void HAL_MVD_EnableAutoInsertDummyPattern(MS_U8 u8Idx, MS_BOOL bEnable);
479 void HAL_MVD_Drop_One_PTS(MS_U8 u8Idx);
480 E_MVD_Result HAL_MVD_PVR_Seamless_mode(MS_U8 u8Idx, MS_U8 u8Arg);
481 E_MVD_Result HAL_MVD_SetDisplayFinishMode(MS_U8 u8Idx, MS_U8 u8Mode);
482 MS_VIRT HAL_MVD_GetVBBUTableAddr(MS_U8 u8Idx);
483 MS_BOOL HAL_MVD_GetColorInfo(MS_U8 u8Idx, MVD_Color_Info* pstColorInfo);
484 #ifdef VDEC3
485 MS_BOOL HAL_MVD_IsDisplayCommand(MS_U8 u8Cmd);
486 MS_BOOL HAL_MVD_IsNormalCommand(MS_U8 u8Cmd);
487 MS_BOOL HAL_MVD_IsNeedResponseCommand(MS_U8 u8Cmd);
488 #endif
489 void HAL_MVD_ResetHandShake(MS_U8 u8Idx, MVD_HANDSHAKE_CMD cmd);
490 MS_BOOL HAL_MVD_FRC_OnlyShowTopField(MS_U8 u8Idx, MS_BOOL bEnable);
491 
492 void HAL_MVD_SetDmxFrameRate(MS_U8 u8HalIdx,MS_U32 u32Value);
493 void HAL_MVD_SetDmxFrameRateBase(MS_U8 u8HalIdx,MS_U32 u32Value);
494 void HAL_MVD_TrickPlay2xAVSync(MS_U8 u8Idx,MS_BOOL bEnable);
495 void HAL_MVD_SetFrameBufferMiu(MS_U8 u8HalIdx,MS_U8 u8MiuIdx);
496 void HAL_MVD_SetCMAAllocateDone(MS_U8 u8HalIdx);
497 void HAL_MVD_GetCMAInformation(MS_U8 u8HalIdx,MS_U64* u64Addr,MS_SIZE* u64Size,MS_BOOL* bAllocDone);
498 void HAL_MVD_SetCMAInformation(void* cmaInitParam);
499 E_MVD_Result HAL_MVD_Set_SlowSyncParam(MS_U8 u8Idx, MS_U8 u8RepeatPeriod,MS_U8 u8DropPeriod);
500 MS_BOOL HAL_MVD_VariableFrameRate(MS_U8 u8Idx);
501 E_MVD_DISP_QUEUE HAL_MVD_IsDispQueueEmpty(MS_U8 u8Idx);
502 MS_U32 HAL_MVD_GetMinTspDataSize(MS_U8 u8HalIdx);
503 #endif
504 
505 #endif // _DEV_MVD_H_
506