1 /* 2 * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 */ 18 19 #ifndef __DRV_TDE_TYPE_H__ 20 #define __DRV_TDE_TYPE_H__ 21 22 #include "hi_tde_errcode.h" 23 24 #ifdef __cplusplus 25 #if __cplusplus 26 extern "C" { 27 #endif /* __cplusplus */ 28 #endif /* __cplusplus */ 29 30 /* Definition of the TDE handle */ 31 /* TDE callback functions */ 32 typedef hi_void (*tde_func_cb)(hi_void *, hi_void *); 33 34 typedef hi_void (*tde_trig_sel)(hi_u32); 35 36 /* RGB and packet YUV formats */ 37 typedef enum { 38 HI_TDE_COLOR_FMT_RGB444 = 0, /* 39 * <For the RGB444 format, 40 * red occupies four bits, green occupies four bits, 41 * and blue occupies four bits. Other formats may be deduced by 42 * analogy. 43 */ 44 HI_TDE_COLOR_FMT_BGR444, /* <BGR444 format */ 45 HI_TDE_COLOR_FMT_RGB555, /* <RGB555 format */ 46 HI_TDE_COLOR_FMT_BGR555, /* <BGR555 format */ 47 HI_TDE_COLOR_FMT_RGB565, /* <RGB565 format */ 48 HI_TDE_COLOR_FMT_BGR565, /* <BGR565 format */ 49 HI_TDE_COLOR_FMT_RGB888, /* <RGB888 format */ 50 HI_TDE_COLOR_FMT_BGR888, /* <BGR888 format */ 51 HI_TDE_COLOR_FMT_ARGB4444, /* <ARGB4444 format */ 52 HI_TDE_COLOR_FMT_ABGR4444, /* <ABGR4444 format */ 53 HI_TDE_COLOR_FMT_RGBA4444, /* <RGBA4444 format */ 54 HI_TDE_COLOR_FMT_BGRA4444, /* <BGRA4444 format */ 55 HI_TDE_COLOR_FMT_ARGB1555, /* <ARGB1555 format */ 56 HI_TDE_COLOR_FMT_ABGR1555, /* <ABGR1555 format */ 57 HI_TDE_COLOR_FMT_RGBA1555, /* <RGBA1555 format */ 58 HI_TDE_COLOR_FMT_BGRA1555, /* <BGRA1555 format */ 59 HI_TDE_COLOR_FMT_ARGB8565, /* <ARGB8565 format */ 60 HI_TDE_COLOR_FMT_ABGR8565, /* <ABGR8565 format */ 61 HI_TDE_COLOR_FMT_RGBA8565, /* <RGBA8565 format */ 62 HI_TDE_COLOR_FMT_BGRA8565, /* <BGRA8565 format */ 63 HI_TDE_COLOR_FMT_ARGB8888, /* <ARGB8888 format */ 64 HI_TDE_COLOR_FMT_ABGR8888, /* <ABGR8888 format */ 65 HI_TDE_COLOR_FMT_RGBA8888, /* <RGBA8888 format */ 66 HI_TDE_COLOR_FMT_BGRA8888, /* <BGRA8888 format */ 67 HI_TDE_COLOR_FMT_RABG8888, /* <RABG8888 format */ 68 HI_TDE_COLOR_FMT_CLUT1, /* <1-bit palette format without alpha component. Each pixel occupies one bit. */ 69 HI_TDE_COLOR_FMT_CLUT2, /* <2-bit palette format without alpha component. Each pixel occupies two bits. */ 70 HI_TDE_COLOR_FMT_CLUT4, /* <4-bit palette format without alpha component. Each pixel occupies four bits. */ 71 HI_TDE_COLOR_FMT_CLUT8, /* <8-bit palette format without alpha component. Each pixel occupies eight bits. */ 72 HI_TDE_COLOR_FMT_ACLUT44, /* <1-bit palette format with alpha component. Each pixel occupies one bit. */ 73 HI_TDE_COLOR_FMT_ACLUT88, /* <1-bit palette format with alpha component. Each pixel occupies one bit. */ 74 HI_TDE_COLOR_FMT_A1, /* <Alpha format. Each pixel occupies one bit. */ 75 HI_TDE_COLOR_FMT_A8, /* <Alpha format. Each pixel occupies eight bits. */ 76 HI_TDE_COLOR_FMT_YCBCR888, /* <YUV packet format without alpha component */ 77 HI_TDE_COLOR_FMT_AYCBCR8888, /* <YUV packet format with alpha component */ 78 HI_TDE_COLOR_FMT_YCBCR422, /* <YUV packet422 format */ 79 HI_TDE_COLOR_FMT_PKGVYUY, /* <YUV packet422 format, VYUY format */ 80 HI_TDE_COLOR_FMT_BYTE, /* <Only for fast copy */ 81 HI_TDE_COLOR_FMT_HALFWORD, /* <Only for fast copy */ 82 HI_TDE_COLOR_FMT_JPG_YCBCR400MBP, /* <Semi-planar YUV400 format, for JPG decoding */ 83 HI_TDE_COLOR_FMT_JPG_YCBCR422MBHP, /* <Semi-planar YUV422 format, horizontal sampling, for JPG decoding */ 84 HI_TDE_COLOR_FMT_JPG_YCBCR422MBVP, /* <Semi-planar YUV422 format, vertical sampling, for JPG decoding */ 85 HI_TDE_COLOR_FMT_MP1_YCBCR420MBP, /* <Semi-planar YUV420 format */ 86 HI_TDE_COLOR_FMT_MP2_YCBCR420MBP, /* <Semi-planar YUV420 format */ 87 HI_TDE_COLOR_FMT_MP2_YCBCR420MBI, /* <Semi-planar YUV400 format */ 88 HI_TDE_COLOR_FMT_JPG_YCBCR420MBP, /* <Semi-planar YUV400 format, for JPG decoding */ 89 HI_TDE_COLOR_FMT_JPG_YCBCR444MBP, /* <Semi-planar YUV444 format */ 90 HI_TDE_COLOR_FMT_MAX /* <End of enumeration */ 91 } hi_tde_color_fmt; 92 93 /* Definition of the semi-planar YUV format */ 94 typedef enum { 95 HI_TDE_MB_COLOR_FMT_JPG_YCBCR400MBP = 0, /* <Semi-planar YUV400 format, for JPG decoding */ 96 HI_TDE_MB_COLOR_FMT_JPG_YCBCR422MBHP, /* <Semi-planar YUV422 format, horizontal sampling, for JPG decoding */ 97 HI_TDE_MB_COLOR_FMT_JPG_YCBCR422MBVP, /* <Semi-planar YUV422 format, vertical sampling, for JPG decoding */ 98 HI_TDE_MB_COLOR_FMT_MP1_YCBCR420MBP, /* <Semi-planar YUV420 format */ 99 HI_TDE_MB_COLOR_FMT_MP2_YCBCR420MBP, /* <Semi-planar YUV420 format */ 100 HI_TDE_MB_COLOR_FMT_MP2_YCBCR420MBI, /* <Semi-planar YUV400 format */ 101 HI_TDE_MB_COLOR_FMT_JPG_YCBCR420MBP, /* <Semi-planar YUV400 format, for JPG pictures */ 102 HI_TDE_MB_COLOR_FMT_JPG_YCBCR444MBP, /* <Semi-planar YUV444 format, for JPG pictures */ 103 HI_TDE_MB_COLOR_FMT_MAX 104 } hi_tde_mb_color_fmt; 105 106 /* Structure of the bitmap information set by customers */ 107 typedef struct { 108 hi_u64 phy_addr; /* <Header address of a bitmap or the Y component */ 109 110 hi_tde_color_fmt color_fmt; /* <Color format */ 111 112 hi_u32 height; /* <Bitmap height */ 113 114 hi_u32 width; /* <Bitmap width */ 115 116 hi_u32 stride; /* <Stride of a bitmap or the Y component */ 117 118 hi_bool is_ycbcr_clut; /* <Whether the CLUT is in the YCbCr space. */ 119 120 hi_bool alpha_max_is_255; /* <The maximum alpha value of a bitmap is 255 or 128. */ 121 122 hi_bool support_alpha_ext_1555; /* <Whether to enable the alpha extension of an ARGB1555 bitmap. */ 123 hi_u8 alpha0; /* <Values of alpha0 and alpha1, used as the ARGB1555 format */ 124 hi_u8 alpha1; /* <Values of alpha0 and alpha1, used as the ARGB1555 format */ 125 hi_u64 cbcr_phy_addr; /* <Address of the CbCr component, pilot */ 126 hi_u32 cbcr_stride; /* <Stride of the CbCr component, pilot */ 127 hi_u64 clut_phy_addr; /* <Address of the color look-up table (CLUT), for color extension or color correction */ 128 } hi_tde_surface; 129 130 /* Definition of the semi-planar YUV data */ 131 typedef struct { 132 hi_tde_mb_color_fmt mb_color_fmt; /* <YUV format */ 133 hi_u64 y_addr; /* <Physical address of the Y component */ 134 hi_u32 y_width; /* <Width of the Y component */ 135 hi_u32 y_height; /* <Height of the Y component */ 136 hi_u32 y_stride; /* < Stride of the Y component, indicating bytes in each row */ 137 hi_u64 cbcr_phy_addr; /* <Width of the UV component */ 138 hi_u32 cbcr_stride; /* <Stride of the UV component, indicating the bytes in each row */ 139 } hi_tde_mb_surface; 140 141 /* Definition of the TDE rectangle */ 142 typedef struct { 143 hi_s32 pos_x; /* <Horizontal coordinate */ 144 hi_s32 pos_y; /* <Vertical coordinate */ 145 hi_u32 width; /* <Width */ 146 hi_u32 height; /* <Height */ 147 } hi_tde_rect; 148 149 /* dma module */ 150 typedef struct { 151 hi_tde_surface *dst_surface; 152 hi_tde_rect *dst_rect; 153 } hi_tde_none_src; 154 155 /* single source */ 156 typedef struct { 157 hi_tde_surface *src_surface; 158 hi_tde_surface *dst_surface; 159 hi_tde_rect *src_rect; 160 hi_tde_rect *dst_rect; 161 } hi_tde_single_src; 162 163 /* mb source */ 164 typedef struct { 165 hi_tde_mb_surface *mb_surface; 166 hi_tde_surface *dst_surface; 167 hi_tde_rect *src_rect; 168 hi_tde_rect *dst_rect; 169 } hi_tde_mb_src; 170 171 /* double source */ 172 typedef struct { 173 hi_tde_surface *bg_surface; 174 hi_tde_surface *fg_surface; 175 hi_tde_surface *dst_surface; 176 hi_tde_rect *bg_rect; 177 hi_tde_rect *fg_rect; 178 hi_tde_rect *dst_rect; 179 } hi_tde_double_src; 180 181 /* triple source */ 182 typedef struct { 183 hi_tde_surface *bg_surface; 184 hi_tde_surface *fg_surface; 185 hi_tde_surface *dst_surface; 186 hi_tde_surface *mask_surface; 187 hi_tde_rect *bg_rect; 188 hi_tde_rect *fg_rect; 189 hi_tde_rect *mask_rect; 190 hi_tde_rect *dst_rect; 191 } hi_tde_triple_src; 192 193 /* command info */ 194 typedef struct { 195 hi_s32 handle; /* < TDE handle */ 196 hi_bool is_sync; /* < weather sync */ 197 hi_bool is_block; /* < weather block */ 198 hi_u32 time_out; /* < time out(ms) */ 199 } drv_tde_end_job_cmd; 200 201 /* Logical operation type */ 202 typedef enum { 203 HI_TDE_ALPHA_BLENDING_NONE = 0x0, /* <No alpha and raster of operation (ROP) blending */ 204 HI_TDE_ALPHA_BLENDING_BLEND = 0x1, /* <Alpha blending */ 205 HI_TDE_ALPHA_BLENDING_ROP = 0x2, /* <ROP blending */ 206 HI_TDE_ALPHA_BLENDING_COLORIZE = 0x4, /* <Colorize operation */ 207 HI_TDE_ALPHA_BLENDING_MAX = 0x8 /* <End of enumeration */ 208 } hi_tde_alpha_blending; 209 210 /* Definition of ROP codes */ 211 typedef enum { 212 HI_TDE_ROP_BLACK = 0, /* <Blackness */ 213 HI_TDE_ROP_NOTMERGEPEN, /* <~(S2 | S1) */ 214 HI_TDE_ROP_MASKNOTPEN, /* <~S2&S1 */ 215 HI_TDE_ROP_NOTCOPYPEN, /* < ~S2 */ 216 HI_TDE_ROP_MASKPENNOT, /* < S2&~S1 */ 217 HI_TDE_ROP_NOT, /* < ~S1 */ 218 HI_TDE_ROP_XORPEN, /* < S2^S1 */ 219 HI_TDE_ROP_NOTMASKPEN, /* < ~(S2 & S1) */ 220 HI_TDE_ROP_MASKPEN, /* < S2&S1 */ 221 HI_TDE_ROP_NOTXORPEN, /* < ~(S2^S1) */ 222 HI_TDE_ROP_NOP, /* < S1 */ 223 HI_TDE_ROP_MERGENOTPEN, /* < ~S2|S1 */ 224 HI_TDE_ROP_COPYPEN, /* < S2 */ 225 HI_TDE_ROP_MERGEPENNOT, /* < S2|~S1 */ 226 HI_TDE_ROP_MERGEPEN, /* < S2|S1 */ 227 HI_TDE_ROP_WHITE, /* < Whiteness */ 228 HI_TDE_ROP_MAX 229 } hi_tde_rop_mode; 230 231 /* Definition of the blit mirror */ 232 typedef enum { 233 HI_TDE_MIRROR_NONE = 0, /* <No mirror */ 234 HI_TDE_MIRROR_HORIZONTAL, /* <Horizontal mirror */ 235 HI_TDE_MIRROR_VERTICAL, /* <Vertical mirror */ 236 HI_TDE_MIRROR_BOTH, /* <Horizontal and vertical mirror */ 237 HI_TDE_MIRROR_MAX 238 } hi_tde_mirror_mode; 239 240 /* Clip operation type */ 241 typedef enum { 242 HI_TDE_CLIP_MODE_NONE = 0, /* <No clip */ 243 HI_TDE_CLIP_MODE_INSIDE, /* <Clip the data within the rectangle to output and discard others */ 244 HI_TDE_CLIP_MODE_OUTSIDE, /* <Clip the data outside the rectangle to output and discard others */ 245 HI_TDE_CLIP_MODE_MAX 246 } hi_tde_clip_mode; 247 248 /* Scaling mode for the macroblock */ 249 typedef enum { 250 HI_TDE_MB_RESIZE_NONE = 0, /* <No scaling */ 251 HI_TDE_MB_RESIZE_QUALITY_LOW, /* <Low-quality scaling */ 252 HI_TDE_MB_RESIZE_QUALITY_MIDDLE, /* <Medium-quality scaling */ 253 HI_TDE_MB_RESIZE_QUALITY_HIGH, /* <High-quality scaling */ 254 HI_TDE_MB_RESIZE_MAX 255 } hi_tde_mb_resize; 256 257 /* Definition of fill colors */ 258 typedef struct { 259 hi_tde_color_fmt color_fmt; /* <TDE pixel format */ 260 hi_u32 color_value; /* <Fill colors that vary according to pixel formats */ 261 } hi_tde_fill_color; 262 263 /* Definition of colorkey modes */ 264 typedef enum { 265 HI_TDE_COLOR_KEY_MODE_NONE = 0, /* <No colorkey */ 266 HI_TDE_COLOR_KEY_MODE_FOREGROUND, /* 267 * <When performing the colorkey operation on the foreground bitmap, 268 * you need to perform this operation before the CLUT for color extension 269 * and perform this operation after the CLUT for 270 * color correction. 271 */ 272 HI_TDE_COLOR_KEY_MODE_BACKGROUND, /* <Perform the colorkey operation on the background bitmap */ 273 HI_TDE_COLOR_KEY_MODE_MAX 274 } hi_tde_color_key_mode; 275 276 /* Definition of colorkey range */ 277 typedef struct { 278 hi_u8 component_min; /* <Minimum value of a component */ 279 hi_u8 component_max; /* <Maximum value of a component */ 280 hi_u8 is_component_out; /* <The colorkey of a component is within or beyond the range. */ 281 hi_u8 is_component_ignore; /* <Whether to ignore a component. */ 282 hi_u8 component_mask; /* <Component mask */ 283 hi_u8 component_reserved; 284 hi_u8 component_reserved1; 285 hi_u8 component_reserved2; 286 } hi_tde_color_key_comp; 287 288 /* Definition of colorkey values */ 289 typedef union { 290 struct { 291 hi_tde_color_key_comp alpha; /* <Alpha component */ 292 hi_tde_color_key_comp red; /* <Red component */ 293 hi_tde_color_key_comp green; /* <Green component */ 294 hi_tde_color_key_comp blue; /* <Blue component */ 295 } argb_color_key; 296 struct { 297 hi_tde_color_key_comp alpha; /* <Alpha component */ 298 hi_tde_color_key_comp y; /* <Y component */ 299 hi_tde_color_key_comp cb; /* <Cb component */ 300 hi_tde_color_key_comp cr; /* <Cr component */ 301 } ycbcr_color_key; 302 struct { 303 hi_tde_color_key_comp alpha; /* <Alpha component */ 304 hi_tde_color_key_comp clut; /* <Palette component */ 305 } clut_color_key; 306 } hi_tde_color_key; 307 308 /* Definition of alpha output sources */ 309 typedef enum { 310 HI_TDE_OUT_ALPHA_FROM_NORM = 0, /* <Output from the result of alpha blending or anti-flicker */ 311 HI_TDE_OUT_ALPHA_FROM_BACKGROUND, /* <Output from the background bitmap */ 312 HI_TDE_OUT_ALPHA_FROM_FOREGROUND, /* <Output from the foreground bitmap */ 313 HI_TDE_OUT_ALPHA_FROM_GLOBALALPHA, /* <Output from the global alpha */ 314 HI_TDE_OUT_ALPHA_FROM_MAX 315 } hi_tde_out_alpha_from; 316 317 /* Definition of filtering */ 318 typedef enum { 319 HI_TDE_FILTER_MODE_COLOR = 0, /* <Filter the color */ 320 HI_TDE_FILTER_MODE_ALPHA, /* <Filter the alpha channel */ 321 HI_TDE_FILTER_MODE_BOTH, /* <Filter the color and alpha channel */ 322 HI_TDE_FILTER_MODE_NONE, /* <No filter */ 323 HI_TDE_FILTER_MODE_MAX 324 } hi_tde_filter_mode; 325 326 /* Configuration of the anti-flicker channel */ 327 typedef enum { 328 HI_TDE_DEFLICKER_LEVEL_MODE_NONE = 0, /* <No anti-flicker */ 329 HI_TDE_DEFLICKER_LEVEL_MODE_RGB, /* <Perform anti-flicker on the RGB component */ 330 HI_TDE_DEFLICKER_LEVEL_MODE_BOTH, /* <Perform anti-flicker on the alpha component */ 331 HI_TDE_DEFLICKER_LEVEL_MODE_MAX 332 } hi_tde_deflicker_mode; 333 334 /* blend mode */ 335 typedef enum { 336 HI_TDE_BLEND_ZERO = 0x0, 337 HI_TDE_BLEND_ONE, 338 HI_TDE_BLEND_SRC2COLOR, 339 HI_TDE_BLEND_INVSRC2COLOR, 340 HI_TDE_BLEND_SRC2ALPHA, 341 HI_TDE_BLEND_INVSRC2ALPHA, 342 HI_TDE_BLEND_SRC1COLOR, 343 HI_TDE_BLEND_INVSRC1COLOR, 344 HI_TDE_BLEND_SRC1ALPHA, 345 HI_TDE_BLEND_INVSRC1ALPHA, 346 HI_TDE_BLEND_SRC2ALPHASAT, 347 HI_TDE_BLEND_MAX 348 } hi_tde_blend_mode; 349 350 /* 351 * pixel = (source * fs + destination * fd), 352 * sa = source alpha, 353 * da = destination alpha 354 */ 355 typedef enum { 356 HI_TDE_BLEND_CMD_NONE = 0x0, /* < fs: sa fd: 1.0-sa */ 357 HI_TDE_BLEND_CMD_CLEAR, /* < fs: 0.0 fd: 0.0 */ 358 HI_TDE_BLEND_CMD_SRC, /* < fs: 1.0 fd: 0.0 */ 359 HI_TDE_BLEND_CMD_SRCOVER, /* < fs: 1.0 fd: 1.0-sa */ 360 HI_TDE_BLEND_CMD_DSTOVER, /* < fs: 1.0-da fd: 1.0 */ 361 HI_TDE_BLEND_CMD_SRCIN, /* < fs: da fd: 0.0 */ 362 HI_TDE_BLEND_CMD_DSTIN, /* < fs: 0.0 fd: sa */ 363 HI_TDE_BLEND_CMD_SRCOUT, /* < fs: 1.0-da fd: 0.0 */ 364 HI_TDE_BLEND_CMD_DSTOUT, /* < fs: 0.0 fd: 1.0-sa */ 365 HI_TDE_BLEND_CMD_SRCATOP, /* < fs: da fd: 1.0-sa */ 366 HI_TDE_BLEND_CMD_DSTATOP, /* < fs: 1.0-da fd: sa */ 367 HI_TDE_BLEND_CMD_ADD, /* < fs: 1.0 fd: 1.0 */ 368 HI_TDE_BLEND_CMD_XOR, /* < fs: 1.0-da fd: 1.0-sa */ 369 HI_TDE_BLEND_CMD_DST, /* < fs: 0.0 fd: 1.0 */ 370 HI_TDE_BLEND_CMD_CONFIG, /* <You can set the parameteres. */ 371 HI_TDE_BLEND_CMD_MAX 372 } hi_tde_blend_cmd; 373 374 /* Options for the alpha blending operation */ 375 typedef struct { 376 hi_bool global_alpha_en; /* <Global alpha enable */ 377 hi_bool pixel_alpha_en; /* <Pixel alpha enable */ 378 hi_bool src1_alpha_premulti; /* <Src1 alpha premultiply enable */ 379 hi_bool src2_alpha_premulti; /* <Src2 alpha premultiply enable */ 380 hi_tde_blend_cmd blend_cmd; /* <Alpha blending command */ 381 /* Src1 blending mode select. It is valid when blend_cmd is set to HI_TDE_BLEND_CMD_CONFIG */ 382 hi_tde_blend_mode src1_blend_mode; 383 /* Src2 blending mode select. It is valid when blend_cmd is set to HI_TDE_BLEND_CMD_CONFIG */ 384 hi_tde_blend_mode src2_blend_mode; 385 } hi_tde_blend_opt; 386 387 /* CSC parameter option */ 388 typedef struct { 389 hi_bool src_csc_user_en; /* User-defined ICSC parameter enable */ 390 hi_bool src_csc_param_reload_en; /* User-defined ICSC parameter reload enable */ 391 hi_bool dst_csc_user_en; /* User-defined OCSC parameter enable */ 392 hi_bool dst_csc_param_reload_en; /* User-defined OCSC parameter reload enable */ 393 hi_u64 src_csc_param_addr; /* ICSC parameter address. The address must be 128-bit aligned. */ 394 hi_u64 dst_csc_param_addr; /* OCSC parameter address. The address must be 128-bit aligned. */ 395 } hi_tde_csc_opt; 396 397 /* Definition of blit operation options */ 398 typedef struct { 399 hi_tde_alpha_blending alpha_blending_cmd; /* <Logical operation type */ 400 401 hi_tde_rop_mode rop_color; /* <ROP type of the color space */ 402 403 hi_tde_rop_mode rop_alpha; /* <ROP type of the alpha component */ 404 405 hi_tde_color_key_mode color_key_mode; /* <Colorkey mode */ 406 407 hi_tde_color_key color_key_value; /* <Colorkey value */ 408 409 hi_tde_clip_mode clip_mode; /* <Perform the clip operation within or beyond the area */ 410 411 hi_tde_rect clip_rect; /* <Definition of the clipping area */ 412 413 hi_tde_deflicker_mode deflicker_mode; /* <Anti-flicker mode */ 414 415 hi_bool resize; /* <Whether to scale */ 416 417 hi_tde_filter_mode filter_mode; /* <Filtering mode during scaling */ 418 419 hi_tde_mirror_mode mirror; /* <Mirror type */ 420 421 hi_bool clut_reload; /* <Whether to reload the CLUT */ 422 423 hi_u8 global_alpha; /* <Global alpha value */ 424 425 hi_tde_out_alpha_from out_alpha_from; /* <Source of the output alpha */ 426 427 hi_u32 color_resize; /* <Colorize value */ 428 429 hi_tde_blend_opt blend_opt; 430 431 hi_tde_csc_opt csc_opt; 432 hi_bool is_compress; 433 hi_bool is_decompress; 434 } hi_tde_opt; 435 436 /* Definition of macroblock operation options */ 437 typedef struct { 438 hi_tde_clip_mode clip_mode; /* <Clip mode */ 439 440 hi_tde_rect clip_rect; /* <Definition of the clipping area */ 441 442 hi_bool is_deflicker; /* <Whether to perform anti-flicker */ 443 444 hi_tde_mb_resize resize_en; /* <Scaling information */ 445 446 hi_bool is_set_out_alpha; /* <If the alpha value is not set, the maximum alpha value is output by default. */ 447 448 hi_u8 out_alpha; /* <Global alpha for operation */ 449 } hi_tde_mb_opt; 450 451 /* Definition of the pattern filling operation */ 452 typedef struct { 453 hi_tde_alpha_blending alpha_blending_cmd; /* <Logical operation type */ 454 455 hi_tde_rop_mode rop_color; /* <ROP type of the color space */ 456 457 hi_tde_rop_mode rop_alpha; /* <ROP type of the alpha component */ 458 459 hi_tde_color_key_mode color_key_mode; /* <Colorkey mode */ 460 461 hi_tde_color_key color_key_value; /* <Colorkey value */ 462 463 hi_tde_clip_mode clip_mode; /* <Clip mode */ 464 465 hi_tde_rect clip_rect; /* <Clipping area */ 466 467 hi_bool clut_reload; /* <Whether to reload the CLUT */ 468 469 hi_u8 global_alpha; /* <Global alpha */ 470 471 hi_tde_out_alpha_from out_alpha_from; /* <Source of the output alpha */ 472 473 hi_u32 color_resize; /* <Colorize value */ 474 475 hi_tde_blend_opt blend_opt; /* <Options of the blending operation */ 476 477 hi_tde_csc_opt csc_opt; /* <CSC parameter option */ 478 } hi_tde_pattern_fill_opt; 479 480 /* Definition of rotation directions */ 481 typedef enum { 482 HI_TDE_ROTATE_CLOCKWISE_90 = 0, /* <Rotate 90 degree clockwise */ 483 HI_TDE_ROTATE_CLOCKWISE_180, /* <Rotate 180 degree clockwise */ 484 HI_TDE_ROTATE_CLOCKWISE_270, /* <Rotate 270 degree clockwise */ 485 HI_TDE_ROTATE_MAX 486 } hi_tde_rotate_angle; 487 488 /* Definition of anti-flicker levels */ 489 typedef enum { 490 HI_TDE_DEFLICKER_LEVEL_AUTO = 0, /* <Adaptation. The anti-flicker coefficient is selected by the TDE. */ 491 HI_TDE_DEFLICKER_LEVEL_LOW, /* <Low-level anti-flicker */ 492 HI_TDE_DEFLICKER_LEVEL_MIDDLE, /* <Medium-level anti-flicker */ 493 HI_TDE_DEFLICKER_LEVEL_HIGH, /* High-level anti-flicker */ 494 HI_TDE_DEFLICKER_LEVEL_MAX 495 } hi_tde_deflicker_level; 496 497 /* composed surface info */ 498 typedef struct { 499 hi_tde_surface src_surface; 500 hi_tde_rect src_rect; 501 hi_tde_rect dst_rect; 502 hi_tde_opt option; 503 } hi_tde_composer; 504 505 /* composed surface list */ 506 typedef struct { 507 hi_u32 surface_num; 508 hi_tde_surface *dst_surface; 509 hi_tde_composer *composor; 510 } hi_tde_surface_list; 511 512 #ifdef __cplusplus 513 #if __cplusplus 514 } 515 #endif /* __cplusplus */ 516 #endif /* __cplusplus */ 517 518 #endif /* End of #ifndef __TDE_TYPE_H__ */ 519