xref: /utopia/UTPA2-700.0.x/modules/graphic/drv/gop/drvGOP.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   drvGOP.h
98 /// @brief  Graphics Output Path Driver Interface
99 /// @author MStar Semiconductor Inc.
100 ///////////////////////////////////////////////////////////////////////////////////////////////////
101 
102 #ifndef _DRV_GOP_H_
103 #define _DRV_GOP_H_
104 
105 #ifdef __cplusplus
106 extern "C"
107 {
108 #endif
109 #if defined(MSOS_TYPE_LINUX_KERNEL)
110 #include "autoconf.h"
111 #endif
112 #include "MsCommon.h"
113 
114 #if defined(MSOS_TYPE_LINUX)
115 #include <sys/types.h>
116 #include <unistd.h>
117 #elif defined(MSOS_TYPE_LINUX_KERNEL)
118 #define getpid() pInstance
119 #else
120 #define getpid() 0UL
121 #endif
122 
123 #include "apiGOP.h"
124 
125 #define GETPIDTYPE ptrdiff_t
126 
127 #if (defined ANDROID) && (defined TV_OS)
128 #include <cutils/log.h>
129 #define printf LOGD
130 #ifndef LOGD // android 4.1 rename LOGx to ALOGx
131 #define LOGD ALOGD
132 #endif
133 #endif
134 
135 #ifdef  MSOS_TYPE_LINUX
136 #include <assert.h>
137 #include <unistd.h>
138 #define APIGOP_ASSERT(_bool, pri)  if (!(_bool)) {printf("\nAssert in %s,%d\n", __FUNCTION__, __LINE__); {pri;}; MsOS_DelayTask(100); assert(0);}
139 #else
140 #define APIGOP_ASSERT(_bool, pri)  if (!(_bool)) {printf("\nAssert in %s,%d\n", __FUNCTION__, __LINE__); {pri;};};
141 #endif
142 
143 #if defined(CONFIG_API_GOP) || defined(CONFIG_API_GOP_MODULE)
144 #else
145 #define CONFIG_GOP_POOL_ARRANGE
146 #define CONFIG_GOP_GWIN_MISC
147 #define CONFIG_GOP_2ND_PAL
148 #define CONFIG_GOP_BG
149 #define CONFIG_GOP_FADE
150 #define CONFIG_GOP_YUV_SWAP
151 #define CONFIG_GOP_CONTRAST
152 #define CONFIG_GOP_GOP_VE_CAPTURE
153 #define CONFIG_GOP_SCROLL
154 #define CONFIG_GOP_TEST_PATTERN
155 #define CONFIG_GOP_VE_CAPTURE
156 #endif
157 //-------------------------------------------------------------------------------------------------
158 //  Driver Capability
159 //-------------------------------------------------------------------------------------------------
160 
161 //-------------------------------------------------------------------------------------------------
162 //  Customize Define
163 //-------------------------------------------------------------------------------------------------
164 #define CUS_SETTING               0UL
165 #define INSTANT_PRIVATE           1UL
166 #if CUS_SETTING
167 #define WINFB_INSHARED            1UL
168 #define POOL_INSHARED             1UL
169 #define CURSOR_SUPPORT            1UL
170 #define MUTEX_LOCK_ENABLE         0UL
171 #define ENABLE_GOP0_RBLK_MIRROR   FALSE
172 #ifndef DRV_MAX_GWIN_FB_SUPPORT
173 #define DRV_MAX_GWIN_FB_SUPPORT   0xFFFEUL
174 #endif
175 #define GFLIP_ENABLE              FALSE
176 #define BOOTLOGO_PATCH            TRUE
177 #define GOP_PIXEL_ALIGN           FALSE
178 #define GOP_SW_SCROLL             TRUE
179 #define GOP_3D_TYPE_SEL           E_DRV_3D_DUP_FULL
180 #define GOP_VSYNC_WAIT_BYSLEEP    FALSE
181 
182 #else  //mstar default
183 #define WINFB_INSHARED            1UL
184 #define POOL_INSHARED             0UL
185 #define CURSOR_SUPPORT            0UL
186 #define MUTEX_LOCK_ENABLE         0UL
187 #define ENABLE_GOP0_RBLK_MIRROR   TRUE
188 #ifndef DRV_MAX_GWIN_FB_SUPPORT
189 #define DRV_MAX_GWIN_FB_SUPPORT   32UL
190 #endif
191 
192 #ifdef CONFIG_GOP_DISABLE_GFLIP
193 #define GFLIP_ENABLE              FALSE
194 #else
195 #define GFLIP_ENABLE              TRUE
196 #endif
197 #define BOOTLOGO_PATCH            FALSE
198 #define GOP_PIXEL_ALIGN           FALSE
199 #define GOP_SW_SCROLL             FALSE
200 #define GOP_3D_TYPE_SEL           E_DRV_3D_DUP_HALF
201 #define GOP_VSYNC_WAIT_BYSLEEP    TRUE
202 #endif
203 
204 
205 #ifdef  MSOS_TYPE_NOS
206 #define GOP_LOCK_SUPPORT                0UL
207 #define GOP_XC_LOCK_SUPPORT             0UL
208 #define GOP_XC_SEMPHORE_PROTECT         0UL
209 #else
210 #define GOP_LOCK_SUPPORT                MUTEX_LOCK_ENABLE
211 #define GOP_XC_LOCK_SUPPORT             MUTEX_LOCK_ENABLE
212 #ifdef UTOPIA_V2  //XC
213 #define GOP_XC_SEMPHORE_PROTECT         1UL
214 #else
215 #define GOP_XC_SEMPHORE_PROTECT         0UL
216 #endif
217 
218 #endif
219 #define GOP_XC_LOCK_DEBUG               0UL
220 
221 #ifdef GOP_UTOPIA2K
222     #define GOPDRIVER_BASE              KERNEL_MODE
223 #else
224     #define GOPDRIVER_BASE              0UL
225 #endif
226 //-------------------------------------------------------------------------------------------------
227 //  Macro and Define
228 //-------------------------------------------------------------------------------------------------
229 #define UNUSED( var )                   (void)((var) = (var))
230 
231 #define MAX_GOP_INFO_COUNT      6
232 #define INVAILD_GOP_NUM                 0xFFUL
233 #define INVALID_GWIN_ID                 0xFFUL
234 #define GWIN_OSD_DEFAULT                (MS_U8)g_pGOPCtxLocal->pGopChipProperty->TotalGwinNum
235 #define INVALID_POOL_NEXT_FBID          0xFFFFFFFFUL
236 #define FB_FMT_AS_DEFAULT               0xFFFFUL
237 #define INVALID_CLIENT_PID              0x00UL //Invalid PID
238 #define INVALID_GOP_MUX_VAL             0xFFFFUL
239 
240 #define MIU_0                           0UL
241 #define MIU_1                           1UL
242 
243 #define GOP_STRETCH_WIDTH_UNIT          2UL    // 2-pixel
244 
245 #define GOP_STRETCH_TABLE_NUM           50UL
246 #define GOP_VSTRETCH_TABLE_NUM          32UL
247 #define GOP_REG_MAX                     128UL
248 
249 
250 #define SHARED_GWIN_MAX_COUNT           32UL
251 #define SHARED_GOP_MAX_COUNT            8UL
252 #define MAX_GOP_SW_SCROLLNUM            16UL
253 #define MAX_MUX_NUMBER_SUPPORT          MAX_GOP_MUX
254 
255 #define HAS_BIT(flag, bit)              ((flag) &  (1<<bit))
256 #define SET_BIT(flag, bit)              ((flag) |= (1<<bit))
257 #define RESET_BIT(flag, bit)            ((flag) &= (~(1<<bit)))
258 
259 #define GOP_MIU_CLIENT_OC9              0x9UL
260 #define INVALID_BPP                     0xFFFFUL
261 
262 #define SCALING_MULITPLIER              0x1000UL
263 
264 #define GOP_FMT_RGB555_BLINK       0x0UL
265 #define GOP_FMT_RGB565             0x1UL
266 #define GOP_FMT_ARGB4444           0x2UL
267 #define GOP_FMT_FaBaFgBg2266       0x3UL
268 #define GOP_FMT_I8                 0x4UL
269 #define GOP_FMT_ARGB8888           0x5UL
270 #define GOP_FMT_ARGB1555           0x6UL
271 #define GOP_FMT_ABGR8888           0x7UL
272 #define GOP_FMT_ARGB1555_DST       0x8UL
273 #define GOP_FMT_YUV422             0x9UL
274 #define GOP_FMT_RGBA5551           10UL
275 #define GOP_FMT_RGBA4444           11UL
276 #define GOP_FMT_RGBA8888           12UL
277 #define GOP_FMT_BGR565             17UL
278 #define GOP_FMT_ABGR4444           18UL
279 #define GOP_FMT_ABGR1555           22UL
280 #define GOP_FMT_BGRA5551           26UL
281 #define GOP_FMT_BGRA4444           27UL
282 #define GOP_FMT_BGRA8888           28UL
283 #define GOP_FMT_GENERIC            0xFFFFUL
284 
285 #ifndef PAGE_SIZE
286 #define PAGE_SIZE                  4096UL
287 #endif
288 #define PER_BYTE_BITS              8UL
289 #define TLB_PER_ENTRY_SIZE         4UL
290 #define PER_MIU_TLB_ENTRY_COUNT    8UL
291 #define ADDRESSING_8BYTE_UNIT      8UL
292 
293 ///GOP_PALETTE_ENTRY_NUM
294 #define GOP_PALETTE_ENTRY_NUM_MAX   256UL
295 
296 //-------------------------------------------------------------------------------------------------
297 //  Type and Structure
298 //-------------------------------------------------------------------------------------------------
299 /// Define GOP driver/hal layer return code, this enum should sync with E_GOP_API_Result
300 typedef enum
301 {
302     GOP_FAIL                        = 0,
303     GOP_SUCCESS                     = 1,
304     GOP_NON_ALIGN_ADDRESS           ,
305     GOP_NON_ALIGN_PITCH             ,
306     GOP_DEPEND_NOAVAIL              ,
307     GOP_MUTEX_OBTAIN_FAIL           ,
308     GOP_MUTEX_OBTAINED              ,
309 
310     GOP_INVALID_BUFF_INFO          ,
311     GOP_INVALID_PARAMETERS,
312     GOP_FUN_NOT_SUPPORTED,
313     GOP_ENUM_NOT_SUPPORTED,
314     GOP_CRT_GWIN_FAIL               = 0xFE,
315     GOP_CRT_GWIN_NOAVAIL            = 0xFF,
316 } GOP_Result;
317 
318 
319 /// Define GWIN color format.
320 typedef enum
321 {
322     /// Color format RGB555 and Blink.
323     E_DRV_GOP_COLOR_RGB555_BLINK    =E_MS_FMT_1ABFgBg12355,
324     /// Color format RGB565.
325     E_DRV_GOP_COLOR_RGB565          =E_MS_FMT_RGB565,
326     /// Color format ARGB4444.
327     E_DRV_GOP_COLOR_ARGB4444        =E_MS_FMT_ARGB4444,
328     /// Color format alpha blink.
329     E_DRV_GOP_COLOR_2266            =E_MS_FMT_FaBaFgBg2266,
330     /// Color format I8 (256-entry palette).
331     E_DRV_GOP_COLOR_I8              =E_MS_FMT_I8,
332     /// Color format ARGB8888.
333     E_DRV_GOP_COLOR_ARGB8888        =E_MS_FMT_ARGB8888,
334     /// Color format ARGB1555.
335     E_DRV_GOP_COLOR_ARGB1555        =E_MS_FMT_ARGB1555,
336     /// Color format ARGB8888.  - Andriod format
337     E_DRV_GOP_COLOR_ABGR8888        =E_MS_FMT_ABGR8888,
338     /// Color format RGB555/YUV422.
339     E_DRV_GOP_COLOR_RGB555YUV422    =E_MS_FMT_ARGB1555_DST,
340     /// Color format YUV422.
341     E_DRV_GOP_COLOR_YUV422          =E_MS_FMT_YUV422,
342     /// Color format RGBA5551.  - Andriod format
343     E_DRV_GOP_COLOR_RGBA5551        =E_MS_FMT_RGBA5551,
344     /// Color format RGBA4444.  - Andriod format
345     E_DRV_GOP_COLOR_RGBA4444        =E_MS_FMT_RGBA4444,
346     /// Color format RGBA8888.    - Andriod Format
347     E_DRV_GOP_COLOR_RGBA8888        =E_MS_FMT_RGBA8888,
348     /// Color format BGR565.    - Andriod Format
349     E_DRV_GOP_COLOR_BGR565          =E_MS_FMT_BGR565,
350     /// Color format ABGR4444.    - Andriod Format
351     E_DRV_GOP_COLOR_ABGR4444        =E_MS_FMT_ABGR4444,
352     /// Color format AYUV8888.    - Andriod Format
353     E_DRV_GOP_COLOR_AYUV8888        =E_MS_FMT_AYUV8888,
354     /// Color format ABGR1555.    - Andriod Format
355     E_DRV_GOP_COLOR_ABGR1555        =E_MS_FMT_ABGR1555,
356     /// Color format BGRA5551.    - Andriod Format
357     E_DRV_GOP_COLOR_BGRA5551        =E_MS_FMT_BGRA5551,
358     /// Color format BGRA4444.    - Andriod Format
359     E_DRV_GOP_COLOR_BGRA4444        =E_MS_FMT_BGRA4444,
360     /// Color format BGRA8888.    - Andriod Format
361     E_DRV_GOP_COLOR_BGRA8888        =E_MS_FMT_BGRA8888,
362 
363     /// Invalid color format.
364     E_DRV_GOP_COLOR_INVALID         =E_MS_FMT_GENERIC
365 } DRV_GOPColorType;
366 
367 typedef enum
368 {
369     DRV_VALID_6BITS             =   0,
370     DRV_VALID_8BITS             =   1,
371     DRV_NONE_SETTING            =   2,
372 } DRV_GOP_CONSALPHA_BITS;
373 
374 typedef enum
375 {
376     E_DRV_3D_NONE               =   0, ///3D type: Not support
377     E_DRV_3D_DUP_HALF           =   1, ///3D type: Support, but SW need expand GWIN and StretchWin
378     E_DRV_3D_DUP_FULL           =   2, ///3D type: Support, and HW automatically expand GWIN and StretchWin
379 } EN_DRV_GOP_3D_TYPE;
380 
381 /// Define Mux
382 typedef enum
383 {
384     ///Select gop output to mux0
385     E_GOP_MUX0 = 0,
386     /// Select gop output to mux1
387     E_GOP_MUX1 = 1,
388     /// Select gop output to mux2
389     E_GOP_MUX2 = 2,
390     /// Select gop output to mux3
391     E_GOP_MUX3 = 3,
392     /// Select gop output to mux4
393     E_GOP_MUX4 = 4,
394     ///Select gop output to IP0
395     E_GOP_IP0_MUX,
396     /// Select gop output to IP1
397     E_GOP_IP1_MUX,
398     /// Select gop output to vop0
399     E_GOP_VOP0_MUX,
400     /// Select gop output to vop1
401     E_GOP_VOP1_MUX,
402     /// Select gop output to FRC mux0
403     E_GOP_FRC_MUX0,
404     /// Select gop output to FRC mux1
405     E_GOP_FRC_MUX1,
406     /// Select gop output to FRC mux2
407     E_GOP_FRC_MUX2,
408     /// Select gop output to FRC mux3
409     E_GOP_FRC_MUX3,
410     /// Select gop output to BYPASS mux
411     E_GOP_BYPASS_MUX0,
412     /// Select gop output to IP0_SUB
413     E_GOP_IP0_SUB_MUX,
414     /// Select gop output to VOP0_SUB
415     E_GOP_VOP0_SUB_MUX,
416     /// Select gop output to OP1
417     E_GOP_OP1_MUX,
418     /// Select gop output to DIP
419     E_GOP_DIP_MUX,
420     /// Select gop output to DIP
421     E_GOP_GS_MUX,
422     /// Select gop output to Mix layer0
423     E_GOP_Mix_MUX0,
424     /// Select gop output to Mix layer1
425     E_GOP_Mix_MUX1,
426     /// Select gop output to VE0
427     E_GOP_VE0_MUX,
428     /// Select gop output to VE1
429     E_GOP_VE1_MUX,
430 
431     ///Select gop output to dual rate op mux0
432     E_GOP_DUALRATE_OP_MUX0,
433     ///Select gop output to dual rate op mux1
434     E_GOP_DUALRATE_OP_MUX1,
435     ///Select gop output to dual rate op mux2
436     E_GOP_DUALRATE_OP_MUX2,
437 
438     MAX_GOP_MUX_SUPPORT,
439     E_GOP_MUX_INVAILD,
440 } Gop_MuxSel;
441 
442 /// Define GOP destination displayplane type
443 typedef enum
444 {
445     E_DRV_GOP_DST_IP0       =   0,
446     E_DRV_GOP_DST_IP0_SUB   =   1,
447     E_DRV_GOP_DST_MIXER2VE  =   2,
448     E_DRV_GOP_DST_OP0       =   3,
449     E_DRV_GOP_DST_VOP       =   4,
450     E_DRV_GOP_DST_IP1       =   5,
451     E_DRV_GOP_DST_IP1_SUB   =   6,
452     E_DRV_GOP_DST_MIXER2OP  =   7,
453     E_DRV_GOP_DST_VOP_SUB   =   8,
454     E_DRV_GOP_DST_FRC       =   9,
455     E_DRV_GOP_DST_VE        =   10,
456     E_DRV_GOP_DST_BYPASS    =   11,
457     E_DRV_GOP_DST_OP1       =   12,
458     E_DRV_GOP_DST_MIXER2OP1 =  13,
459     E_DRV_GOP_DST_DIP       =   14,
460     E_DRV_GOP_DST_GOPScaling  = 15,
461     E_DRV_GOP_DST_OP_DUAL_RATE   = 16,
462     MAX_DRV_GOP_DST_SUPPORT ,
463     E_DRV_GOP_DST_INVALID  ,
464 } DRV_GOPDstType;
465 
466 /// Define GOP chip property for different chip characteristic.
467 typedef struct __attribute__((packed))
468 {
469     MS_BOOL bSetHSyncInverse;
470     MS_BOOL bGop1GPalette;
471     MS_BOOL bSetHPipeOfst;
472     MS_BOOL bNeedCheckMVOP;
473     MS_BOOL bNeedSetMUX1ToIP0;
474     MS_BOOL bNeedSetMUX3ToIP0;
475     MS_BOOL bNewMux;
476     MS_BOOL bNewPalette;
477     MS_BOOL bNewBwReg;
478     MS_BOOL bGop2VStretch;
479     MS_BOOL bIgnoreIPHPD;
480     MS_BOOL bIgnoreIP1HPD;
481     MS_BOOL bIgnoreVEHPD;
482     MS_BOOL bhastilemode;
483     MS_BOOL bInitNotEnableGOPToSC;
484     MS_BOOL bXCDirrectBankSupport;
485     MS_BOOL bTstPatternAlpha;
486     MS_BOOL bFRCSupport;
487     MS_BOOL bGOPMixerToVE;
488     MS_BOOL bBnkForceWrite;
489     MS_BOOL bPixelModeSupport;
490     MS_BOOL bDWINSupport;
491     MS_BOOL bScalingDownSupport;
492     MS_BOOL b2Pto1PSupport;
493     MS_BOOL bTLBSupport[6];
494     MS_BOOL bInternalMIUSelect[8];
495     MS_BOOL bAFBC_Support[6];
496 
497     MS_BOOL bAutoAdjustMirrorHSize;
498     MS_BOOL bGOPWithVscale[6];
499     MS_BOOL bGOPWithScaleDown[6];
500 
501     MS_U16  GOP_TestPattern_Vaild;
502     MS_U16 DwinVer;
503     MS_S16 GOP_PD;
504     MS_U16 GOP_IP_PD;
505     MS_U16 GOP_MVOP_PD;
506     MS_U16 GOP_VE_PD;
507     MS_U16 GOP_OP1_PD;
508     MS_U16 GOP_MIXER_PD;
509     MS_U16 GOP_NonVS_PD_Offset;
510     MS_U16 GOP_NonVS_DualOpPD_Offset;
511     MS_U16 GOP_VE_V_Offset;
512     MS_U16 GOP_HDR_OP_PD;
513     MS_U16 GOP_DUAL_OP_PD;
514 
515     MS_U16 GOP_MUX_Delta;
516     MS_U16 GOP_Mux_Offset[6];
517     MS_U16 GOP_Zorder_Mux_Offset[6];
518     Gop_MuxSel GOP_MapLayer2Mux[6];
519     Gop_MuxSel GOP_MapLayer2DualOpMux[6];
520     MS_U16 GOP_Mux_FRC_offset;
521     MS_U16 GOP_DualRateMux_Offset[6];
522     MS_U16 GOP_REF_POSITION_X;
523 
524     MS_U16 WordUnit;
525     MS_U16 TotalGwinNum;
526     DRV_GOP_CONSALPHA_BITS Default_ConsAlpha_bits;
527     EN_DRV_GOP_3D_TYPE enGOP3DType;
528     MS_BOOL bOpInterlace;
529 
530     MS_BOOL bAFBCMIUSelDoubleBuffer;
531     MS_BOOL bAFBC_Merge_GOP_Trig;
532     MS_BOOL bGOPVscalePipeDelay[6];
533     MS_BOOL bGOPNeedSplitMode4DualRate[6];
534     MS_BOOL bOPHandShakeModeSupport;
535     MS_BOOL bOPMuxDoubleBuffer;
536     MS_BOOL bGOPAutoClkGating;
537 }GOP_CHIP_PROPERTY;
538 
539 /// GOP0 gwin priority
540 typedef struct DLL_PACKED
541 {
542     MS_U8 u81stGwin;
543     MS_U8 u82stGwin;
544     MS_U8 u83stGwin;
545     MS_U8 u84stGwin;
546 }GOP0_GwinPri;
547 
548 // GOP0/GOP1 gwin priority
549 typedef struct DLL_PACKED
550 {
551     GOP0_GwinPri Gop0_GwinPri;
552     MS_U8 Gop1_1stGwin  :1;
553 }GOP_GwinPriority;
554 
555 /// GWIN Information
556 typedef struct DLL_PACKED
557 {
558     MS_U16 u16DispVPixelStart;      //!< unit: pix
559     MS_U16 u16DispVPixelEnd;        //!< unit: pix
560     MS_U16 u16DispHPixelStart;      //!< unit: pix
561     MS_U16 u16DispHPixelEnd;        //!< unit: pix
562     MS_PHY u64DRAMRBlkStart;        //!< unit: Byte
563     MS_U16 u16RBlkHPixSize;     //!< unit: pix
564     MS_U16 u16RBlkVPixSize;     //!< unit: pix
565     MS_U16 u16RBlkHRblkSize;       //!< unit: Byte
566     MS_U16 u16WinX;             //!< unit: pix
567     MS_U16 u16WinY;             //!< unit: pix
568     MS_U32 u32scrX;             //!< unit: pix
569     MS_U32 u32scrY;             //!< unit: pix
570     DRV_GOPColorType clrType;       //!< color format of the buffer
571 } DRV_GOP_GWIN_INFO;
572 
573 /// Dump Window Information
574 typedef struct DLL_PACKED
575 {
576     MS_U16 u16VPixelStart;      //!< unit: pix
577     MS_U16 u16VPixelEnd;        //!< unit: pix
578     MS_U16 u16HPixelStart;      //!< unit: pix
579     MS_U16 u16HPixelEnd;        //!< unit: pix
580     MS_PHY u64TFDRAMAddr;       //!< unit: Byte
581     MS_PHY u64BFDRAMAddr;       //!< unit: Byte
582     MS_U16 u16DRAMJumpLen;      //!< unit: Byte
583     MS_U8 u8fmt;                //!< DWIN format: 0 UV7Y8, 1 UV8Y8, 2 ARGB8888, 3 RGB565
584 } DRV_GOP_DWIN_INFO;
585 
586 /// DWIN propert
587 typedef struct DLL_PACKED
588 {
589     MS_U16 u16x;           ///< x
590     MS_U16 u16y;           ///< y
591     MS_U16 u16w;           ///< width
592     MS_U16 u16h;           ///< height
593     MS_PHY u64fbaddr0;     ///< Top field DRAM address
594     MS_PHY u64fbaddr1;     ///< Bottom field DRAM address
595     MS_U16 u16fbw;         ///< Number of bytes per horizontal line
596 } DRV_GOP_DwinProperty;
597 
598 typedef union DLL_PACKED
599 {
600     MS_U8 u8DWinIntInfo;
601     struct DLL_PACKED
602     {
603         MS_U8 bDWinIntWADR:1;
604         MS_U8 bDWinIntPROG:1;
605         MS_U8 bDWinIntTF:1;
606         MS_U8 bDWinIntBF:1;
607         MS_U8 bDWinIntVS:1;
608         MS_U8 reserved:3;
609     }sDwinIntInfo;
610 } DRV_GOP_DWinIntInfo;
611 
612 /// Frame buffer attributes for GWIN
613 typedef struct DLL_PACKED
614 {
615     MS_U8 gWinId;          ///< id
616     MS_U8 enable:1;        ///< 4bits enable
617     MS_U8 allocated:1;    ///< 4bits
618 
619     MS_U16 x0;                 ///< MS_U16
620     MS_U16 y0;                 ///< MS_U16
621     MS_U16 x1;                 ///< MS_U16
622     MS_U16 y1;                 ///< MS_U16
623     MS_U16 width;                 ///< MS_U16
624     MS_U16 height;                 ///< MS_U16
625     MS_U16 pitch;                    ///< MS_U16
626     MS_U16 fbFmt;                 ///< MS_U16
627 
628     MS_U32 addr;                     ///< MS_U32
629     MS_U32 size;                     ///< MS_U32
630 
631     MS_U8 next;                 ///< MS_U8
632     MS_U8 prev;                  ///< MS_U8
633     MS_U8 string;               //store which AP use this FB
634     //MS_U8 flag;                ///< bit 0:scroll
635     MS_U16 s_x;                ///< MS_U16
636     MS_U16 s_y;                ///< MS_U16
637     MS_U16 dispWidth;          ///< MS_U16
638     MS_U16 dispHeight;         ///< MS_U16
639 } DRV_Gwin_FB_Attr;
640 
641 /// OC Info
642 typedef struct DLL_PACKED
643 {
644     MS_PHY u64GOP_OC_DRAM_RBLK;         ///Bytes
645     MS_PHY u64GOP_OC_ADDRPROTECT_STR;   ///Bytes
646     MS_PHY u64GOP_OC_ADDRPROTECT_END;   ///Bytes
647     MS_U32 u32GOP_OC_FETCH;
648     MS_U16 u16GOP_OC_HSIZE;
649     MS_U16 u16GOP_OC_VSIZE;
650     MS_BOOL bGOP_OC_MIUID;
651     MS_U8 u8GOP_OC_BANK_MODE;
652 } DRV_GOP_OC_INFO;
653 
654 /// GWIN output color domain
655 typedef enum
656 {
657     DRV_GOPOUT_RGB,     ///< 0: output color RGB
658     DRV_GOPOUT_YUV,     ///< 1: output color YUV
659 } GOP_OupputColor;
660 
661 /// Transparent color format
662 typedef enum
663 {
664     DRV_GOPTRANSCLR_FMT0,   //!< RGB mode transparent color
665     DRV_GOPTRANSCLR_FMT1,   //!< index mode transparent color
666     DRV_GOPTRANSCLR_FMT2,   //!< ARGB 8888 transparent color
667     DRV_GOPTRANSCLR_FMT3,   //!< YUV mode transparent color
668 } GOP_TransClrFmt;
669 
670 /// Define Scaler GOP IP setting.
671 typedef enum
672 {
673     MS_DRV_IP0_SEL_GOP0,
674     MS_DRV_IP0_SEL_GOP1,
675     MS_DRV_IP0_SEL_GOP2,
676     MS_DRV_NIP_SEL_GOP0,
677     MS_DRV_NIP_SEL_GOP1,
678     MS_DRV_NIP_SEL_GOP2,
679     MS_DRV_MVOP_SEL,
680     MS_DRV_SUBMVOP_SEL,
681     MS_DRV_IP1_SEL,
682     MS_DRV_SUBIP0_SEL,
683     MS_DRV_SC1OP_SEL,
684     MS_DRV_DIP_SEL,
685 }MS_IPSEL_GOP;
686 
687 typedef enum
688 {
689     E_DRV_MIXER_DST_IP       =   0,
690     E_DRV_MIXER_DST_MIXER    =   1,
691     E_DRV_MIXER_DST_OP       =   2,
692     E_DRV_MIXER_DST_VE       =   3,
693     E_DRV_MIXER_DST_OP1      =   4,
694     MAX_DRV_MIXER_DST_SUPPORT      ,
695     E_DRV_MIXER_DST_INVALID   =   0xFF,
696 } DRV_MixerDstType;
697 
698 /// Define GOP H-Stretch mode.
699 typedef enum
700 {
701     E_DRV_GOP_HSTRCH_6TAPE = 0,
702     E_DRV_GOP_HSTRCH_DUPLICATE = 1,
703     E_DRV_GOP_HSTRCH_6TAPE_LINEAR  = 2,
704     E_DRV_GOP_HSTRCH_6TAPE_NEAREST = 3,
705     E_DRV_GOP_HSTRCH_6TAPE_GAIN0   = 4,
706     E_DRV_GOP_HSTRCH_6TAPE_GAIN1   = 5,
707     E_DRV_GOP_HSTRCH_6TAPE_GAIN2   = 6,
708     E_DRV_GOP_HSTRCH_6TAPE_GAIN3   = 7,
709     E_DRV_GOP_HSTRCH_6TAPE_GAIN4   = 8,
710     E_DRV_GOP_HSTRCH_6TAPE_GAIN5   = 9,
711     E_DRV_GOP_HSTRCH_4TAPE         = 0xA,
712     E_DRV_GOP_HSTRCH_2TAPE         = 0xB,
713     MAX_GOP_HSTRETCH_MODE_SUPPORT,
714 } DRV_GOPStrchHMode;
715 
716 /// Define GOP V-Stretch mode.
717 typedef enum
718 {
719     E_DRV_GOP_VSTRCH_LINEAR = 0,
720     E_DRV_GOP_VSTRCH_DUPLICATE = 1,
721     E_DRV_GOP_VSTRCH_NEAREST = 2,
722     E_DRV_GOP_VSTRCH_LINEAR_GAIN0 = 3,
723     E_DRV_GOP_VSTRCH_LINEAR_GAIN1 = 4,
724     E_DRV_GOP_VSTRCH_LINEAR_GAIN2 = 5,
725     E_DRV_GOP_VSTRCH_4TAP = 6,
726     MAX_GOP_VSTRETCH_MODE_SUPPORT,
727 } DRV_GOPStrchVMode;
728 
729 /// Define GOP Transparent color Stretch mode.
730 typedef enum
731 {
732     E_DRV_GOP_TRANSPCOLOR_STRCH_DUPLICATE = 0,
733     E_DRV_GOP_TRANSPCOLOR_STRCH_ASNORMAL = 1,
734     MAX_GOP_TRANSPCOLOR_STRETCH_MODE_SUPPORT,
735 } DRV_GOPSTRCH_TRANSPCOLORMODE;
736 
737 /// Define palette read type.
738 typedef enum
739 {
740     /// Palette access from GOP0 RIU
741     E_DRV_GOP_PAL_GOP_RIU    = 0,
742     /// Palette access from GOP0 REGDMA
743     E_DRV_GOP_PAL_GOP_REGDMA  = 1,
744     /// Palette access from GOP1 RIU
745     E_DRV_GOP1_PAL_GOP_RIU    = 2,
746     /// Palette access from GOP1 REGDMA
747     E_DRV_GOP1_PAL_GOP_REGDMA  = 3,
748 } DRV_GopPalReadType;
749 
750 /// Scroll direction
751 typedef enum
752 {
753     GOP_DRV_SCROLL_NONE = 0,
754     GOP_DRV_SCROLL_UP,      // bottom to top
755     GOP_DRV_SCROLL_DOWN,    // top to bottom
756     GOP_DRV_SCROLL_LEFT,            //right to left
757     GOP_DRV_SCROLL_RIGHT,   //left to right
758     GOP_DRV_SCROLL_SW,          // Scroll by sw
759     GOP_DRV_SCROLL_KERNEL,      // Scroll by sw on kernel
760     GOP_DRV_SCROLL_MAX,
761 } E_GOP_SCROLL_TYPE;
762 
763 /// DWIN capture data source
764 typedef enum
765 {
766     GOPDWIN_DATA_SRC_SCALAR,    //!< scaler output
767     GOPDWIN_DATA_SRC_EXTRGB,        //!< External, RGB, YUV(pass R2Y)
768     GOPDWIN_DATA_SRC_VOP,       //!< DVB VOP (MVOP)
769     GOPDWIN_DATA_SRC_MAX
770 } EN_GOP_DWIN_DATA_SRC;
771 
772 /// DWIN scan mode
773 typedef enum
774 {
775     GOPDWIN_SCAN_MODE_PROGRESSIVE,  ///< Progressive scan
776     GOPDWIN_SCAN_MODE_INTERLACE,  ///< Interlace scan
777     GOPDWIN_SCAN_MODE_MAX
778 } EN_GOP_DWIN_SCAN_TYPE;
779 
780 /// DWIN source selection
781 typedef enum
782 {
783     /// DWIN OP source
784     GOP_DRV_DWIN_SRC_OP = 0,
785     /// DWIN MVOP source
786     GOP_DRV_DWIN_SRC_MVOP = 1,
787     /// DWIN IP source
788     GOP_DRV_DWIN_SRC_IP = 2,
789     /// DWIN OP1 source
790     GOP_DRV_DWIN_SRC_OP1 =3,
791     /// DWIN SUB MVOP source
792     GOP_DRV_DWIN_SRC_SUBMVOP =4,
793     /// DWIN GOPScaling source
794     GOP_DRV_DWIN_SRC_GOPScaling =5,
795     GOP_DRV_DWIN_SRC_MAX = 6
796 }DRV_GOP_DWIN_SRC_SEL;
797 
798 /// DWIN source data format
799 typedef enum
800 {
801     GOPDWIN_DATA_FMT_UV7Y8 = 0,     //!< CrYCb domain
802     GOPDWIN_DATA_FMT_UV8Y8,         //!< CrYCb domain
803     GOPDWIN_DATA_FMT_ARGB8888,      //!< RGB domain (CSC bypass)
804     GOPDWIN_DATA_FMT_RGB565,        //!< RGB domain (CSC bypass)
805     GOPDWIN_DATA_FMT_MAX
806 } DRV_GOP_DWIN_DATA_FMT;
807 
808 /// Define palette color format.
809 typedef enum
810 {
811     /// Palette color format is RGB888.
812     E_DRV_GOP_PAL_ARGB8888    = 0,
813     /// Invalid palette color format.
814     E_DRV_GOP_PAL_INVALID
815 } DRV_GopPalType;
816 
817 /// Define GOP gwin fade in/out.
818 typedef enum
819 {
820     /// GOP gwin fade in.
821     E_DRV_GOP_GWIN_FADE_IN,
822     /// GOP gwin fade out.
823     E_DRV_GOP_GWIN_FADE_OUT,
824     /// GOP gwin fade unknow type.
825     E_DRV_GOP_GWIN_FADE_UNKNOWN,
826 } DRV_GOP_FADE_TYPE;
827 
828 //----------------------------------------------------------------------------
829 // GOP Reg Page Form
830 //----------------------------------------------------------------------------
831 typedef enum
832 {
833     E_GOP_REG_FORM_4G   = 0x0000,
834     E_GOP_REG_FORM_T21G = 0x0001,
835     E_GOP_REG_FORM_2G   = 0x0002,
836     E_GOP_REG_FORM_T81G = 0x0003,
837     E_GOP_REG_FORM_U42G = 0x0004,
838     E_GOP_REG_FORM_NONE = 0x000F,
839     E_GOP_REG_FORM_MASK = 0x000F,
840 }   E_GOP_REG_FORM;
841 
842 typedef enum
843 {
844     E_GOPD_FIFO_DEPTH_64   = 0x0000,
845     E_GOPD_FIFO_DEPTH_128  = 0x0010,
846     E_GOPD_FIFO_DEPTH_256  = 0x0020,
847     E_GOPD_FIFO_DEPTH_MASK = 0x00F0,
848 }   E_GOPD_FIFO_DEPTH;
849 
850 // GOP palette type
851 typedef enum
852 {
853     E_GOP_PAL_SIZE_NONE = 0x0000,
854     E_GOP_PAL_SIZE_256  = 0x0100,
855     E_GOP_PAL_SIZE_64   = 0x0200,
856     E_GOP_PAL_SIZE_MASK = 0x0F00,
857 }   E_GOP_PAL_SIZE;
858 
859 /// GOP VE timing type
860 typedef enum
861 {
862     E_GOP_VE_NTSC ,
863     E_GOP_VE_PAL,
864     E_GOP_VE_TIMEING_MAX,
865 }E_GOP_VE_TIMINGTYPE;
866 
867 /// GOP MIXER timing type
868 typedef enum
869 {
870     E_GOP_NTSC ,
871     E_GOP_PAL,
872     E_GOP_CUSTOM,
873     E_GOP_CUSTOM_OP,
874     E_GOP_MIXER_TIMEING_MAX,
875 }E_GOP_MIXER_TIMINGTYPE;
876 
877 /// video timing mirror type
878 typedef enum
879 {
880     E_GOP_VIDEOTIMING_MIRROR_BYSCALER,
881     E_GOP_VIDEOTIMING_MIRROR_BYMVOP,
882     E_GOP_VIDEOTIMING_MIRROR_MAX,
883 }E_GOP_VIDEOTIMING_MIRRORTYPE;
884 
885 
886 /// Define GOP burst length.
887 typedef enum
888 {
889     /// burst length: long
890     E_GOP_BURSTLEN_LONG,
891     /// burst length: middle
892     E_GOP_BURSTLEN_MIDDLE,
893     /// burst length: short
894     E_GOP_BURSTLEN_SHORT,
895 } EN_GOP_BURST_LEN;
896 
897 /// Define GOP G3D DATA FORMAT.
898 typedef enum
899 {
900     /// E_GOP_TILE_DATA_16BPP. 16 BPP DATA FOR TILE MODE
901     E_DRV_GOP_TILE_DATA_16BPP    = 0,
902     /// E_GOP_TILE_DATA_16BPP. 32 BPP DATA FOR TILE MODE
903     E_DRV_GOP_TILE_DATA_32BPP    = 1,
904 } E_GOP_TILE_DATA_TYPE;
905 
906 /// Define GOP MIU SEL
907 typedef enum
908 {
909     /// E_DRV_GOP_SEL_MIU0. gop access miu 0
910     E_DRV_GOP_SEL_MIU0    = 0,
911     /// E_GOP_SEL_MIU1. gop access miu1
912     E_DRV_GOP_SEL_MIU1    = 1,
913     /// E_GOP_SEL_MIU2. gop access miu2
914     E_DRV_GOP_SEL_MIU2    = 2,
915     /// E_GOP_SEL_MIU3. gop access miu3
916     E_DRV_GOP_SEL_MIU3    = 3,
917 } E_DRV_GOP_SEL_TYPE;
918 
919 /// Define GOP PINPON Mode
920 typedef enum
921 {
922     /// E_DRV_GOP_PINPON_G3D. gop set g3d pinpon
923     E_DRV_GOP_PINPON_G3D    = 0,
924     /// E_DRV_GOP_PINPON_VE. gop set ve pinpon
925     E_DRV_GOP_PINPON_VE     = 1,
926     /// E_DRV_GOP_PINPON_DWIN. gop set dwin pinpon
927     E_DRV_GOP_PINPON_DWIN   = 2,
928     /// E_DRV_GOP_PINPON_DIP. gop set dwin pinpon
929     E_DRV_GOP_PINPON_DIP   = 3,
930     /// E_DRV_GOP_PINPON_DWIN0. gop set dwin pinpon
931     E_DRV_GOP_PINPON_DWIN0   = 4,
932     /// E_DRV_GOP_PINPON_DWIN1. gop set dwin pinpon
933     E_DRV_GOP_PINPON_DWIN1   = 5,
934 
935 } E_DRV_GOP_PINPON_MODE;
936 
937 
938 
939 /// Define the entry of palette.
940 typedef union DLL_PACKED
941 {
942     /// ARGB888
943     struct DLL_PACKED
944     {
945         MS_U8 u8A;
946         MS_U8 u8R;
947         MS_U8 u8G;
948         MS_U8 u8B;
949     } RGB;
950     /// 32-bit direct access.
951     MS_U8 u8Data[4];
952 } DRV_GopPaletteEntry;
953 
954 typedef enum
955 {
956    GOP_WINFB_POOL_NULL = 0,
957    GOP_WINFB_POOL1 = 1,
958    GOP_WINFB_POOL2= 2
959 }GOP_FBPOOL_ID;
960 
961 typedef enum
962 {
963     E_DRV_GOP_AFBC_SPILT            =0x1,
964     E_DRV_GOP_AFBC_YUV_TRANSFER	    =0x2,
965     E_DRV_GOP_AFBC_ARGB8888         =0x4,
966     E_DRV_GOP_AFBC_MAX,
967 }EN_DRV_GOP_AFBC_CNTL;
968 
969 /// Define GOP FB string.
970 typedef enum
971 {
972     E_DRV_GOP_FB_NULL,
973     /// OSD frame buffer.
974     E_DRV_GOP_FB_OSD,
975     /// Mute frame buffer.
976     E_DRV_GOP_FB_MUTE,
977     /// subtitle frame buffer.
978     E_DRV_GOP_FB_SUBTITLE,
979     /// teltext frame buffer.
980     E_DRV_GOP_FB_TELTEXT,
981     /// MHEG5 frame buffer.
982     E_DRV_GOP_FB_MHEG5,
983     /// CC frame buffer.
984     E_DRV_GOP_FB_CLOSEDCAPTION,
985     /// AFBC frame buffer.
986     E_DRV_GOP_FB_AFBC_SPLT_YUVTRNSFER_ARGB8888 = 0x100,
987     E_DRV_GOP_FB_AFBC_NONSPLT_YUVTRS_ARGB8888,
988     E_DRV_GOP_FB_AFBC_SPLT_NONYUVTRS_ARGB8888,
989     E_DRV_GOP_FB_AFBC_NONSPLT_NONYUVTRS_ARGB8888,
990 } EN_DRV_FRAMEBUFFER_STRING;
991 
992 /// Frame buffer attributes for GWIN
993 typedef struct __attribute__((packed))
994 {
995     MS_PHY addr;                     ///< MS_U64  /*For 32/64 share memory align*/
996     MS_U32 size;                     ///< MS_U32
997     MS_U32 nextFBIdInPool;           ///next winId in same pool
998 
999     MS_U16 x0;                 ///< MS_U16
1000     MS_U16 y0;                 ///< MS_U16
1001     MS_U16 x1;                 ///< MS_U16
1002     MS_U16 y1;                 ///< MS_U16
1003     MS_U16 width;                 ///< MS_U16
1004     MS_U16 height;                 ///< MS_U16
1005     MS_U16 pitch;                     ///< MS_U16
1006     MS_U16 fbFmt;                 ///< MS_U16
1007 
1008     MS_U16 s_x;                ///< MS_U16
1009     MS_U16 s_y;                ///< MS_U16
1010     MS_U16 dispWidth;          ///< MS_U16
1011     MS_U16 dispHeight;         ///< MS_U16
1012 
1013     GOP_FBPOOL_ID poolId;
1014 
1015     MS_U8 gWinId;
1016     MS_U8 string;               ///store which AP use this FB
1017     MS_U8 enable:1;
1018     MS_U8 in_use:1;
1019     MS_U32 u32GOPClientId;     ///<<store Client ID of using this FB
1020     MS_U8 obtain;
1021     EN_DRV_FRAMEBUFFER_STRING FBString;
1022 } GOP_WinFB_INFO;
1023 
1024 typedef struct __attribute__((packed))
1025 {
1026    MS_U32 PalSWArray[GOP_PALETTE_ENTRY_NUM_MAX];
1027 }GOP_Palette_INFO;
1028 
1029 typedef struct __attribute__((packed))
1030 {
1031    GOP_FBPOOL_ID poolId;
1032    MS_PHY GWinFB_Pool_BaseAddr;
1033    MS_U32 u32GWinFB_Pool_MemLen;
1034    MS_U32 u32FirstFBIdInPool;
1035 }GOP_FB_POOL;
1036 
1037 typedef struct __attribute__((packed))
1038 {
1039     MS_U32 u32GOPClientId;
1040     MS_U32 u32CurFBId;
1041     MS_U16 u16SharedCnt;
1042     MS_BOOL bIsShared;
1043 }GWIN_MAP;
1044 
1045 typedef struct DLL_PACKED
1046 {
1047     MS_PHY u64NonMirrorFBAdr;
1048     MS_U16 u16NonMirrorHStr;
1049     MS_U16 u16NonMirrorHEnd;
1050     MS_U16 u16NonMirrorVStr;
1051     MS_U16 u16NonMirrorVEnd;
1052     MS_U16 u16NonMirrorGOP0WinX;
1053     MS_U16 u16NonMirrorGOP0WinY;
1054 }GOP_GwinMirror_Info;
1055 
1056 ///the GOP MIXER timing info
1057 typedef struct DLL_PACKED
1058 {
1059     MS_U32 hstart;
1060     MS_U32 hend;
1061     MS_U32 vstart;
1062     MS_U32 vend;
1063     MS_U32 htotal;
1064     MS_U32 hsyncdelay;
1065 }GOP_DRV_MixerTiming;
1066 
1067 ///GOP Ignore init value
1068 typedef enum
1069 {
1070     E_DRV_GOP_MUX_IGNORE              =   0x0001,
1071     E_DRV_GOP_GWIN_IGNORE             =   0x0002,
1072     E_DRV_GOP_STRETCHWIN_IGNORE       =   0x0004,
1073     E_DRV_GOP_PALETTE_IGNORE          =   0x0008,
1074     E_DRV_GOP_SET_DST_OP_IGNORE       =   0x0010,
1075     E_DRV_GOP_ENABLE_TRANSCLR_IGNORE  =   0x0020,
1076     E_DRV_GOP_ALL_IGNORE              =   0xFFFF,
1077 } DRV_GOP_IGNOREINIT;
1078 
1079 ///the GOP config
1080 typedef struct DLL_PACKED
1081 {
1082   DRV_GOP_IGNOREINIT eGopIgnoreInit;
1083 }GOP_Config;
1084 
1085 typedef struct __attribute__((packed))
1086 {
1087         MS_U32 u32ClientIdAllocator;
1088         MS_U32 u32LstGOPClientId;
1089         MS_U16 u16PnlWidth[SHARED_GOP_MAX_COUNT];
1090         MS_U16 u16PnlHeight[SHARED_GOP_MAX_COUNT];
1091         MS_U16 u16PnlHStr[SHARED_GOP_MAX_COUNT];
1092         MS_BOOL bHMirror;
1093         MS_BOOL bVMirror;
1094         MS_BOOL b16TileMode[SHARED_GOP_MAX_COUNT];
1095         MS_BOOL b32TileMode[SHARED_GOP_MAX_COUNT];
1096         MS_U16  ScrollBufNum;
1097         MS_U16  ScrollBufIdx;
1098         MS_U32  ScrollBuffer[MAX_GOP_SW_SCROLLNUM];
1099 
1100         GWIN_MAP gwinMap[SHARED_GWIN_MAX_COUNT];
1101 
1102         GOP_FB_POOL fbPool1;
1103         GOP_FB_POOL fbPool2;
1104         GOP_FBPOOL_ID fb_currentPoolId;
1105 
1106         MS_S32 s32OutputColorType[SHARED_GOP_MAX_COUNT];
1107         MS_BOOL bGopHasInitialized[SHARED_GOP_MAX_COUNT];
1108         MS_BOOL bGWINEnable[SHARED_GWIN_MAX_COUNT];
1109 #if WINFB_INSHARED
1110         GOP_WinFB_INFO winFB[DRV_MAX_GWIN_FB_SUPPORT+1];
1111 #endif
1112         MS_U8 GOP_StereoMode[SHARED_GOP_MAX_COUNT];
1113         MS_U16 u16APIStretchWidth[SHARED_GOP_MAX_COUNT]; //Store API set stretch win width(May Not sync with HW register in GOP 3D SBS mode)
1114         MS_U16 u16APIStretchHeight[SHARED_GOP_MAX_COUNT];
1115         MS_U8 GOP_TestPatternMode;
1116         MS_BOOL bGOP3DLRSwitch[SHARED_GOP_MAX_COUNT]; //GOP 3D L/R Switch flag
1117         MS_U16 u16HScaleDst[SHARED_GOP_MAX_COUNT];
1118         MS_U16 u16VScaleDst[SHARED_GOP_MAX_COUNT];
1119         MS_BOOL bPixelMode[SHARED_GOP_MAX_COUNT];
1120         MS_BOOL bInitShared;
1121         MS_BOOL bDummyInit;//TRUE: the gop init's input parameter is NULL when SHM is firstly initialized
1122         MS_BOOL bEnableVsyncIntFlip;
1123         MS_S32 s32GOPLockTid;
1124         MS_U32  GOPLockPid;
1125         MS_BOOL bTLB[SHARED_GOP_MAX_COUNT];
1126         MS_PHY  u64TLBAddress[SHARED_GOP_MAX_COUNT];
1127         GOP_Palette_INFO GOPPaletteInfo[SHARED_GOP_MAX_COUNT];
1128 #ifdef CONFIG_MSTAR_SRAMPD
1129         MS_BOOL bGOPPowerDown[SHARED_GOP_MAX_COUNT];
1130 #endif
1131         MS_PHY phyGOPRegdmaAdr;
1132         MS_U32 u32GOPRegdmaLen;
1133 } MS_GOP_CTX_SHARED;
1134 
1135 typedef struct DLL_PACKED
1136 {
1137     MS_GOP_CTX_SHARED *pGOPCtxShared;//pointer to shared context paramemetrs;
1138     GOP_CHIP_PROPERTY *pGopChipProperty;
1139     DRV_GOP_CONSALPHA_BITS *pGopConsAlphaBits;
1140     GOP_Config sGOPConfig;  //GOP configs set for special cases
1141     MS_U32 u32GOPClientId;
1142 #if GOP_LOCK_SUPPORT
1143     MS_S32      s32GOPMutex;
1144     MS_S32      s32GOPLock;
1145     MS_S32      s32GOPMutexCnt;
1146 #endif
1147 #if GOP_XC_LOCK_SUPPORT
1148     MS_S32      s32GOPXC_Mutex;
1149     MS_S32      s32GOPXC_Lock;
1150     MS_S32      s32GOPXC_MutexCnt;
1151 #endif
1152     //for local GWIN memory pool
1153 
1154 #if WINFB_INSHARED
1155     //GOP_WinFB_INFO winFB[MAX_GWIN_FB_SUPPORT+1]; //move to MS_GOP_CTX_SHARED
1156 #else
1157     GOP_WinFB_INFO winFB[DRV_MAX_GWIN_FB_SUPPORT+1];
1158 #endif
1159     MS_U8 current_winId;
1160 
1161 
1162     MS_BOOL Gwin_H_Dup, Gwin_V_Dup;
1163     MS_U16 u16GOP_HMirrorRBLK_Adr;   //Consider 16Gwins totally
1164     MS_U16 u16GOP_VMirrorRBLK_Adr;   //Consider 16Gwins totally
1165     MS_U16 u16GOP_HMirror_HPos;      //Consider 16Gwins totally
1166     MS_U16 u16GOP_VMirror_VPos;      //Consider 16Gwins totally
1167 
1168     GOP_GwinMirror_Info* sMirrorInfo;
1169     MS_U8 MS_MuxGop[MAX_GOP_MUX_SUPPORT];
1170     MS_U8 u8ChgIpMuxGop;
1171     MS_BOOL IsChgMux;
1172     MS_BOOL IsClkClosed;
1173     MS_BOOL bUpdateRegOnce[SHARED_GOP_MAX_COUNT];
1174 #ifdef CONFIG_GOP_TEST_PATTERN
1175     MS_U16 GOPBnk[SHARED_GOP_MAX_COUNT][GOP_REG_MAX];
1176     MS_U16 GWINBnk[SHARED_GOP_MAX_COUNT][GOP_REG_MAX];
1177     MS_U16 GOPStBnk[SHARED_GOP_MAX_COUNT][GOP_REG_MAX];
1178 #endif
1179     MS_U16 GOP_FramePacking_Gap;
1180     MS_U16 u16GOPGWinMiddle[SHARED_GOP_MAX_COUNT];
1181 
1182     MS_BOOL bInitFWR;
1183 }MS_GOP_CTX_LOCAL;
1184 
1185 typedef struct DLL_PACKED
1186 {
1187     MS_BOOL bEnable; //InOut
1188     MS_U8   u8FrameCount; //Out, value range: 0~3
1189     MS_U8   u8Result; //Out
1190 }MS_DRVGOP_VECAPTURESTATE, *PMS_DRVGOP_VECAPTURESTATE;
1191 
1192 
1193 //3D OSD mode type
1194 typedef enum
1195 {
1196     E_DRV_GOP_3D_DISABLE ,
1197     E_DRV_GOP_3D_SWITH_BY_FRAME,
1198     E_DRV_GOP_3D_SIDE_BY_SYDE,
1199     E_DRV_GOP_3D_TOP_BOTTOM,
1200     E_DRV_GOP_3D_LINE_ALTERNATIVE,
1201     E_DRV_GOP_3D_LINE_FRAMEPACKING,
1202 }EN_DRV_GOP_3D_MODE;
1203 
1204 typedef enum
1205 {
1206     E_DRV_GOP_Deldirect_Front ,
1207     E_DRV_GOP_Deldirect_Back,
1208 }E_DRV_GOP_DelDirect;
1209 
1210 
1211 typedef enum
1212 {
1213     E_DRV_GOP_MAIN_WINDOW=0,          ///< main window if with PIP or without PIP
1214     E_DRV_GOP_SUB_WINDOW=1,           ///< sub window if PIP
1215     E_DRV_GOP_MAX_WINDOW              /// The max support window
1216 }E_DRV_GOP_SCALER_WIN;
1217 
1218 ///Dwin Capability of IC
1219 typedef struct DLL_PACKED
1220 {
1221     MS_BOOL bSupportWindowDECapture; //TRUE: Support it; FALSE:Not support, should use FrameDE to capture video
1222     MS_BOOL bSupportOSDCapture;      //TRUE: Support it; FALSE:Not support
1223 }DRV_GOP_DWIN_CAP, *PDRV_GOP_DWIN_CAP;
1224 
1225 ///GOP MUX Caps
1226 typedef struct DLL_PACKED
1227 {
1228     MS_U8 u8MuxNumber;
1229     MS_U8 *pu8MuxProrityArray;
1230     MS_BOOL bNewMux;
1231     MS_BOOL bNeedSetMUX1ToIP0;
1232     MS_BOOL bNeedSetMUX3ToIP0;
1233 }ST_DRV_GOP_MUX_CAP, *PST_DRV_GOP_MUX_CAP;
1234 
1235 ///GOP MUX Caps
1236 typedef struct
1237 {
1238     MS_U8 u8MuxNumber;
1239     MS_U8 pu8MuxProrityArray[MAX_GOP_INFO_COUNT];
1240     MS_BOOL bNewMux;
1241     MS_BOOL bNeedSetMUX1ToIP0;
1242     MS_BOOL bNeedSetMUX3ToIP0;
1243 }ST_DRV_GOP_MUX_CAP_EX, *PST_DRV_GOP_MUX_CAP_EX;
1244 
1245 typedef enum
1246 {
1247     E_DRV_GOP_BNK_WRITE =0,    //restore the bank register
1248     E_DRV_GOP_BNK_READ,        //back the bank register
1249 }E_DRV_GOP_BNK_STATUS;
1250 
1251 typedef enum
1252 {
1253     E_DRV_GOP_GPU_TILE_LINEAR =0,
1254     E_DRV_GOP_GPU_TILE_DIP8X,
1255     E_DRV_GOP_GPU_TILE_DIP16X,
1256     E_DRV_GOP_GPU_TILE_GPU,
1257 }EN_DRV_GOP_GPU_TILE_MODE;
1258 
1259 typedef enum
1260 {
1261     EN_GOP_CROP_DISABLE = 0,
1262     EN_GOP_CROP_ENABLE = 1,
1263 } EN_GOP_CROP_CTL;
1264 
1265 ///  Test Pattern
1266 typedef struct DLL_PACKED
1267 {
1268     /// TSTClr_en
1269     MS_BOOL bTSTClr_En;
1270     /// TSTClr_Alpha_En
1271     MS_BOOL bTSTClr_Alpha_En;
1272 
1273     ///TSTClr_Alpha
1274     MS_U8 u8TSTClr_Alpha;
1275     /// R_stc
1276     MS_U8 u8R_stc;
1277     /// G_stc.
1278     MS_U8 u8G_stc;
1279     /// B_stc.
1280     MS_U8 u8B_stc;
1281 
1282     /// TSTClr_hdup
1283     MS_U8 u8TSTClr_Hdup;
1284     /// TSTClr_vdup.
1285     MS_U8 u8TSTClr_Vdup;
1286 
1287     /// H_R_inc.
1288     MS_U8 u8HR_inc;
1289     /// H_R_inc_signz
1290     MS_BOOL u8HR_inc_signz;
1291     /// H_G_inc.
1292     MS_U8 u8HG_inc;
1293     /// H_G_inc_signz
1294     MS_BOOL u8HG_inc_signz;
1295     /// H_B_inc.
1296     MS_U8 u8HB_inc;
1297     /// H_B_inc_signz
1298     MS_BOOL u8HB_inc_signz;
1299     /// H_R_step
1300     MS_U8 u8HR_step;
1301     /// H_G_stepc
1302     MS_U8 u8HG_step;
1303     /// H_B_step.
1304     MS_U8 u8HB_step;
1305 
1306     /// V_R_inc.
1307     MS_U8 u8VR_inc;
1308     /// V_R_inc_signz
1309     MS_BOOL u8VR_inc_signz;
1310     /// V_G_inc.
1311     MS_U8 u8VG_inc;
1312     /// V_G_inc_signz
1313     MS_BOOL u8VG_inc_signz;
1314     /// V_B_inc.
1315     MS_U8 u8VB_inc;
1316     /// V_B_inc_signz
1317     MS_BOOL u8VB_inc_signz;
1318     /// V_R_step
1319     MS_U8 u8VR_step;
1320     /// V_G_step
1321     MS_U8 u8VG_step;
1322     /// V_B_step.
1323     MS_U8 u8VB_step;
1324 } DRV_GOP_TSTPATTERN;
1325 
1326 
1327 typedef struct DLL_PACKED
1328 {
1329     MS_U8 GOP0;
1330     MS_U8 GOP1;
1331     MS_U8 GOP2;
1332     MS_U8 GOP3;
1333     MS_U8 GOP4;
1334     MS_U8 GOP5;
1335     MS_U8 DWIN;
1336     MS_U8 MIXER;
1337 }GOP_TYPE_DEF;
1338 
1339 typedef struct DLL_PACKED
1340 {
1341     MS_PHY u64Addr;
1342     MS_U16 u16Pitch;
1343     MS_U16 u16Fmt;
1344 }DRV_GOP_CBFmtInfo;
1345 
1346 typedef struct DLL_PACKED
1347 {
1348     MS_PHY u64DRAMAddr;       //!< unit: Byte
1349     MS_U16 u16HPixelStart;      //!< unit: pix
1350     MS_U16 u16HPixelEnd;        //!< unit: pix
1351     MS_U16 u16VPixelStart;      //!< unit: pix
1352     MS_U16 u16VPixelEnd;        //!< unit: pix
1353     MS_U16 u16Pitch;            //!< unit: Byte
1354     MS_U8  u8Fmt;
1355 }DRV_GOP_AFBC_Info;
1356 
1357 //-------------------------------------------------------------------------------------------------
1358 //  Function and Variable
1359 //-------------------------------------------------------------------------------------------------
1360 
1361 //======================================================================================
1362 //  GOP Common utility
1363 //======================================================================================
1364 MS_U8 MDrv_DumpGopByGwinId(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U32 GwinID);
1365 void* MDrv_GOP_GetShareMemory(MS_BOOL *pbNeedInitShared);
1366 GOP_Result MDrv_GOP_Sel(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum);
1367 MS_GOP_CTX_LOCAL*  Drv_GOP_Init_Context(void* pInstance,MS_BOOL *pbNeedInitShared);
1368 void MDrv_GOP_Init(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum, MS_PHY u64GOP_REGDMABASE, MS_U32 u32GOP_RegdmaLen, MS_BOOL bEnableVsyncIntFlip);
1369 void MDrv_GOP_DeInit(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum);
1370 void MDrv_GOP_PerClientInit(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum, MS_PHY u64GOP_REGDMABASE, MS_U32 u32GOP_RegdmaLen, MS_BOOL bEnableVsyncIntFlip);
1371 void MDrv_GOP_SetRegDMA(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, MS_PHY u64GOP_REGDMABASE, MS_U32 u32GOP_RegdmaLen);
1372 void MDrv_GOP_SetGOPEnable2SC(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 gopNum, MS_BOOL bEnable);
1373 void MDrv_GOP_SetIPSel2SC(MS_GOP_CTX_LOCAL*pGOPCtx, MS_IPSEL_GOP ipSelGop);
1374 void MDrv_GOP_SetClkForCapture(MS_GOP_CTX_LOCAL*pGOPCtx, DRV_GOP_DWIN_SRC_SEL enSrcSel);
1375 void MDrv_GOP_SetVOPNBL(MS_GOP_CTX_LOCAL*pGOPCtx,MS_BOOL bEnable);
1376 void MDrv_GOP_GWIN_UpdateReg(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP);
1377 void MDrv_GOP_GWIN_UpdateRegWithSync(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP, MS_BOOL bSync);
1378 void MDrv_GOP_GWIN_UpdateRegWithMaskSync(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U16 u16GopMask, MS_BOOL bSync);
1379 void MDrv_GOP_TriggerRegWriteIn(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP, MS_BOOL bForceWriteIn, MS_BOOL bSync);
1380 void MDrv_GOP_Restore_Ctx(MS_GOP_CTX_LOCAL*pGOPCtx);
1381 MS_BOOL MDrv_GetAFBCCapsSupport(MS_GOP_CTX_LOCAL*pGOPCtx);
1382 MS_U8 MDrv_GOP_Get(MS_GOP_CTX_LOCAL*pGOPCtx);
1383 MS_U8 MDrv_GOP_GetGwinNum(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GopNum);
1384 MS_U8 MDrv_GetMaxMuxOPNum(void);
1385 MS_BOOL MDrv_GOP_SetIOMapBase(MS_GOP_CTX_LOCAL*pGOPCtx);
1386 MS_BOOL MDrv_GOP_HasGop1GPalette(MS_GOP_CTX_LOCAL*pGOPCtx);
1387 MS_BOOL MDrv_GOP_SwitchGWIN2Addr(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 gWinId, MS_PHY u64MainAddress, MS_PHY u64SubAddress, MS_U32 u32WaitTagID,  MS_U32 *pU32QueueCnt);
1388 GOP_Result MDrv_GOP_SetGOPClk(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 gopNum, DRV_GOPDstType eDstType);
1389 GOP_Result MDrv_GOP_MIXER_SetGOPEnable2Mixer(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 gopNum, MS_BOOL bEnable);
1390 GOP_Result MDrv_GOP_SetGOPHighPri(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum);
1391 GOP_Result MDrv_GOP_InitMux(MS_GOP_CTX_LOCAL*pGOPCtx);
1392 MS_U8 MDrv_GOP_GetWordUnit(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum);
1393 MS_U16 MDrv_GOP_GetGOPACK(MS_GOP_CTX_LOCAL *pGOPCtx, MS_U8 enGopType);
1394 MS_U8 MDrv_GOP_GetMaxGOPNum(MS_GOP_CTX_LOCAL*pGOPCtx);
1395 MS_U8 MDrv_GOP_GetMaxMuxSel(MS_GOP_CTX_LOCAL*pGOPCtx);
1396 MS_U8 MDrv_GOP_SelGwinIdByGOP(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP, MS_U8 u8GWinIdx);
1397 GOP_Result MDrv_GOP_SetClock(MS_GOP_CTX_LOCAL*pGOPCtx,MS_BOOL bEnable);
1398 GOP_Result MDrv_GOP_ConvertAPIAddr2HAL(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8Gwinid, MS_PHY* u64ApiAdr);
1399 GOP_Result MDrv_GOP_GWIN_SetFadeInOut(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 gId, DRV_GOP_FADE_TYPE eGwinFadeType, MS_BOOL bEnable, MS_U8 u8FadeRate);
1400 MS_U32 MDrv_GOP_GetMIULen(MS_GOP_CTX_LOCAL*pGOPCtx);
1401 void  MDrv_GOP_MIU_Sel(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum,E_DRV_GOP_SEL_TYPE miusel);
1402 MS_U8 MDrv_GOP_Get_MIU_Sel(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum);
1403 void MDrv_GOP_SetGOPBWStrength(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, EN_GOP_BURST_LEN eGOPBWStr);
1404 EN_GOP_BURST_LEN MDrv_GOP_GetGOPBWStrength(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP);
1405 void MDrv_GOP_SetGOPYUV(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP);
1406 MS_U8 MDrv_GOP_GetHPipeOfst(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP_num, DRV_GOPDstType GopDst);
1407 MS_U8 MDrv_GOP_GetDWINMIU(MS_GOP_CTX_LOCAL*pGOPCtx);
1408 GOP_Result MDrv_GOP_SetDWINMIU(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 miu);
1409 GOP_Result MDrv_GOP_VE_SetOutputTiming(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U32 u32mode);
1410 GOP_Result MDrv_GOP_MIXER_SetOutputTiming(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U32 u32mode, GOP_DRV_MixerTiming *pTM);
1411 GOP_Result MDrv_GOP_MIXER_EnableVfilter(MS_GOP_CTX_LOCAL*pGOPCtx, MS_BOOL bEnable);
1412 GOP_Result MDrv_GOP_MIXER_EnableOldBlendMode(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 gopNum, MS_BOOL bEnable);
1413 MS_BOOL MDrv_GOP_RestoreFromVsyncLimitation(MS_GOP_CTX_LOCAL *pGOPCtx);
1414 MS_U32 MDrv_GOP_GetRegForm(MS_GOP_CTX_LOCAL *pGOPCtx, MS_U8 u8gop, MS_U8 u8gwin);
1415 GOP_Result MDrv_GOP_SetGOPBrightness(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP,MS_U16 u16BriVal,MS_BOOL bMSB);
1416 GOP_Result MDrv_GOP_GetGOPBrightness(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP,MS_U16* u16BriVal,MS_BOOL* bMSB);
1417 GOP_Result MDrv_GOP_EnableLBCouple(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP, MS_BOOL bEnable);
1418 GOP_Result MDrv_GOP_Set_PINPON(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum,MS_BOOL bEn,E_DRV_GOP_PINPON_MODE pinpon_mode);
1419 GOP_Result MDrv_GOP_Set_BufferPINPON(MS_GOP_CTX_LOCAL*pGOPCtx,MS_PHY u64fbaddr0,MS_PHY u64fbaddr1);
1420 GOP_Result MDrv_GOP_Set_16bBus(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum,MS_BOOL bEn);
1421 GOP_Result MDrv_GOP_SetUVSwap(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum,MS_BOOL bEn);
1422 GOP_Result MDrv_GOP_SetYCSwap(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum,MS_BOOL bEn);
1423 GOP_Result MDrv_GOP_SetGOPContrast(MS_GOP_CTX_LOCAL* pGOPCtx, MS_U8 u8GOP, MS_U16 u16YContrast, MS_U16 u16UContrast, MS_U16 u16VContrast);
1424 GOP_Result MDrv_GOP_GetGOPContrast(MS_GOP_CTX_LOCAL* pGOPCtx, MS_U8 u8GOP, MS_U32* u32YContrast, MS_U32* u32UContrast, MS_U32* u32VContrast);
1425 MS_BOOL MDrv_GOP_GetVECaptureState(MS_GOP_CTX_LOCAL *pGOPCtx, PMS_DRVGOP_VECAPTURESTATE pstVECapState);
1426 MS_BOOL MDrv_GOP_VECaptureWaitOnFrame(MS_GOP_CTX_LOCAL *pGOPCtx, PMS_DRVGOP_VECAPTURESTATE pstVECapState);
1427 MS_BOOL MDrv_GOP_EnaVECapture(MS_GOP_CTX_LOCAL *pGOPCtx, PMS_DRVGOP_VECAPTURESTATE pstVECapState);
1428 GOP_Result MDrv_GOP_Set3DOSD_Mode(MS_GOP_CTX_LOCAL* pGOPCtx, MS_U8 u8GOP ,EN_DRV_GOP_3D_MODE en3DOSDMode);
1429 GOP_Result MDrv_GOP_Set3DOSD_Sub(MS_GOP_CTX_LOCAL* pGOPCtx, MS_U8 u8Gwin, MS_PHY u64SubAddr);
1430 GOP_Result MDrv_GOP_Set3D_LR_FrameExchange(MS_GOP_CTX_LOCAL* pGOPCtx, MS_U8 u8GOP);
1431 MS_U16 MDrv_GOP_GetCurrentHSPipe(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP);
1432 void MDrv_GOP_Set3DOSD_Middle(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP);
1433 MS_BOOL MDrv_GOP_SetGPIO3DPin(MS_GOP_CTX_LOCAL*pGOPCtx,  MS_U32 u32GPIO3DPin);
1434 void MDrv_GOP_Mask_First_Hsync(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, MS_BOOL bMask );
1435 GOP_Result MDrv_GOP_Set_VE_MUX(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 gopNum, MS_BOOL bEn);
1436 GOP_Result MDrv_GOP_BNK(MS_GOP_CTX_LOCAL*pGOPCtx, E_DRV_GOP_BNK_STATUS Bnk_op);
1437 MS_BOOL MDrv_GOP_GetGOPEnum(MS_GOP_CTX_LOCAL*pGOPCtx, GOP_TYPE_DEF* GOP_TYPE);
1438 GOP_Result MDrv_GOP_GWIN_PowerState(void* pInstance, MS_U32 u32PowerState, void* pModule);
1439 GOP_Result MDrv_GOP_AFBC_Core_Reset(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP);
1440 GOP_Result MDrv_GOP_AFBC_Core_Enable(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP, MS_BOOL bEna);
1441 GOP_Result MDrv_GOP_GWIN_AFBCMode(MS_GOP_CTX_LOCAL*pGOPCtx, MS_BOOL u8GOP, MS_BOOL bEnable, EN_DRV_GOP_AFBC_CNTL eCTL);
1442 GOP_Result MDrv_GOP_GWIN_AFBCSetWindow(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP, DRV_GOP_AFBC_Info* pinfo, MS_BOOL bChangePitch);
1443 GOP_Result MDrv_GOP_SetDbgLevel(EN_GOP_DEBUG_LEVEL level);
1444 //======================================================================================
1445 //  GOP GWIN Setting
1446 //======================================================================================
1447 void MDrv_GOP_GWIN_EnableProgressive(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum, MS_BOOL bEnable);
1448 MS_BOOL MDrv_GOP_GWIN_IsProgressive(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum);
1449 void MDrv_GOP_GWIN_SetForceWrite(MS_GOP_CTX_LOCAL*pGOPCtx, MS_BOOL bEnable);
1450 void MDrv_GOP_GWIN_SetBnkForceWrite(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP, MS_BOOL bEnable);
1451 void MDrv_GOP_GWIN_ForceWrite_Update(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP, MS_BOOL bEnable);
1452 MS_BOOL MDrv_GOP_GWIN_IsForceWrite(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP);
1453 void MDrv_GOP_GWIN_OutputColor(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, GOP_OupputColor type);
1454 void MDrv_GOP_GWIN_SetTransClr_8888(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, MS_U32 clr, MS_U32 mask);
1455 void MDrv_GOP_GWIN_SetTransClr_YUV(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, MS_U32 clr, MS_U32 mask);
1456 void MDrv_GOP_GWIN_EnableTransClr(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, GOP_TransClrFmt fmt, MS_BOOL bEnable);
1457 void MDrv_GOP_GWIN_EnableMultiAlpha(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U32 u32GopIdx, MS_BOOL bEnable);
1458 MS_BOOL MDrv_GOP_GWIN_IsMultiAlphaEnable(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U32 u32GopIdx);
1459 void MDrv_GOP_GWIN_SetBlink(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8win, MS_BOOL bEnable, MS_U8 u8rate);
1460 void MDrv_GOP_GWIN_SetFieldInver(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, MS_BOOL enable);
1461 void MDrv_GOP_GWIN_SetAlphaInverse(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8gopNum, MS_BOOL bEnable);
1462 void MDrv_GOP_GWIN_GetAlphaInverse(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, MS_BOOL *bBool);
1463 GOP_Result MDrv_GOP_GWIN_GetDstPlane(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum, DRV_GOPDstType *pGopDst);
1464 void MDrv_GOP_GWIN_SetBlending(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8win, MS_BOOL bEnable, MS_U8 u8coef);
1465 void MDrv_GOP_GWIN_SetWinFmt(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8win, DRV_GOPColorType clrtype);
1466 void MDrv_GOP_GWIN_EnableGwin(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8win, MS_BOOL bEnable);
1467 void MDrv_GOP_GWIN_Set_BGWIN(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 bgwID, MS_U16 x0, MS_U16 y0, MS_U16 x1, MS_U16 y1, MS_U16 color);
1468 void MDrv_GOP_GWIN_Set_BGWIN_Alpha(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 bgwID, MS_BOOL bEnable, MS_U8 alpha);
1469 void MDrv_GOP_GWIN_IsGWINEnabled(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8win, MS_BOOL* pbEnable );
1470 void MDrv_GOP_GWIN_EnableHMirror(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum, MS_BOOL bEnable);
1471 void MDrv_GOP_GWIN_EnableVMirror(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum, MS_BOOL bEnalbe);
1472 void MDrv_GOP_IsGOPMirrorEnable(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum, MS_BOOL *bHMirror, MS_BOOL *bVMirror);
1473 void MDrv_GOP_GWIN_SetGwinPriority(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GopNum, GOP_GwinPriority *GwinPri);
1474 void MDrv_GOP_GWIN_GetGwinPriority(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8Gopnum, GOP_GwinPriority *GwinPri);
1475 void MDrv_GOP_GWIN_SetMux(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum, Gop_MuxSel eGopMux);
1476 void MDrv_GOP_MapLayer2Mux(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U32 u32Layer, MS_U8 u8Gopnum, MS_U32 *pu32Mux);
1477 void MDrv_GOP_GWIN_GetMux(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8* u8GOPNum, Gop_MuxSel eGopMux);
1478 MS_BOOL Mdrv_GOP_GetMuxPriority(MS_GOP_CTX_LOCAL*pGOPCtx, PST_DRV_GOP_MUX_CAP_EX pstMuxPriEx);
1479 void MDrv_GOP_GWIN_SetHSPipe(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum, MS_U16 u16HSPipe);
1480 void MDrv_GOP_DWIN_GetWinProperty(MS_GOP_CTX_LOCAL*pGOPCtx, DRV_GOP_DwinProperty *pproperty);
1481 void MDrv_GOP_DWIN_SetWinProperty(MS_GOP_CTX_LOCAL*pGOPCtx, DRV_GOP_DwinProperty *pproperty);
1482 void MDrv_GOP_GWIN_SetVSyncinverse(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, MS_BOOL bEnable);
1483 void MDrv_GOP_SetGOPEnable2Mode1(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 gopNum, MS_BOOL bEnable);
1484 void MDrv_GOP_GetGOPEnable2Mode1(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 gopNum, MS_BOOL *pbEnable);
1485 GOP_Result MDrv_GOP_GWIN_GetGwinInfo(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8win, DRV_GOP_GWIN_INFO* pinfo);
1486 GOP_Result MDrv_GOP_GWIN_SetGwinInfo(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8win, DRV_GOP_GWIN_INFO* pinfo);
1487 MS_BOOL MDrv_GOP_GWIN_SendGwinInfo2Flip(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8win, DRV_GOP_GWIN_INFO* pinfo);
1488 GOP_Result MDrv_GOP_GWIN_SetDstPlane(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum, DRV_GOPDstType eDstType,MS_BOOL bOnlyCheck);
1489 GOP_Result MDrv_GOP_GWIN_Enable_BGWIN(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 bgwID, MS_BOOL bEnable);
1490 GOP_Result MDrv_GOP_GWIN_EnableTileMode(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8win, MS_BOOL bEnable,E_GOP_TILE_DATA_TYPE tilemode);
1491 GOP_Result MDrv_GOP_GWIN_SetMixerDstPlane(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum, DRV_GOPDstType eDstType);
1492 GOP_Result MDrv_GOP_GWIN_GetMixerDstPlane(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum, DRV_GOPDstType *pGopDst);
1493 GOP_Result MDrv_GOP_MIXER_SetMux(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 gopNum, MS_U8 muxNum, MS_BOOL bEnable);
1494 GOP_Result MDrv_GOP_GWIN_GetGwinNewAlphaModeEnable(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8win, MS_BOOL* bEnable);
1495 GOP_Result MDrv_GOP_GWIN_SetNewAlphaMode(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8win, MS_BOOL bEnable);
1496 GOP_Result MDrv_GOP_GWIN_ClearFlipQueue(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 gWinId);
1497 MS_U16 MDrv_GOP_GetBPP(MS_GOP_CTX_LOCAL*pGOPCtx, DRV_GOPColorType fbFmt);
1498 E_GOP_VIDEOTIMING_MIRRORTYPE Mdrv_GOP_GetVideoTimingMirrorType(MS_GOP_CTX_LOCAL* pGOPCtx, MS_BOOL bHorizontal);
1499 GOP_Result MDrv_GOP_GWIN_DeleteWinHVSize(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP, MS_U16 u16HSize, MS_U16 u16VSize);
1500 void MDrv_GOP_SelfFirstHs(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8Gop, MS_BOOL bEnable);
1501 
1502 //======================================================================================
1503 //  GOP Stretch Window Setting
1504 //======================================================================================
1505 void MDrv_GOP_GWIN_SetStretchWin(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP, MS_U16 x, MS_U16 y, MS_U16 width, MS_U16 height);
1506 void MDrv_GOP_GWIN_SetStretchWinPosition(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP,MS_U16 u16x, MS_U16 u16y);
1507 void MDrv_GOP_GWIN_SetHTotal(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP, MS_U16 width);
1508 void MDrv_GOP_GWIN_Get_StretchWin(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP, MS_U16 *x, MS_U16 *y, MS_U16 *width, MS_U16 *height);
1509 MS_BOOL MDrv_GOP_GWIN_Get_HVScaleRatio(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP_num, MS_U16 *pu16HScaleRat, MS_U16 *pu16VScaleRat);
1510 void MDrv_GOP_GWIN_Set_HSCALE(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP, MS_BOOL bEnable, MS_U16 src, MS_U16 dst) ;
1511 void MDrv_GOP_GWIN_Set_VSCALE(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP, MS_BOOL bEnable, MS_U16 src, MS_U16 dst) ;
1512 void MDrv_GOP_GWIN_Set_HStretchMode(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, DRV_GOPStrchHMode HStrchMode);
1513 void MDrv_GOP_GWIN_Set_VStretchMode(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, DRV_GOPStrchVMode VStrchMode);
1514 GOP_Result MDrv_GOP_GWIN_Set_TranspColorStretchMode(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP, DRV_GOPSTRCH_TRANSPCOLORMODE TColorStrchMode);
1515 void MDrv_GOP_GWIN_Load_HStretchModeTable(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP , DRV_GOPStrchHMode HStrchMode);
1516 void MDrv_GOP_GWIN_Load_VStretchModeTable(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, DRV_GOPStrchVMode VStrchMode);
1517 
1518 //======================================================================================
1519 //  GOP Palette setting
1520 //======================================================================================
1521 void MDrv_GOP_GWIN_SetPaletteOpt( MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, DRV_GopPaletteEntry *pPalArray, MS_U16 u32PalStart, MS_U16 u32PalEnd, DRV_GopPalType ePalType);
1522 void MDrv_GOP_GWIN_SetPaletteRead(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, DRV_GopPalReadType type);
1523 void MDrv_GOP_GWIN_ReadPalette(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, MS_U8 idx, MS_U32* clr);
1524 void MDrv_GOP_GWIN_2GSetPaletteOpt(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, DRV_GopPaletteEntry *pPalArray, MS_U16 u32PalStart, MS_U16 u32PalEnd);
1525 void MDrv_GOP_GWIN_2GSetPaletteRead(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, DRV_GopPalReadType type);
1526 void MDrv_GOP_GWIN_2GReadPalette(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, MS_U8 idx, MS_U32* clr);
1527 
1528 //======================================================================================
1529 //  GOP GWIN H/V Scroll
1530 //======================================================================================
1531 void MDrv_GOP_GWIN_SetScrollRate(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8rate);
1532 void MDrv_GOP_GWIN_SetHScroll(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8win, E_GOP_SCROLL_TYPE type, MS_U32 offset, MS_BOOL bEnable);
1533 void MDrv_GOP_GWIN_SetVScroll(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8win, E_GOP_SCROLL_TYPE type, MS_U32 offset, MS_BOOL bEnable);
1534 void MDrv_GOP_GWIN_Scroll_EnableAutoStop(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8win, MS_BOOL bEnable);
1535 MS_BOOL MDrv_GOP_GWIN_Scroll_AutoStop_HSet(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8win, MS_U32 u32AutoHStopOffset);
1536 MS_BOOL MDrv_GOP_GWIN_Scroll_AutoStop_VSet(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8win, MS_U32 u32AutoVStopOffset);
1537 
1538 
1539 //======================================================================================
1540 //  GOP DWIN Utility
1541 //======================================================================================
1542 void MDrv_GOP_DWIN_SetForceWrite(MS_GOP_CTX_LOCAL*pGOPCtx, MS_BOOL bEnable);
1543 void MDrv_GOP_DWIN_EnableCaptureStream(MS_GOP_CTX_LOCAL*pGOPCtx, MS_BOOL bEnable);
1544 void MDrv_GOP_DWIN_CaptureOneFrame(MS_GOP_CTX_LOCAL*pGOPCtx);
1545 void MDrv_GOP_DWIN_CaptureOneFrame2(MS_GOP_CTX_LOCAL*pGOPCtx);
1546 void MDrv_GOP_DWIN_SetWinInfo(MS_GOP_CTX_LOCAL*pGOPCtx, DRV_GOP_DWIN_INFO* pinfo);
1547 void MDrv_GOP_DWIN_GetWinInfo(MS_GOP_CTX_LOCAL*pGOPCtx, DRV_GOP_DWIN_INFO* pinfo);
1548 void MDrv_GOP_DWIN_EnableProgressive(MS_GOP_CTX_LOCAL*pGOPCtx, MS_BOOL bEnable);
1549 void MDrv_GOP_DWIN_SelectSource(MS_GOP_CTX_LOCAL*pGOPCtx, EN_GOP_DWIN_DATA_SRC enSrc);
1550 void MDrv_GOP_DWIN_SelectSourceScanType(MS_GOP_CTX_LOCAL*pGOPCtx, EN_GOP_DWIN_SCAN_TYPE enScan);
1551 void MDrv_GOP_DWIN_EnableIntr(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U16 u8mask, MS_BOOL bEnable);
1552 void MDrv_GOP_DWIN_ClearIntr(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U16 u8mask);
1553 void MDrv_GOP_DWIN_Set_CTRL0(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U16 val, MS_U16 mask);
1554 void MDrv_GOP_DWIN_SetDataFmt(MS_GOP_CTX_LOCAL*pGOPCtx, DRV_GOP_DWIN_DATA_FMT fmt) ;
1555 void MDrv_GOP_DWIN_GetDataFmt(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 *fmt);
1556 void MDrv_GOP_DWIN_SetAlphaValue(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8AlphaVal);
1557 void MDrv_GOP_DWIN_SetAlphaSrc(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 source);
1558 void MDrv_GOP_DWIN_SetAlphaInverse(MS_GOP_CTX_LOCAL*pGOPCtx, MS_BOOL bEnable);
1559 void MDrv_GOP_DWIN_SetUVSample(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 mode);
1560 void MDrv_GOP_DWIN_SetSkipFrame(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U32 framecount);
1561 void MDrv_GOP_DWIN_EnableDither(MS_GOP_CTX_LOCAL*pGOPCtx, MS_BOOL bEnable);
1562 GOP_Result MDrv_GOP_DWIN_EnableR2YCSC(MS_GOP_CTX_LOCAL*pGOPCtx, MS_BOOL bEnable);
1563 void MDrv_GOP_DWIN_SetUVSwap(MS_GOP_CTX_LOCAL*pGOPCtx, MS_BOOL bEnable);
1564 MS_U16 MDrv_GOP_DWIN_GetIntrStatus(MS_GOP_CTX_LOCAL*pGOPCtx);
1565 GOP_Result MDrv_GOP_DWIN_SetSourceSel(MS_GOP_CTX_LOCAL*pGOPCtx, DRV_GOP_DWIN_SRC_SEL enSrcSel);
1566 GOP_Result MDrv_GOP_DWIN_GetDWinIntInfo(MS_GOP_CTX_LOCAL *pGOPCtx, DRV_GOP_DWinIntInfo *pGopDWinIntInfo,MS_U32 u32Timeout);
1567 void Mdrv_GOP_GetDWinCapability(MS_GOP_CTX_LOCAL*pGOPCtx, PDRV_GOP_DWIN_CAP pDwinCap);
1568 
1569 //======================================================================================
1570 //  GOP OC
1571 //======================================================================================
1572 GOP_Result MDrv_GOP_OC_SetOCEn(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOPNum, MS_BOOL bOCEn);
1573 GOP_Result MDrv_GOP_OC_SetOCInfo(MS_GOP_CTX_LOCAL*pGOPCtx, DRV_GOP_OC_INFO* OCinfo);
1574 
1575 //======================================================================================
1576 //  GOP GPU Tile
1577 //======================================================================================
1578 GOP_Result MDrv_GOP_GWIN_SetGPUTileMode(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8win, EN_DRV_GOP_GPU_TILE_MODE mode);
1579 
1580 
1581 //======================================================================================
1582 //  GOP TLB
1583 //======================================================================================
1584 GOP_Result MDrv_GOP_TLBEnable(MS_GOP_CTX_LOCAL*pGOPCtx, MS_U8 u8GOP, MS_BOOL bTLBEn);
1585 GOP_Result MDrv_GOP_SetTLBAddr(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 GOP, MS_PHY u64TLBAddr,MS_BOOL bHMirror,MS_BOOL bVMirror,DRV_GOP_GWIN_INFO* pinfo);
1586 GOP_Result MDrv_GOP_SetTLBSubAddr(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8GOP, MS_PHY u64TLBAddr);
1587 
1588 //======================================================================================
1589 //  GOP INTERNAL GET XC STATUS
1590 //======================================================================================
1591 GOP_Result MDrv_GOP_GetIPCaptureHStart(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U32 *u32Hstart,E_DRV_GOP_SCALER_WIN eWindow);
1592 GOP_Result MDrv_GOP_GetIPInterlace(MS_GOP_CTX_LOCAL*pGOPCtx,MS_BOOL *bInterlace,E_DRV_GOP_SCALER_WIN eWindow);
1593 
1594 
1595 //======================================================================================
1596 //  GOP TestPattern Setting
1597 //======================================================================================
1598 GOP_Result MDrv_GOP_TestPattern_IsVaild(MS_GOP_CTX_LOCAL*pGOPCtx);
1599 GOP_Result MDrv_GOP_TestPatternAlpha_Enable(MS_GOP_CTX_LOCAL*pGOPCtx, MS_BOOL bTSTClr_Alpha_En);
1600 GOP_Result MDrv_GOP_TestPattern(MS_GOP_CTX_LOCAL*pGOPCtx, MS_BOOL bTSTClr_En, MS_U8 u8TSTClr_Alpha);
1601 GOP_Result MDrv_GOP_TestPattern_SetStartClr(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8StartR,MS_U8 u8StartG,MS_U8 u8StartB);
1602 GOP_Result MDrv_GOP_TestPattern_SetHInitColor(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8HIniR,MS_U8 u8HIniG,MS_U8 u8HIniB);
1603 GOP_Result MDrv_GOP_TestPattern_SetVInitColor(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8VIniR,MS_U8 u8VIniG,MS_U8 u8VIniB);
1604 GOP_Result MDrv_GOP_TestPattern_SetHIncremental_Signz(MS_GOP_CTX_LOCAL*pGOPCtx,MS_BOOL bHIncreSigR,MS_BOOL bHIncreSigG,MS_BOOL bHIncreSigB);
1605 GOP_Result MDrv_GOP_TestPattern_SetVIncremental_Signz(MS_GOP_CTX_LOCAL*pGOPCtx,MS_BOOL bVIncreSigR,MS_BOOL bVIncreSigG,MS_BOOL bVIncreSigB);
1606 GOP_Result MDrv_GOP_TestPattern_SetHStep(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8HStepR,MS_U8 u8HStepG,MS_U8 u8HStepB);
1607 GOP_Result MDrv_GOP_TestPattern_SetVStep(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8VStepR,MS_U8 u8VStepG,MS_U8 u8VStepB);
1608 GOP_Result MDrv_GOP_TestPattern_SetHVDuplicate(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8HDup,MS_U8 u8VDup);
1609 MS_BOOL MDrv_GOP_GWIN_BeginDraw(void);
1610 MS_BOOL MDrv_GOP_GWIN_EndDraw(void);
1611 void MDrv_GOP_GWIN_Interrupt(MS_GOP_CTX_LOCAL*pGOPCtx,MS_U8 u8Gop,MS_BOOL bEable);
1612 
1613 //======================================================================================
1614 //  GOP HDR
1615 //======================================================================================
1616 GOP_Result MDrv_GOP_IsHDREnabled(MS_GOP_CTX_LOCAL*pGOPCtx, MS_BOOL* pbHDREnable);
1617 
1618 #ifdef CONFIG_UTOPIA_PROC_DBG_SUPPORT
1619 void MDrv_GOP_MDCMD_GETINFO(void* pInstance, MS_U64* u64ReqHdl);
1620 void MDrv_GOP_MDCMD_EchoCmd(void* pInstance, MS_U64* u64ReqHdl, char* pcCmdLine);
1621 #endif
1622 
1623 #ifdef __cplusplus
1624 }
1625 #endif
1626 
1627 
1628 #endif // _DRV_TEMP_H_
1629