102f4aeb0Sopenharmony_ciName
202f4aeb0Sopenharmony_ci
302f4aeb0Sopenharmony_ci    EXT_device_openwf
402f4aeb0Sopenharmony_ci    EXT_output_openwf
502f4aeb0Sopenharmony_ci
602f4aeb0Sopenharmony_ciName Strings
702f4aeb0Sopenharmony_ci
802f4aeb0Sopenharmony_ci    EGL_EXT_device_openwf
902f4aeb0Sopenharmony_ci    EGL_EXT_output_openwf
1002f4aeb0Sopenharmony_ci
1102f4aeb0Sopenharmony_ciContributors
1202f4aeb0Sopenharmony_ci
1302f4aeb0Sopenharmony_ci    Daniel Kartch
1402f4aeb0Sopenharmony_ci    James Jones
1502f4aeb0Sopenharmony_ci    Christopher James Halse Rogers
1602f4aeb0Sopenharmony_ci
1702f4aeb0Sopenharmony_ciContacts
1802f4aeb0Sopenharmony_ci
1902f4aeb0Sopenharmony_ci    Daniel Kartch, NVIDIA (dkartch 'at' nvidia.com)
2002f4aeb0Sopenharmony_ci
2102f4aeb0Sopenharmony_ciStatus
2202f4aeb0Sopenharmony_ci
2302f4aeb0Sopenharmony_ci    Complete
2402f4aeb0Sopenharmony_ci
2502f4aeb0Sopenharmony_ciVersion
2602f4aeb0Sopenharmony_ci
2702f4aeb0Sopenharmony_ci    Version 5 - January 21, 2016
2802f4aeb0Sopenharmony_ci
2902f4aeb0Sopenharmony_ciNumber
3002f4aeb0Sopenharmony_ci
3102f4aeb0Sopenharmony_ci    EGL Extension #80
3202f4aeb0Sopenharmony_ci
3302f4aeb0Sopenharmony_ciExtension Type
3402f4aeb0Sopenharmony_ci
3502f4aeb0Sopenharmony_ci    EGL device extension for EGL_EXT_device_openwf
3602f4aeb0Sopenharmony_ci
3702f4aeb0Sopenharmony_ci    EGL display extension for EGL_EXT_output_openwf
3802f4aeb0Sopenharmony_ci
3902f4aeb0Sopenharmony_ciDependencies
4002f4aeb0Sopenharmony_ci
4102f4aeb0Sopenharmony_ci    EGL_EXT_device_openwf requires EGL_EXT_device_base.
4202f4aeb0Sopenharmony_ci
4302f4aeb0Sopenharmony_ci    EGL_EXT_output_openwf requires EGL_EXT_output_base.
4402f4aeb0Sopenharmony_ci
4502f4aeb0Sopenharmony_ci    Both require OpenWF Display
4602f4aeb0Sopenharmony_ci
4702f4aeb0Sopenharmony_ci    EGL_EXT_device_openwf interacts with EGL_EXT_platform_device
4802f4aeb0Sopenharmony_ci
4902f4aeb0Sopenharmony_ci    An EGLDisplay supporting EGL_EXT_output_openwf must be associated
5002f4aeb0Sopenharmony_ci    with an EGLDevice supporting EGL_EXT_device_openwf.
5102f4aeb0Sopenharmony_ci
5202f4aeb0Sopenharmony_ciOverview
5302f4aeb0Sopenharmony_ci
5402f4aeb0Sopenharmony_ci    Increasingly, EGL and its client APIs are being used in place of
5502f4aeb0Sopenharmony_ci    "native" rendering APIs to implement the basic graphics
5602f4aeb0Sopenharmony_ci    functionality of native windowing systems.  This creates demand
5702f4aeb0Sopenharmony_ci    for a method to initialize EGL displays and surfaces directly on
5802f4aeb0Sopenharmony_ci    top of native GPU or device objects rather than native window
5902f4aeb0Sopenharmony_ci    system objects.  The mechanics of enumerating the underlying
6002f4aeb0Sopenharmony_ci    native devices and constructing EGL displays and surfaces from
6102f4aeb0Sopenharmony_ci    them have been solved in various platform and implementation-
6202f4aeb0Sopenharmony_ci    specific ways.  The EGL device family of extensions offers a
6302f4aeb0Sopenharmony_ci    standardized framework for bootstrapping EGL without the use of
6402f4aeb0Sopenharmony_ci    any underlying "native" APIs or functionality.
6502f4aeb0Sopenharmony_ci
6602f4aeb0Sopenharmony_ci    These extensions define how to map device and output handles between
6702f4aeb0Sopenharmony_ci    EGL and OpenWF Display. An EGL implementation which provides these
6802f4aeb0Sopenharmony_ci    extensions must have access to sufficient knowledge of the OpenWF
6902f4aeb0Sopenharmony_ci    implementation to be able to perform these mappings. No requirements
7002f4aeb0Sopenharmony_ci    are imposed on how this information is obtained, nor does this
7102f4aeb0Sopenharmony_ci    support have any implications for how EGL devices and outputs are
7202f4aeb0Sopenharmony_ci    implemented. An implementation which supports these extensions may
7302f4aeb0Sopenharmony_ci    support other low level device interfaces, such as DRM/KMS, as well.
7402f4aeb0Sopenharmony_ci
7502f4aeb0Sopenharmony_ciNew Types
7602f4aeb0Sopenharmony_ci
7702f4aeb0Sopenharmony_ci    None
7802f4aeb0Sopenharmony_ci
7902f4aeb0Sopenharmony_ciNew Procedures and Functions
8002f4aeb0Sopenharmony_ci
8102f4aeb0Sopenharmony_ci    None
8202f4aeb0Sopenharmony_ci
8302f4aeb0Sopenharmony_ciNew Tokens
8402f4aeb0Sopenharmony_ci
8502f4aeb0Sopenharmony_ci    Added by EXT_device_openwf:
8602f4aeb0Sopenharmony_ci
8702f4aeb0Sopenharmony_ci        Accepted as the <attribute> parameter of eglQueryDeviceAttribEXT
8802f4aeb0Sopenharmony_ci
8902f4aeb0Sopenharmony_ci        EGL_OPENWF_DEVICE_ID_EXT                0x3237
9002f4aeb0Sopenharmony_ci
9102f4aeb0Sopenharmony_ci        If EGL_EXT_platform_device is present, the following is accepted
9202f4aeb0Sopenharmony_ci        in the <attrib_list> of eglGetPlatformDisplayEXT().
9302f4aeb0Sopenharmony_ci
9402f4aeb0Sopenharmony_ci        EGL_OPENWF_DEVICE_EXT                   0x333D
9502f4aeb0Sopenharmony_ci
9602f4aeb0Sopenharmony_ci    Added by EXT_output_openwf:
9702f4aeb0Sopenharmony_ci
9802f4aeb0Sopenharmony_ci        Accepted in the <attrib_list> of eglGetOutputLayersEXT and as
9902f4aeb0Sopenharmony_ci        the <attribute> parameter of eglQueryOutputLayerAttribEXT
10002f4aeb0Sopenharmony_ci
10102f4aeb0Sopenharmony_ci        EGL_OPENWF_PIPELINE_ID_EXT              0x3238
10202f4aeb0Sopenharmony_ci
10302f4aeb0Sopenharmony_ci        Accepted in the <attrib_list> of eglGetOutputPortsEXT and as
10402f4aeb0Sopenharmony_ci        the <attribute> parameter of eglQueryOutputPortAttribEXT
10502f4aeb0Sopenharmony_ci
10602f4aeb0Sopenharmony_ci        EGL_OPENWF_PORT_ID_EXT                  0x3239
10702f4aeb0Sopenharmony_ci
10802f4aeb0Sopenharmony_ciNew Behavior for EXT_device_openwf
10902f4aeb0Sopenharmony_ci
11002f4aeb0Sopenharmony_ci    EGLDeviceEXTs may be mapped to OpenWF Display devices.
11102f4aeb0Sopenharmony_ci
11202f4aeb0Sopenharmony_ci    To obtain a WFD_DEVICE_ID for an EGLDeviceEXT, call
11302f4aeb0Sopenharmony_ci    eglQueryDeviceAtribEXT with <attribute> set to
11402f4aeb0Sopenharmony_ci    EGL_OPENWF_DEVICE_ID_EXT.
11502f4aeb0Sopenharmony_ci
11602f4aeb0Sopenharmony_ciIf EGL_EXT_platform_device is present, replace the last sentence of the
11702f4aeb0Sopenharmony_cithird paragraph in section 3.2 "Initialization" with the following:
11802f4aeb0Sopenharmony_ci
11902f4aeb0Sopenharmony_ci    When <platform> is EGL_PLATFORM_DEVICE_EXT, the only valid attribute
12002f4aeb0Sopenharmony_ci    name is EGL_OPENWF_DEVICE_EXT.  If specified, the value must be a
12102f4aeb0Sopenharmony_ci    WFDDevice created with the device ID returned by querying
12202f4aeb0Sopenharmony_ci    EGL_OPENWF_DEVICE_ID_EXT from the specified EGLDevice.  If the device
12302f4aeb0Sopenharmony_ci    handle does not refer to the correct OpenWF device the behavior is
12402f4aeb0Sopenharmony_ci    undefined.  Calls to eglGetPlatformDeviceEXT() with the same values
12502f4aeb0Sopenharmony_ci    for <platform> and <native_display> but distinct EGL_OPENWF_DEVICE_EXT
12602f4aeb0Sopenharmony_ci    values will return separate EGLDisplays.
12702f4aeb0Sopenharmony_ci
12802f4aeb0Sopenharmony_ci    EGL may require the use of the OpenWF device beyond the duration of
12902f4aeb0Sopenharmony_ci    the call to eglGetPlatformDisplayEXT().  The application must ensure
13002f4aeb0Sopenharmony_ci    the device handle remains valid for the lifetime of the display
13102f4aeb0Sopenharmony_ci    returned.  If no OpenWF device handle is specified and EGL requires
13202f4aeb0Sopenharmony_ci    one, it will attempt to create the device itself.  Applications
13302f4aeb0Sopenharmony_ci    should only need to specify an OpenWF device in situations where EGL
13402f4aeb0Sopenharmony_ci    may fail to create one itself due to an existing instance of the same
13502f4aeb0Sopenharmony_ci    underlying device in the process.
13602f4aeb0Sopenharmony_ci
13702f4aeb0Sopenharmony_ciNew Behavior for EXT_output_openwf
13802f4aeb0Sopenharmony_ci
13902f4aeb0Sopenharmony_ci    OpenWF pipeline and port IDs may be used to restrict EGL output
14002f4aeb0Sopenharmony_ci    handle searches and may be queried from EGL output handles.
14102f4aeb0Sopenharmony_ci
14202f4aeb0Sopenharmony_ci    Add to Table 3.10.3.1 in EGL_EXT_output_base:
14302f4aeb0Sopenharmony_ci
14402f4aeb0Sopenharmony_ci        Attribute                   Type      Access
14502f4aeb0Sopenharmony_ci        --------------------------  -------   ------
14602f4aeb0Sopenharmony_ci        EGL_OPENWF_PIPELINE_ID_EXT  integer   S|R
14702f4aeb0Sopenharmony_ci
14802f4aeb0Sopenharmony_ci    Add to Table 3.10.3.2 in EGL_EXT_output_base:
14902f4aeb0Sopenharmony_ci
15002f4aeb0Sopenharmony_ci        Attribute                   Type      Access
15102f4aeb0Sopenharmony_ci        --------------------------  -------   ------
15202f4aeb0Sopenharmony_ci        EGL_OPENWF_PORT_ID_EXT      integer   S|R
15302f4aeb0Sopenharmony_ci
15402f4aeb0Sopenharmony_ciIssues
15502f4aeb0Sopenharmony_ci
15602f4aeb0Sopenharmony_ci    1.  Although the overview says that we do not impose any
15702f4aeb0Sopenharmony_ci        restrictions on how the features are implemented, restrictions
15802f4aeb0Sopenharmony_ci        in the OpenWF specification combined with the chosen interface
15902f4aeb0Sopenharmony_ci        here do implicitly impose limitations. Specifically, the
16002f4aeb0Sopenharmony_ci        wfdCreate* functions can only be called once to obtain OpenWF
16102f4aeb0Sopenharmony_ci        handles. This means that an EGLDevice/Output implementation
16202f4aeb0Sopenharmony_ci        cannot be layered on top of OpenWF without preventing the
16302f4aeb0Sopenharmony_ci        application from calling these functions. So we must assume that
16402f4aeb0Sopenharmony_ci        the implementation instead has some backdoor into OpenWF to
16502f4aeb0Sopenharmony_ci        obtain the object IDs. Possible resolutions include:
16602f4aeb0Sopenharmony_ci        a)  Keep the access model as is. This assumption is a reasonable
16702f4aeb0Sopenharmony_ci            one.
16802f4aeb0Sopenharmony_ci        b)  Flip the requirement. The EGL device/output implementation
16902f4aeb0Sopenharmony_ci            should always create the OpenWF handles itself. We can add
17002f4aeb0Sopenharmony_ci            queries so that the application can get these handles from
17102f4aeb0Sopenharmony_ci            EGL.
17202f4aeb0Sopenharmony_ci        c)  Generalize this extension to support both models. The
17302f4aeb0Sopenharmony_ci            application would have to first query EGL to determine
17402f4aeb0Sopenharmony_ci            whether or not it owns the handles, and then be prepared to
17502f4aeb0Sopenharmony_ci            either query them from EGL or create them itself.
17602f4aeb0Sopenharmony_ci        d)  Require the application to provide its OpenWF device handle
17702f4aeb0Sopenharmony_ci            if it has one.
17802f4aeb0Sopenharmony_ci
17902f4aeb0Sopenharmony_ci        RESOLVED: (d), though implementations are free to use (a) when
18002f4aeb0Sopenharmony_ci        possible.
18102f4aeb0Sopenharmony_ci
18202f4aeb0Sopenharmony_ci    2.  Should different values of EGL_OPENWF_DEVICE_EXT result in separate
18302f4aeb0Sopenharmony_ci        EGLDisplays?
18402f4aeb0Sopenharmony_ci
18502f4aeb0Sopenharmony_ci        RESOLVED: Yes.  Consider an application made up of two independent
18602f4aeb0Sopenharmony_ci        modules running in two independently scheduled threads.  Each
18702f4aeb0Sopenharmony_ci        module calls eglGetPlatformDisplayEXT():
18802f4aeb0Sopenharmony_ci
18902f4aeb0Sopenharmony_ci          WFDDevice wfdDev = wfdCreateDevice(WFD_DEFAULT_DEVICE_ID, NULL);
19002f4aeb0Sopenharmony_ci          int attr1[] = { EGL_OPENWF_DEVICE_EXT, wfdDev };
19102f4aeb0Sopenharmony_ci          dpy1 = eglGetPlatformDisplayEXT(EGL_PLATFORM_DEVICE_EXT,
19202f4aeb0Sopenharmony_ci                                          eglDev,
19302f4aeb0Sopenharmony_ci                                          attr1);
19402f4aeb0Sopenharmony_ci
19502f4aeb0Sopenharmony_ci        ...
19602f4aeb0Sopenharmony_ci                                
19702f4aeb0Sopenharmony_ci          dpy2 = eglGetPlatformDisplayEXT(EGL_PLATFORM_DEVICE_EXT,
19802f4aeb0Sopenharmony_ci                                          eglDev,
19902f4aeb0Sopenharmony_ci                                          NULL);
20002f4aeb0Sopenharmony_ci
20102f4aeb0Sopenharmony_ci        Presumably, if dpy1 == dpy2, they would both be using the same
20202f4aeb0Sopenharmony_ci        WFDDevice for output operations internally.  That would mean
20302f4aeb0Sopenharmony_ci        output operations would likely fail if dpy2 happened to be created
20402f4aeb0Sopenharmony_ci        before dpy1.  This would be painful to debug.  If dpy2 != dpy1,
20502f4aeb0Sopenharmony_ci        failure for dpy2 would be consistent and obvious.  The application
20602f4aeb0Sopenharmony_ci        author would be required to work out a scheme to share the WFDDevice
20702f4aeb0Sopenharmony_ci        between modules before creating EGL displays.
20802f4aeb0Sopenharmony_ci
20902f4aeb0Sopenharmony_ciRevision History:
21002f4aeb0Sopenharmony_ci
21102f4aeb0Sopenharmony_ci    #5  (January 21st, 2016) James Jones
21202f4aeb0Sopenharmony_ci        - Add EGL_OPENWF_DEVICE_EXT to resolve issue 1.
21302f4aeb0Sopenharmony_ci        - Added possible solution (d) to issue 1, and resolve to use it.
21402f4aeb0Sopenharmony_ci        - Added issue 2.
21502f4aeb0Sopenharmony_ci
21602f4aeb0Sopenharmony_ci    #4  (August 22nd, 2014) James Jones
21702f4aeb0Sopenharmony_ci        - Marked complete.
21802f4aeb0Sopenharmony_ci        - Listed Daniel as the contact.
21902f4aeb0Sopenharmony_ci
22002f4aeb0Sopenharmony_ci    #3  (June 5th, 2014) Daniel Kartch
22102f4aeb0Sopenharmony_ci        - Assign enumerated values for constants.
22202f4aeb0Sopenharmony_ci
22302f4aeb0Sopenharmony_ci    #2  (May 28th, 2014) Daniel Kartch
22402f4aeb0Sopenharmony_ci        - Simplified description of new behavior based on refinements
22502f4aeb0Sopenharmony_ci          to EGL_EXT_output_base.
22602f4aeb0Sopenharmony_ci
22702f4aeb0Sopenharmony_ci    #1  (January 31st, 2014) Daniel Kartch
22802f4aeb0Sopenharmony_ci        - Initial draft, representing a signficant reworking of
22902f4aeb0Sopenharmony_ci          functionality previously proposed in
23002f4aeb0Sopenharmony_ci          EGL_EXT_native_device_openwf.
231