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