1 /* 2 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 /** 17 * @addtogroup Display 18 * @{ 19 * 20 * @brief Defines driver functions of the display module. 21 * 22 * This module provides driver functions for the graphics subsystem, including graphics layer management, 23 * device control, graphics hardware acceleration, display memory management, and callbacks. 24 * 25 * @since 1.0 26 * @version 2.0 27 */ 28 29 /** 30 * @file display_type.h 31 * 32 * @brief Declares the data types used by the display driver functions. 33 * 34 * @since 1.0 35 * @version 2.0 36 */ 37 38 #ifndef DISPLAY_TYPE_H 39 #define DISPLAY_TYPE_H 40 #include <fcntl.h> 41 #include <stdbool.h> 42 #include <stddef.h> 43 #include <stdlib.h> 44 #include <sys/ioctl.h> 45 #include <sys/prctl.h> 46 #include <sys/types.h> 47 #include <unistd.h> 48 #include <stdint.h> 49 #include "buffer_handle.h" 50 51 #ifdef __cplusplus 52 extern "C" { 53 #endif 54 55 /** 56 * @brief Enumerates return values of the functions. 57 * 58 */ 59 typedef enum { 60 DISPLAY_SUCCESS = 0, /**< Success */ 61 DISPLAY_FAILURE = -1, /**< Failure */ 62 DISPLAY_FD_ERR = -2, /**< File handle (FD) error */ 63 DISPLAY_PARAM_ERR = -3, /**< Parameter error */ 64 DISPLAY_NULL_PTR = -4, /**< Null pointer */ 65 DISPLAY_NOT_SUPPORT = -5, /**< Unsupported feature */ 66 DISPLAY_NOMEM = -6, /**< Insufficient memory */ 67 DISPLAY_SYS_BUSY = -7, /**< System busy */ 68 DISPLAY_NOT_PERM = -8 /**< Forbidden operation */ 69 } DispErrCode; 70 71 /** 72 * @brief Enumerates layer types. 73 * 74 */ 75 typedef enum { 76 LAYER_TYPE_GRAPHIC, /**< Graphic layer */ 77 LAYER_TYPE_OVERLAY, /**< Overlay layer */ 78 LAYER_TYPE_SDIEBAND, /**< Sideband layer */ 79 LAYER_TYPE_CURSOR, /**< Cursor Layer */ 80 LAYER_TYPE_BUTT /**< Empty layer */ 81 } LayerType; 82 83 /* * 84 * @brief Defines the buffer usage. 85 * 86 */ 87 enum { 88 HBM_USE_CPU_READ = (1 << 0), /**< CPU will read the memory */ 89 HBM_USE_CPU_WRITE = (1 << 1), /**< CPU will write the memory */ 90 HBM_USE_MEM_MMZ = (1 << 2), /**< will use mmz to allocate memory */ 91 HBM_USE_MEM_DMA = (1 << 3), /**< the allocator should support dma buffer */ 92 HBM_USE_MEM_SHARE = (1 << 4), /**< the allocator should support shared memory buffer*/ 93 HBM_USE_MEM_MMZ_CACHE = (1 << 5), /**< will use mmz to allocate memory with cache*/ 94 HBM_USE_MEM_FB = (1 << 6), /**< the buffer allocate for framebuffer */ 95 HBM_USE_ASSIGN_SIZE = (1 << 7), /**< assign memory size from requester */ 96 }; 97 98 /** 99 * @brief Enumerates pixel formats. 100 * 101 */ 102 typedef enum { 103 PIXEL_FMT_CLUT8 = 0, /**< CLUT8 format */ 104 PIXEL_FMT_CLUT1, /**< CLUT1 format */ 105 PIXEL_FMT_CLUT4, /**< CLUT4 format */ 106 PIXEL_FMT_RGB_565, /**< RGB565 format */ 107 PIXEL_FMT_RGBA_5658, /**< RGBA5658 format */ 108 PIXEL_FMT_RGBX_4444, /**< RGBX4444 format */ 109 PIXEL_FMT_RGBA_4444, /**< RGBA4444 format */ 110 PIXEL_FMT_RGB_444, /**< RGB444 format */ 111 PIXEL_FMT_RGBX_5551, /**< RGBX5551 format */ 112 PIXEL_FMT_RGBA_5551, /**< RGBA5551 format */ 113 PIXEL_FMT_RGB_555, /**< RGB555 format */ 114 PIXEL_FMT_RGBX_8888, /**< RGBX8888 format */ 115 PIXEL_FMT_RGBA_8888, /**< RGBA8888 format */ 116 PIXEL_FMT_RGB_888, /**< RGB888 format */ 117 PIXEL_FMT_BGR_565, /**< BGR565 format */ 118 PIXEL_FMT_BGRX_4444, /**< BGRX4444 format */ 119 PIXEL_FMT_BGRA_4444, /**< BGRA4444 format */ 120 PIXEL_FMT_BGRX_5551, /**< BGRX5551 format */ 121 PIXEL_FMT_BGRA_5551, /**< BGRA5551 format */ 122 PIXEL_FMT_BGRX_8888, /**< BGRX8888 format */ 123 PIXEL_FMT_BGRA_8888, /**< BGRA8888 format */ 124 PIXEL_FMT_YUV_422_I, /**< YUV422 interleaved format */ 125 PIXEL_FMT_YCBCR_422_SP, /**< YCBCR422 semi-planar format */ 126 PIXEL_FMT_YCRCB_422_SP, /**< YCRCB422 semi-planar format */ 127 PIXEL_FMT_YCBCR_420_SP, /**< YCBCR420 semi-planar format */ 128 PIXEL_FMT_YCRCB_420_SP, /**< YCRCB420 semi-planar format */ 129 PIXEL_FMT_YCBCR_422_P, /**< YCBCR422 planar format */ 130 PIXEL_FMT_YCRCB_422_P, /**< YCRCB422 planar format */ 131 PIXEL_FMT_YCBCR_420_P, /**< YCBCR420 planar format */ 132 PIXEL_FMT_YCRCB_420_P, /**< YCRCB420 planar format */ 133 PIXEL_FMT_YUYV_422_PKG, /**< YUYV422 packed format */ 134 PIXEL_FMT_UYVY_422_PKG, /**< UYVY422 packed format */ 135 PIXEL_FMT_YVYU_422_PKG, /**< YVYU422 packed format */ 136 PIXEL_FMT_VYUY_422_PKG, /**< VYUY422 packed format */ 137 PIXEL_FMT_BUTT /**< Invalid pixel format */ 138 } PixelFormat; 139 140 /** 141 * @brief Enumerates transform types of images. 142 * 143 */ 144 typedef enum { 145 ROTATE_NONE = 0, /**< No rotation */ 146 ROTATE_90, /**< Rotation by 90 degrees */ 147 ROTATE_180, /**< Rotation by 180 degrees */ 148 ROTATE_270, /**< Rotation by 270 degrees */ 149 ROTATE_BUTT /**< Invalid operation */ 150 } TransformType; 151 152 /** 153 * @brief Enumerates image blending types. 154 * 155 * The system combines images based on a specified blending type during hardware acceleration. 156 * 157 */ 158 typedef enum { 159 BLEND_NONE = 0, /**< No blending */ 160 BLEND_CLEAR, /**< CLEAR blending */ 161 BLEND_SRC, /**< SRC blending */ 162 BLEND_SRCOVER, /**< SRC_OVER blending */ 163 BLEND_DSTOVER, /**< DST_OVER blending */ 164 BLEND_SRCIN, /**< SRC_IN blending */ 165 BLEND_DSTIN, /**< DST_IN blending */ 166 BLEND_SRCOUT, /**< SRC_OUT blending */ 167 BLEND_DSTOUT, /**< DST_OUT blending */ 168 BLEND_SRCATOP, /**< SRC_ATOP blending */ 169 BLEND_DSTATOP, /**< DST_ATOP blending */ 170 BLEND_ADD, /**< ADD blending */ 171 BLEND_XOR, /**< XOR blending */ 172 BLEND_DST, /**< DST blending */ 173 BLEND_AKS, /**< AKS blending */ 174 BLEND_AKD, /**< AKD blending */ 175 BLEND_BUTT /**< Null operation */ 176 } BlendType; 177 178 /** 179 * @brief Enumerates ROP types supported by hardware acceleration. 180 * 181 * ROP performs bitwise Boolean operations (including bitwise AND and bitwise OR) on the RGB color and 182 * alpha values of the foreground bitmap with those of the background bitmap, and then outputs the result. 183 * 184 */ 185 typedef enum { 186 ROP_BLACK = 0, /**< Blackness */ 187 ROP_NOTMERGEPEN, /**< ~(S2+S1) */ 188 ROP_MASKNOTPEN, /**< ~S2&S1 */ 189 ROP_NOTCOPYPEN, /**< ~S2 */ 190 ROP_MASKPENNOT, /**< S2&~S1 */ 191 ROP_NOT, /**< ~S1 */ 192 ROP_XORPEN, /**< S2^S1 */ 193 ROP_NOTMASKPEN, /**< ~(S2&S1) */ 194 ROP_MASKPEN, /**< S2&S1 */ 195 ROP_NOTXORPEN, /**< ~(S2^S1) */ 196 ROP_NOP, /**< S1 */ 197 ROP_MERGENOTPEN, /**< ~S2+S1 */ 198 ROP_COPYPE, /**< S2 */ 199 ROP_MERGEPENNOT, /**< S2+~S1 */ 200 ROP_MERGEPEN, /**< S2+S1 */ 201 ROP_WHITE, /**< Whiteness */ 202 ROP_BUTT /**< Invalid ROP type */ 203 } RopType; 204 205 /** 206 * @brief Enumerates color key types supported by hardware acceleration. 207 * 208 */ 209 typedef enum { 210 CKEY_NONE = 0, /**< No color key */ 211 CKEY_SRC, /**< Source color key */ 212 CKEY_DST, /**< Destination color key */ 213 CKEY_BUTT /**< Null operation */ 214 } ColorKey; 215 216 /** 217 * @brief Enumerates mirror types supported by hardware acceleration. 218 * 219 */ 220 typedef enum { 221 MIRROR_NONE = 0, /**< No mirror */ 222 MIRROR_LR, /**< Left and right mirrors */ 223 MIRROR_TB, /**< Top and bottom mirrors */ 224 MIRROR_BUTT /**< Null operation */ 225 } MirrorType; 226 227 /** 228 * @brief Enumerates connection types of hot plugging. 229 * 230 */ 231 typedef enum { 232 INVALID = 0, /**< Invalid connection */ 233 CONNECTED, /**< Connected */ 234 DISCONNECTED /**< Disconnected */ 235 } Connection; 236 237 /** 238 * @brief Defines display information. 239 * 240 */ 241 typedef struct { 242 uint32_t width; /**< Display width */ 243 uint32_t height; /**< Display height */ 244 int32_t rotAngle; /**< Rotation angle of the display */ 245 } DisplayInfo; 246 247 /** 248 * @brief Defines layer information. 249 * 250 * <b>LayerInfo</b> must be passed to the {@link OpenLayer} function, which creates a layer based on the layer 251 * information. 252 * 253 */ 254 typedef struct { 255 int32_t width; /**< Layer width */ 256 int32_t height; /**< Layer height */ 257 LayerType type; /**< Layer type, which can be a graphic layer, overlay layer, or sideband layer */ 258 int32_t bpp; /**< Number of bits occupied by each pixel */ 259 PixelFormat pixFormat; /**< Pixel format of the layer */ 260 } LayerInfo; 261 262 /** 263 * @brief Defines alpha information about a layer. 264 * 265 */ 266 typedef struct { 267 bool enGlobalAlpha; /**< Global alpha enable bit */ 268 bool enPixelAlpha; /**< Pixel alpha enable bit */ 269 uint8_t alpha0; /**< Alpha0 value, ranging from 0 to 255 */ 270 uint8_t alpha1; /**< Alpha1 value, ranging from 0 to 255 */ 271 uint8_t gAlpha; /**< Global alpha value, ranging from 0 to 255 */ 272 } LayerAlpha; 273 274 275 /** 276 * @brief Defines buffer data of a layer, including the virtual and physical memory addresses. 277 * 278 */ 279 typedef struct { 280 uint64_t phyAddr; /**< Physical memory address */ 281 void *virAddr; /**< Virtual memory address */ 282 } BufferData; 283 284 /** 285 * @brief Defines the buffer, which is used to store layer data. 286 * 287 */ 288 typedef struct { 289 int32_t fenceId; /**< Fence ID of the buffer */ 290 int32_t width; /**< Buffer width */ 291 int32_t height; /**< Buffer height */ 292 int32_t pitch; /**< Number of bytes from one row of pixels in memory to the next */ 293 PixelFormat pixFormat; /**< Pixel format of the buffer */ 294 BufferData data; /**< Layer buffer data */ 295 BufferHandle* hdl; /**< Layer buffer handle */ 296 } LayerBuffer; 297 298 /** 299 * @brief Defines the information about a rectangle. 300 * 301 */ 302 typedef struct { 303 int32_t x; /**< Start X coordinate of the rectangle */ 304 int32_t y; /**< Start Y coordinate of the rectangle */ 305 int32_t w; /**< Width of the rectangle */ 306 int32_t h; /**< Height of the rectangle */ 307 } IRect; 308 309 /** 310 * @brief Stores surface information for hardware acceleration, such as draw image and bit blit. 311 * 312 */ 313 typedef struct { 314 uint64_t phyAddr; /**< Start physical address of an image */ 315 int32_t height; /**< Image height */ 316 int32_t width; /**< Image width */ 317 int32_t stride; /**< Image stride */ 318 PixelFormat enColorFmt; /**< Image format */ 319 bool bYCbCrClut; /**< Whether the color lookup table (CLUT) is in the YCbCr space */ 320 bool bAlphaMax255; /**< Maximum alpha value of an image (255 or 128) */ 321 bool bAlphaExt1555; /**< ARGB1555 alpha extension enable bit */ 322 uint8_t alpha0; /**< Value of alpha0, ranging from 0 to 255 */ 323 uint8_t alpha1; /**< Value of alpha1, ranging from 0 to 255 */ 324 uint64_t cbcrPhyAddr; /**< CbCr physical address */ 325 int32_t cbcrStride; /**< CbCr stride */ 326 uint64_t clutPhyAddr; /**< Start physical address of the CLUT, used for color extension or correction */ 327 } ISurface; 328 329 /** 330 * @brief Describes a line to help draw lines in hardware acceleration. 331 * 332 */ 333 typedef struct { 334 int32_t x0; /**< X coordinate of the start point of a line */ 335 int32_t y0; /**< Y coordinate of the start point of a line */ 336 int32_t x1; /**< X coordinate of the end point of a line */ 337 int32_t y1; /**< Y coordinate of the end point of a line */ 338 uint32_t color; /**< Line color */ 339 } ILine; 340 341 /** 342 * @brief Describes a circle to help draw circles in hardware acceleration. 343 * 344 */ 345 typedef struct { 346 int32_t x; /**< X coordinate of a circle center */ 347 int32_t y; /**< Y coordinate of a circle center */ 348 int32_t r; /**< Radius of a circle */ 349 uint32_t color; /**< Circle color */ 350 } ICircle; 351 352 /** 353 * @brief Describes a rectangle to help draw rectangles in hardware acceleration. 354 * 355 */ 356 typedef struct { 357 IRect rect; /**< Bounds of a rectangle */ 358 uint32_t color; /**< Rectangle color */ 359 } Rectangle; 360 361 /** 362 * @brief Defines hardware acceleration options. 363 * 364 */ 365 typedef struct { 366 bool enGlobalAlpha; /**< Golbal alpha enable bit */ 367 uint32_t globalAlpha; /**< Global alpha value */ 368 bool enPixelAlpha; /**< Pixel alpha enable bit */ 369 BlendType blendType; /**< Blending type */ 370 ColorKey colorKeyFrom; /**< Color key mode */ 371 bool enableRop; /**< Raster operations pipeline (ROP) enable bit */ 372 RopType colorRopType; /**< Color ROP type */ 373 RopType alphaRopType; /**< Alpha ROP type */ 374 bool enableScale; /**< Scaling enable bit */ 375 TransformType rotateType; /**< Rotation type */ 376 MirrorType mirrorType; /**< Mirror type */ 377 } GfxOpt; 378 379 #define PROPERTY_NAME_LEN 50 380 381 /** 382 * @brief Defines property object which contains name, property id and value. 383 * 384 */ 385 typedef struct { 386 char name[PROPERTY_NAME_LEN]; /**< Name of the property */ 387 uint32_t propId; /**< Property id which was decided in the DRM internal */ 388 uint64_t value; /**< the value of property */ 389 } PropertyObject; 390 391 /** 392 * @brief Enumerates interface types. 393 * 394 */ 395 typedef enum { 396 DISP_INTF_HDMI = 0, /**< HDMI interface */ 397 DISP_INTF_LCD, /**< LCD interface */ 398 DISP_INTF_BT1120, /**< BT1120 interface */ 399 DISP_INTF_BT656, /**< BT656 interface */ 400 DISP_INTF_YPBPR, /**< YPBPR interface */ 401 DISP_INTF_RGB, /**< RGB interface */ 402 DISP_INTF_CVBS, /**< CVBS interface */ 403 DISP_INTF_SVIDEO, /**< SVIDEO interface */ 404 DISP_INTF_VGA, /**< VGA interface */ 405 DISP_INTF_MIPI, /**< MIPI interface */ 406 DISP_INTF_PANEL, /**< PANEL interface */ 407 DISP_INTF_BUTT, 408 } InterfaceType; 409 410 /** 411 * @brief Defines the capability of the output. 412 */ 413 typedef struct { 414 char name[PROPERTY_NAME_LEN]; /**< name of output */ 415 InterfaceType type; /**< interface type of output */ 416 uint32_t phyWidth; /**< Physical width */ 417 uint32_t phyHeight; /**< Physical width */ 418 uint32_t supportLayers; /**< BitMask of LayerType */ 419 uint32_t virtualDispCount; /**< the count of virtual displays supported*/ 420 bool supportWriteBack; /**< wether support writeback*/ 421 uint32_t propertyCount; /**< Count of properties */ 422 PropertyObject* props; /**< Array of property objects */ 423 } DisplayCapability; 424 425 /** 426 * @brief Defines output mode info 427 */ 428 typedef struct { 429 int32_t width; /**< width in pixel */ 430 int32_t height; /**< height in pixel */ 431 uint32_t freshRate; /**< fresh rate in one second */ 432 int32_t id; /**< the id of the mode */ 433 } DisplayModeInfo; 434 435 /** 436 * @brief Defines information for allocate memory 437 * 438 */ 439 typedef struct { 440 uint32_t width; /**< The width of the request allocation */ 441 uint32_t height; /**< The height of the request allocation */ 442 uint64_t usage; /**< The usage of the request allocation */ 443 PixelFormat format; /**< The format of the request allocation */ 444 uint32_t expectedSize; /**< The size assigned by memory requester */ 445 } AllocInfo; 446 /** 447 * @brief Enumerates power status. 448 */ 449 450 typedef enum { 451 POWER_STATUS_ON, /**< The power status is on */ 452 POWER_STATUS_STANDBY, /**< The power status is standby */ 453 POWER_STATUS_SUSPEND, /**< The power status is suspend */ 454 POWER_STATUS_OFF, /**< The power status is off */ 455 POWER_STATUS_BUTT 456 } DispPowerStatus; 457 458 /** 459 * @brief Enumerates composition type for special layer 460 */ 461 typedef enum { 462 COMPOSITION_CLIENT, /**< client composistion type, the composer should been cpu or gpu */ 463 COMPOSITION_DEVICE, /**< device composistion type, the composer should been a hardware */ 464 COMPOSITION_CURSOR, /**< cursor composistion type. it should been used for cursor */ 465 COMPOSITION_VIDEO, /**< cursor composistion type. it should been used for video */ 466 COMPOSITION_BUTT 467 } CompositionType; 468 469 /** 470 * @brief Enumerates the color gamuts. 471 * 472 */ 473 typedef enum { 474 COLOR_GAMUT_INVALID = -1, /**< Invalid */ 475 COLOR_GAMUT_NATIVE = 0, /**< Native or default */ 476 COLOR_GAMUT_SATNDARD_BT601 = 1, /**< Standard BT601 */ 477 COLOR_GAMUT_STANDARD_BT709 = 2, /**< Standard BT709 */ 478 COLOR_GAMUT_DCI_P3 = 3, /**< DCI P3 */ 479 COLOR_GAMUT_SRGB = 4, /**< SRGB */ 480 COLOR_GAMUT_ADOBE_RGB = 5, /**< Adobe RGB */ 481 COLOR_GAMUT_DISPLAY_P3 = 6, /**< display P3 */ 482 COLOR_GAMUT_BT2020 = 7, /**< BT2020 */ 483 COLOR_GAMUT_BT2100_PQ = 8, /**< BT2100 PQ */ 484 COLOR_GAMUT_BT2100_HLG = 9, /**< BT2100 HLG */ 485 COLOR_GAMUT_DISPLAY_BT2020 = 10, /**< Display BT2020 */ 486 } ColorGamut; 487 488 /** 489 * @brief Enumerates the color gamut maps. 490 * 491 */ 492 typedef enum { 493 GAMUT_MAP_CONSTANT = 0, 494 GAMUT_MAP_EXPANSION = 1, 495 GAMUT_MAP_HDR_CONSTANT = 2, 496 GAMUT_MAP_HDR_EXPANSION = 3, 497 } GamutMap; 498 499 /** 500 * @brief Enumerates the color data spaces. 501 * 502 */ 503 504 typedef enum { 505 COLOR_DATA_SPACE_UNKNOWN = 0, 506 GAMUT_BT601 = 0x00000001, 507 GAMUT_BT709 = 0x00000002, 508 GAMUT_DCI_P3 = 0x00000003, 509 GAMUT_SRGB = 0x00000004, 510 GAMUT_ADOBE_RGB = 0x00000005, 511 GAMUT_DISPLAY_P3 = 0x00000006, 512 GAMUT_BT2020 = 0x00000007, 513 GAMUT_BT2100_PQ = 0x00000008, 514 GAMUT_BT2100_HLG = 0x00000009, 515 GAMUT_DISPLAY_BT2020 = 0x0000000a, 516 TRANSFORM_FUNC_UNSPECIFIED = 0x00000100, 517 TRANSFORM_FUNC_LINEAR = 0x00000200, 518 TRANSFORM_FUNC_SRGB = 0x00000300, 519 TRANSFORM_FUNC_SMPTE_170M = 0x00000400, 520 TRANSFORM_FUNC_GM2_2 = 0x00000500, 521 TRANSFORM_FUNC_GM2_6 = 0x00000600, 522 TRANSFORM_FUNC_GM2_8 = 0x00000700, 523 TRANSFORM_FUNC_ST2084 = 0x00000800, 524 TRANSFORM_FUNC_HLG = 0x00000900, 525 PRECISION_UNSPECIFIED = 0x00010000, 526 PRECISION_FULL = 0x00020000, 527 PRESION_LIMITED = 0x00030000, 528 PRESION_EXTENDED = 0x00040000, 529 BT601_SMPTE170M_FULL = GAMUT_BT601 | TRANSFORM_FUNC_SMPTE_170M | PRECISION_FULL, 530 BT601_SMPTE170M_LIMITED = GAMUT_BT601 | TRANSFORM_FUNC_SMPTE_170M | PRESION_LIMITED, 531 BT709_LINEAR_FULL = GAMUT_BT709 | TRANSFORM_FUNC_LINEAR | PRECISION_FULL, 532 BT709_LINEAR_EXTENDED = GAMUT_BT709 | TRANSFORM_FUNC_LINEAR | PRESION_EXTENDED, 533 BT709_SRGB_FULL = GAMUT_BT709 | TRANSFORM_FUNC_SRGB | PRECISION_FULL, 534 BT709_SRGB_EXTENDED = GAMUT_BT709 | TRANSFORM_FUNC_SRGB | PRESION_EXTENDED, 535 BT709_SMPTE170M_LIMITED = GAMUT_BT709 | TRANSFORM_FUNC_SMPTE_170M | PRESION_LIMITED, 536 DCI_P3_LINEAR_FULL = GAMUT_DCI_P3 | TRANSFORM_FUNC_LINEAR | PRECISION_FULL, 537 DCI_P3_GAMMA26_FULL = GAMUT_DCI_P3 | TRANSFORM_FUNC_GM2_6 | PRECISION_FULL, 538 DISPLAY_P3_LINEAR_FULL = GAMUT_DISPLAY_P3 | TRANSFORM_FUNC_LINEAR | PRECISION_FULL, 539 DCI_P3_SRGB_FULL = GAMUT_DCI_P3 | TRANSFORM_FUNC_SRGB | PRECISION_FULL, 540 ADOBE_RGB_GAMMA22_FULL = GAMUT_ADOBE_RGB | TRANSFORM_FUNC_GM2_2 | PRECISION_FULL, 541 BT2020_LINEAR_FULL = GAMUT_BT2020 | TRANSFORM_FUNC_LINEAR | PRECISION_FULL, 542 BT2020_SRGB_FULL = GAMUT_BT2020 | TRANSFORM_FUNC_SRGB | PRECISION_FULL, 543 BT2020_SMPTE170M_FULL = GAMUT_BT2020 | TRANSFORM_FUNC_SMPTE_170M | PRECISION_FULL, 544 BT2020_ST2084_FULL = GAMUT_BT2020 | TRANSFORM_FUNC_ST2084 | PRECISION_FULL, 545 BT2020_HLG_FULL = GAMUT_BT2020 | TRANSFORM_FUNC_HLG | PRECISION_FULL, 546 BT2020_ST2084_LIMITED = GAMUT_BT2020 | TRANSFORM_FUNC_ST2084 | PRESION_LIMITED, 547 } ColorDataSpace; 548 549 /** 550 * @brief Enumerates the HDR formats. 551 * 552 */ 553 typedef enum { 554 NOT_SUPPORT_HDR = 0, 555 DOLBY_VISION = 1, 556 HDR10 = 2, 557 HLG = 3, 558 HDR10_PLUS = 4, 559 HDR_VIVID = 5, 560 } HDRFormat; 561 562 /** 563 * @brief Defines the HDR capability. 564 * 565 */ 566 typedef struct { 567 uint32_t formatCount; 568 HDRFormat* formats; 569 float maxLum; 570 float maxAverageLum; 571 float minLum; 572 } HDRCapability; 573 574 /** 575 * @brief Enumerates the HDR metadata keys. 576 * 577 */ 578 typedef enum { 579 MATAKEY_RED_PRIMARY_X = 0, 580 MATAKEY_RED_PRIMARY_Y = 1, 581 MATAKEY_GREEN_PRIMARY_X = 2, 582 MATAKEY_GREEN_PRIMARY_Y = 3, 583 MATAKEY_BLUE_PRIMARY_X = 4, 584 MATAKEY_BLUE_PRIMARY_Y = 5, 585 MATAKEY_WHITE_PRIMARY_X = 6, 586 MATAKEY_WHITE_PRIMARY_Y = 7, 587 MATAKEY_MAX_LUMINANCE = 8, 588 MATAKEY_MIN_LUMINANCE = 9, 589 MATAKEY_MAX_CONTENT_LIGHT_LEVEL = 10, 590 MATAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL = 11, 591 MATAKEY_HDR10_PLUS = 12, 592 MATAKEY_HDR_VIVID = 13, 593 } HDRMetadataKey; 594 595 /** 596 * @brief Defines the HDR metadata. 597 * 598 */ 599 typedef struct { 600 HDRMetadataKey key; 601 float value; 602 } HDRMetaData; 603 604 #ifdef __cplusplus 605 } 606 #endif 607 #endif 608 /* @} */ 609