xref: /utopia/UTPA2-700.0.x/modules/xc/drv/xc/include/drv_sc_ip.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 _MDRV_SC_IP_H_
96 #define _MDRV_SC_IP_H_
97 
98 #include "mhal_ip.h"
99 #include "mhal_xc_chip_config.h"
100 
101 //-------------------------------------------------------------------------------------------------
102 //  Macro and Define
103 //-------------------------------------------------------------------------------------------------
104 #define PERIOD_TOLARANCE 5
105 #define MAX_GET_VPERIOD_TIME 3
106 #define ENABLE_DEBUG_CAPTURE_N_FRAMES           0
107 
108 // mode change torlance for timing monitor, also used in auto procedure
109 #define MD_HPERIOD_TORLANCE         5      // horizontal period torlance
110 #define MD_VTOTAL_TORLANCE          5      // vertical total torlance
111 #define MD_HDE_TORLANCE             5
112 #define MD_VDE_TORLANCE             5
113 
114 #define ACCURATE_VFREQ_TOLERANCE 20 //Tolerance for using new accurate vfreq method: 1hz
115 
116 #define ACCURATE_VFREQ_TOLERANCE_FOR_VD_SOURCE 8 //Tolerance for using new accurate vfreq method: 0.8hz
117 #define ACCURATE_VFREQ_TOLERANCE_FOR_VD_SOURCE_EX 2 //Tolerance for using new accurate vfreq method: 0.2hz
118 
119 
120 #define WAIT_VSYNC_TIME_MAX  50
121 
122 //-------------------------------------------------------------------------------------------------
123 //  Type and Structure
124 //-------------------------------------------------------------------------------------------------
125 /// Indecate the status of pc monitor.
126 typedef struct __attribute__((packed))
127 {
128     INPUT_SOURCE_TYPE_t eCurrentSrc;    ///< indicate current input source type
129 
130     XC_PCMONITOR_STATUS eCurrentState;       ///< timing monitor state
131     XC_PCMONITOR_STATUS ePreMonitorState;  ///< timing pre monitor state
132 
133     MS_U32 u32LastExecutedTime;            ///< 30ms execute timing monitor once
134     MS_BOOL bInputTimingChange;         ///< indicate input timing changed or not
135     MS_U8  ucInputTimingStableCounter;     ///< input timing stable counter
136     MS_U8  ucTimingChangeDebounce;         ///< debounce counter when timing un-stable
137     MS_BOOL bInputTimingStable;         ///< input timing stable or not
138     MS_BOOL bDoModeSetting;             ///< indicate the timing is stable (either with sync or without sync) and can do mode setting
139 
140     // Analog
141     MS_U16 u16Hperiod;                     ///< Hperiod got from scaler
142     MS_U16 u16VSyncTime;                   ///< vsync time calculated from Hperiod & Vtotal
143 
144     MS_U16 u16Vtotal;                      ///< Vertical total
145     MS_U8  u8SyncStatus;                   ///< from XC driver, including H/V sync polarity, interlaced or progressive
146 
147     // Digital
148     MS_WINDOW_TYPE sDVI_HDMI_DE_Info;   ///< DVI/HDMI input DE information
149     MS_U32 u32FrameRatex1K;                // Frame rate x1K
150 
151 } XC_PCMONITOR_HK_INFO;
152 //-------------------------------------------------------------------------------------------------
153 //  Function and Variable
154 //-------------------------------------------------------------------------------------------------
155 
156 #ifdef _MDRV_SC_IP_C_
157 #define INTERFACE
158 #else
159 #define INTERFACE extern
160 #endif
161 
162 typedef enum
163 {
164     IP_ANALOG1 = 0x00,
165     IP_ANALOG2 = 0x01,
166     IP_ANALOG3 = 0x02,
167     IP_DVI     = 0x03,
168     IP_VIDEO   = 0x04,
169     IP_HDTV    = 0x05,
170     IP_HDMI    = 0x07,
171 } EN_ISELECT;
172 
173 // This can be added in the future.
174 // FCLK have to be changed case by case.
175 typedef enum
176 {
177     EN_FCLK_NORMAL,
178     EN_FCLK_FBL,
179 } EN_SET_FCLK_CASE;
180 
181 extern MS_U16 MDrv_XC_cal_pixclk(void *pInstance, MS_U16 u16HTotal, SCALER_WIN eWindow);
182 extern void MDrv_XC_reset_ip(void *pInstance, SCALER_WIN eWindow);
183 
184 #define MDrv_SC_de_only_en  Hal_SC_de_only_en
185 INTERFACE void MDrv_SC_de_only_en(void *pInstance, MS_BOOL benable, SCALER_WIN eWindow);
186 
187 #define MDrv_SC_de_direct_en  Hal_SC_de_direct_en
188 INTERFACE void MDrv_SC_de_direct_en(void *pInstance, MS_BOOL benable, SCALER_WIN eWindow);
189 
190 #define MDrv_SC_set_delayline  Hal_SC_set_delayline
191 INTERFACE void MDrv_SC_set_delayline(void *pInstance, MS_U8 u8DelayLines, SCALER_WIN eWindow );
192 
193 #define MDrv_SC_set_Fclk  Hal_SC_set_Fclk
194 INTERFACE void MDrv_SC_set_Fclk(void *pInstance, EN_SET_FCLK_CASE enCase );
195 
196 #define MDrv_SC_setfield Hal_SC_setfield
197 INTERFACE void MDrv_SC_setfield(void *pInstance, MS_U16 reg_1D, MS_U16 reg_21, MS_U16 reg_23, SCALER_WIN eWindow );
198 
199 #define MDrv_SC_ip_set_input_source Hal_SC_ip_set_input_source
200 INTERFACE void MDrv_SC_ip_set_input_source(void *pInstance, MS_U8 u8InputSrcSel, MS_U8 u8SyncSel, MS_U8 u8VideoSel, MS_U8 u8isYPbPr, SCALER_WIN eWindow );
201 
202 #define MDrv_SC_ip_set_image_wrap Hal_SC_ip_set_image_wrap
203 INTERFACE void MDrv_SC_ip_set_image_wrap(void *pInstance, MS_BOOL bHEnable, MS_BOOL bVEnable, SCALER_WIN eWindow );
204 
205 #define MDrv_SC_ip_set_input_sync_reference_edge  Hal_SC_ip_set_input_sync_reference_edge
206 INTERFACE void MDrv_SC_ip_set_input_sync_reference_edge(void *pInstance, MS_BOOL bHRef, MS_BOOL bVRef, SCALER_WIN eWindow );
207 
208 #define MDrv_SC_ip_set_input_vsync_delay Hal_SC_ip_set_input_vsync_delay
209 INTERFACE void MDrv_SC_ip_set_input_vsync_delay(void *pInstance, MS_BOOL bDelay, SCALER_WIN eWindow );
210 
211 #define MDrv_SC_ip_set_de_only_mode Hal_SC_ip_set_de_only_mode
212 INTERFACE void MDrv_SC_ip_set_de_only_mode(void *pInstance, MS_BOOL bEnable, SCALER_WIN eWindow );
213 
214 #define MDrv_SC_ip_set_coast_input Hal_SC_ip_set_coast_input
215 INTERFACE void MDrv_SC_ip_set_coast_input(void *pInstance, MS_BOOL bInputSel, SCALER_WIN eWindow );
216 
217 #define MDrv_ip_set_input_10bit hal_ip_set_input_10bit
218 INTERFACE void MDrv_ip_set_input_10bit(void *pInstance, MS_BOOL bInput10Bit, SCALER_WIN eWindow );
219 
220 #define MDrv_SC_ip_set_ms_filter Hal_SC_ip_set_ms_filter
221 INTERFACE void MDrv_SC_ip_set_ms_filter(void *pInstance, MS_BOOL bEnable, MS_U16 u16FilterRange, SCALER_WIN eWindow );
222 
223 #define MDrv_SC_ip_set_coast_window Hal_SC_ip_set_coast_window
224 INTERFACE void MDrv_SC_ip_set_coast_window(void *pInstance, MS_U8 u8Start, MS_U8 u8End, SCALER_WIN eWindow );
225 
226 #define MDrv_SC_ip_set_input_sync_sample_mode Hal_SC_ip_set_input_sync_sample_mode
227 INTERFACE void MDrv_SC_ip_set_input_sync_sample_mode(void *pInstance, MS_BOOL bMode, SCALER_WIN eWindow );
228 
229 #define MDrv_SC_ip_set_de_bypass_mode Hal_SC_ip_set_de_bypass_mode
230 INTERFACE void Hal_SC_ip_set_de_bypass_mode(void *pInstance, MS_BOOL bEnable, SCALER_WIN eWindow );
231 
232 #define MDrv_SC_ip_set_de_lock_mode Hal_SC_ip_set_de_lock_mode
233 INTERFACE void Hal_SC_ip_set_de_lock_mode(void *pInstance, MS_BOOL bEnable, SCALER_WIN eWindow );
234 
235 #define MDrv_SC_get_hsd_pixel_count Hal_SC_get_hsd_pixel_count
236 INTERFACE MS_U16 Hal_SC_get_hsd_pixel_count(void *pInstance, SCALER_WIN eWindow );
237 
238 #define MDrv_SC_get_vsd_line_count Hal_SC_get_vsd_line_count
239 INTERFACE MS_U16 Hal_SC_get_vsd_line_count(void *pInstance, SCALER_WIN eWindow );
240 
241 #define MDrv_SC_ip_set_post_glitch_removal Hal_SC_ip_set_post_glitch_removal
242 INTERFACE void MDrv_SC_ip_set_post_glitch_removal(void *pInstance, MS_BOOL bEnble, MS_U8 u8Range, SCALER_WIN eWindow );
243 
244 #define MDrv_SC_ip_get_post_glitch_removal Hal_SC_ip_get_post_glitch_removal
245 INTERFACE MS_U8 MDrv_SC_ip_get_post_glitch_removal(void *pInstance, SCALER_WIN eWindow);
246 
247 #define MDrv_SC_ip_set_DE_Mode_Glitch Hal_SC_ip_set_DE_Mode_Glitch
248 INTERFACE void MDrv_SC_ip_set_DE_Mode_Glitch(void *pInstance, MS_U8 u8Setting , SCALER_WIN eWindow );
249 
250 #define MDrv_SC_ip_get_DE_mode_glitch_protect_enabled Hal_SC_ip_get_DE_mode_glitch_protect_enabled
251 INTERFACE MS_BOOL MDrv_SC_ip_get_DE_mode_glitch_protect_enabled(void *pInstance, SCALER_WIN eWindow);
252 
253 // Htt Vtt
254 INTERFACE MS_U16 Hal_SC_ip_get_horizontalPeriod(void *pInstance, SCALER_WIN eWindow);
255 #define MDrv_SC_ip_get_horizontalPeriod  Hal_SC_ip_get_horizontalPeriod
256 
257 INTERFACE MS_U16 Hal_SC_ip_get_verticaltotal(void *pInstance, SCALER_WIN eWindow);
258 #define MDrv_SC_ip_get_verticaltotal     Hal_SC_ip_get_verticaltotal
259 
260 #define MDrv_SC_ip_set_handshaking_md Hal_SC_ip_set_handshaking_md
261 INTERFACE void MDrv_SC_ip_set_handshaking_md(void *pInstance, MS_U8 u8MD, SCALER_WIN eWindow);
262 
263 INTERFACE void MDrv_XC_Set_FD_Mask_ByWin(void *pInstance, MS_BOOL bEnable,SCALER_WIN eWindow);
264 
265 #define MDrv_XC_GetCaptureWindow Hal_SC_ip_get_capture_window
266 INTERFACE void MDrv_XC_GetCaptureWindow(void *pInstance, MS_WINDOW_TYPE* capture_win, SCALER_WIN eWindow);
267 
268 #define MDrv_XC_GenSpecificTiming Hal_SC_IPMux_Gen_SpecificTiming
269 INTERFACE void MDrv_XC_GenSpecificTiming(void *pInstance, XC_Internal_TimingType timingtype);
270 
271 #define MDrv_XC_InitIPForInternalTiming Hal_SC_ip_Init_for_internal_timing
272 INTERFACE void MDrv_XC_InitIPForInternalTiming(void *pInstance, XC_Internal_TimingType timingtype, SCALER_WIN eWindow);
273 
274 INTERFACE E_APIXC_ReturnValue MDrv_SC_ForceInterlaceInPMode(void *pInstance, MS_BOOL bEnable, SCALER_WIN eWindow);
275 INTERFACE MS_BOOL MDrv_SC_GetInterlaceInPModeStatus(void *pInstance, SCALER_WIN eWindow );
276 
277 INTERFACE MS_BOOL MDrv_SC_Check_IP_Gen_Timing(void *pInstance);
278 INTERFACE void MDrv_XC_SetCaptureWindow (void *pInstance, MS_WINDOW_TYPE* pstCaptureWin, SCALER_WIN eWindow,  MS_BOOL bFire);
279 INTERFACE void MDrv_XC_ip_get_sync_status(void *pInstance, XC_IP_SYNC_STATUS *sXC_Sync_Status, E_MUX_INPUTPORT enInputPort , SCALER_WIN eWindow);
280 INTERFACE MS_U8 MDrv_XC_wait_output_vsync(void *pInstance, MS_U8 u8NumVSyncs, MS_U16 u16Timeout, SCALER_WIN eWindow);
281 INTERFACE MS_U8 MDrv_XC_wait_input_vsync(void *pInstance, MS_U8 u8NumVSyncs, MS_U16 u16Timeout, SCALER_WIN eWindow);
282 INTERFACE MS_U32 MDrv_XC_DelayAndWaitOutVsync(void *pInstance, MS_U32 u32DelayTime, SCALER_WIN eWindow);
283 INTERFACE void MDrv_XC_HWAuto_SyncSeparate(void *pInstance, SCALER_WIN eWindow);
284 INTERFACE MS_BOOL MApi_XC_IsAutoPositionResultReady(void *pInstance, SCALER_WIN eWindow);
285 INTERFACE void MApi_XC_AutoPositionEnable(void *pInstance, MS_U8 u8Enable , SCALER_WIN eWindow);
286 INTERFACE MS_BOOL MApi_XC_AutoPhaseEnable(void *pInstance, MS_BOOL bEnable , SCALER_WIN eWindow);
287 INTERFACE void    MDrv_XC_SetValidDataThreshold(void *pInstance, MS_U8 u8Threshold, SCALER_WIN eWindow );
288 INTERFACE MS_U16  MApi_XC_SetAutoPositionVstart(void *pInstance, SCALER_WIN eWindow );
289 INTERFACE MS_U16  MApi_XC_SetAutoPositionHstart(void *pInstance, SCALER_WIN eWindow );
290 INTERFACE MS_U16  MApi_XC_SetAutoPositionVend(void *pInstance, SCALER_WIN eWindow );
291 INTERFACE MS_U16  MApi_XC_SetAutoPositionHend(void *pInstance, SCALER_WIN eWindow );
292 INTERFACE MS_BOOL MDrv_XC_GetAutoPositionForcePixelMode(void *pInstance, SCALER_WIN eWindow);
293 INTERFACE void    MDrv_XC_SetAutoPositionForcePixelMode(void *pInstance, MS_BOOL bEnable, SCALER_WIN eWindow);
294 INTERFACE void    MApi_XC_VsyncPolarityDetectMode(void *pInstance, MS_U8 u8Enable, SCALER_WIN eWindow );
295 INTERFACE void    MApi_XC_TimingChangeInit(void *pInstance, SCALER_WIN eWindow);
296 INTERFACE MS_AUTOADC_TYPE MApi_XC_GetAverageDataFromMemory(void *pInstance, MS_WINDOW_TYPE* mem_win);
297 INTERFACE MS_U8   MApi_XC_CalculateVsyncTime(void *pInstance, MS_U16 u16VTotal, MS_U16 u16HPeriod);
298 INTERFACE void    MApi_XC_EnableIPAutoCoast(MS_BOOL bEnable);
299 INTERFACE void    MDrv_XC_EnableIPAutoCoast(void *pInstance, MS_BOOL bEnable);
300 INTERFACE MS_U8 MDrv_XC_PCMonitor_GetVSyncTime(void *pInstance, SCALER_WIN eWindow);
301 INTERFACE void MApi_XC_AutoRangeEnable(void *pInstance, MS_U8 u8Enable , SCALER_WIN eWindow);
302 INTERFACE void MApi_XC_SetAutoRangeWindow(void *pInstance, MS_U16 u16Vstart, MS_U16 u16Hstart, MS_U16 u16Vsize, MS_U16 u16Hsize, SCALER_WIN eWindow);
303 ////===========
304 ////get scaler de info from sc_ip
305 INTERFACE MS_U16 MDrv_SC_de_hend_info(void); //NO_USE
306 INTERFACE MS_U16 MDrv_SC_de_vend_info(void); //NO_USE
307 
308 INTERFACE void MDrv_XC_init_riu_base(MS_VIRT u32riu_base, MS_VIRT u32PMriu_base);
309 //INTERFACE void MApi_XC_GetFrameData(XC_ApiStatus stSrcInfo, MS_RECT_INFO eRect_Info);
310 INTERFACE void MDrv_SC_SetFrameDataCore(void *pInstance, MS_S16 x0, MS_S16 y0, MS_S16 x1, MS_S16 y1,
311                               MS_U8 *pRect,
312                               MS_U32 u32RectPitch,
313                               MS_U32 u32RectSize,
314                               MS_U16 u16PointSize);
315 
316 INTERFACE void MApi_XC_Rerout_for_Capture_VOP_Data(void *pInstance);
317 
318 INTERFACE MS_U8 MDrv_XC_WaitOutputVSync(void *pInstance, MS_U8 u8NumVSyncs, MS_U16 u16Timeout, SCALER_WIN eWindow);
319 INTERFACE void MDrv_XC_DisableInputSource(void *pInstance, MS_BOOL bDisable, SCALER_WIN eWindow);
320 INTERFACE MS_BOOL MDrv_XC_IsInputSourceDisabled(void *pInstance, SCALER_WIN eWindow);
321 INTERFACE void MDrv_XC_SoftwareReset(void *pInstance, MS_U8 u8Reset, SCALER_WIN eWindow);
322 INTERFACE void MDrv_XC_GetSyncStatus(void *pInstance, INPUT_SOURCE_TYPE_t eCurrentSrc, XC_IP_SYNC_STATUS *sXC_Sync_Status, SCALER_WIN eWindow);
323 INTERFACE MS_U16 MApi_XC_GetAutoGainResult(void *pInstance, AUTO_GAIN_TYPE u8Type, MS_U8 u8DelayMS, SCALER_WIN eWindow);
324 INTERFACE MS_U8 MApi_XC_GetAutoGainMaxValueStatus(void *pInstance, SCALER_WIN eWindow);
325 INTERFACE void MApi_XC_EuroHdtvHandler(void *pInstance, SCALER_WIN eWindow);
326 INTERFACE MS_DETECT_EURO_HDTV_STATUS_TYPE MDrv_XC_ip_GetEuroHdtvStatus(void *pInstance, SCALER_WIN eWindow);
327 INTERFACE void MApi_XC_SetFIRDownSampleDivider(void *pInstance, MS_U8 u8Enable , MS_U16 u16OverSamplingCount , SCALER_WIN eWindow );
328 INTERFACE void MApi_XC_SetCaptureWindowVsize(MS_U16 u16Vsize , SCALER_WIN eWindow); //API_INTERFACE
329 INTERFACE void MApi_XC_SetCaptureWindowHsize(MS_U16 u16Hsize , SCALER_WIN eWindow); //API_INTERFACE
330 INTERFACE void MApi_XC_Set_BufferData_WithoutMutex(void *pInstance, E_XC_INPUTDATA_TYPE eBufType, MS_WINDOW_TYPE *pDstRect, void *pSrcBuf, MS_WINDOW_TYPE *pSrcRect, SCALER_WIN eWindow);
331 INTERFACE void MApi_XC_Get_BufferData_WithoutMutex(void *pInstance, E_XC_OUTPUTDATA_TYPE eBufType, MS_WINDOW_TYPE *pRect, void *pRectBuf, SCALER_WIN eWindow);
332 
333 #define MDrv_SC_IP2_PreFilter_Enable  Hal_SC_IP2_PreFilter_Enable
334 INTERFACE void MDrv_SC_IP2_PreFilter_Enable(void *pInstance, MS_BOOL bEnable);
335 INTERFACE void MApi_XC_InitRegInTimingChange_Post(void *pInstance, MS_U8 u8CurrentSyncStatus, SCALER_WIN eWindow);
336 INTERFACE MS_BOOL MApi_XC_GetDstInfo_IP1(void *pInstance, MS_XC_DST_DispInfo *pDstInfo, MS_U32 u32SizeofDstInfo, SCALER_WIN eWindow);
337 INTERFACE void MDrv_XC_GetDEWidthHeightInDEByPassMode(void* pInstance, MS_U16* pu16Width, MS_U16* pu16Height, SCALER_WIN eWindow);
338 INTERFACE MS_BOOL MDrv_SC_Get_DE_Bypass_Mode(void *pInstance, SCALER_WIN eWindow);
339 INTERFACE MS_BOOL MDrv_XC_GetSkipOPWriteOffInSetWindow(void *pInstance, SCALER_WIN eWindow);
340 INTERFACE void MDrv_XC_SetSkipDisableOPWriteOffInFPLL(void *pInstance, MS_BOOL bEnable, SCALER_WIN eWindow);
341 
342 INTERFACE void MDrv_XC_SetVGASogEn(void *pInstance, MS_BOOL bVGASogEn);
343 INTERFACE MS_BOOL MDrv_XC_GetVGASogEn(void *pInstance);
344 INTERFACE void MDrv_XC_SetSogDetectStatus(void *pInstance, MS_U8  u8SogDetectStatus);
345 INTERFACE MS_U8  MDrv_XC_GetSogDetectStatus(void *pInstance);
346 
347 INTERFACE EN_FORCEi_SUPPORT_TYPE MDrv_XC_GetForceiSupportType(void *pInstance);
348 INTERFACE MS_U32 MDrv_XC_CalculateVFreqx1K(void *pInstance, MS_U32 u16HFreq, MS_U16 u16VTotal);
349 INTERFACE MS_U16 MDrv_XC_CalculateVFreqx10(void *pInstance, MS_U16 u16HFreq, MS_U16 u16VTotal);
350 INTERFACE MS_U32 MDrv_XC_GetAccurateVFreqx1K(void* pInstance, SCALER_WIN eWindow);
351 INTERFACE MS_U32 MDrv_XC_CalculateHFreqx1K(void* pInstance, MS_U16 u16HPeriod);
352 INTERFACE MS_U16 MDrv_XC_CalculateHFreqx10(void* pInstance, MS_U16 u16HPeriod);
353 INTERFACE void MDrv_XC_SetCaptureWindowHstart(void *pInstance, MS_U16 u16Hstart , SCALER_WIN eWindow);
354 INTERFACE void MDrv_XC_SetCaptureWindowVstart(void *pInstance, MS_U16 u16Vstart , SCALER_WIN eWindow);
355 INTERFACE void MDrv_XC_SetCaptureWindowHstart_with_Menuload(void *pInstance, MS_U16 u16Hstart , SCALER_WIN eWindow);
356 INTERFACE void MDrv_XC_SetCaptureWindowVstart_with_Menuload(void *pInstance, MS_U16 u16Vstart , SCALER_WIN eWindow);
357 INTERFACE void MDrv_XC_GetDEWindow(void *pInstance, MS_WINDOW_TYPE *psWin, SCALER_WIN eWindow);
358 
359 INTERFACE MS_BOOL MDrv_XC_PCMonitor_Init(void *pInstance, MS_U8 u8MaxWindowNum);
360 INTERFACE XC_PCMONITOR_HK_INFO MDrv_XC_PCMonitor_GetStatus(void *pInstance, SCALER_WIN eWindow);
361 INTERFACE MS_BOOL MDrv_XC_PCMonitor_SetStatus(void *pInstance, XC_PCMONITOR_HK_INFO sPCMONITOR_HK_Info, SCALER_WIN eWindow);
362 INTERFACE MS_U8 MDrv_XC_PCMonitor_GetStableCounter(void *pInstance, SCALER_WIN eWindow);
363 INTERFACE MS_U8 MDrv_XC_PCMonitor_GetNoSyncCounter(void *pInstance, SCALER_WIN eWindow);
364 INTERFACE MS_U16 MDrv_XC_PCMonitor_Get_VFreqx10(void *pInstance, SCALER_WIN eWindow);
365 INTERFACE MS_U16 MDrv_XC_PCMonitor_Get_HFreqx10(void *pInstance, SCALER_WIN eWindow);
366 INTERFACE MS_U32 MDrv_XC_PCMonitor_Get_HFreqx1K(void *pInstance, SCALER_WIN eWindow);
367 INTERFACE MS_U32 MDrv_XC_PCMonitor_Get_VFreqx1K(void *pInstance, SCALER_WIN eWindow);
368 INTERFACE MS_U16 MDrv_XC_PCMonitor_Get_Vtotal(void *pInstance, SCALER_WIN eWindow);
369 INTERFACE void MDrv_XC_PCMonitor_Restart(void *pInstance, SCALER_WIN eWindow);
370 INTERFACE void MDrv_XC_PCMonitor_Get_Dvi_Hdmi_De_Info(void *pInstance, SCALER_WIN eWindow,MS_WINDOW_TYPE* msWin);
371 INTERFACE MS_BOOL MDrv_XC_PCMonitor_SyncLoss(void *pInstance, SCALER_WIN eWindow);
372 INTERFACE MS_BOOL MDrv_XC_PCMonitor_InvalidTimingDetect(void *pInstance, MS_BOOL bPollingOnly, SCALER_WIN eWindow);
373 INTERFACE MS_U32 MDrv_SC_ip_get_verticalperiod(void *pInstance, SCALER_WIN eWindow);
374 //INTERFACE EN_FORCEi_SUPPORT_TYPE MDrv_XC_GetForceiSupportType(void *pInstance); //re-declaration
375 INTERFACE void MDrv_XC_SetHVSyncStatusCheck(void *pInstance, MS_BOOL bEnable, SCALER_WIN eWindow);
376 INTERFACE void MDrv_XC_SetNewModeInterlacedDetect(void *pInstance, MS_BOOL bEnable, MS_U8 u8Source, MS_BOOL bVttByPixelClk, MS_BOOL bVInvert, MS_BOOL bHInvert, SCALER_WIN eWindow);
377 INTERFACE MS_BOOL MDrv_XC_IsPNLYUVOutput(void *pInstance);
378 INTERFACE MS_BOOL MDrv_XC_Is2K2KToFrc(void *pInstance);
379 INTERFACE MS_U32 MDrv_XC_PCMonitor_Get_FrameRatex1K(void* pInstance, SCALER_WIN eWindow);
380 INTERFACE MS_BOOL MDrv_XC_OPTEE_Mux(void *pInstance,EN_XC_OPTEE_ACTION action,XC_OPTEE_MUX_DATA xc_mux_data);
381 INTERFACE MS_BOOL MDrv_XC_OPTEE_Control(void *pInstance,EN_XC_OPTEE_ACTION action,XC_OPTEE_HANDLER* xc_handler);
382 INTERFACE MS_BOOL MDrv_XC_OPTEE_Update(void *pInstance,EN_XC_OPTEE_ACTION action,XC_OPTEE_HANDLER xc_handler);
383 
384 #undef INTERFACE
385 #endif /* _MDRV_SC_IP_H_ */
386