blob: 9f5467b950d139331568c8b77c11e097d785a0ab [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*******************************************************************************
2 * Copyright by ZTE Corporation.
3 *
4 * File Name:
5 * File Mark:
6 * Description:
7 * Others:
8 * Version: v0.1
9 * Author: wuhui
10 * Date: 2016-12-17
11 * History 1:
12 * Date:
13 * Version:
14 * Author:
15 * Modification:
16 * History 2:
17 ********************************************************************************/
18
19#ifndef _DRVS_VOU_H
20#define _DRVS_VOU_H
21
22
23/****************************************************************************
24* Include files
25****************************************************************************/
26
27
28/****************************************************************************
29* Macros
30****************************************************************************/
31
32
33/****************************************************************************
34* Types
35****************************************************************************/
36typedef struct
37{
38 BOOL funcCSC; /*CSC for VL, color conversion from YUV to RGB or from RGB to YUV*/
39 UINT32 VLNum; /*how many Video layers*/
40 UINT32 GLNum; /*how many Video layers*/
41 BOOL VL_SrcYUYV; /*whether VL Source data support YUYV format */
42 BOOL VL_SrcUYVY; /*whether VL Source data support UYVY format */
43 BOOL VL_SrcYVYU; /*whether VL Source data support YVYU format */
44 BOOL VL_SrcVYUY; /*whether VL Source data support VYUY format */
45 BOOL VL_SrcPlanarYUV420; /*whether VL Source data support PlanarYUV420 format*/
46 BOOL VL_SrcSemiPlanarYUV420; /*whether VL Source data support SemiPlanarYUV420 format */
47 BOOL VL_GlobalAlpha; /*whether VL support global alpha */
48 BOOL GL_SrcARGB8888; /*whether GL Source data support ARGB8888 format */
49 BOOL GL_SrcRGB888; /*whether GL Source data support RGB888 format */
50 BOOL GL_SrcRGB565; /*whether GL Source data support RGB565 format */
51 BOOL GL_SrcARGB1555; /*whether GL Source data support ARGB1555 format */
52 BOOL GL_Src8BPP; /*whether GL Source data support 8BPP format */
53 BOOL GL_ColorkeyAlpha; /*whether GL support Color key Alpha */
54 BOOL GL_PixelAlpha; /*whether GL supportPixel Alpha */
55 BOOL GL_GlobalAlpha; /*whether GL support global alpha */
56 UINT32 MAX_WIDTH; /*the max pixel width */
57 UINT32 MAX_HEIGTH; /*the max pixel height */
58 BOOL funcOSD_WB; /*whether support OSD write back function */
59} T_ZDrv_OSDInfo;
60
61typedef enum
62{
63 VOU_OPEN = 0x0,
64 VOU_FINISH_ONEFRAME = 0x1,
65 VOU_ERROR = 0x2,
66 VOU_CLOSE = 0x3,
67 MAX_VOU_STATE = 0x4
68}T_ZDrv_VOUSTATE;
69
70typedef enum
71{
72 eDISABLE = 0,
73 eENABLE =1,
74 MAX_eENABLE_TYPE =2
75}T_ZDrv_ENABLE_TYPE;
76
77typedef enum
78 {
79 eLITTLEENDIAN = 0,
80 eBIGENDIAN = 1,
81 MAX_ENDIAN_TYPE = 2
82 }T_ZDrv_ENDIAN;
83
84typedef enum
85 {
86 eSEMI_PLANAR = 0,
87 ePLANAR = 1,
88 eYUV422_YUYV = 2,
89 eYUV422_YVYU = 3,
90 eYUV422_UYVY = 4,
91 eYUV422_VYUY = 5,
92 MAX_DATASRC_MODE = 6
93 }T_ZDrv_VL_DATASRC_MODE;
94
95typedef enum
96 {
97 eARGB8888 = 0,
98 eRGB888 = 1,
99 eRGB565 = 2,
100 eARGB1555 = 3,
101 e8BPP = 4,
102 MAX_DATAFORMAT = 5
103 }T_ZDrv_GL_DATAFORMAT;
104
105typedef enum
106 {
107 eCOLORKEYALPHA= 0 ,
108 eGLOBALALPHA = 1,
109 ePIXALPHA = 2,
110 MAX_ALPHA_SEL =3
111 }T_ZDrv_ALPHA_SEL;
112
113typedef enum
114{
115 eRANGE0To255 = 0,
116 eRANGE0To127 = 1,
117 MAX_PIXALPHA_RANGE = 2
118}T_ZDrv_PIXALPHA_RANGE;
119
120typedef enum
121{
122 eEXTLOWBITS = 0,
123 eEXTHIGHBITS = 1,
124 MAX_EXT_MODE = 2
125}T_ZDrv_EXT_MODE;
126
127typedef enum
128{
129 eEXTBYALL0 = 0,
130 eEXTBYALL1 = 1,
131 eEXTBYLSB = 2,
132 eEXTBYMSB = 3,
133 MAX_EXT_DATA_TYPE = 4
134}T_ZDrv_EXT_DATA_TYPE;
135
136typedef enum
137{
138 eRGB666_IN_18B = 0,
139 eRGB666_IN_24B = 1,
140 eRGB565_IN_32B = 2,
141 eRGB565_IN_16B = 3,
142 MAX_WB_DATA_MODE = 4
143}T_ZDrv_WB_DATA_MODE;
144
145typedef enum
146{
147 RGB_TO_YUV_FOR_SDTV = 0,
148 YUV_TO_RGB_FOR_SDTV = 1,
149 RGB_TO_YUV_FOR_SDTV_COMPUTER = 2,
150 YUV_TO_RGB_FOR_SDTV_COMPUTER = 3,
151 RGB_TO_YUV_FOR_HDTV = 4,
152 YUV_TO_RGB_FOR_HDTV = 5,
153 RGB_TO_YUV_FOR_HDTV_COMPUTER = 6,
154 YUV_TO_RGB_FOR_HDTV_COMPUTER = 7,
155 MAX_CSC_MODE = 8
156}T_ZDrv_CSC_MODE;
157
158typedef struct _T_VOU_POSXY
159{
160 UINT16 startX; /*dislplay start pos X,in pixels,from top left point of screen,range 0~1919 */
161 UINT16 startY; /*dislplay start pos Y,in pixels,from top left point of screen,range 0~1079 */
162 UINT16 endX; /*dislplay end pos X,in pixels,from top left point of screen,range 0~1919 */
163 UINT16 endY; /*dislplay end pos Y,in pixels,from top left point of screen,range 0~1079 */
164} T_ZDrv_VOU_POSXY;
165
166typedef struct _T_VOU_VL_SRCWH
167{
168 UINT16 VLSrcWidth; /*the source width in pixels, make sure picture boundary is inside screen*/
169 UINT16 VLSrcHeight; /*the source height in pixels, make sure picture boundary is inside screen*/
170} T_ZDrv_VOU_VL_SRCWH;
171
172typedef struct _T_VOU_VL_SRCSTR
173{
174 UINT16 VLLuStr; /*the luma stride in bytes, 8 bytes aligned*/
175 UINT16 VLChrStr; /*the chroma stride in bytes, 8 bytes aligned*/
176} T_ZDrv_VOU_VL_SRCSTR;
177
178typedef struct _T_VOU_VL_YUVADDR
179{
180 UINT8* VL_AddrY; /*address of Y for VL,8 bytes aligned*/
181 UINT8* VL_AddrU; /*address of U for VL,8 bytes aligned*/
182 UINT8* VL_AddrV; /*address of V for VL,8 bytes aligned*/
183} T_ZDrv_VOU_VL_YUVADDR;
184
185typedef struct _T_VOU_VL_GALP
186{
187 T_ZDrv_ENABLE_TYPE VL_GAlpEnable; /*enalble VL layer alpha or not*/
188 UINT8 VL_GAlpVal; /*the global alpha value ,range 0~255,0 is transparent*/
189} T_ZDrv_VOU_VL_GALP;
190
191typedef struct _T_VOU_GL_ALP
192{
193 UINT8 GL_AlpA0; /*the alpha for ARGB1555 When A=0 ,range 0~127 or range 0~255,0 is transparent*/
194 UINT8 GL_AlpA1; /*the alpha for ARGB1555 When A=1 ,range 0~127 or range 0~255,0 is transparent*/
195 UINT8 GL_AlpGlobal; /*the global alpha value ,range 0~255,0 is totally transparent*/
196 T_ZDrv_ALPHA_SEL GL_AlphaMode;
197 T_ZDrv_PIXALPHA_RANGE GL_PixelAlpRange;
198} T_ZDrv_VOU_GL_ALP;
199
200typedef struct _T_VOU_VLPara
201{
202 T_ZDrv_ENABLE_TYPE VLEnable; /*enalble VL layer or not*/
203 UINT8 VLPriority; /*VL layer priority ,value range 0~7,he value must diffrent,the smaller value,the higher priority */
204 T_ZDrv_VOU_POSXY VL_PosXY; /*just need the start X Y,end XY can be calculated based on width and height*/
205 T_ZDrv_VL_DATASRC_MODE VLSrcMode; /*the VL src data mode*/
206 T_ZDrv_VOU_VL_SRCSTR VL_SrcStr;
207 T_ZDrv_VOU_VL_SRCWH VL_SrcHW;
208 T_ZDrv_VOU_VL_YUVADDR VL_AddrYUV;
209 T_ZDrv_VOU_VL_GALP VL_GAlp;
210} T_ZDrv_VOU_VLPara;
211
212typedef struct _T_VOU_GL_EXT
213{
214 T_ZDrv_EXT_MODE GL_ExtDir; /*the extension direction , recommand eEXTLOWBITS ,only for ARGB1555 /RGB 565 */
215 T_ZDrv_EXT_DATA_TYPE GL_ExtDataMode; /*the extension date type, recommand eEXTBYALL0 */
216} T_ZDrv_VOU_GL_EXT;
217
218typedef struct _T_VOU_GL_CK0
219{
220 UINT8 GL_AlpColorIn; /*alpha inside color key region0 and region1 ,range 0~255*/
221 UINT8 GL_CK0_MinR; /*the color key region0,the min R value*/
222 UINT8 GL_CK0_MinG; /*the color key region0,the min G value*/
223 UINT8 GL_CK0_MinB; /*the color key region0,the min B value*/
224 UINT8 GL_AlpColorOut; /*alpha outside color key region0 and region1,range 0~255 */
225 UINT8 GL_CK0_MaxR; /*the color key region0,the max R value*/
226 UINT8 GL_CK0_MaxG; /*the color key region0,the max G value*/
227 UINT8 GL_CK0_MaxB; /*the color key region0,the max B value*/
228} T_ZDrv_VOU_GL_CK0;
229
230typedef struct _T_VOU_GL_CK1
231{
232 T_ZDrv_ENABLE_TYPE GL_CKRegion1Enable; /*enalble color key region1 or not*/
233 UINT8 GL_CK1_MinR; /*the color key region1,the min R value*/
234 UINT8 GL_CK1_MinG; /*the color key region1,the min G value*/
235 UINT8 GL_CK1_MinB; /*the color key region1,the min B value*/
236 UINT8 GL_CK1_MaxR; /*the color key region1,the max R value*/
237 UINT8 GL_CK1_MaxG; /*the color key region1,the max G value*/
238 UINT8 GL_CK1_MaxB; /*the color key region1,the max B value*/
239} T_ZDrv_VOU_GL_CK1;
240
241
242typedef struct _T_VOU_GLPara
243{
244 T_ZDrv_ENABLE_TYPE GLEnable; /*enalble GL layer or not*/
245 UINT8 GLPriority; /*GL layer priority ,value range 0~7;the value must diffrent ,the smaller value,the higher priority */
246 T_ZDrv_ENDIAN GL_endianType; /*the graphic data type ,recommand little endian*/
247 T_ZDrv_VOU_POSXY GL_PosXY;
248 T_ZDrv_GL_DATAFORMAT GLSrcMode; /*the GL src data mode*/
249 T_ZDrv_VOU_GL_ALP GL_Alp;
250 T_ZDrv_VOU_GL_EXT GL_Ext;
251 UINT16 GLStride; /*the stride in bytes, 8 bytes aligned*/
252 UINT8* GL_SrcAddr; /*address of Graphic data,8 bytes aligned*/
253 T_ZDrv_VOU_GL_CK0 GL_CK0;
254 T_ZDrv_VOU_GL_CK1 GL_CK1;
255} T_ZDrv_VOU_GLPara;
256
257typedef struct _T_VOU_MC_WH
258{
259 UINT16 MCScrWidth; /*the screen width, max to 1920, multiple of 2 */
260 UINT16 MCScrHeight; /*the screen height, max to 1088, multiple of 2 */
261}T_ZDrv_VOU_MC_WH;
262
263typedef struct _T_VOU_MC_BG
264{
265 UINT8 MC_BGValueR; /*the main back ground R value*/
266 UINT8 MC_BGValueG; /*the main back ground G value*/
267 UINT8 MC_BGValueB; /*the main back ground B value*/
268}T_ZDrv_VOU_MC_BG;
269
270
271typedef struct _T_VOU_MCPara
272{
273 T_ZDrv_ENABLE_TYPE MCEnable; /*enalble main channel or not*/
274 T_ZDrv_VOU_MC_WH MCSrcWH;
275 T_ZDrv_VOU_MC_BG MC_BG_RGB;
276} T_ZDrv_VOU_MCPara;
277
278typedef struct _T_VOU_WB_BUFADDR
279{
280 UINT8* WB_BufAddr0; /*address of write back frame buffer 0,8 bytes aligned*/
281 UINT8* WB_BufAddr1; /*address of write back frame buffer 1,8 bytes aligned*/
282 UINT8* WB_BufAddr2; /*address of write back frame buffer 2,8 bytes aligned*/
283 UINT8* WB_BufAddr3; /*address of write back frame buffer 3,8 bytes aligned*/
284}T_ZDrv_VOU_WB_BUFADDR;
285
286typedef struct _T_VOU_WBPara
287{
288 T_ZDrv_ENABLE_TYPE WBEnable; /*enalble write back or not*/
289 UINT16 WBStride; /*the write back stride, multiple of 8 */
290 UINT8 WBBufNum; /*indicate how many frame buffers will be used,range 1~4*/
291 UINT8 WBPeriod; /*skip n frames before write back one frame,range 0~7*/
292 T_ZDrv_WB_DATA_MODE WBDataMode;
293 T_ZDrv_VOU_WB_BUFADDR WBBufAddr;
294} T_ZDrv_VOU_WBPara;
295
296typedef struct _T_VOU_CSC_Coeff
297{
298 SINT16 CSC_CoeA; /* the coefficient of X in F(X.Y,Z) */
299 SINT16 CSC_CoeB; /* the coefficient of Y in F(X.Y,Z) */
300 SINT16 CSC_CoeC; /* the coefficient of Z in F(X.Y,Z) */
301 SINT16 CSC_CoeD; /* the coefficient of d in F(X.Y,Z) */
302}T_ZDrv_VOU_CSC_Coeff;
303
304typedef struct _T_VOU_CSC_SPACE
305{
306 UINT8 CSC_SPACE_FLOOR; /* the floor level of col */
307 UINT8 CSC_SPACE_TOP; /* the top level of col */
308}T_ZDrv_VOU_CSC_SPACE;
309
310typedef struct _T_VOU_CSCPara
311{
312 T_ZDrv_ENABLE_TYPE CSCEnable; /*enalble CSC or not*/
313 T_ZDrv_CSC_MODE CSC_ConMode; /* the conversion mode */
314 T_ZDrv_VOU_CSC_Coeff CSC_XYZ_F[3]; /* the coefficient of X in F1(X.Y,Z) ,F2(X.Y,Z) ,F3(X.Y,Z) */
315 T_ZDrv_VOU_CSC_SPACE CSC_SPACE_IN[3]; /* the floor&top level of col_in1, col_in2,col_in3*/
316 T_ZDrv_VOU_CSC_SPACE CSC_SPACE_OUT[3]; /* the floor&top level of col_out1, col_out2,col_out3*/
317} T_ZDrv_VOU_CSCPara;
318
319typedef struct _T_VOU_OSDPara
320{
321 T_ZDrv_VOU_VLPara OSD_VLPara; /*Video layer Parameters*/
322 T_ZDrv_VOU_GLPara OSD_GLPara; /*Graphic layer Parameters*/
323 T_ZDrv_VOU_MCPara OSD_MCPara; /*Main Chanle Parameters*/
324} T_ZDrv_VOU_OSDPara;
325
326/****************************************************************************
327* Constants
328****************************************************************************/
329
330/****************************************************************************
331* Global Variables
332****************************************************************************/
333
334/****************************************************************************
335* Function Prototypes
336****************************************************************************/
337
338
339
340#endif/*_FILENAME_H*/
341