xref: /utopia/UTPA2-700.0.x/projects/tmplib/include/apiGFX.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 /// @file   apiGFX.h
97 /// @brief  MStar Graphics Driver Interface
98 /// @author MStar Semiconductor Inc.
99 /// @version 1.0
100 ///////////////////////////////////////////////////////////////////////////////
101 
102 //-------------------------------------------------
103 /*! \defgroup GFX GFX interface
104 
105   \brief
106   GE:Graphic Engine \n\n
107   Basic primitives supported:\n
108   Line draw: Draw a straight line \n
109   Rect fill(Rectangular Fill) : Draw rectangle \n
110   Bitblt(Bit Transfer Block) : Memory copy \n
111 
112   <b> GFX Init Flow: </b> \n
113   \image html apiGFX_pic1.png
114   \n\n
115   <b> GFX Execute procedure: </b> \n
116   \image html apiGFX_pic2.png
117 
118   *! \defgroup GFX_INIT GFX init related functions
119   *   \ingroup   GFX
120 
121   *! \defgroup GFX_CAPS GFX get capability related functions
122   *   \ingroup   GFX
123 
124   *! \defgroup GFX_CB GFX call back related functions
125   *   \ingroup   GFX
126 
127   *! \defgroup GFX_DRAW_SETTING GFX draw setting related functions
128   *   \ingroup   GFX
129 
130   *! \defgroup GFX_LOCK_BEGINE_END GFX lock begine/end related functions
131   *   \ingroup   GFX_DRAW_SETTING
132 
133   *! \defgroup GFX_BUFFER_INFO GFX buffer info related functions
134   *   \ingroup   GFX_DRAW_SETTING
135 
136   *! \defgroup GFX_COLOR_KEY GFX color key related functions
137   *   \ingroup   GFX_DRAW_SETTING
138 
139   *! \defgroup GFX_ROP GFX ROP related functions
140   *   \ingroup   GFX_DRAW_SETTING
141 
142   *! \defgroup GFX_ALPHA_COMPARE GFX alpha compare related functions
143   *   \ingroup   GFX_DRAW_SETTING
144 
145   *! \defgroup GFX_ALPHA_BLENDING GFX alpha blending related functions
146   *   \ingroup   GFX_DRAW_SETTING
147 
148   *! \defgroup GFX_DFB GFX DFB related functions
149   *   \ingroup   GFX_DRAW_SETTING
150 
151   *! \defgroup GFX_PALETTE GFX palette related functions
152   *   \ingroup   GFX_DRAW_SETTING
153 
154   *! \defgroup GFX_CLIP GFX clip window related functions
155   *   \ingroup   GFX_DRAW_SETTING
156 
157   *! \defgroup GFX_DRAW GFX draw related functions
158   *   \ingroup   GFX_DRAW_SETTING
159 
160   *! \defgroup GFX_DRAW_MISC GFX draw misc related functions
161   *   \ingroup   GFX_DRAW_SETTING
162 
163   *! \defgroup GFX_WAIT_DONE GFX wait done related functions
164   *   \ingroup   GFX_DRAW_SETTING
165 
166   *! \defgroup GFX_CLEAR GFX clear buffer related functions
167   *   \ingroup   GFX_DRAW_SETTING
168 
169   *! \defgroup GFX_OPTION GFX option related functions
170   *   \ingroup   GFX
171 
172   *! \defgroup GFX_STRETCH GFX stretch related functions
173   *   \ingroup   GFX_OPTION
174 
175   *! \defgroup GFX_MIRROR GFX mirror related functions
176   *   \ingroup   GFX_OPTION
177 
178   *! \defgroup GFX_ROTATE GFX rotate related functions
179   *   \ingroup   GFX_OPTION
180 
181   *! \defgroup GFX_DITHER GFX dither related functions
182   *   \ingroup   GFX_OPTION
183 
184   *! \defgroup GFX_R2Y GFX r2y related functions
185   *   \ingroup   GFX_OPTION
186 
187   *! \defgroup GFX_WRITE_PROTECT GFX write protect related functions
188   *   \ingroup   GFX_OPTION
189 
190   *! \defgroup GFX_VCMQ GFX virtual CMDQ related functions
191   *   \ingroup   GFX_OPTION
192 
193   *! \defgroup GFX_PIXEL_MODE GFX pixel mode related functions
194   *   \ingroup   GFX_OPTION
195 
196   *! \defgroup GFX_POWER_STATE GFX power state related functions
197   *   \ingroup   GFX
198 
199   *! \defgroup GFX_MISC GFX misc related functions
200   *   \ingroup   GFX
201 
202   *! \defgroup GFX_MISC_NOS GFX misc nos related functions
203   *   \ingroup   GFX
204 
205   *! \defgroup GFX_MISC_BOX GFX misc box related functions
206   *   \ingroup   GFX
207 
208   *! \defgroup GFX_ToBeRemove GFX to be remove related functions
209   *   \ingroup   GFX
210 
211   */
212 //-------------------------------------------------
213 
214 #ifndef _API_GFX_H_
215 #define _API_GFX_H_
216 
217 //#include "drvGE.h"
218 //#define MAX_FONT                    20  //5
219 //#define MAX_BITMAP                  127
220 
221 #include "MsTypes.h"
222 #include "MsDevice.h"
223 #include "MsCommon.h"
224 
225 #ifdef __cplusplus
226 extern "C"
227 {
228 #endif
229 
230 // For CHAKRA
231 #define GE_ALIGNED_VALUE(value, align)  ( ((value) + ((align)-1)) & ~((align)-1) )
232 #define GE_ADDR_ALIGNMENT(addr)         GE_ALIGNED_VALUE(addr, 8)    // 8-byte alignment
233 
234 // END CHAKRA
235 
236 #define ERR_HANDLE                  -1
237 #define ERR_NULL_INDEX                  0xFFFFUL
238 
239 #define MSIF_GFX_LIB_CODE               {'G','F','X','_'} //Lib code
240 #define MSIF_GFX_LIBVER                 {'1','9'}      //LIB version
241 #define MSIF_GFX_BUILDNUM               {'1','9' }    //Build Number
242 #define MSIF_GFX_CHANGELIST             {'0','0','6','1','8','4','6','4'} //P4 ChangeList Number
243 
244 #define GFX_DRV_VERSION                 /* Character String for DRV/API version             */  \
245     MSIF_TAG,                           /* 'MSIF'                                           */  \
246     MSIF_CLASS,                         /* '00'                                             */  \
247     MSIF_CUS,                           /* 0x0000                                           */  \
248     MSIF_MOD,                           /* 0x0000                                           */  \
249     MSIF_CHIP,                                                                                  \
250     MSIF_CPU,                                                                                   \
251     MSIF_GFX_LIB_CODE,                  /* IP__                                             */  \
252     MSIF_GFX_LIBVER,                    /* 0.0 ~ Z.Z                                        */  \
253     MSIF_GFX_BUILDNUM,                  /* 00 ~ 99                                          */  \
254     MSIF_GFX_CHANGELIST,                /* CL#                                              */  \
255     MSIF_OS
256 
257 //GE return code
258 /// GFX API return value
259 typedef enum
260 {
261     GFX_FAIL                        = 0,
262     GFX_SUCCESS                        ,
263     GFX_NON_ALIGN_ADDRESS             ,
264     GFX_NON_ALIGN_PITCH               ,
265     GFX_INVALID_PARAMETERS            ,
266     /// not support
267     GFX_DRV_NOT_SUPPORT               ,
268     /// pixel format error
269     GFX_DRV_FAIL_FORMAT               ,
270     /// bitblit start address error
271     GFX_DRV_FAIL_BLTADDR              ,
272     /// bitblt overlap (if STRETCH, ITALIC, MIRROR, ROTATE)
273     GFX_DRV_FAIL_OVERLAP              ,
274     /// stretch bitblt fail
275     GFX_DRV_FAIL_STRETCH              ,
276     /// italic bitblt fail (if MIRROR, ROTATE)
277     GFX_DRV_FAIL_ITALIC               ,
278     /// engine is locked by others
279     GFX_DRV_FAIL_LOCKED               ,
280     /// primitive will not be drawn
281     GFX_DRV_NOT_DRAW                   ,
282     /// Dependent functions are not linked
283     GFX_DRV_NO_DEPENDENT              ,
284     /// context not inited.
285     GFX_DRV_CTXMAG_FAIL               ,
286 
287     GFX_INVALID_INTENSITY_ID = 0x100,
288     GFX_INVALID_BUFF_INFO             ,
289     GFX_INVALID_FONT_HANDLE           ,
290     GFX_INVALID_BMP_HANDLE            ,
291     GFX_INIT_FAIL                                  ,
292 } GFX_Result;
293 
294 
295 ///Define Raster Operation
296 typedef enum
297 {
298     /// rop_result = 0;
299     ROP2_OP_ZERO                    = 0,
300     /// rop_result = ~( rop_src | rop_dst );
301     ROP2_OP_NOT_PS_OR_PD            ,
302     /// rop_result = ((~rop_src) & rop_dst);
303     ROP2_OP_NS_AND_PD               ,
304     /// rop_result = ~(rop_src);
305     ROP2_OP_NS                      ,
306     /// rop_result = (rop_src & (~rop_dst));
307     ROP2_OP_PS_AND_ND               ,
308     /// rop_result = ~(rop_dst);
309     ROP2_OP_ND                      ,
310     /// rop_result = ( rop_src ^ rop_dst);
311     ROP2_OP_PS_XOR_PD               ,
312     /// rop_result = ~(rop_src & rop_dst);
313     ROP2_OP_NOT_PS_AND_PD           ,
314     /// rop_result = (rop_src & rop_dst);
315     ROP2_OP_PS_AND_PD               ,
316     /// rop_result = ~(rop_dst ^ rop_src);
317     ROP2_OP_NOT_PS_XOR_PD           ,
318     /// rop_result = rop_dst;
319     ROP2_OP_PD                      ,
320     /// rop_result = (rop_dst | (~rop_src));
321     ROP2_OP_NS_OR_PD                ,
322     /// rop_result = rop_src;
323     ROP2_OP_PS                      ,
324     /// rop_result = (rop_src | (~rop_dst));
325     ROP2_OP_PS_OR_ND                ,
326     /// rop_result = (rop_dst | rop_src);
327     ROP2_OP_PD_OR_PS                ,
328     /// rop_result = 0xffffff;
329     ROP2_OP_ONE                     ,
330 } GFX_ROP2_Op;
331 
332 
333 /// Color Key Operation Mode
334 typedef enum
335 {
336     /// If EQUAL then perform CK operation
337     CK_OP_EQUAL                     = 0,
338     /// If NOT EQUAL then perform CK operation
339     CK_OP_NOT_EQUAL                 = 1,
340     /// If EQUAL then perform Alpha Key operation
341     AK_OP_EQUAL                     = 2,
342     /// If NOT EQUAL then Alpha Key operation
343     AK_OP_NOT_EQUAL                 = 3,
344 } GFX_ColorKeyMode;
345 
346 ///Define Blending Coefficient
347 typedef enum
348 {
349     /// Csrc
350     COEF_ONE                        = 0,
351     /// Csrc * Aconst + Cdst * (1 - Aconst)
352     COEF_CONST                      ,
353     ///  Csrc * Asrc + Cdst * (1 - Asrc)
354     COEF_ASRC                       ,
355     /// Csrc * Adst + Cdst * (1 - Adst)
356     COEF_ADST                       ,
357 
358     /// Cdst
359     COEF_ZERO                       ,
360     /// Csrc * (1 - Aconst) + Cdst * Aconst
361     COEF_1_CONST                    ,
362     /// Csrc * (1 - Asrc) + Cdst * Asrc
363     COEF_1_ASRC                     ,
364     ///  Csrc * (1 - Adst) + Cdst * Adst
365     COEF_1_ADST                     ,
366 
367     /// ((Asrc * Aconst) * Csrc + (1-(Asrc *Aconst)) * Cdst) / 2
368     COEF_ROP8_ALPHA                 ,
369     /// ((Asrc * Aconst) * Csrc + Adst * Cdst * (1-(Asrc * Aconst))) / (Asrc * Aconst) + Adst * (1- Asrc * Aconst))
370     COEF_ROP8_SRCOVER               ,
371     /// ((Asrc * Aconst) * Csrc * (1-Adst) + Adst * Cdst) / (Asrc * Aconst) * (1-Adst) + Adst)
372     COEF_ROP8_DSTOVER               ,
373 
374     /// Csrc * Aconst
375     ///@note
376     /// <b>[URANUS] <em>It does not support COEF_CONST_SRC</em></b>
377     COEF_CONST_SRC              ,
378     /// Csrc * (1 - Aconst)
379     ///@note
380     /// <b>[URANUS] <em>It does not support COEF_1_CONST_SRC</em></b>
381     COEF_1_CONST_SRC            ,
382 
383     /// Csrc * Adst * Asrc * Aconst + Cdst * Adst * (1 - Asrc * Aconst)
384     ///@note
385     /// <b>[URANUS] <em>It does not support COEF_SRC_ATOP_DST</em></b>
386     COEF_SRC_ATOP_DST               ,
387     /// Cdst * Asrc * Aconst * Adst + Csrc * Asrc * Aconst * (1 - Adst)
388     ///@note
389     /// <b>[URANUS] <em>It does not support COEF_DST_ATOP_SRC</em></b>
390     COEF_DST_ATOP_SRC               ,
391     /// (1 - Adst) * Csrc * Asrc * Aconst + Adst * Cdst * (1 - Asrc * Aconst)
392     ///@note
393     /// <b>[URANUS] <em>It does not support COEF_SRC_XOR_DST</em></b>
394     COEF_SRC_XOR_DST                ,
395 } GFX_BlendCoef;
396 
397 ///Define Blending Source from
398 typedef enum
399 {
400     /// constant
401     ABL_FROM_CONST                  = 0,
402     /// source alpha
403     ABL_FROM_ASRC                   ,
404     /// destination alpha
405     ABL_FROM_ADST                   ,
406     /// Aout = Asrc*Aconst
407     ABL_FROM_ROP8_SRC       ,
408     /// Aout = Asrc*Aconst * Adst
409     ABL_FROM_ROP8_IN  ,
410     /// Aout = (1-Asrc*Aconst) * Adst
411     ABL_FROM_ROP8_DSTOUT  ,
412     /// Aout = (1-Adst) * Asrc*Aconst
413     ABL_FROM_ROP8_SRCOUT           ,
414     /// Aout = (Asrc*Aconst) + Adst*(1-Asrc*Aconst) or (Asrc*Aconst)*(1-Adst) + Adst
415     ABL_FROM_ROP8_OVER             ,
416 
417     /// 1 - Aconst
418     ABL_FROM_ROP8_INV_CONST       ,
419     /// 1 - Asrc
420     ABL_FROM_ROP8_INV_ASRC         ,
421     /// 1 - Adst
422     ABL_FROM_ROP8_INV_ADST         ,
423     /// Adst * Asrc * Aconst + Adst * (1 - Asrc * Aconst) A atop B
424     ABL_FROM_ROP8_SRC_ATOP_DST    ,
425     /// Asrc * Aconst * Adst + Asrc * Aconst * (1 - Adst) B atop A
426     ABL_FROM_ROP8_DST_ATOP_SRC    ,
427     /// (1 - Adst) * Asrc * Aconst + Adst * (1 - Asrc * Aconst) A xor B
428     ABL_FROM_ROP8_SRC_XOR_DST     ,
429     /// Asrc * Asrc * Aconst + Adst * (1 - Asrc * Aconst)
430     ABL_FROM_ROP8_INV_SRC_ATOP_DST     ,
431     /// Asrc * (1 - Asrc * Aconst) + Adst * Asrc * Aconst
432     ABL_FROM_ROP8_INV_DST_ATOP_SRC
433 } GFX_AlphaSrcFrom;
434 
435 
436 ///Define Colorkey Mode
437 typedef enum
438 {
439     /// max(Asrc,Adst)
440     GFX_ACMP_OP_MAX                = 0,
441     /// min(Asrc,Adst)
442     GFX_GE_ACMP_OP_MIN                = 1,
443 
444 } GFX_ACmpOp;
445 
446 
447 /// GE buffer format
448 typedef enum
449 {
450     /// font mode I1
451     GFX_FMT_I1                      = E_MS_FMT_I1,
452     /// font mode I2
453     GFX_FMT_I2                      = E_MS_FMT_I2,
454     /// font mode I4
455     GFX_FMT_I4                      = E_MS_FMT_I4,
456     /// color format palette 256(I8)
457     GFX_FMT_I8                      = E_MS_FMT_I8,
458      /// color format blinking display
459     GFX_FMT_FABAFGBG2266 = E_MS_FMT_FaBaFgBg2266,
460     /// Uranus GOP only support this blinking
461     /// color format for blinking display format
462     GFX_FMT_1ABFGBG12355            = E_MS_FMT_1ABFgBg12355,
463     /// color format RGB565
464     GFX_FMT_RGB565                  = E_MS_FMT_RGB565,
465     // color format ORGB1555
466     GFX_FMT_ARGB1555                = E_MS_FMT_ARGB1555,
467     // color format ARGB4444
468     GFX_FMT_ARGB4444                = E_MS_FMT_ARGB4444,
469     // color format for blinking display format
470     // Uranus GOP does NOT support this blinking format
471     // GE_FMT_1BAAFGBG123433       = 0xb,
472     // @FIXME: Venus does not have this color format. Need to take care of it.
473     /// color format ARGB1555 DST
474     GFX_FMT_ARGB1555_DST            = E_MS_FMT_ARGB1555_DST,
475     /// color format YUV422
476     GFX_FMT_YUV422                  = E_MS_FMT_YUV422,
477     /// color format ARGB8888
478     GFX_FMT_ARGB8888                = E_MS_FMT_ARGB8888,
479     /// color format RGBA5551
480     GFX_FMT_RGBA5551                = E_MS_FMT_RGBA5551,
481      /// color format RGBA4444
482     GFX_FMT_RGBA4444               = E_MS_FMT_RGBA4444,
483     /// color format ABGR8888
484     GFX_FMT_ABGR8888                = E_MS_FMT_ABGR8888,
485     /// New Color Format
486     /// color format BGRA5551
487     GFX_FMT_BGRA5551               = E_MS_FMT_BGRA5551,
488     /// color format ABGR1555
489     GFX_FMT_ABGR1555               = E_MS_FMT_ABGR1555,
490     /// color format ABGR4444
491     GFX_FMT_ABGR4444               = E_MS_FMT_ABGR4444,
492     /// color format BGRA4444
493     GFX_FMT_BGRA4444               = E_MS_FMT_BGRA4444,
494     /// color format BGR565
495     GFX_FMT_BGR565               = E_MS_FMT_BGR565,
496     /// color format RGBA8888
497     GFX_FMT_RGBA8888               = E_MS_FMT_RGBA8888,
498     /// color format RGBA8888
499     GFX_FMT_BGRA8888               = E_MS_FMT_BGRA8888,
500 } GFX_Buffer_Format;
501 
502 ///Define RGB2YUV conversion formula
503 typedef enum
504 {
505     GFX_YUV_OP1            ,  // GFX_YUV_Rgb2Yuv
506     GFX_YUV_OP2            ,  // GFX_YUV_OutRange
507     GFX_YUV_OP3            ,  // GE_YUV_InRange
508     GFX_YUV_OP4            ,  // GFX_YUV_422
509 } GFX_YUV_OpType;
510 
511 ///Define RGB2YUV conversion formula
512 typedef enum
513 {
514     GFX_YUV_RGB2YUV_PC             = 0,
515     GFX_YUV_RGB2YUV_255            = 1,
516 
517 } GFX_YUV_Rgb2Yuv;
518 
519 ///Define output YUV color domain
520 typedef enum
521 {
522     GFX_YUV_OUT_255                = 0,
523     GFX_YUV_OUT_PC                 = 1,
524 
525 } GFX_YUV_OutRange;
526 
527 ///Define input YUV color domain
528 typedef enum
529 {
530     GFX_YUV_IN_255                 = 0,
531     GFX_YUV_IN_127                 = 1,
532 
533 } GFX_YUV_InRange;
534 
535 ///Define YOU 422 format
536 typedef enum
537 {
538     GFX_YUV_YVYU                   = 0,
539     GFX_YUV_YUYV                   = 1,
540     GFX_YUV_VYUY                   = 2,
541     GFX_YUV_UYVY                   = 3,
542 
543 } GFX_YUV_422;
544 
545 ///Define paramter for YUV operation
546 typedef struct
547 {
548     GFX_YUV_Rgb2Yuv                  rgb2yuv;
549     GFX_YUV_OutRange                 out_range;
550     GFX_YUV_InRange                  in_range;
551     GFX_YUV_422                      dst_fmt;
552     GFX_YUV_422                      src_fmt;
553 } GFX_YUVMode;
554 
555 
556 //-------------------------------------------------
557 /// Define Virtual Command Buffer Size
558 typedef enum
559 {
560     /// 4K
561     GFX_VCMD_4K = 0,
562     /// 8K
563     GFX_VCMD_8K = 1,
564     /// 16K
565     GFX_VCMD_16K = 2,
566     /// 32K
567     GFX_VCMD_32K = 3,
568     /// 64K
569     GFX_VCMD_64K = 4,
570     /// 128K
571     GFX_VCMD_128K = 5,
572     /// 256K
573     GFX_VCMD_256K = 6,
574     /// 512K
575     GFX_VCMD_512K = 7,
576     /// 1024k
577     GFX_VCMD_1024K = 8,
578 } GFX_VcmqBufSize;
579 
580 
581 
582 //-------------------------------------------------
583 /// Define RGB color in LE
584 typedef struct
585 {
586     /// Blue
587     MS_U8 b;
588     /// Green
589     MS_U8 g;
590     /// Red
591     MS_U8 r;
592     /// Alpha
593     MS_U8 a;
594 } GFX_RgbColor;
595 
596 /// Define YUV color
597 typedef struct
598 {
599     MS_U32         Y:8;
600     MS_U32         U:4;
601     MS_U32         V:4;
602 } GFX_YuvColor;
603 
604 
605 /// General GFX color type, union of rgb and yuv color.
606 typedef struct{
607     union{
608         GFX_RgbColor    rgb;
609         GFX_YuvColor    yuv;
610     };
611 } GFX_Color;
612 
613 //-------------------------------------------------
614 /// Define the start color & end color
615 typedef struct
616 {
617     /// start color
618     GFX_RgbColor color_s;
619     /// end color
620     GFX_RgbColor color_e;
621 } GFX_ColorRange;
622 
623 //-------------------------------------------------
624 /// Define the position of one point.
625 typedef struct
626 {
627     /// X address
628     MS_U16 x;
629     /// Y address
630     MS_U16 y;
631 } GFX_Point;
632 
633 //-------------------------------------------------
634 /// Specify the blink data
635         //          1 A B Fg Bg
636         //          1 2 3  5  5
637 typedef struct
638 {
639     /// BG color (for blink mode use)
640     MS_U8                  background;             // 5 bits
641     /// FG color (for blink mode use)
642     MS_U8                  foreground;             // 5 bits
643     /// Control flag\n
644     union{
645         MS_U16             ctrl_flag;
646         struct{
647             MS_U16         Blink:3;                // 3 bits
648             MS_U16         Alpha:2;                // 2 bits
649             MS_U16         blink_en:1;
650             MS_U16         reserved1:10;
651         } Bits;
652         struct{
653             MS_U16 BlinkAlpha:4;
654             MS_U16 Alpha:2;
655             MS_U16 Blink:3;
656             MS_U16 reserved:7;
657         }Bits2;
658         struct{
659             MS_U16 Fa:2;
660             MS_U16 Ba:2;
661             MS_U16 reserved:12;
662 
663         }Bits3;
664     };
665 
666 
667 } GFX_BlinkData;
668 
669 
670 /// Define the start blink color & end blink color.
671 typedef struct
672 {
673     /// start blink color
674     GFX_BlinkData blink_data_s;
675     /// end blink color
676     GFX_BlinkData blink_data_e;
677 } GFX_BlinkDataRange;
678 
679 //-------------------------------------------------
680 //-------------------------------------------------
681 #define GFXLINE_FLAG_COLOR_CONSTANT     0x00UL
682 #define GFXLINE_FLAG_COLOR_GRADIENT     0x01UL
683 
684 /// Define the attribute of line.
685 typedef struct
686 {
687     /// start X address
688     MS_U16 x1;
689     /// Start Y address
690     MS_U16 y1;
691     /// End X address
692     MS_U16 x2;
693     /// End Y address
694     MS_U16 y2;
695     /// Color format
696     GFX_Buffer_Format fmt;
697     union
698     {
699         /// Color
700         ///For all RGB color, the color set as the ARGB8888 format.\n
701         ///Each color component need to shift to high bit.\n
702         ///Use ARGB1555 as the example, the source color key as the following:\n
703         ///ARGB1555  --> ARRRRRGGGGGBBBBB                   (every character represents one bit)\n
704         ///colorRange.color_s --> A0000000RRRRR000GGGGG000BBBBB000   (every character represents one bit)\n\n
705         ///For GFX_FMT_I8 format, the index set to b component (colorRange.color_s.b = b).\n
706         GFX_ColorRange       colorRange;
707         ///Blink attribute
708         ///For GFX_FMT_1BAAFGBG123433 foramt, the foramt set as the GFX_BlinkData.\n
709         GFX_BlinkDataRange  blkDataRange;
710     };
711     /// Line width
712     MS_U32 width;
713     /// GFXLINE_FLAG_COLOR_CONSTANT: Constant color\n
714     /// GFXLINE_FLAG_COLOR_GRADIENT: Gradient color
715     MS_U32 flag;
716 
717 } GFX_DrawLineInfo;
718 
719 //-------------------------------------------------
720 
721 /// Define the dimension of one block
722 typedef struct
723 {
724     /// X start address
725     MS_U16 x;
726     /// Y start address
727     MS_U16 y;
728     /// width
729     MS_U16 width;
730     /// height
731     MS_U16 height;
732 } GFX_Block;
733 
734 /*******************************************************************
735 // Define the Trapezoid                                            *
736 // [u16X0, u16Y0]: The Left point of top of Trapezoid;             *
737 // [u16X1, u16Y1]: The Left point of bottom of Trapezoid;          *
738 // [u16DeltaTop]: The Width of top of Trapezoid;                   *
739 // [u16DeltaBottom]: The Width of bottom of Trapezoid;             *
740 // To Simplify, For DIRECTION_X: u16Y0 < u16Y1                     *
741 // To Simplify, For DIRECTION_Y: u16X0 > u16X1                     *
742 ********************************************************************/
743 typedef struct
744 {
745     /// x0 start address
746     MS_U16                          u16X0;
747     /// y0 start address
748     MS_U16                          u16Y0;
749     /// x1 start address
750     MS_U16                          u16X1;
751     /// y1 start address
752     MS_U16                          u16Y1;
753     /// delta of Top
754     MS_U16                          u16DeltaTop;
755     // delta of Bottom
756     MS_U16                          u16DeltaBottom;
757 } GFX_Trapezoid;
758 
759 //-------------------------------------------------
760 
761 #define GFXRECT_FLAG_COLOR_CONSTANT     0x0UL
762 #define GFXRECT_FLAG_COLOR_GRADIENT_X   0x1UL
763 #define GFXRECT_FLAG_COLOR_GRADIENT_Y   0x2UL
764 #define GFXRECT_FLAG_TRAPE_DIRECTION_X  0x4UL //excluded with GFXRECT_FLAG_TRAPE_DIRECTION_Y
765 #define GFXRECT_FLAG_TRAPE_DIRECTION_Y  0x8UL //excluded with GFXRECT_FLAG_TRAPE_DIRECTION_X
766 
767 /// Define the info. of one block.
768 typedef struct
769 {
770     /// dst block info
771     union
772     {
773         GFX_Block       dstBlock;
774         GFX_Trapezoid   dstTrapezoidBlk;
775     };
776     /// Color format
777     GFX_Buffer_Format fmt;
778     union
779     {
780         /// Color
781         ///For all RGB color, the color set as the ARGB8888 format.\n
782         ///Each color component need to shift to high bit.\n
783         ///Use ARGB1555 as the example, the source color key as the following:\n
784         ///ARGB1555  --> ARRRRRGGGGGBBBBB                   (every character represents one bit)\n
785         ///color_s   --> A0000000RRRRR000GGGGG000BBBBB000   (every character represents one bit)\n\n
786         ///For GFX_FMT_I8 format, the index set to b component (colorRange.color_s.b = b).\n
787         GFX_ColorRange       colorRange;
788         ///Blink attribute
789         ///For GFX_FMT_1BAAFGBG123433 foramt, the foramt set as the GFX_BlinkData.\n
790         GFX_BlinkDataRange  blkDataRange;
791     };
792 
793     /// GERECT_FLAG_COLOR_CONSTANT: Constant color\n
794     /// GERECT_FLAG_COLOR_GRADIENT_X: X direction gradient color\n
795     /// GERECT_FLAG_COLOR_GRADIENT_Y: Y direction gradient color\n
796     /// GFXRECT_FLAG_TRAPE_DIRECTION_X: for trapezoid, top & bottom in X direction parallel, excluded with GFXRECT_FLAG_TRAPE_DIRECTION_Y\n
797     /// GFXRECT_FLAG_TRAPE_DIRECTION_Y: for trapezoid, top & bottom in Y direction parallel, excluded with GFXRECT_FLAG_TRAPE_DIRECTION_X\n
798     MS_U32 flag;
799 
800 } GFX_RectFillInfo;
801 
802 /// Define structure for OVAL drawing.
803 typedef struct
804 {
805     /// dst block info
806     GFX_Block       dstBlock;
807     /// Color format
808     GFX_Buffer_Format fmt;
809     union{
810         GFX_RgbColor color;
811         GFX_BlinkData blink_data;
812     };
813     MS_U32 u32LineWidth;
814 } GFX_OvalFillInfo;
815 
816 typedef struct {
817      int            x0;  /* X coordinate of first edge */
818      int            y0;  /* Y coordinate of first edge */
819      int            x1;  /* X coordinate of second edge */
820      int            y1;  /* Y coordinate of second edge */
821      int            x2;  /* X coordinate of third edge */
822      int            y2;  /* Y coordinate of third edge */
823 } GFX_Triangle;
824 
825 typedef struct
826 {
827     GFX_Triangle tri;
828     GFX_Block    clip_box;
829     GFX_Buffer_Format fmt;
830     union
831     {
832         /// Color
833         ///For all RGB color, the color set as the ARGB8888 format.\n
834         ///Each color component need to shift to high bit.\n
835         ///Use ARGB1555 as the example, the source color key as the following:\n
836         ///ARGB1555  --> ARRRRRGGGGGBBBBB                   (every character represents one bit)\n
837         ///color_s   --> A0000000RRRRR000GGGGG000BBBBB000   (every character represents one bit)\n\n
838         ///For GFX_FMT_I8 format, the index set to b component (colorRange.color_s.b = b).\n
839         GFX_ColorRange       colorRange;
840         ///Blink attribute
841         ///For GFX_FMT_1BAAFGBG123433 foramt, the foramt set as the GFX_BlinkData.\n
842         GFX_BlinkDataRange  blkDataRange;
843     };
844 
845     /// GERECT_FLAG_COLOR_CONSTANT: Constant color\n
846     /// GERECT_FLAG_COLOR_GRADIENT_X: X direction gradient color\n
847     /// GERECT_FLAG_COLOR_GRADIENT_Y: Y direction gradient color\n
848     /// GFXRECT_FLAG_TRAPE_DIRECTION_X: for trapezoid, top & bottom in X direction parallel, excluded with GFXRECT_FLAG_TRAPE_DIRECTION_Y\n
849     /// GFXRECT_FLAG_TRAPE_DIRECTION_Y: for trapezoid, top & bottom in Y direction parallel, excluded with GFXRECT_FLAG_TRAPE_DIRECTION_X\n
850     MS_U32 flag;
851 } GFX_TriFillInfo;
852 
853 typedef struct {
854     int            x;   /* X coordinate */
855     int            w;   /* width of span */
856 } Span;
857 
858 typedef struct {
859      int y;
860      Span *spans;
861      int num_spans;
862 } GFX_Span;
863 
864 typedef struct
865 {
866     GFX_Span     span;
867     GFX_Block    clip_box;
868     GFX_Buffer_Format fmt;
869     union
870     {
871         /// Color
872         ///For all RGB color, the color set as the ARGB8888 format.\n
873         ///Each color component need to shift to high bit.\n
874         ///Use ARGB1555 as the example, the source color key as the following:\n
875         ///ARGB1555  --> ARRRRRGGGGGBBBBB                   (every character represents one bit)\n
876         ///color_s   --> A0000000RRRRR000GGGGG000BBBBB000   (every character represents one bit)\n\n
877         ///For GFX_FMT_I8 format, the index set to b component (colorRange.color_s.b = b).\n
878         GFX_ColorRange       colorRange;
879         ///Blink attribute
880         ///For GFX_FMT_1BAAFGBG123433 foramt, the foramt set as the GFX_BlinkData.\n
881         GFX_BlinkDataRange  blkDataRange;
882     };
883 
884     /// GERECT_FLAG_COLOR_CONSTANT: Constant color\n
885     /// GERECT_FLAG_COLOR_GRADIENT_X: X direction gradient color\n
886     /// GERECT_FLAG_COLOR_GRADIENT_Y: Y direction gradient color\n
887     /// GFXRECT_FLAG_TRAPE_DIRECTION_X: for trapezoid, top & bottom in X direction parallel, excluded with GFXRECT_FLAG_TRAPE_DIRECTION_Y\n
888     /// GFXRECT_FLAG_TRAPE_DIRECTION_Y: for trapezoid, top & bottom in Y direction parallel, excluded with GFXRECT_FLAG_TRAPE_DIRECTION_X\n
889     MS_U32 flag;
890 } GFX_SpanFillInfo;
891 
892 //-------------------------------------------------
893 #define GFXFONT_FLAG_DEFAULT            0x0UL
894 #define GFXFONT_FLAG_ITALIC             0x1UL
895 #define GFXFONT_FLAG_SCALE              0x2UL
896 #define GFXFONT_FLAG_COMPACT            0x4UL
897 #define GFXFONT_FLAG_BACKGROUND         0x8UL
898 #define GFXFONT_FLAG_BLINK              0x10UL
899 #define GFXFONT_FLAG_VARWIDTH           0x20UL
900 #define GFXFONT_FLAG_GAP                0x40UL
901 #define GFXFONT_FLAG_BOLD               0x80UL
902 
903 /// Define font overlap info.
904 typedef struct
905 {
906     MS_S8 s8Xoffset;         ///
907     MS_S8 s8Yoffset;
908 } GFX_GlyphOverlapInfo;
909 
910 /// Glyph display information
911 typedef struct
912 {
913     MS_U8  u8X0;               ///< Left position to display
914     MS_U8  u8Width;            ///< Width of the glyph to display
915     MS_U16 u16Index;           ///< Glyph index in the font table
916     GFX_GlyphOverlapInfo overlap_info;
917 } GFX_GlyphDispInfo;
918 
919 
920 
921 
922 /// Font format
923 typedef struct
924 {
925     /// GEFONT_FLAG_DEFAULT: Default font format\n
926     /// GEFONT_FLAG_SCALE: scalable font\n
927     /// GEFONT_FLAG_COMPACT: Compact font\n
928     /// GEFONT_FLAG_GAP: Gap font\n
929     /// GEFONT_FLAG_VARIABLE_WIDTH: Variable font width, depend on horizontal font length.
930     MS_U32 flag;
931 
932     /// dst block first character position , and each character width , height
933     GFX_Block  dstblk;
934 
935     /// set compact distant(take indent effect) when GEFONT_FLAG_COMPACT is set
936     MS_U16 dis;
937     MS_U16 gap;
938 
939     GFX_GlyphDispInfo *pGlyphDispInfo;
940 
941     union{
942         MS_U32  u32data;
943         GFX_RgbColor color;
944         GFX_BlinkData blink_data;
945     };
946 
947 } GFX_TextOutInfo;
948 
949 
950 /// Define blink type for blinking data
951 typedef enum
952 {
953     GEBLINK_NONE = 0x0,
954     GEBLINK_BACKGROUND,
955     GEBLINK_FOREGROUND,
956     GEBLINK_BOTH,
957 } GFX_BlinkType;
958 
959 // Define write protect type
960 typedef enum
961 {
962     GFX_WP_IN_RANGE                = 0,
963     GFX_WP_OUT_RANGE               = 1,
964     GFX_WP_DISABLE                 = 0xFF,
965 
966 } GFX_WPType;
967 
968 /// Bounding box (BBox) of a glyph
969 typedef struct
970 {
971     MS_U8  u8X0;       ///< Position of the left edge of the bounding box
972     MS_U8  u8Width;    ///< Width of the bounding box
973     MS_U8  u8Y0;       ///< Position of the top edge of the bounding box
974     MS_U8  u8Height;   ///< Height of the bounding box
975 } GFX_GlyphBbox;
976 
977 /// X-direction information of the bounding box of a glyph
978 typedef struct
979 {
980     MS_U8  u8X0;       ///< Position of the left edge of the bounding box
981     MS_U8  u8Width;    ///< Width of the bounding box
982 } GFX_GlyphBbox_X;
983 
984 /// Y-direction information of the bounding box of a glyph
985 typedef struct
986 {
987     MS_U8  u8Y0;       ///< Position of the top edge of the bounding box
988     MS_U8  u8Height;   ///< Height of the bounding box
989 } GFX_GlyphBbox_Y;
990 
991 
992 /// Define structure for color delta (Gradient color)
993 typedef struct
994 {
995     MS_U8 flag;
996     MS_U32 delta_r;
997     MS_U32 delta_g;
998     MS_U32 delta_b;
999 } GFX_GFX_ColorDelta;
1000 
1001 
1002 //-------------------------------------------------
1003 /// Specify the attribute of a bitmap
1004 typedef struct
1005 {
1006     /// Do scaling operation
1007     MS_BOOL bScale;
1008     /// X start address
1009     MS_U16 x;
1010     /// Y start address
1011     MS_U16 y;
1012     /// width
1013     MS_U16 width;
1014     /// height
1015     MS_U16 height;
1016 } GFX_DrawBmpInfo;
1017 
1018 
1019 //-------------------------------------------------
1020 /// Define rotation angle
1021 typedef enum
1022 {
1023     /// Do not rotate
1024     GEROTATE_0,
1025     /// Rotate 90 degree
1026     GEROTATE_90,
1027     /// Rotate 180 degree
1028     GEROTATE_180,
1029     /// Rotate 270 degree
1030     GEROTATE_270,
1031 } GFX_RotateAngle;
1032 
1033 //=============================================================================
1034 // Font information
1035 //=============================================================================
1036 #if 0
1037 /// Bounding box (BBox) of a glyph
1038 typedef struct
1039 {
1040     ///Position of the left edge of the bounding box
1041     MS_U8  u8X0;
1042     ///Width of the bounding box
1043     MS_U8  u8Width;
1044     ///Position of the top edge of the bounding box
1045     MS_U8  u8Y0;
1046     ///Height of the bounding box
1047     MS_U8  u8Height;
1048 }GFX_GFX_GLYPH_BBOX;
1049 #endif
1050 
1051 /// define character information
1052 typedef struct
1053 {
1054     /// Character start address (128 bits alignment)
1055     MS_PHY addr;
1056     /// Character width
1057     MS_U32 width;
1058     /// Character pitch
1059     MS_U32 pitch;
1060     /// Character height
1061     MS_U32 height;
1062     /// Character horizontal offset
1063     MS_U32 Hoffset;
1064     /// Character vertical offset
1065     MS_U32 Voffset;
1066     /// Character format
1067     GFX_Buffer_Format fmt;
1068 } GFX_CharInfo;
1069 
1070 /// Define font table information
1071 typedef struct
1072 {
1073     /// font start address
1074     MS_PHY addr;
1075     /// font length
1076     MS_U32 len;
1077     /// font structure is used
1078     MS_BOOL inUsed;
1079     /// character width (pixel unit)
1080     MS_U32 width;
1081     /// character pitch (byte unit)
1082     MS_U32 pitch;
1083     /// character height (pixel unit)
1084     MS_U32 height;
1085     /// one character length (byte unit)
1086     MS_U32 offset;
1087     /// Bounding Box offset
1088     GFX_GlyphBbox* pBBox;
1089     /// font format
1090     GFX_Buffer_Format fmt;
1091 } GFX_FontInfo;
1092 
1093 
1094 //=============================================================================
1095 // Bitmap information
1096 //=============================================================================
1097 typedef struct
1098 {
1099     MS_PHY addr;       // flat address of whole memory map
1100     MS_U32 len;
1101     MS_BOOL inUsed;
1102     MS_U32 width;
1103     MS_U32 pitch;
1104     MS_U32 height;
1105     GFX_Buffer_Format fmt;
1106 } GFX_BitmapInfo;
1107 
1108 
1109 //=============================================================================
1110 // Draw Rect info
1111 //=============================================================================
1112 /// Define the bitblt source & destination block.
1113 typedef struct
1114 {
1115     /// Source block
1116     GFX_Block srcblk;
1117 
1118     /// Destination block
1119     union
1120     {
1121         GFX_Trapezoid dsttrapeblk;
1122         GFX_Block dstblk;
1123     };
1124 }GFX_DrawRect;
1125 
1126 /// Define the bitblt two source & destination block.
1127 typedef struct
1128 {
1129     /// Source block
1130     GFX_Block srcblk0;
1131     // Attendtion, width and height of srcblk1 must be the same as dstblk
1132     GFX_Block srcblk1;
1133     /// Destination block
1134     GFX_Block dstblk;
1135 }GFX_DrawTwoSourceRect;
1136 
1137 
1138 /// Define the scaling factor for X & Y direction.
1139 typedef struct
1140 {
1141     MS_U32 u32DeltaX;
1142     MS_U32 u32DeltaY;
1143     MS_U32 u32InitDelatX;
1144     MS_U32 u32InitDelatY;
1145 }GFX_ScaleInfo;
1146 
1147 //=============================================================================
1148 // Data Buffer info
1149 //=============================================================================
1150 /// Data buffer info.
1151 typedef struct
1152 {
1153     /// start memory address
1154     MS_PHY u32Addr;       // flat address of whole memory map
1155     /// width
1156     MS_U32 u32Width;
1157     /// height
1158     MS_U32 u32Height;
1159     /// pitch
1160     MS_U32 u32Pitch;
1161     /// Color format\n
1162     /// - GFX_FMT_I1\n
1163     /// - GFX_FMT_I2\n
1164     /// - GFX_FMT_I4\n
1165     /// - GFX_FMT_I8\n
1166     /// - GFX_FMT_RGB565\n
1167     /// - GFX_FMT_ARGB1555\n
1168     /// - GFX_FMT_ARGB4444\n
1169     /// - GFX_FMT_1BAAFGBG123433\n
1170     /// - GFX_FMT_ARGB8888\n
1171     GFX_Buffer_Format u32ColorFmt;
1172 } GFX_BufferInfo;
1173 
1174 /// Define the GFX init parameter.
1175 typedef struct
1176 {
1177     MS_U8                           u8Miu;
1178     MS_U8                           u8Dither;
1179     MS_U32                          u32VCmdQSize;                       /// MIN:4K, MAX:512K, <MIN:Disable
1180     MS_PHY                          u32VCmdQAddr;                       //  8-byte aligned
1181     MS_BOOL                         bIsHK;                              /// Running as HK or Co-processor
1182     MS_BOOL                         bIsCompt;                           /// Running as compatible mode. In compatible mode, the parameter checking loose for NOS APP compatibility.  TRUE=>compatible with 51/Chakra , FALSE=>linux OS style
1183 }GFX_Config;
1184 
1185 /// GE dbg info
1186 typedef struct
1187 {
1188     /// Specified format
1189     MS_U8                       verctrl[32];
1190     /// Specified format
1191     MS_U8                       gedump[256];
1192     /// Base alignment in byte unit
1193     MS_U32                      semstaus;
1194 } GFX_DbgInfo;
1195 
1196 
1197 typedef GFX_BufferInfo* PGFX_BufferInfo;
1198 
1199 
1200 
1201 //=============================================================================
1202 // GE palette information
1203 //=============================================================================
1204 
1205 typedef union
1206 {
1207     /// ARGB8888
1208     struct
1209     {
1210         MS_U8 u8A;
1211         MS_U8 u8R;
1212         MS_U8 u8G;
1213         MS_U8 u8B;
1214     } RGB;
1215     // 32-bit direct access.
1216     MS_U8 u8Data[4];
1217 } GFX_PaletteEntry;
1218 
1219 
1220 
1221 #define GFXDRAW_FLAG_DEFAULT            0x0UL
1222 #define GFXDRAW_FLAG_SCALE              0x1UL
1223 #define GFXDRAW_FLAG_DUPLICAPE          0x2UL
1224 #define GFXDRAW_FLAG_TRAPEZOID_X        0x4UL // excluded with GFXDRAW_FLAG_TRAPEZOID_Y
1225 #define GFXDRAW_FLAG_TRAPEZOID_Y        0x8UL // excluded with GFXDRAW_FLAG_TRAPEZOID_X
1226 
1227 //#define FB_FMT_AS_DEFAULT               0xFFFF
1228 
1229 //=============================================================================
1230 // YUV color setting
1231 //=============================================================================
1232 typedef MS_U8                           GFX_Rgb2yuvMode;
1233 #define GFX_RGB2YUV_PC_MODE             ((GFX_Rgb2yuvMode)0x0UL)          // computer mode Y: 16~ 235, UV: 0~ 240
1234 #define GFX_RGB2YUV_255_MODE            ((GFX_Rgb2yuvMode)0x1UL)          // To 0~ 255
1235 
1236 typedef MS_U8                           GFX_YuvRangeOut;
1237 #define GFX_YUV_RANGE_OUT_255           ((GFX_YuvRangeOut)0x0UL)         // To 0~ 255
1238 #define GFX_YUV_RANGE_OUT_PC            ((GFX_YuvRangeOut)0x1UL)         // To Y: 16~ 235
1239 
1240 typedef MS_U8                           GFX_YuvRangeIn;
1241 #define GFX_YUV_RANGE_IN_255            ((GFX_YuvRangeIn)0x0UL)          // UV input range, 0~ 255
1242 #define GFX_YUV_RANGE_IN_127            ((GFX_YuvRangeIn)0x1UL)          // UV input range, -128~ 127
1243 
1244 typedef MS_U8                           GFX_Yuv422Fmt;
1245 #define GFX_YUV_422_FMT_UY1VY0          ((GFX_Yuv422Fmt)0x00UL)          // CbY1CrY0
1246 #define GFX_YUV_422_FMT_VY1UY0          ((GFX_Yuv422Fmt)0x01UL)          // CrY1CbY0
1247 #define GFX_YUV_422_FMT_Y1UY0V          ((GFX_Yuv422Fmt)0x02UL)          // Y1CbY0Cr
1248 #define GFX_YUV_422_FMT_Y1VY0U          ((GFX_Yuv422Fmt)0x03UL)          // Y1CrY0Cb
1249 
1250 /// Pack of YUV CSC info
1251 typedef struct
1252 {
1253     GFX_Rgb2yuvMode                     rgb2yuv_mode;
1254     GFX_YuvRangeOut                    yuv_range_out;
1255     GFX_YuvRangeIn                     yuv_range_in;
1256     GFX_Yuv422Fmt                      yuv_mem_fmt_src;
1257     GFX_Yuv422Fmt                      yuv_mem_fmt_dst;
1258 } GFX_YuvInfo;
1259 
1260 //-------------------------------------------------
1261 /// Define Stretch Bitblt with Color Key Type
1262 typedef enum
1263 {
1264     /// Do nothing
1265     GFX_DONOTHING = 0,
1266     /// Nearest When the Color Key happened
1267     GFX_NEAREST = 1,
1268     /// Replace the Key to Custom Color
1269     GFX_REPLACE_KEY_2_CUS = 2,
1270 } GFX_StretchCKType;
1271 
1272 //-------------------------------------------------
1273 /// Define DFB Blending Related:
1274 #define GFX_DFB_BLD_FLAG_COLORALPHA             0x0001UL
1275 #define GFX_DFB_BLD_FLAG_ALPHACHANNEL           0x0002UL
1276 #define GFX_DFB_BLD_FLAG_COLORIZE               0x0004UL
1277 #define GFX_DFB_BLD_FLAG_SRCPREMUL              0x0008UL
1278 #define GFX_DFB_BLD_FLAG_SRCPREMULCOL           0x0010UL
1279 #define GFX_DFB_BLD_FLAG_DSTPREMUL              0x0020UL
1280 #define GFX_DFB_BLD_FLAG_XOR                    0x0040UL
1281 #define GFX_DFB_BLD_FLAG_DEMULTIPLY             0x0080UL
1282 #define GFX_DFB_BLD_FLAG_SRCALPHAMASK           0x0100UL
1283 #define GFX_DFB_BLD_FLAG_SRCCOLORMASK           0x0200UL
1284 #define GFX_DFB_BLD_FLAG_ALL                    0x03FFUL
1285 
1286 typedef enum
1287 {
1288     GFX_DFB_BLD_OP_ZERO                 = 0,
1289     GFX_DFB_BLD_OP_ONE                  = 1,
1290     GFX_DFB_BLD_OP_SRCCOLOR             = 2,
1291     GFX_DFB_BLD_OP_INVSRCCOLOR          = 3,
1292     GFX_DFB_BLD_OP_SRCALPHA             = 4,
1293     GFX_DFB_BLD_OP_INVSRCALPHA          = 5,
1294     GFX_DFB_BLD_OP_DESTALPHA            = 6,
1295     GFX_DFB_BLD_OP_INVDESTALPHA         = 7,
1296     GFX_DFB_BLD_OP_DESTCOLOR            = 8,
1297     GFX_DFB_BLD_OP_INVDESTCOLOR         = 9,
1298     GFX_DFB_BLD_OP_SRCALPHASAT          = 10,
1299 }GFX_DFBBldOP;
1300 
1301 //=============================================================================
1302 // GFX format capability setting
1303 //=============================================================================
1304 ///Define Buffer Usage Type
1305 typedef enum
1306 {
1307     /// Desitination buffer for LINE, RECT, BLT
1308     E_GFX_BUF_DST                    = 0,
1309     /// Source buffer for BLT
1310     E_GFX_BUF_SRC                    = 1,
1311 } EN_GFX_BUF_TYPE;
1312 
1313 /// Define gfx format capability type
1314 typedef enum
1315 {
1316     E_GFX_FMT_CAP_NONE = 0x0,
1317     E_GFX_FMT_CAP_MULTI_PIXEL,
1318 } EN_GFX_FMT_CAPS_TYPE;
1319 
1320 typedef struct
1321 {
1322     /// Color format\n
1323     /// - GFX_FMT_I1\n
1324     /// - GFX_FMT_I2\n
1325     /// - GFX_FMT_I4\n
1326     /// - GFX_FMT_I8\n
1327     /// - GFX_FMT_RGB565\n
1328     /// - GFX_FMT_ARGB1555\n
1329     /// - GFX_FMT_ARGB4444\n
1330     /// - GFX_FMT_1BAAFGBG123433\n
1331     /// - GFX_FMT_ARGB8888\n
1332     GFX_Buffer_Format    u32ColorFmt;
1333     EN_GFX_BUF_TYPE      eBufferType;
1334     EN_GFX_FMT_CAPS_TYPE eFmtCapsType;
1335     MS_U8                u8BaseAlign;
1336     MS_U8                u8PitchAlign;
1337 }GFX_FmtAlignCapsInfo;
1338 
1339 //=============================================================================
1340 // GFX capability setting
1341 //=============================================================================
1342 
1343 //GFX Capability
1344 typedef enum
1345 {
1346     E_GFX_CAP_MULTI_PIXEL,
1347     E_GFX_CAP_BLT_DOWN_SCALE,
1348     E_GFX_CAP_DFB_BLENDING,
1349     E_GFX_CAP_ALIGN,
1350     E_GFX_CAP_TLB,
1351 }EN_GFX_CAPS;
1352 
1353 ///GFX Capability MultiPixel Info
1354 typedef struct
1355 {
1356     MS_U16  WordUnit;
1357     MS_BOOL bSupportMultiPixel;
1358 }GFX_CapMultiPixelInfo;
1359 
1360 ///GFX Capability Bitblt down scale Info
1361 typedef struct
1362 {
1363     /// Bitblt down scale range start
1364     MS_U8 u8RangeMax;
1365     /// Bitblt down scale range end
1366     MS_U8 u8RangeMin;
1367     /// Bitblt down scale continuous range end
1368     MS_U8 u8ContinuousRangeMin;
1369     /// Is full range support down scaling.
1370     /// - TRUE: The down scale value between u8RangeMax to u8RangeMin is fully supported.
1371     /// - FALSE: The down scale value between u8RangeMax to u8ContinuousRangeMin is fully supported.
1372     ///          The down scale value between u8ContinuousRangeMin to u8RangeMin is supported
1373     ///          if the value is power of two (e.g., 4, 8, 16, and 32).
1374     MS_BOOL bFullRangeSupport;
1375 }GFX_BLT_DownScaleInfo;
1376 
1377 //GFX TLB Mode
1378 typedef enum
1379 {
1380     /// TLB for None
1381     E_GFX_TLB_NONE = 0x0000,
1382     /// TLB for Source
1383     E_GFX_TLB_SRC = 0x0001,
1384     /// TLB for Destination
1385     E_GFX_TLB_DST = 0x0002,
1386     /// TLB for Source and Destination
1387     E_GFX_TLB_SRC_DST = 0x0003,
1388 }EN_GFX_TLB_Mode;
1389 
1390 //-----------------------------------------------------------------------------
1391 //  Functions
1392 //-----------------------------------------------------------------------------
1393 //-----------------
1394 // GFX_INIT
1395 //-----------------
1396 //-------------------------------------------------------------------------------------------------
1397 /// Initialize GFX module.
1398 /// @ingroup GFX_INIT
1399 /// @param  geConfig             \b IN: init config
1400 /// @return void
1401 //-------------------------------------------------------------------------------------------------
1402 DLL_PUBLIC extern void MApi_GFX_Init(GFX_Config *geConfig);
1403 
1404 
1405 //-----------------
1406 // GFX_ToBeRemove
1407 //-----------------
1408 //-------------------------------------------------------------------------------------------------
1409 /// MApi_GFX_GetFontInfo
1410 /// @ingroup GFX_ToBeRemove
1411 /// @return GFX_SUCCESS         - Success
1412 /// @return GFX_FAIL            - Failure
1413 //-------------------------------------------------------------------------------------------------
1414 // DLL_PUBLIC extern GFX_Result MApi_GFX_GetFontInfo(MS_S32 handle, GFX_FontInfo* pinfo);
1415 
1416 //-------------------------------------------------------------------------------------------------
1417 /// Get clip window
1418 /// @ingroup GFX_CLIP
1419 /// @param  v0                  \b IN: left-top point
1420 /// @param  v1                  \b IN: right-down point
1421 /// @return GFX_SUCCESS         - Success
1422 /// @return GFX_FAIL            - Failure
1423 //-------------------------------------------------------------------------------------------------
1424 DLL_PUBLIC extern GFX_Result MApi_GFX_GetClip(GFX_Point* v0, GFX_Point* v1);
1425 
1426 //-------------------------------------------------------------------------------------------------
1427 /// Get I2 I4 palette
1428 /// @ingroup GFX_PALETTE
1429 /// @param  id                  \b IN: index
1430 /// @param  pColor              \b IN: color
1431 /// @return GFX_SUCCESS         - Success
1432 /// @return GFX_FAIL            - Failure
1433 //-------------------------------------------------------------------------------------------------
1434 DLL_PUBLIC extern GFX_Result MApi_GFX_GetIntensity(MS_U32 idx, MS_U32 *color);
1435 //-------------------------------------------------------------------------------------------------
1436 /// Get tag
1437 /// @ingroup GFX_WAIT_DONE
1438 /// @param  tagID                  \b IN: tag
1439 /// @return GFX_SUCCESS         - Success
1440 /// @return GFX_FAIL            - Failure
1441 //-------------------------------------------------------------------------------------------------
1442 // DLL_PUBLIC extern GFX_Result MApi_GFX_GetTAGID(MS_U16 *tagID);
1443 
1444 //-------------------------------------------------------------------------------------------------
1445 /// Get next tag
1446 /// @ingroup GFX_WAIT_DONE
1447 /// @param  bStepTagBefore      \b IN: next tag
1448 /// @return GFX_SUCCESS         - Success
1449 /// @return GFX_FAIL            - Failure
1450 //-------------------------------------------------------------------------------------------------
1451 DLL_PUBLIC extern MS_U16     MApi_GFX_GetNextTAGID(MS_BOOL bStepTagBefore);
1452 //-------------------------------------------------------------------------------------------------
1453 /// MApi_GFX_GetInfo
1454 /// @ingroup GFX_ToBeRemove
1455 /// @return GFX_SUCCESS         - Success
1456 /// @return GFX_FAIL            - Failure
1457 //-------------------------------------------------------------------------------------------------
1458 // DLL_PUBLIC extern GFX_Result MApi_GFX_GetInfo( GFX_DbgInfo *dbg );
1459 //-----------------
1460 // GFX_CAPS
1461 //-----------------
1462 //-------------------------------------------------------------------------------------------------
1463 /// Get GE capability
1464 /// @ingroup GFX_CAPS
1465 /// @param  eCapType            \b IN: cap type
1466 /// @param  pRet                \b IN: cap struct pointer
1467 /// @param  ret_size            \b IN: cap struct size
1468 /// @return GFX_SUCCESS         - Success
1469 /// @return GFX_FAIL            - Failure
1470 //-------------------------------------------------------------------------------------------------
1471 DLL_PUBLIC extern GFX_Result MApi_GFX_GetGECaps(EN_GFX_CAPS eCapType, MS_U32* pRet, MS_U32 ret_size);
1472 
1473 
1474 
1475 //-----------------
1476 // GFX_DRAW
1477 //-----------------
1478 //-------------------------------------------------------------------------------------------------
1479 /// Draw line
1480 /// @ingroup GFX_DRAW
1481 /// @param  pline               \b IN: line info
1482 /// @return GFX_SUCCESS         - Success
1483 /// @return GFX_FAIL            - Failure
1484 //-------------------------------------------------------------------------------------------------
1485 DLL_PUBLIC extern GFX_Result MApi_GFX_DrawLine(GFX_DrawLineInfo *pline);
1486 
1487 //-------------------------------------------------------------------------------------------------
1488 /// Fill Rect
1489 /// @ingroup GFX_DRAW
1490 /// @param  pfillblock          \b IN: Rect info
1491 /// @return GFX_SUCCESS         - Success
1492 /// @return GFX_FAIL            - Failure
1493 //-------------------------------------------------------------------------------------------------
1494 DLL_PUBLIC extern GFX_Result MApi_GFX_RectFill(GFX_RectFillInfo *pfillblock);
1495 
1496 //-------------------------------------------------------------------------------------------------
1497 /// Fill Triangle
1498 /// @ingroup GFX_DRAW
1499 /// @param  ptriblock          \b IN: Triangle info
1500 /// @return GFX_SUCCESS         - Success
1501 /// @return GFX_FAIL            - Failure
1502 //-------------------------------------------------------------------------------------------------
1503 DLL_PUBLIC extern GFX_Result MApi_GFX_TriFill(GFX_TriFillInfo *ptriblock);
1504 
1505 //-------------------------------------------------------------------------------------------------
1506 /// Fill Span
1507 /// @ingroup GFX_DRAW
1508 /// @param  pspanblock          \b IN: Span info
1509 /// @return GFX_SUCCESS         - Success
1510 /// @return GFX_FAIL            - Failure
1511 //-------------------------------------------------------------------------------------------------
1512 DLL_PUBLIC extern GFX_Result MApi_GFX_SpanFill(GFX_SpanFillInfo *pspanblock);
1513 
1514 //-----------------
1515 // GFX_BUFFER_INFO
1516 //-----------------
1517 //-------------------------------------------------------------------------------------------------
1518 /// Set Src buffer info
1519 /// @ingroup GFX_BUFFER_INFO
1520 /// @param  bufInfo              \b IN: Src buffer info
1521 /// @param  offsetofByte         \b IN: offset
1522 /// @return GFX_SUCCESS         - Success
1523 /// @return GFX_FAIL            - Failure
1524 //-------------------------------------------------------------------------------------------------
1525 DLL_PUBLIC extern GFX_Result MApi_GFX_SetSrcBufferInfo(GFX_BufferInfo *bufInfo, MS_U32 offsetofByte);
1526 //-------------------------------------------------------------------------------------------------
1527 /// Set Dst buffer info
1528 /// @ingroup GFX_BUFFER_INFO
1529 /// @param  bufInfo              \b IN: Dst buffer info
1530 /// @param  offsetofByte         \b IN: offset
1531 /// @return GFX_SUCCESS         - Success
1532 /// @return GFX_FAIL            - Failure
1533 //-------------------------------------------------------------------------------------------------
1534 DLL_PUBLIC extern GFX_Result MApi_GFX_SetDstBufferInfo(GFX_BufferInfo *bufInfo, MS_U32 offsetofByte);
1535 
1536 
1537 
1538 //-----------------
1539 // GFX_ROP
1540 //-----------------
1541 //-------------------------------------------------------------------------------------------------
1542 /// Set ROP
1543 /// @ingroup GFX_ROP
1544 /// @param  enable              \b IN: Enable/Disable
1545 /// @param  eRopMode              \b IN: ROP operation
1546 /// @return GFX_SUCCESS         - Success
1547 /// @return GFX_FAIL            - Failure
1548 //-------------------------------------------------------------------------------------------------
1549 DLL_PUBLIC extern GFX_Result MApi_GFX_SetROP2(MS_BOOL enable, GFX_ROP2_Op eRopMode);
1550 //-----------------
1551 // GFX_COLOR_KEY
1552 //-----------------
1553 //-------------------------------------------------------------------------------------------------
1554 /// Set Src color-key info
1555 /// @ingroup GFX_COLOR_KEY
1556 /// @param  enable              \b IN: Enable/Disable
1557 /// @param  opMode              \b IN: color key operation
1558 /// @param  fmt                 \b IN: color format
1559 /// @param  ps_color            \b IN: color key range start
1560 /// @param  pe_color            \b IN: color key range end
1561 /// @return GFX_SUCCESS         - Success
1562 /// @return GFX_FAIL            - Failure
1563 //-------------------------------------------------------------------------------------------------
1564 DLL_PUBLIC extern GFX_Result MApi_GFX_SetSrcColorKey(MS_BOOL enable, GFX_ColorKeyMode opMode,
1565                                       GFX_Buffer_Format fmt, void *ps_color,
1566                                       void *pe_color);
1567 
1568 //-------------------------------------------------------------------------------------------------
1569 /// Set Dst color-key info
1570 /// @ingroup GFX_COLOR_KEY
1571 /// @param  enable              \b IN: Enable/Disable
1572 /// @param  opMode              \b IN: color key operation
1573 /// @param  fmt                 \b IN: color format
1574 /// @param  ps_color            \b IN: color key range start
1575 /// @param  pe_color            \b IN: color key range end
1576 /// @return GFX_SUCCESS         - Success
1577 /// @return GFX_FAIL            - Failure
1578 //-------------------------------------------------------------------------------------------------
1579 DLL_PUBLIC extern GFX_Result MApi_GFX_SetDstColorKey(MS_BOOL enable, GFX_ColorKeyMode opMode,
1580                                       GFX_Buffer_Format fmt, void *ps_color,
1581                                       void *pe_color);
1582 //-------------------------------------------------------------------------------------------------
1583 /// Set alpha blending info
1584 /// @ingroup GFX_ALPHA_BLENDING
1585 /// @param  enable              \b IN: Enable/Disable
1586 /// @param  coef                \b IN: color blending formular
1587 /// @param  db_abl              \b IN: alpha blending formular
1588 /// @param  abl_const           \b IN: constant alpha
1589 /// @return GFX_SUCCESS         - Success
1590 /// @return GFX_FAIL            - Failure
1591 //-------------------------------------------------------------------------------------------------
1592 DLL_PUBLIC extern GFX_Result MApi_GFX_SetAlpha(MS_BOOL enable, GFX_BlendCoef coef, GFX_AlphaSrcFrom db_abl, MS_U8 abl_const);
1593 //-----------------
1594 // GFX_ALPHA_BLENDING
1595 //-----------------
1596 //-------------------------------------------------------------------------------------------------
1597 /// Enable alpha blending
1598 /// @ingroup GFX_ALPHA_BLENDING
1599 /// @param  enable              \b IN: Enable/Disable
1600 /// @return GFX_SUCCESS         - Success
1601 /// @return GFX_FAIL            - Failure
1602 //-------------------------------------------------------------------------------------------------
1603 DLL_PUBLIC extern GFX_Result MApi_GFX_EnableAlphaBlending(MS_BOOL enable);
1604 //-------------------------------------------------------------------------------------------------
1605 /// Enable DFB
1606 /// @ingroup GFX_DFB
1607 /// @param  enable              \b IN: Enable/Disable
1608 /// @return GFX_SUCCESS         - Success
1609 /// @return GFX_FAIL            - Failure
1610 //-------------------------------------------------------------------------------------------------
1611 DLL_PUBLIC extern GFX_Result MApi_GFX_EnableDFBBlending(MS_BOOL enable);
1612 
1613 //-------------------------------------------------------------------------------------------------
1614 /// Set DFB extra flag
1615 /// @ingroup GFX_DFB
1616 /// @param  u16DFBBldFlags      \b IN: extra blending flag
1617 /// @return GFX_SUCCESS         - Success
1618 /// @return GFX_FAIL            - Failure
1619 //-------------------------------------------------------------------------------------------------
1620 DLL_PUBLIC extern GFX_Result MApi_GFX_SetDFBBldFlags(MS_U16 u16DFBBldFlags);
1621 
1622 
1623 //-------------------------------------------------------------------------------------------------
1624 /// Set DFB fomular
1625 /// @ingroup GFX_DFB
1626 /// @param  gfxSrcBldOP         \b IN: src blending operation
1627 /// @param  gfxDstBldOP         \b IN: dst blending operation
1628 /// @return GFX_SUCCESS         - Success
1629 /// @return GFX_FAIL            - Failure
1630 //-------------------------------------------------------------------------------------------------
1631 DLL_PUBLIC extern GFX_Result MApi_GFX_SetDFBBldOP(GFX_DFBBldOP gfxSrcBldOP, GFX_DFBBldOP gfxDstBldOP);
1632 
1633 //-------------------------------------------------------------------------------------------------
1634 /// Set DFB constant color
1635 /// @ingroup GFX_DFB
1636 /// @param  gfxRgbColor         \b IN: constant color
1637 /// @return GFX_SUCCESS         - Success
1638 /// @return GFX_FAIL            - Failure
1639 //-------------------------------------------------------------------------------------------------
1640 DLL_PUBLIC extern GFX_Result MApi_GFX_SetDFBBldConstColor(GFX_RgbColor gfxRgbColor);
1641 //-------------------------------------------------------------------------------------------------
1642 /// BitBlit
1643 /// @ingroup GFX_DRAW
1644 /// @param  pfillblock          \b IN: BitBlit info
1645 /// @param  drawflag            \b IN: BitBlit flag
1646 /// @return GFX_SUCCESS         - Success
1647 /// @return GFX_FAIL            - Failure
1648 //-------------------------------------------------------------------------------------------------
1649 DLL_PUBLIC extern GFX_Result MApi_GFX_BitBlt(GFX_DrawRect *drawbuf,MS_U32 drawflag);
1650 //-------------------------------------------------------------------------------------------------
1651 /// BitBlit with scaling info
1652 /// @ingroup GFX_DRAW
1653 /// @param  pfillblock          \b IN: BitBlit info
1654 /// @param  drawflag            \b IN: BitBlit flag
1655 /// @param  ScaleInfo           \b IN: Scaling info
1656 /// @return GFX_SUCCESS         - Success
1657 /// @return GFX_FAIL            - Failure
1658 //-------------------------------------------------------------------------------------------------
1659 DLL_PUBLIC extern GFX_Result MApi_GFX_BitBltEx(GFX_DrawRect * drawbuf, MS_U32 drawflag, GFX_ScaleInfo * ScaleInfo);
1660 
1661 //-----------------
1662 // GFX_PALETTE
1663 //-----------------
1664 //-------------------------------------------------------------------------------------------------
1665 /// Set I2 I4 palette
1666 /// @ingroup GFX_PALETTE
1667 /// @param  id                  \b IN: index
1668 /// @param  fmt                 \b IN: color format
1669 /// @param  pColor              \b IN: color
1670 /// @return GFX_SUCCESS         - Success
1671 /// @return GFX_FAIL            - Failure
1672 //-------------------------------------------------------------------------------------------------
1673 DLL_PUBLIC extern GFX_Result MApi_GFX_SetIntensity(MS_U32 id, GFX_Buffer_Format fmt, MS_U32 *pColor);
1674 
1675 
1676 //-----------------
1677 // GFX_CLIP
1678 //-----------------
1679 //-------------------------------------------------------------------------------------------------
1680 /// Set clip window
1681 /// @ingroup GFX_CLIP
1682 /// @param  v0                  \b IN: left-top point
1683 /// @param  v1                  \b IN: right-down point
1684 /// @return GFX_SUCCESS         - Success
1685 /// @return GFX_FAIL            - Failure
1686 //-------------------------------------------------------------------------------------------------
1687 DLL_PUBLIC extern GFX_Result MApi_GFX_SetClip(GFX_Point* v0, GFX_Point* v1);
1688 //-------------------------------------------------------------------------------------------------
1689 /// MApi_GFX_SetItalic
1690 /// @ingroup GFX_ToBeRemove
1691 /// @return GFX_SUCCESS         - Success
1692 /// @return GFX_FAIL            - Failure
1693 //-------------------------------------------------------------------------------------------------
1694 DLL_PUBLIC extern GFX_Result MApi_GFX_SetItalic(MS_BOOL enable,MS_U8 ini_line, MS_U8 ini_dis, MS_U8 delta);
1695 
1696 //-----------------
1697 // GFX_DITHER
1698 //-----------------
1699 //-------------------------------------------------------------------------------------------------
1700 /// Set Dither
1701 /// @ingroup GFX_DITHER
1702 /// @param  enable              \b IN: Enable/Disable
1703 /// @return GFX_SUCCESS         - Success
1704 /// @return GFX_FAIL            - Failure
1705 //-------------------------------------------------------------------------------------------------
1706 DLL_PUBLIC extern GFX_Result MApi_GFX_SetDither(MS_BOOL enable);
1707 
1708 //-----------------
1709 // GFX_PIXEL_MODE
1710 //-----------------
1711 //-------------------------------------------------------------------------------------------------
1712 /// Set one pixel mode
1713 /// @ingroup GFX_PIXEL_MODE
1714 /// @param  enable              \b IN: Enable/Disable
1715 /// @return GFX_SUCCESS         - Success
1716 /// @return GFX_FAIL            - Failure
1717 //-------------------------------------------------------------------------------------------------
1718 // DLL_PUBLIC extern GFX_Result MApi_GFX_SetOnePixelMode(MS_BOOL enable);
1719 //-----------------
1720 // GFX_OPTION
1721 //-----------------
1722 //-----------------
1723 // GFX_STRETCH
1724 //-----------------
1725 //-------------------------------------------------------------------------------------------------
1726 /// Enable Nearest mode
1727 /// @ingroup GFX_STRETCH
1728 /// @param  enable              \b IN: Enable/Disable
1729 /// @return GFX_SUCCESS         - Success
1730 /// @return GFX_FAIL            - Failure
1731 //-------------------------------------------------------------------------------------------------
1732 DLL_PUBLIC extern GFX_Result MApi_GFX_SetNearestMode(MS_BOOL enable);
1733 //-----------------
1734 // GFX_MIRROR
1735 //-----------------
1736 //-------------------------------------------------------------------------------------------------
1737 /// Set Src mirror
1738 /// @ingroup GFX_MIRROR
1739 /// @param  isMirrorX           \b IN: Enable/Disable
1740 /// @param  isMirrorY           \b IN: Enable/Disable
1741 /// @return GFX_SUCCESS         - Success
1742 /// @return GFX_FAIL            - Failure
1743 //-------------------------------------------------------------------------------------------------
1744 DLL_PUBLIC extern GFX_Result MApi_GFX_SetMirror(MS_BOOL isMirrorX, MS_BOOL isMirrorY);
1745 //-------------------------------------------------------------------------------------------------
1746 /// Set Dst mirror
1747 /// @ingroup GFX_MIRROR
1748 /// @param  isMirrorX           \b IN: Enable/Disable
1749 /// @param  isMirrorY           \b IN: Enable/Disable
1750 /// @return GFX_SUCCESS         - Success
1751 /// @return GFX_FAIL            - Failure
1752 //-------------------------------------------------------------------------------------------------
1753 DLL_PUBLIC extern GFX_Result MApi_GFX_SetDstMirror(MS_BOOL isMirrorX, MS_BOOL isMirrorY);
1754 
1755 //-----------------
1756 // GFX_ROTATE
1757 //-----------------
1758 //-------------------------------------------------------------------------------------------------
1759 /// Set rotation
1760 /// @ingroup GFX_ROTATE
1761 /// @param  angle               \b IN: angle
1762 /// @return GFX_SUCCESS         - Success
1763 /// @return GFX_FAIL            - Failure
1764 //-------------------------------------------------------------------------------------------------
1765 DLL_PUBLIC extern GFX_Result MApi_GFX_SetRotate(GFX_RotateAngle angle);
1766 
1767 //-----------------
1768 // GFX_OPTION
1769 //-----------------
1770 //-----------------
1771 // GFX_STRETCH
1772 //-----------------
1773 //-------------------------------------------------------------------------------------------------
1774 /// Enable Nearest mode
1775 /// @ingroup GFX_STRETCH
1776 /// @param  enable              \b IN: Enable/Disable
1777 /// @return GFX_SUCCESS         - Success
1778 /// @return GFX_FAIL            - Failure
1779 //-------------------------------------------------------------------------------------------------
1780 DLL_PUBLIC extern GFX_Result MApi_GFX_SetNearestMode(MS_BOOL enable);
1781 //-----------------
1782 // GFX_WAIT_DONE
1783 //-----------------
1784 //-------------------------------------------------------------------------------------------------
1785 /// Set tag
1786 /// @ingroup GFX_WAIT_DONE
1787 /// @param  tagID                  \b IN: tag
1788 /// @return GFX_SUCCESS         - Success
1789 /// @return GFX_FAIL            - Failure
1790 //-------------------------------------------------------------------------------------------------
1791 DLL_PUBLIC extern GFX_Result MApi_GFX_SetTAGID(MS_U16 tagID);
1792 //-------------------------------------------------------------------------------------------------
1793 /// wait for tag
1794 /// @ingroup GFX_WAIT_DONE
1795 /// @param  tagID               \b IN: tagID
1796 /// @return GFX_SUCCESS         - Success
1797 /// @return GFX_FAIL            - Failure
1798 //-------------------------------------------------------------------------------------------------
1799 DLL_PUBLIC extern GFX_Result MApi_GFX_WaitForTAGID(MS_U16 tagID);
1800 
1801 //-------------------------------------------------------------------------------------------------
1802 /// Set next tag
1803 /// @ingroup GFX_WAIT_DONE
1804 /// @param  void
1805 /// @return GFX_SUCCESS         - Success
1806 /// @return GFX_FAIL            - Failure
1807 //-------------------------------------------------------------------------------------------------
1808 DLL_PUBLIC extern MS_U16     MApi_GFX_SetNextTAGID(void);
1809 //-----------------
1810 // GFX_VCMQ
1811 //-----------------
1812 //-------------------------------------------------------------------------------------------------
1813 /// Enable GE virtual cmdq
1814 /// @ingroup GFX_VCMQ
1815 /// @param  enable              \b IN: Enable/Disable
1816 /// @return GFX_SUCCESS         - Success
1817 /// @return GFX_FAIL            - Failure
1818 //-------------------------------------------------------------------------------------------------
1819 DLL_PUBLIC extern GFX_Result MApi_GFX_EnableVCmdQueue(MS_U16 blEnable);
1820 //-------------------------------------------------------------------------------------------------
1821 /// Set GE virtual cmdq info
1822 /// @ingroup GFX_VCMQ
1823 /// @param  u32Addr             \b IN: vcmdq addr
1824 /// @param  enBufSize           \b IN: vcmdq size
1825 /// @return GFX_SUCCESS         - Success
1826 /// @return GFX_FAIL            - Failure
1827 //-------------------------------------------------------------------------------------------------
1828 DLL_PUBLIC extern GFX_Result MApi_GFX_SetVCmdBuffer(MS_PHY PhyAddr, GFX_VcmqBufSize enBufSize);
1829 //-------------------------------------------------------------------------------------------------
1830 /// Set GE write queue threadhold to DRAM
1831 /// @ingroup GFX_VCMQ
1832 /// @param  u8W_Threshold       \b IN: Threshold
1833 /// @return GFX_SUCCESS         - Success
1834 /// @return GFX_FAIL            - Failure
1835 //-------------------------------------------------------------------------------------------------
1836 // DLL_PUBLIC extern GFX_Result MApi_GE_SetVCmd_W_Thread(MS_U8 u8W_Threshold);
1837 //-------------------------------------------------------------------------------------------------
1838 /// Set GE read queue threadhold to DRAM
1839 /// @ingroup GFX_VCMQ
1840 /// @param  u8R_Threshold       \b IN: Threshold
1841 /// @return GFX_SUCCESS         - Success
1842 /// @return GFX_FAIL            - Failure
1843 //-------------------------------------------------------------------------------------------------
1844 // DLL_PUBLIC extern GFX_Result MApi_GE_SetVCmd_R_Thread(MS_U8 u8R_Threshold);
1845 //-------------------------------------------------------------------------------------------------
1846 /// flush all ge queue
1847 /// @ingroup GFX_WAIT_DONE
1848 /// @param  void
1849 /// @return GFX_SUCCESS         - Success
1850 /// @return GFX_FAIL            - Failure
1851 //-------------------------------------------------------------------------------------------------
1852 DLL_PUBLIC extern GFX_Result MApi_GFX_FlushQueue(void) ;
1853 //-------------------------------------------------------------------------------------------------
1854 /// MApi_GFX_PowerOn
1855 /// @ingroup GFX_ToBeRemove
1856 /// @return GFX_SUCCESS         - Success
1857 /// @return GFX_FAIL            - Failure
1858 //-------------------------------------------------------------------------------------------------
1859 // DLL_PUBLIC extern GFX_Result MApi_GFX_PowerOn(void);
1860 //-------------------------------------------------------------------------------------------------
1861 /// MApi_GFX_PowerOff
1862 /// @ingroup GFX_ToBeRemove
1863 /// @return GFX_SUCCESS         - Success
1864 /// @return GFX_FAIL            - Failure
1865 //-------------------------------------------------------------------------------------------------
1866 // DLL_PUBLIC extern GFX_Result MApi_GFX_PowerOff(void);
1867 //-----------------
1868 // GFX_POWER_STATE
1869 //-----------------
1870 //-------------------------------------------------------------------------------------------------
1871 /// Set GE suspend resume
1872 /// @ingroup GFX_POWER_STATE
1873 /// @param  u16PowerState       \b IN: suspend/resume
1874 /// @return GFX_SUCCESS         - Success
1875 /// @return GFX_FAIL            - Failure
1876 //-------------------------------------------------------------------------------------------------
1877 DLL_PUBLIC extern MS_U32     MApi_GFX_SetPowerState(EN_POWER_MODE u16PowerState);
1878 
1879 //-----------------
1880 // GFX_WRITE_PROTECT
1881 //-----------------
1882 //-------------------------------------------------------------------------------------------------
1883 /// Set GE write protect
1884 /// @ingroup GFX_WRITE_PROTECT
1885 /// @param  miu                 \b IN: miu
1886 /// @param  addr_low            \b IN: addr_low
1887 /// @param  addr_high           \b IN: addr_high
1888 /// @param  eWPType             \b IN: eWPType
1889 /// @return GFX_SUCCESS         - Success
1890 /// @return GFX_FAIL            - Failure
1891 //-------------------------------------------------------------------------------------------------
1892 // DLL_PUBLIC extern GFX_Result MApi_GFX_WriteProtect(MS_U8 miu,MS_PHY addr_low,MS_PHY addr_high,GFX_WPType eWPType);
1893 //-------------------------------------------------------------------------------------------------
1894 /// Set I8 palette
1895 /// @ingroup GFX_PALETTE
1896 /// @param  pPalArray           \b IN: color array
1897 /// @param  u32PalStart         \b IN: color index start
1898 /// @param  u32PalEnd           \b IN: color index end
1899 /// @return GFX_SUCCESS         - Success
1900 /// @return GFX_FAIL            - Failure
1901 DLL_PUBLIC extern GFX_Result MApi_GFX_SetPaletteOpt( GFX_PaletteEntry *pPalArray, MS_U16 u32PalStart, MS_U16 u32PalEnd);
1902 
1903 
1904 
1905 //-----------------
1906 // GFX_DRAW_MISC
1907 //-----------------
1908 //-------------------------------------------------------------------------------------------------
1909 /// MApi_GFX_DrawBitmap
1910 /// @ingroup GFX_DRAW_MISC
1911 /// @return GFX_SUCCESS         - Success
1912 /// @return GFX_FAIL            - Failure
1913 //-------------------------------------------------------------------------------------------------
1914 DLL_PUBLIC extern GFX_Result MApi_GFX_DrawBitmap(MS_S32 handle, GFX_DrawBmpInfo *pbmpfmt);
1915 //-------------------------------------------------------------------------------------------------
1916 /// MApi_GFX_TextOut
1917 /// @ingroup GFX_DRAW_MISC
1918 /// @return GFX_SUCCESS         - Success
1919 /// @return GFX_FAIL            - Failure
1920 //-------------------------------------------------------------------------------------------------
1921 DLL_PUBLIC extern GFX_Result MApi_GFX_TextOut(MS_S32 fhandle, MS_U8 *pindex, MS_U32 strwidth, GFX_TextOutInfo *pfmt);
1922 //-------------------------------------------------------------------------------------------------
1923 /// MApi_GFX_CharacterOut
1924 /// @ingroup GFX_DRAW_MISC
1925 /// @return GFX_SUCCESS         - Success
1926 /// @return GFX_FAIL            - Failure
1927 //-------------------------------------------------------------------------------------------------
1928 DLL_PUBLIC extern GFX_Result MApi_GFX_CharacterOut(GFX_CharInfo*  pChar, GFX_TextOutInfo *pfmt);
1929 //-------------------------------------------------------------------------------------------------
1930 /// MApi_GFX_GetBitmapInfo
1931 /// @ingroup GFX_ToBeRemove
1932 /// @return GFX_SUCCESS         - Success
1933 /// @return GFX_FAIL            - Failure
1934 //-------------------------------------------------------------------------------------------------
1935 // DLL_PUBLIC extern GFX_Result MApi_GFX_GetBitmapInfo(MS_S32 handle, GFX_BitmapInfo* pinfo);
1936 //-------------------------------------------------------------------------------------------------
1937 /// MApi_GFX_GetFrameBufferInfo
1938 /// @ingroup GFX_ToBeRemove
1939 /// @return GFX_SUCCESS         - Success
1940 /// @return GFX_FAIL            - Failure
1941 //-------------------------------------------------------------------------------------------------
1942 // DLL_PUBLIC extern GFX_Result MApi_GFX_GetFrameBufferInfo(MS_U32 *width, MS_U32 *height, MS_U32 *pitch, MS_U32 *fbFmt, MS_PHY *addr);
1943 //-------------------------------------------------------------------------------------------------
1944 /// MApi_GFX_TrapezoidFill
1945 /// @ingroup GFX_ToBeRemove
1946 /// @return GFX_SUCCESS         - Success
1947 /// @return GFX_FAIL            - Failure
1948 //-------------------------------------------------------------------------------------------------
1949 DLL_PUBLIC extern GFX_Result MApi_GFX_TrapezoidFill(GFX_RectFillInfo *pGfxFillInfo);
1950 //-------------------------------------------------------------------------------------------------
1951 /// MApi_GFX_EnableTrapezoidAA
1952 /// @ingroup GFX_ToBeRemove
1953 /// @return GFX_SUCCESS         - Success
1954 /// @return GFX_FAIL            - Failure
1955 //-------------------------------------------------------------------------------------------------
1956 // DLL_PUBLIC extern GFX_Result MApi_GFX_EnableTrapezoidAA(MS_BOOL bEnable);
1957 //-------------------------------------------------------------------------------------------------
1958 /// MApi_GFX_EnableTrapSubPixCorr
1959 /// @ingroup GFX_ToBeRemove
1960 /// @return GFX_SUCCESS         - Success
1961 /// @return GFX_FAIL            - Failure
1962 //-------------------------------------------------------------------------------------------------
1963 // DLL_PUBLIC extern GFX_Result MApi_GFX_EnableTrapSubPixCorr(MS_BOOL bEnable);
1964 //-------------------------------------------------------------------------------------------------
1965 /// MApi_GFX_QueryTextDispLength
1966 /// @ingroup GFX_MISC_NOS
1967 /// @return GFX_SUCCESS         - Success
1968 /// @return GFX_FAIL            - Failure
1969 //-------------------------------------------------------------------------------------------------
1970 // DLL_PUBLIC extern GFX_Result MApi_GFX_QueryTextDispLength(MS_S32 fhandle, MS_U8 *pu8index, MS_U32 u32strwidth,
1971 //                                                GFX_TextOutInfo *pfmt, MS_U32* pu32DispLength);
1972 //-------------------------------------------------------------------------------------------------
1973 /// Set alpha formular
1974 /// @ingroup GFX_ALPHA_BLENDING
1975 /// @param  eMode               \b IN: alpha blending formular
1976 /// @return GFX_SUCCESS         - Success
1977 /// @return GFX_FAIL            - Failure
1978 //-------------------------------------------------------------------------------------------------
1979 DLL_PUBLIC extern GFX_Result MApi_GFX_SetAlphaSrcFrom(GFX_AlphaSrcFrom eMode);
1980 //-------------------------------------------------------------------------------------------------
1981 /// Set color formular
1982 /// @ingroup GFX_ALPHA_BLENDING
1983 /// @param  blendcoef           \b IN: color blending formular
1984 /// @param  blendfactor         \b IN: constant alpha
1985 /// @return GFX_SUCCESS         - Success
1986 /// @return GFX_FAIL            - Failure
1987 DLL_PUBLIC extern GFX_Result MApi_GFX_SetAlphaBlending(GFX_BlendCoef blendcoef, MS_U8 blendfactor);
1988 //-----------------
1989 // GFX_DFB
1990 //-----------------
1991 //-------------------------------------------------------------------------------------------------
1992 /// Query DFB capability
1993 /// @ingroup GFX_DFB
1994 /// @param  pU16SupportedBldFlags   \b IN: DFB capability
1995 /// @return GFX_SUCCESS             - Success
1996 /// @return GFX_FAIL                - Failure
1997 //-------------------------------------------------------------------------------------------------
1998 DLL_PUBLIC extern GFX_Result MApi_GFX_QueryDFBBldCaps(MS_U16 *pU16SupportedBldFlags);
1999 //-------------------------------------------------------------------------------------------------
2000 /// MApi_GFX_SetDFBBldSrcColorMask
2001 /// @ingroup GFX_ToBeRemove
2002 /// @return GFX_SUCCESS         - Success
2003 /// @return GFX_FAIL            - Failure
2004 //-------------------------------------------------------------------------------------------------
2005 // DLL_PUBLIC extern GFX_Result MApi_GFX_SetDFBBldSrcColorMask(GFX_RgbColor gfxRgbColor);
2006 //-------------------------------------------------------------------------------------------------
2007 /// MApi_GFX_Line_Pattern_Reset
2008 /// @ingroup GFX_MISC_NOS
2009 /// @return GFX_SUCCESS         - Success
2010 /// @return GFX_FAIL            - Failure
2011 //-------------------------------------------------------------------------------------------------
2012 DLL_PUBLIC extern GFX_Result MApi_GFX_Line_Pattern_Reset(void);
2013 //-------------------------------------------------------------------------------------------------
2014 /// MApi_GFX_Set_Line_Pattern
2015 /// @ingroup GFX_MISC_NOS
2016 /// @return GFX_SUCCESS         - Success
2017 /// @return GFX_FAIL            - Failure
2018 //-------------------------------------------------------------------------------------------------
2019 DLL_PUBLIC extern GFX_Result MApi_GFX_Set_Line_Pattern(MS_BOOL enable, MS_U8 linePattern, MS_U8 repeatFactor);
2020 
2021 //-----------------
2022 // GFX_DRAW_SETTING
2023 //-----------------
2024 //-----------------
2025 // GFX_BEGINE_END
2026 //-----------------
2027 //-------------------------------------------------------------------------------------------------
2028 /// Begine of draw.
2029 /// @ingroup GFX_LOCK_BEGINE_END
2030 /// @param  void
2031 /// @return GFX_SUCCESS         - Success
2032 /// @return GFX_FAIL            - Failure
2033 //-------------------------------------------------------------------------------------------------
2034 DLL_PUBLIC extern GFX_Result MApi_GFX_BeginDraw(void);
2035 //-------------------------------------------------------------------------------------------------
2036 /// End of draw.
2037 /// @ingroup GFX_LOCK_BEGINE_END
2038 /// @param  void
2039 /// @return GFX_SUCCESS         - Success
2040 /// @return GFX_FAIL            - Failure
2041 //-------------------------------------------------------------------------------------------------
2042 DLL_PUBLIC extern GFX_Result MApi_GFX_EndDraw(void);
2043 //-------------------------------------------------------------------------------------------------
2044 /// MApi_GFX_YUV_Get
2045 /// @ingroup GFX_ToBeRemove
2046 /// @return GFX_SUCCESS         - Success
2047 /// @return GFX_FAIL            - Failure
2048 //-------------------------------------------------------------------------------------------------
2049 // DLL_PUBLIC extern GFX_Result MApi_GFX_YUV_Get(GFX_YuvInfo* pYuvInfo);
2050 //-------------------------------------------------------------------------------------------------
2051 /// MApi_GFX_RectFrame
2052 /// @ingroup GFX_MISC_NOS
2053 /// @return GFX_SUCCESS         - Success
2054 /// @return GFX_FAIL            - Failure
2055 //-------------------------------------------------------------------------------------------------
2056 DLL_PUBLIC extern void MApi_GFX_RectFrame(GFX_RectFillInfo *pblock, GFX_DrawLineInfo *plinefmt);
2057 //-----------------
2058 // GFX_R2Y
2059 //-----------------
2060 //-------------------------------------------------------------------------------------------------
2061 /// Set R2Y CSC
2062 /// @ingroup GFX_R2Y
2063 /// @param  mode                \b IN: mode
2064 /// @param  yuv_out_range       \b IN: dst YUV range
2065 /// @param  uv_in_range         \b IN: src UV range
2066 /// @param  srcfmt              \b IN: src YUV fmt
2067 /// @param  dstfmt              \b IN: dst YUV fmt
2068 /// @return GFX_SUCCESS         - Success
2069 /// @return GFX_FAIL            - Failure
2070 //-------------------------------------------------------------------------------------------------
2071 DLL_PUBLIC extern GFX_Result MApi_GFX_SetDC_CSC_FMT(GFX_YUV_Rgb2Yuv mode, GFX_YUV_OutRange yuv_out_range, GFX_YUV_InRange uv_in_range, GFX_YUV_422 srcfmt, GFX_YUV_422 dstfmt);
2072 //-------------------------------------------------------------------------------------------------
2073 /// MApi_GFX_SetPatchMode
2074 /// @ingroup GFX_ToBeRemove
2075 /// @return GFX_SUCCESS         - Success
2076 /// @return GFX_FAIL            - Failure
2077 //-------------------------------------------------------------------------------------------------
2078 DLL_PUBLIC extern GFX_Result MApi_GFX_SetPatchMode(MS_BOOL enable);
2079 //-------------------------------------------------------------------------------------------------
2080 /// Get buffer info
2081 /// @ingroup GFX_BUFFER_INFO
2082 /// @param  srcbufInfo          \b IN: Src buffer info
2083 /// @param  dstbufInfo          \b IN: Dst buffer info
2084 /// @return GFX_SUCCESS         - Success
2085 /// @return GFX_FAIL            - Failure
2086 //-------------------------------------------------------------------------------------------------
2087 DLL_PUBLIC extern GFX_Result MApi_GFX_GetBufferInfo(PGFX_BufferInfo srcbufInfo, PGFX_BufferInfo dstbufInfo);
2088 //-------------------------------------------------------------------------------------------------
2089 /// Clear frame by 32 bits value
2090 /// @ingroup GFX_CLEAR
2091 /// @param  StrAddr             \b IN: addr
2092 /// @param  length              \b IN: len
2093 /// @param  ClearValue          \b IN: value
2094 /// @return GFX_SUCCESS         - Success
2095 /// @return GFX_FAIL            - Failure
2096 //-------------------------------------------------------------------------------------------------
2097 DLL_PUBLIC extern GFX_Result MApi_GFX_ClearFrameBufferByWord(MS_PHY StrAddr, MS_U32 length, MS_U32 ClearValue);
2098 //-----------------
2099 // GFX_CLEAR
2100 //-----------------
2101 //-------------------------------------------------------------------------------------------------
2102 /// Clear frame by 8 bits value
2103 /// @ingroup GFX_CLEAR
2104 /// @param  StrAddr             \b IN: addr
2105 /// @param  length              \b IN: len
2106 /// @param  ClearValue          \b IN: value
2107 /// @return GFX_SUCCESS         - Success
2108 /// @return GFX_FAIL            - Failure
2109 //-------------------------------------------------------------------------------------------------
2110 DLL_PUBLIC extern GFX_Result MApi_GFX_ClearFrameBuffer(MS_PHY StrAddr, MS_U32 length, MS_U8 ClearValue);
2111 //-------------------------------------------------------------------------------------------------
2112 /// Set alpha value in ARGB1555
2113 /// @ingroup GFX_ALPHA_BLENDING
2114 /// @param  coef                \b IN: alpha value
2115 /// @return GFX_SUCCESS         - Success
2116 /// @return GFX_FAIL            - Failure
2117 //-------------------------------------------------------------------------------------------------
2118 DLL_PUBLIC extern GFX_Result MApi_GFX_SetAlpha_ARGB1555(MS_U8 coef);
2119 //-------------------------------------------------------------------------------------------------
2120 /// Get alpha value in ARGB1555
2121 /// @ingroup GFX_ALPHA_BLENDING
2122 /// @param  coef                \b IN: alpha value
2123 /// @return GFX_SUCCESS         - Success
2124 /// @return GFX_FAIL            - Failure
2125 //-------------------------------------------------------------------------------------------------
2126 // DLL_PUBLIC extern GFX_Result MApi_GFX_GetAlpha_ARGB1555(MS_U8* coef);
2127 //-----------------
2128 // GFX_CB
2129 //-----------------
2130 //-------------------------------------------------------------------------------------------------
2131 /// Get Font info call back.
2132 /// @ingroup GFX_CB
2133 /// @param  fpGFX_CB             \b IN: Get Font info call back
2134 /// @return GFX_SUCCESS         - Success
2135 /// @return GFX_FAIL            - Failure
2136 //-------------------------------------------------------------------------------------------------
2137 DLL_PUBLIC extern GFX_Result MApi_GFX_RegisterGetFontCB(MS_PHY (*fpGFX_CB)(MS_S8, GFX_FontInfo*)  );
2138 //-------------------------------------------------------------------------------------------------
2139 /// Get BMP info call back.
2140 /// @ingroup GFX_CB
2141 /// @param  fpGFX_CB             \b IN: Get BMP info call back
2142 /// @return GFX_SUCCESS         - Success
2143 /// @return GFX_FAIL            - Failure
2144 //-------------------------------------------------------------------------------------------------
2145 DLL_PUBLIC extern GFX_Result MApi_GFX_RegisterGetBMPCB(MS_PHY (*fpGFX_CB)(MS_S16, GFX_BitmapInfo*)  );
2146 //-----------------
2147 // GFX_ALPHA_COMPARE
2148 //-----------------
2149 //-------------------------------------------------------------------------------------------------
2150 /// Set alpha compare info
2151 /// @ingroup GFX_ALPHA_COMPARE
2152 /// @param  enable              \b IN: Enable/Disable
2153 /// @param  eMode               \b IN: alpha compare operation
2154 /// @return GFX_SUCCESS         - Success
2155 /// @return GFX_FAIL            - Failure
2156 //-------------------------------------------------------------------------------------------------
2157 DLL_PUBLIC extern GFX_Result MApi_GFX_SetAlphaCmp(MS_BOOL enable, GFX_ACmpOp eMode);
2158 //-----------------
2159 // GFX_MISC
2160 //-----------------
2161 //-------------------------------------------------------------------------------------------------
2162 /// Configure GFX DBG level
2163 /// @ingroup GFX_MISC
2164 /// @param  level               \b IN: level
2165 /// @return GFX_SUCCESS         - Success
2166 /// @return GFX_FAIL            - Failure
2167 //-------------------------------------------------------------------------------------------------
2168 // DLL_PUBLIC extern void MApi_GFX_SetDbgLevel(MS_U32 level);
2169 //-------------------------------------------------------------------------------------------------
2170 /// Set source color key edge stretch mode
2171 /// @ingroup GFX_STRETCH
2172 /// @param  type                \b IN: stretch mode
2173 /// @param  color               \b IN: customer color
2174 /// @return GFX_SUCCESS         - Success
2175 /// @return GFX_FAIL            - Failure
2176 //-------------------------------------------------------------------------------------------------
2177 DLL_PUBLIC extern GFX_Result MApi_GFX_SetStrBltSckType(GFX_StretchCKType type, GFX_RgbColor *color);
2178 //-----------------
2179 // GFX_MISC_NOS
2180 //-----------------
2181 //-------------------------------------------------------------------------------------------------
2182 /// MApi_GFX_SetHK
2183 /// @ingroup GFX_MISC_NOS
2184 /// @return GFX_SUCCESS         - Success
2185 /// @return GFX_FAIL            - Failure
2186 //-------------------------------------------------------------------------------------------------
2187 DLL_PUBLIC extern GFX_Result MApi_GFX_SetHK(MS_BOOL bIsHK) ;
2188 //-------------------------------------------------------------------------------------------------
2189 /// MApi_GFX_GetHK
2190 /// @ingroup GFX_MISC_NOS
2191 /// @return GFX_SUCCESS         - Success
2192 /// @return GFX_FAIL            - Failure
2193 //-----------------------------------------------------------------------------------------------
2194 // DLL_PUBLIC extern GFX_Result MApi_GFX_GetHK(MS_BOOL *bIsHK) ;
2195 //-------------------------------------------------------------------------------------------------
2196 /// MApi_GFX_DrawOval
2197 /// @ingroup GFX_DRAW_MISC
2198 /// @return GFX_SUCCESS         - Success
2199 /// @return GFX_FAIL            - Failure
2200 //-------------------------------------------------------------------------------------------------
2201 DLL_PUBLIC extern GFX_Result MApi_GFX_DrawOval(GFX_OvalFillInfo *pOval);
2202 //-------------------------------------------------------------------------------------------------
2203 /// MApi_GFX_GetStatus
2204 /// @ingroup GFX_ToBeRemove
2205 /// @return GFX_SUCCESS         - Success
2206 /// @return GFX_FAIL            - Failure
2207 //-------------------------------------------------------------------------------------------------
2208 // DLL_PUBLIC extern GFX_Result MApi_GFX_GetStatus( MS_BOOL *pStatus );
2209 //-------------------------------------------------------------------------------------------------
2210 /// MApi_GFX_GetLibVer
2211 /// @ingroup GFX_ToBeRemove
2212 /// @return GFX_SUCCESS         - Success
2213 /// @return GFX_FAIL            - Failure
2214 //-------------------------------------------------------------------------------------------------
2215 DLL_LOCAL extern GFX_Result MApi_GFX_GetLibVer(const MSIF_Version **ppVersion);
2216 //-------------------------------------------------------------------------------------------------
2217 /// Get GE alignment capability
2218 /// @ingroup GFX_CAPS
2219 /// @param  pAlignCapsInfo      \b IN: AlignCaps
2220 /// @return GFX_SUCCESS         - Success
2221 /// @return GFX_FAIL            - Failure
2222 //-------------------------------------------------------------------------------------------------
2223 DLL_PUBLIC extern GFX_Result MApi_GFX_GetAlignCaps(GFX_FmtAlignCapsInfo* pAlignCapsInfo);
2224 /// msAPI_GE_ClearFrameBufferByWord
2225 /// @ingroup GFX_ToBeRemove
2226 /// @return GFX_SUCCESS         - Success
2227 /// @return GFX_FAIL            - Failure
2228 //-------------------------------------------------------------------------------------------------
2229 DLL_PUBLIC extern void msAPI_GE_ClearFrameBufferByWord (MS_PHY StrAddr, MS_U32 length, MS_U32 ClearValue);
2230 //-------------------------------------------------------------------------------------------------
2231 /// MDrv_GE_EnableAlphaBlending
2232 /// @ingroup GFX_ToBeRemove
2233 /// @return GFX_SUCCESS         - Success
2234 /// @return GFX_FAIL            - Failure
2235 //-------------------------------------------------------------------------------------------------
2236 // DLL_PUBLIC extern GFX_Result MDrv_GE_EnableAlphaBlending(MS_BOOL enable);
2237 //-------------------------------------------------------------------------------------------------
2238 /// MDrv_GE_SetAlphaBlending
2239 /// @ingroup GFX_ToBeRemove
2240 /// @return GFX_SUCCESS         - Success
2241 /// @return GFX_FAIL            - Failure
2242 //-------------------------------------------------------------------------------------------------
2243 // DLL_PUBLIC extern GFX_Result MDrv_GE_SetAlphaBlending(GFX_BlendCoef blendcoef, MS_U8 u8ConstantAlpha);
2244 //-------------------------------------------------------------------------------------------------
2245 /// MDrv_GE_PE_SetIntensity
2246 /// @ingroup GFX_ToBeRemove
2247 /// @return GFX_SUCCESS         - Success
2248 /// @return GFX_FAIL            - Failure
2249 //-------------------------------------------------------------------------------------------------
2250 DLL_PUBLIC extern void MDrv_GE_PE_SetIntensity(MS_U8 id, GFX_Buffer_Format fmt, MS_U32* pcolor);
2251 //-------------------------------------------------------------------------------------------------
2252 /// MApi_GFX_SetTLBMode
2253 /// @ingroup GFX_ToBeRemove
2254 /// @return GFX_SUCCESS         - Success
2255 /// @return GFX_FAIL            - Failure
2256 //-------------------------------------------------------------------------------------------------
2257 DLL_PUBLIC extern GFX_Result MApi_GFX_SetTLBMode(EN_GFX_TLB_Mode TLBmode);
2258 //-------------------------------------------------------------------------------------------------
2259 /// MApi_GFX_SetTLBBaseADDR
2260 /// @ingroup GFX_ToBeRemove
2261 /// @return GFX_SUCCESS         - Success
2262 /// @return GFX_FAIL            - Failure
2263 //-------------------------------------------------------------------------------------------------
2264 DLL_PUBLIC extern GFX_Result MApi_GFX_SetTLBBaseADDR(MS_PHY phyTLBSrcMiuAddr,MS_PHY phyTLBDstMiuAddr);
2265 //-------------------------------------------------------------------------------------------------
2266 /// MApi_GFX_SetTLBFlushTable
2267 /// @ingroup GFX_ToBeRemove
2268 /// @return GFX_SUCCESS         - Success
2269 /// @return GFX_FAIL            - Failure
2270 //-------------------------------------------------------------------------------------------------
2271 DLL_PUBLIC extern GFX_Result MApi_GFX_SetTLBFlushTable(MS_BOOL enable);
2272 //-------------------------------------------------------------------------------------------------
2273 /// MApi_GFX_SetTLBTag
2274 /// @ingroup GFX_ToBeRemove
2275 /// @return GFX_SUCCESS         - Success
2276 /// @return GFX_FAIL            - Failure
2277 //-------------------------------------------------------------------------------------------------
2278 // DLL_PUBLIC extern GFX_Result MApi_GFX_SetTLBTag(MS_U16 tag);
2279 
2280 
2281 //-----------------
2282 // GFX_MISC_BOX
2283 //-----------------
2284 //-------------------------------------------------------------------------------------------------
2285 /// MApi_GFX_BitbltByTwoSourceBuffer
2286 /// @ingroup GFX_MISC_BOX
2287 /// @return GFX_SUCCESS         - Success
2288 /// @return GFX_FAIL            - Failure
2289 //-------------------------------------------------------------------------------------------------
2290 // DLL_PUBLIC extern GFX_Result MApi_GFX_BitbltByTwoSourceBuffer(PGFX_BufferInfo dstbufInfo, GFX_DrawTwoSourceRect *pbmpfmt, MS_U32 drawflag);
2291 
2292 //-------------------------------------------------------------------------------------------------
2293 /// Finalize GFX module.
2294 /// @ingroup GFX_INIT
2295 /// @param  void
2296 /// @return void
2297 //-------------------------------------------------------------------------------------------------
2298 DLL_PUBLIC extern void MApi_GE_Exit(void);
2299 
2300 
2301 
2302 #ifdef __cplusplus
2303 }
2304 #endif
2305 
2306 #endif //_API_GFX_H_
2307 
2308