102f4aeb0Sopenharmony_ciName
202f4aeb0Sopenharmony_ci
302f4aeb0Sopenharmony_ci    EXT_surface_SMPTE2086_metadata
402f4aeb0Sopenharmony_ci
502f4aeb0Sopenharmony_ciName Strings
602f4aeb0Sopenharmony_ci
702f4aeb0Sopenharmony_ci    EGL_EXT_surface_SMPTE2086_metadata
802f4aeb0Sopenharmony_ci
902f4aeb0Sopenharmony_ciContact
1002f4aeb0Sopenharmony_ci
1102f4aeb0Sopenharmony_ci    Weiwan Liu (weiwliu 'at' nvidia.com)
1202f4aeb0Sopenharmony_ci
1302f4aeb0Sopenharmony_ciContributors
1402f4aeb0Sopenharmony_ci
1502f4aeb0Sopenharmony_ci    Tom Cooksey
1602f4aeb0Sopenharmony_ci    Courtney Goeltzenleuchter
1702f4aeb0Sopenharmony_ci    Mathias Heyer
1802f4aeb0Sopenharmony_ci    Lauri Hyvarinen
1902f4aeb0Sopenharmony_ci    James Jones
2002f4aeb0Sopenharmony_ci    Daniel Koch
2102f4aeb0Sopenharmony_ci    Jeff Leger
2202f4aeb0Sopenharmony_ci    Sandeep Shinde
2302f4aeb0Sopenharmony_ci
2402f4aeb0Sopenharmony_ciIP Status
2502f4aeb0Sopenharmony_ci
2602f4aeb0Sopenharmony_ci    No known IP claims.
2702f4aeb0Sopenharmony_ci
2802f4aeb0Sopenharmony_ciStatus
2902f4aeb0Sopenharmony_ci
3002f4aeb0Sopenharmony_ci    Complete
3102f4aeb0Sopenharmony_ci
3202f4aeb0Sopenharmony_ciVersion
3302f4aeb0Sopenharmony_ci
3402f4aeb0Sopenharmony_ci    Version 8 - Oct 16, 2017
3502f4aeb0Sopenharmony_ci
3602f4aeb0Sopenharmony_ciNumber
3702f4aeb0Sopenharmony_ci
3802f4aeb0Sopenharmony_ci    EGL Extension #109
3902f4aeb0Sopenharmony_ci
4002f4aeb0Sopenharmony_ciDependencies
4102f4aeb0Sopenharmony_ci
4202f4aeb0Sopenharmony_ci    This extension requires EGL 1.4.
4302f4aeb0Sopenharmony_ci
4402f4aeb0Sopenharmony_ci    This extension is written against the wording of the EGL 1.5 specification
4502f4aeb0Sopenharmony_ci    (August 27, 2014).
4602f4aeb0Sopenharmony_ci
4702f4aeb0Sopenharmony_ciOverview
4802f4aeb0Sopenharmony_ci
4902f4aeb0Sopenharmony_ci    This extension adds a new set of EGL surface attributes for the metadata
5002f4aeb0Sopenharmony_ci    defined by the SMPTE (the Society of Motion Picture and Television
5102f4aeb0Sopenharmony_ci    Engineers) ST 2086 standard. The SMPTE 2086 metadata includes the color
5202f4aeb0Sopenharmony_ci    primaries, white point and luminance range of the mastering display, which
5302f4aeb0Sopenharmony_ci    all together define the color volume that contains all the possible colors
5402f4aeb0Sopenharmony_ci    the mastering display can produce. The mastering display is the display
5502f4aeb0Sopenharmony_ci    where creative work is done and creative intent is established. To preserve
5602f4aeb0Sopenharmony_ci    such creative intent as much as possible and achieve consistent color
5702f4aeb0Sopenharmony_ci    reproduction on different viewing displays, it is useful for the display
5802f4aeb0Sopenharmony_ci    pipeline to know the color volume of the original mastering display where
5902f4aeb0Sopenharmony_ci    content is created or tuned. This avoids performing unnecessary mapping of
6002f4aeb0Sopenharmony_ci    colors that are not displayable on the original mastering display.
6102f4aeb0Sopenharmony_ci
6202f4aeb0Sopenharmony_ci    This extension adds the ability to pass the SMPTE 2086 metadata via EGL,
6302f4aeb0Sopenharmony_ci    from which the color volume can be derived. While the general purpose of the
6402f4aeb0Sopenharmony_ci    metadata is to assist in the transformation between different color volumes
6502f4aeb0Sopenharmony_ci    of different displays and help achieve better color reproduction, it is not
6602f4aeb0Sopenharmony_ci    in the scope of this extension to define how exactly the metadata should be
6702f4aeb0Sopenharmony_ci    used in such a process. It is up to the implementation to determine how to
6802f4aeb0Sopenharmony_ci    make use of the metadata.
6902f4aeb0Sopenharmony_ci
7002f4aeb0Sopenharmony_ciNew Procedures and Functions
7102f4aeb0Sopenharmony_ci
7202f4aeb0Sopenharmony_ci    None.
7302f4aeb0Sopenharmony_ci
7402f4aeb0Sopenharmony_ciNew Tokens
7502f4aeb0Sopenharmony_ci
7602f4aeb0Sopenharmony_ci    Accepted as attribute by eglSurfaceAttrib and eglQuerySurface:
7702f4aeb0Sopenharmony_ci
7802f4aeb0Sopenharmony_ci        EGL_SMPTE2086_DISPLAY_PRIMARY_RX_EXT       0x3341
7902f4aeb0Sopenharmony_ci        EGL_SMPTE2086_DISPLAY_PRIMARY_RY_EXT       0x3342
8002f4aeb0Sopenharmony_ci        EGL_SMPTE2086_DISPLAY_PRIMARY_GX_EXT       0x3343
8102f4aeb0Sopenharmony_ci        EGL_SMPTE2086_DISPLAY_PRIMARY_GY_EXT       0x3344
8202f4aeb0Sopenharmony_ci        EGL_SMPTE2086_DISPLAY_PRIMARY_BX_EXT       0x3345
8302f4aeb0Sopenharmony_ci        EGL_SMPTE2086_DISPLAY_PRIMARY_BY_EXT       0x3346
8402f4aeb0Sopenharmony_ci        EGL_SMPTE2086_WHITE_POINT_X_EXT            0x3347
8502f4aeb0Sopenharmony_ci        EGL_SMPTE2086_WHITE_POINT_Y_EXT            0x3348
8602f4aeb0Sopenharmony_ci        EGL_SMPTE2086_MAX_LUMINANCE_EXT            0x3349
8702f4aeb0Sopenharmony_ci        EGL_SMPTE2086_MIN_LUMINANCE_EXT            0x334A
8802f4aeb0Sopenharmony_ci
8902f4aeb0Sopenharmony_ciAdditions to Chapter "3.5.6 Surface Attributes" of the EGL 1.5 Specification
9002f4aeb0Sopenharmony_ci
9102f4aeb0Sopenharmony_ci    Add the following paragraph before the "Errors" section on page 43,
9202f4aeb0Sopenharmony_ci
9302f4aeb0Sopenharmony_ci        If attribute is EGL_SMPTE2086_DISPLAY_PRIMARY_RX_EXT, EGL_SMPTE2086_-
9402f4aeb0Sopenharmony_ci        DISPLAY_PRIMARY_RY_EXT, EGL_SMPTE2086_DISPLAY_PRIMARY_GX_EXT, EGL_-
9502f4aeb0Sopenharmony_ci        SMPTE2086_DISPLAY_PRIMARY_GY_EXT, EGL_SMPTE2086_DISPLAY_PRIMARY_BX_EXT
9602f4aeb0Sopenharmony_ci        or EGL_SMPTE2086_DISPLAY_PRIMARY_BY_EXT, then value indicates the
9702f4aeb0Sopenharmony_ci        corresponding xy chromaticity coordinate[12] of the mastering display's
9802f4aeb0Sopenharmony_ci        red, green or blue color primary, as configured for the mastering
9902f4aeb0Sopenharmony_ci        process. The floating-point display primary coordinates should be
10002f4aeb0Sopenharmony_ci        multiplied by EGL_METADATA_SCALING_EXT (50000)[13], before being passed
10102f4aeb0Sopenharmony_ci        into eglSurfaceAttrib as integers.
10202f4aeb0Sopenharmony_ci
10302f4aeb0Sopenharmony_ci        If attribute is EGL_SMPTE2086_WHITE_POINT_X_EXT or EGL_SMPTE2086_WHITE_-
10402f4aeb0Sopenharmony_ci        POINT_Y_EXT, then value indicates the corresponding xy chromaticity
10502f4aeb0Sopenharmony_ci        coordinate[12] of the mastering display's white point, as configured for
10602f4aeb0Sopenharmony_ci        the mastering process. The floating-point white point chromaticity
10702f4aeb0Sopenharmony_ci        coordinates should be multiplied by EGL_METADATA_SCALING_EXT (50000),
10802f4aeb0Sopenharmony_ci        before being passed into eglSurfaceAttrib as integers.
10902f4aeb0Sopenharmony_ci
11002f4aeb0Sopenharmony_ci        If attribute is EGL_SMPTE2086_MAX_LUMINANCE_EXT or EGL_SMPTE2086_MIN_-
11102f4aeb0Sopenharmony_ci        LUMINANCE_EXT, then value indicates the maximum or minimum display
11202f4aeb0Sopenharmony_ci        luminance of the mastering display, as configured for the mastering
11302f4aeb0Sopenharmony_ci        process. The unit of value is 1 nit (candela per square meter). The
11402f4aeb0Sopenharmony_ci        floating-point luminance values should be multiplied by
11502f4aeb0Sopenharmony_ci        EGL_METADATA_SCALING_EXT, a constant scaling factor of 50000, before
11602f4aeb0Sopenharmony_ci        being passed into eglSurfaceAttrib as integers.
11702f4aeb0Sopenharmony_ci
11802f4aeb0Sopenharmony_ci        By defining the mastering display's color volume through color
11902f4aeb0Sopenharmony_ci        primaries, white point, and luminance range, applications give EGL
12002f4aeb0Sopenharmony_ci        and the underlying display pipeline hints as to how to reproduce colors
12102f4aeb0Sopenharmony_ci        more closely to the original content when created on the mastering
12202f4aeb0Sopenharmony_ci        display. Exactly how the color volume information is used to assist the
12302f4aeb0Sopenharmony_ci        color reproduction process is implementation dependant.
12402f4aeb0Sopenharmony_ci
12502f4aeb0Sopenharmony_ci        The initial values of EGL_SMPTE2086_DISPLAY_PRIMARY_RX_EXT, EGL_-
12602f4aeb0Sopenharmony_ci        SMPTE2086_DISPLAY_PRIMARY_RY_EXT, EGL_SMPTE2086_DISPLAY_PRIMARY_GX_EXT,
12702f4aeb0Sopenharmony_ci        EGL_SMPTE2086_DISPLAY_PRIMARY_GY_EXT, EGL_SMPTE2086_DISPLAY_PRIMARY_BX_-
12802f4aeb0Sopenharmony_ci        EXT, EGL_SMPTE2086_DISPLAY_PRIMARY_BY_EXT, EGL_SMPTE2086_WHITE_POINT_X_-
12902f4aeb0Sopenharmony_ci        EXT, EGL_SMPTE2086_WHITE_POINT_Y_EXT, EGL_SMPTE2086_MAX_LUMINANCE_EXT
13002f4aeb0Sopenharmony_ci        and EGL_SMPTE2086_MIN_LUMINANCE_EXT are EGL_DONT_CARE, which causes the
13102f4aeb0Sopenharmony_ci        hints to be ignored. If value is not in the implementation's supported
13202f4aeb0Sopenharmony_ci        range for attribute, a EGL_BAD_PARAMETER error is generated, and some or
13302f4aeb0Sopenharmony_ci        all of the metadata fields are ignored.
13402f4aeb0Sopenharmony_ci
13502f4aeb0Sopenharmony_ci    Add the following footnote at the end of page 43, and increment all the
13602f4aeb0Sopenharmony_ci    subsequent footnote numbers in Chapter 3,
13702f4aeb0Sopenharmony_ci
13802f4aeb0Sopenharmony_ci            [12] Chromaticity coordinates x and y are as specified in CIE
13902f4aeb0Sopenharmony_ci        15:2004 "Calculation of chromaticity coordinates" (Section 7.3) and are
14002f4aeb0Sopenharmony_ci        limited to between 0 and 1 for real colors for the mastering display.
14102f4aeb0Sopenharmony_ci
14202f4aeb0Sopenharmony_ci    Change the original footnote 12 at the end of section "3.5.6 Surface
14302f4aeb0Sopenharmony_ci    Attributes" on page 45 to,
14402f4aeb0Sopenharmony_ci
14502f4aeb0Sopenharmony_ci            [13] EGL_DISPLAY_SCALING (10000) and EGL_METADATA_SCALING_EXT (50000)
14602f4aeb0Sopenharmony_ci        are used where EGL needs to take or return floating-point attribute
14702f4aeb0Sopenharmony_ci        values, which would normally be smaller than 1, as integers while still
14802f4aeb0Sopenharmony_ci        retaining sufficient precision to be meaningful.
14902f4aeb0Sopenharmony_ci
15002f4aeb0Sopenharmony_ci    Addition to Table 3.5 "Queryable surface attributes and types",
15102f4aeb0Sopenharmony_ci
15202f4aeb0Sopenharmony_ci                      Attribute                   Type
15302f4aeb0Sopenharmony_ci        ------------------------------------------------
15402f4aeb0Sopenharmony_ci        EGL_SMPTE2086_DISPLAY_PRIMARY_RX_EXT     integer
15502f4aeb0Sopenharmony_ci        EGL_SMPTE2086_DISPLAY_PRIMARY_RY_EXT     integer
15602f4aeb0Sopenharmony_ci        EGL_SMPTE2086_DISPLAY_PRIMARY_GX_EXT     integer
15702f4aeb0Sopenharmony_ci        EGL_SMPTE2086_DISPLAY_PRIMARY_GY_EXT     integer
15802f4aeb0Sopenharmony_ci        EGL_SMPTE2086_DISPLAY_PRIMARY_BX_EXT     integer
15902f4aeb0Sopenharmony_ci        EGL_SMPTE2086_DISPLAY_PRIMARY_BY_EXT     integer
16002f4aeb0Sopenharmony_ci        EGL_SMPTE2086_WHITE_POINT_X_EXT          integer
16102f4aeb0Sopenharmony_ci        EGL_SMPTE2086_WHITE_POINT_Y_EXT          integer
16202f4aeb0Sopenharmony_ci        EGL_SMPTE2086_MAX_LUMINANCE_EXT          integer
16302f4aeb0Sopenharmony_ci        EGL_SMPTE2086_MIN_LUMINANCE_EXT          integer
16402f4aeb0Sopenharmony_ci
16502f4aeb0Sopenharmony_ci                      Description
16602f4aeb0Sopenharmony_ci        ------------------------------------------------------------------------------------------
16702f4aeb0Sopenharmony_ci        x chromaticity coordinate for red display primary multiplied by EGL_METADATA_SCALING_EXT
16802f4aeb0Sopenharmony_ci        y chromaticity coordinate for red display primary multiplied by EGL_METADATA_SCALING_EXT
16902f4aeb0Sopenharmony_ci        x chromaticity coordinate for green display primary multiplied by EGL_METADATA_SCALING_EXT
17002f4aeb0Sopenharmony_ci        y chromaticity coordinate for green display primary multiplied by EGL_METADATA_SCALING_EXT
17102f4aeb0Sopenharmony_ci        x chromaticity coordinate for blue display primary multiplied by EGL_METADATA_SCALING_EXT
17202f4aeb0Sopenharmony_ci        y chromaticity coordinate for blue display primary multiplied by EGL_METADATA_SCALING_EXT
17302f4aeb0Sopenharmony_ci        x chromaticity coordinate for white point multiplied by EGL_METADATA_SCALING_EXT
17402f4aeb0Sopenharmony_ci        y chromaticity coordinate for white point multiplied by EGL_METADATA_SCALING_EXT
17502f4aeb0Sopenharmony_ci        Maximum luminance in nit multiplied by EGL_METADATA_SCALING_EXT
17602f4aeb0Sopenharmony_ci        Minimum luminance in nit multiplied by EGL_METADATA_SCALING_EXT
17702f4aeb0Sopenharmony_ci
17802f4aeb0Sopenharmony_ci    Add the following paragraph at the end of section "3.5.6 Surface Attributes"
17902f4aeb0Sopenharmony_ci    on page 45,
18002f4aeb0Sopenharmony_ci
18102f4aeb0Sopenharmony_ci        Querying EGL_SMPTE2086_DISPLAY_PRIMARY_RX_EXT, EGL_SMPTE2086_DISPLAY_-
18202f4aeb0Sopenharmony_ci        PRIMARY_RY_EXT, EGL_SMPTE2086_DISPLAY_PRIMARY_GX_EXT, EGL_SMPTE2086_-
18302f4aeb0Sopenharmony_ci        DISPLAY_PRIMARY_GY_EXT, EGL_SMPTE2086_DISPLAY_PRIMARY_BX_EXT or EGL_-
18402f4aeb0Sopenharmony_ci        SMPTE2086_DISPLAY_PRIMARY_BY_EXT returns respectively the xy
18502f4aeb0Sopenharmony_ci        chromaticity coordinate of the mastering display's red, green or blue
18602f4aeb0Sopenharmony_ci        color primary, multiplied by the constant value EGL_METADATA_SCALING_EXT
18702f4aeb0Sopenharmony_ci        (50000). The display primary coordinates can be set via eglSurfaceAttrib
18802f4aeb0Sopenharmony_ci        as described above.
18902f4aeb0Sopenharmony_ci
19002f4aeb0Sopenharmony_ci        Querying EGL_SMPTE2086_WHITE_POINT_X_EXT, or EGL_SMPTE2086_WHITE_POINT_-
19102f4aeb0Sopenharmony_ci        Y_EXT returns respectively the xy chromaticity coordinate of the
19202f4aeb0Sopenharmony_ci        mastering display's white point, multiplied by the constant value EGL_-
19302f4aeb0Sopenharmony_ci        METADATA_SCALING (50000). The white point coordinates can be set via
19402f4aeb0Sopenharmony_ci        eglSurfaceAttrib as described above.
19502f4aeb0Sopenharmony_ci
19602f4aeb0Sopenharmony_ci        Querying EGL_SMPTE2086_MAX_LUMINANCE_EXT or EGL_SMPTE2086_MIN_-
19702f4aeb0Sopenharmony_ci        LUMINANCE_EXT returns respectively the maximum and minimum display
19802f4aeb0Sopenharmony_ci        luminance of the mastering display. The values returned are in units of
19902f4aeb0Sopenharmony_ci        1 nit (candela per square meter), multiplied by the constant value EGL_-
20002f4aeb0Sopenharmony_ci        METADATA_SCALING (50000). The value of EGL_SMPTE2086_MAX_LUMINANCE_EXT
20102f4aeb0Sopenharmony_ci        and EGL_SMPTE2086_MIN_LUMINANCE_EXT can be set via eglSurfaceAttrib as
20202f4aeb0Sopenharmony_ci        described above.
20302f4aeb0Sopenharmony_ci
20402f4aeb0Sopenharmony_ciErrors
20502f4aeb0Sopenharmony_ci
20602f4aeb0Sopenharmony_ci    Described in the body text above.
20702f4aeb0Sopenharmony_ci
20802f4aeb0Sopenharmony_ciIssues
20902f4aeb0Sopenharmony_ci
21002f4aeb0Sopenharmony_ci    1. Should this extension define a valid data range for each metadata field?
21102f4aeb0Sopenharmony_ci
21202f4aeb0Sopenharmony_ci       RESOLVED: No. It is not in the scope of this extension to define how the
21302f4aeb0Sopenharmony_ci       metadata hints should be used in the display pipeline and, as a result,
21402f4aeb0Sopenharmony_ci       what the valid data ranges are for the metadata fields. It is
21502f4aeb0Sopenharmony_ci       implementation dependant, but related standards, such as SMPTE ST 2086,
21602f4aeb0Sopenharmony_ci       can be used as reference. As described in the body, implemetations may
21702f4aeb0Sopenharmony_ci       generate a EGL_BAD_PARAMTER error to notify applications that the input
21802f4aeb0Sopenharmony_ci       metadata values are invalid or not supported.
21902f4aeb0Sopenharmony_ci
22002f4aeb0Sopenharmony_ciRevision History
22102f4aeb0Sopenharmony_ci
22202f4aeb0Sopenharmony_ci    Version 1, 2016/04/22
22302f4aeb0Sopenharmony_ci      - Initial draft
22402f4aeb0Sopenharmony_ci
22502f4aeb0Sopenharmony_ci    Version 2, 2016/05/25
22602f4aeb0Sopenharmony_ci      - Rename to EXT and introduce a new scaling factor
22702f4aeb0Sopenharmony_ci
22802f4aeb0Sopenharmony_ci    Version 3, 2016/10/19
22902f4aeb0Sopenharmony_ci      - Add an error and revise issue 1
23002f4aeb0Sopenharmony_ci
23102f4aeb0Sopenharmony_ci    Version 4, 2016/11/22
23202f4aeb0Sopenharmony_ci      - Change status to complete
23302f4aeb0Sopenharmony_ci
23402f4aeb0Sopenharmony_ci    Version 5, 2016/11/29
23502f4aeb0Sopenharmony_ci      - Add token assigments
23602f4aeb0Sopenharmony_ci
23702f4aeb0Sopenharmony_ci    Version 6, 2017/02/28
23802f4aeb0Sopenharmony_ci      - Add 'EXT' suffix to 'EGL_METADATA_SCALING'
23902f4aeb0Sopenharmony_ci
24002f4aeb0Sopenharmony_ci    Version 7, 2017/10/13
24102f4aeb0Sopenharmony_ci      - Rename EGL_INVALID_VALUE (which doesn't exist) to EGL_FALSE
24202f4aeb0Sopenharmony_ci
24302f4aeb0Sopenharmony_ci    Version 8, 2017/10/16
24402f4aeb0Sopenharmony_ci      - Fix v7 change to use EGL_BAD_PARAMETER as the error code
24502f4aeb0Sopenharmony_ci	generated vs. EGL_FALSE which is the expected return value of
24602f4aeb0Sopenharmony_ci	the function.
24702f4aeb0Sopenharmony_ci
248