102f4aeb0Sopenharmony_ciName 202f4aeb0Sopenharmony_ci 302f4aeb0Sopenharmony_ci EXT_output_base 402f4aeb0Sopenharmony_ci 502f4aeb0Sopenharmony_ciName Strings 602f4aeb0Sopenharmony_ci 702f4aeb0Sopenharmony_ci EGL_EXT_output_base 802f4aeb0Sopenharmony_ci 902f4aeb0Sopenharmony_ciContributors 1002f4aeb0Sopenharmony_ci 1102f4aeb0Sopenharmony_ci Daniel Kartch 1202f4aeb0Sopenharmony_ci James Jones 1302f4aeb0Sopenharmony_ci Christopher James Halse Rogers 1402f4aeb0Sopenharmony_ci 1502f4aeb0Sopenharmony_ciContacts 1602f4aeb0Sopenharmony_ci 1702f4aeb0Sopenharmony_ci Daniel Kartch, NVIDIA (dkartch 'at' nvidia.com) 1802f4aeb0Sopenharmony_ci 1902f4aeb0Sopenharmony_ciStatus 2002f4aeb0Sopenharmony_ci 2102f4aeb0Sopenharmony_ci Complete 2202f4aeb0Sopenharmony_ci 2302f4aeb0Sopenharmony_ciVersion 2402f4aeb0Sopenharmony_ci 2502f4aeb0Sopenharmony_ci Version 9 - August 22, 2014 2602f4aeb0Sopenharmony_ci 2702f4aeb0Sopenharmony_ciNumber 2802f4aeb0Sopenharmony_ci 2902f4aeb0Sopenharmony_ci EGL Extension #78 3002f4aeb0Sopenharmony_ci 3102f4aeb0Sopenharmony_ciExtension Type 3202f4aeb0Sopenharmony_ci 3302f4aeb0Sopenharmony_ci EGL display extension 3402f4aeb0Sopenharmony_ci 3502f4aeb0Sopenharmony_ciDependencies 3602f4aeb0Sopenharmony_ci 3702f4aeb0Sopenharmony_ci Written against the wording of EGL 1.5, plus the EGL_EXT_device_base 3802f4aeb0Sopenharmony_ci specification. 3902f4aeb0Sopenharmony_ci 4002f4aeb0Sopenharmony_ci Requires EGL_EXT_device_base 4102f4aeb0Sopenharmony_ci 4202f4aeb0Sopenharmony_ciOverview 4302f4aeb0Sopenharmony_ci 4402f4aeb0Sopenharmony_ci Increasingly, EGL and its client APIs are being used in place of 4502f4aeb0Sopenharmony_ci "native" rendering APIs to implement the basic graphics 4602f4aeb0Sopenharmony_ci functionality of native windowing systems. This creates demand 4702f4aeb0Sopenharmony_ci for a method to initialize EGL displays and surfaces directly on 4802f4aeb0Sopenharmony_ci top of native GPU or device objects rather than native window 4902f4aeb0Sopenharmony_ci system objects. The mechanics of enumerating the underlying 5002f4aeb0Sopenharmony_ci native devices and constructing EGL displays and surfaces from 5102f4aeb0Sopenharmony_ci them have been solved in various platform and implementation- 5202f4aeb0Sopenharmony_ci specific ways. The EGL device family of extensions offers a 5302f4aeb0Sopenharmony_ci standardized framework for bootstrapping EGL without the use of 5402f4aeb0Sopenharmony_ci any underlying "native" APIs or functionality. 5502f4aeb0Sopenharmony_ci 5602f4aeb0Sopenharmony_ci This extension defines new EGL resource types for referencing 5702f4aeb0Sopenharmony_ci display control hardware associated with an EGL device. Its purpose 5802f4aeb0Sopenharmony_ci is to allow rendering to be directed to a screen in the absence of 5902f4aeb0Sopenharmony_ci (or bypassing) a window system. Because the use models for these 6002f4aeb0Sopenharmony_ci resources are potentially diverse, only the objects themselves and 6102f4aeb0Sopenharmony_ci basic functions to acquire and query them are defined here. More 6202f4aeb0Sopenharmony_ci detailed functions and enumerants required to operate on outputs 6302f4aeb0Sopenharmony_ci are provided by separate extensions. 6402f4aeb0Sopenharmony_ci 6502f4aeb0Sopenharmony_ciNew Types 6602f4aeb0Sopenharmony_ci 6702f4aeb0Sopenharmony_ci A handle representing a portion of display control hardware which 6802f4aeb0Sopenharmony_ci accepts a single image as input and processes it for output on a 6902f4aeb0Sopenharmony_ci display device: 7002f4aeb0Sopenharmony_ci 7102f4aeb0Sopenharmony_ci typedef void* EGLOutputLayerEXT; 7202f4aeb0Sopenharmony_ci 7302f4aeb0Sopenharmony_ci A handle representing a portion of display control hardware which 7402f4aeb0Sopenharmony_ci transmits a signal to a display device: 7502f4aeb0Sopenharmony_ci 7602f4aeb0Sopenharmony_ci typedef void* EGLOutputPortEXT; 7702f4aeb0Sopenharmony_ci 7802f4aeb0Sopenharmony_ciNew Functions 7902f4aeb0Sopenharmony_ci 8002f4aeb0Sopenharmony_ci EGLBoolean eglGetOutputLayersEXT( 8102f4aeb0Sopenharmony_ci EGLDisplay dpy, 8202f4aeb0Sopenharmony_ci const EGLAttrib *attrib_list, 8302f4aeb0Sopenharmony_ci EGLOutputLayerEXT *layers, 8402f4aeb0Sopenharmony_ci EGLint max_layers, 8502f4aeb0Sopenharmony_ci EGLint *num_layers); 8602f4aeb0Sopenharmony_ci 8702f4aeb0Sopenharmony_ci EGLBoolean eglGetOutputPortsEXT( 8802f4aeb0Sopenharmony_ci EGLDisplay dpy, 8902f4aeb0Sopenharmony_ci const EGLAttrib *attrib_list, 9002f4aeb0Sopenharmony_ci EGLOutputPortEXT *ports, 9102f4aeb0Sopenharmony_ci EGLint max_ports, 9202f4aeb0Sopenharmony_ci EGLint *num_ports); 9302f4aeb0Sopenharmony_ci 9402f4aeb0Sopenharmony_ci EGLBoolean eglOutputLayerAttribEXT( 9502f4aeb0Sopenharmony_ci EGLDisplay dpy, 9602f4aeb0Sopenharmony_ci EGLOutputLayerEXT layer, 9702f4aeb0Sopenharmony_ci EGLint attribute, 9802f4aeb0Sopenharmony_ci EGLAttrib value); 9902f4aeb0Sopenharmony_ci 10002f4aeb0Sopenharmony_ci EGLBoolean eglQueryOutputLayerAttribEXT( 10102f4aeb0Sopenharmony_ci EGLDisplay dpy, 10202f4aeb0Sopenharmony_ci EGLOutputLayerEXT layer, 10302f4aeb0Sopenharmony_ci EGLint attribute, 10402f4aeb0Sopenharmony_ci EGLAttrib *value); 10502f4aeb0Sopenharmony_ci 10602f4aeb0Sopenharmony_ci const char* eglQueryOutputLayerStringEXT( 10702f4aeb0Sopenharmony_ci EGLDisplay dpy, 10802f4aeb0Sopenharmony_ci EGLOutputLayerEXT layer, 10902f4aeb0Sopenharmony_ci EGLint name); 11002f4aeb0Sopenharmony_ci 11102f4aeb0Sopenharmony_ci EGLBoolean eglOutputPortAttribEXT( 11202f4aeb0Sopenharmony_ci EGLDisplay dpy, 11302f4aeb0Sopenharmony_ci EGLOutputPortEXT port, 11402f4aeb0Sopenharmony_ci EGLint attribute, 11502f4aeb0Sopenharmony_ci EGLAttrib value); 11602f4aeb0Sopenharmony_ci 11702f4aeb0Sopenharmony_ci EGLBoolean eglQueryOutputPortAttribEXT( 11802f4aeb0Sopenharmony_ci EGLDisplay dpy, 11902f4aeb0Sopenharmony_ci EGLOutputPortEXT port, 12002f4aeb0Sopenharmony_ci EGLint attribute, 12102f4aeb0Sopenharmony_ci EGLAttrib *value); 12202f4aeb0Sopenharmony_ci 12302f4aeb0Sopenharmony_ci const char* eglQueryOutputPortStringEXT( 12402f4aeb0Sopenharmony_ci EGLDisplay dpy, 12502f4aeb0Sopenharmony_ci EGLOutputPortEXT port, 12602f4aeb0Sopenharmony_ci EGLint name); 12702f4aeb0Sopenharmony_ci 12802f4aeb0Sopenharmony_ciNew Tokens 12902f4aeb0Sopenharmony_ci 13002f4aeb0Sopenharmony_ci Functions with a return type of EGLOutputLayerEXT will return this 13102f4aeb0Sopenharmony_ci value on failure: 13202f4aeb0Sopenharmony_ci 13302f4aeb0Sopenharmony_ci EGL_NO_OUTPUT_LAYER_EXT ((EGLOutputLayerEXT)0) 13402f4aeb0Sopenharmony_ci 13502f4aeb0Sopenharmony_ci Functions with a return type of EGLOutputPortEXT will return this 13602f4aeb0Sopenharmony_ci value on failure: 13702f4aeb0Sopenharmony_ci 13802f4aeb0Sopenharmony_ci EGL_NO_OUTPUT_PORT_EXT ((EGLOutputPortEXT)0) 13902f4aeb0Sopenharmony_ci 14002f4aeb0Sopenharmony_ci Functions which fail due to a bad EGLOutputLayerEXT handle will set 14102f4aeb0Sopenharmony_ci this error code: 14202f4aeb0Sopenharmony_ci 14302f4aeb0Sopenharmony_ci EGL_BAD_OUTPUT_LAYER_EXT 0x322D 14402f4aeb0Sopenharmony_ci 14502f4aeb0Sopenharmony_ci Functions which fail due to a bad EGLOutputPortEXT handle will set 14602f4aeb0Sopenharmony_ci this error code: 14702f4aeb0Sopenharmony_ci 14802f4aeb0Sopenharmony_ci EGL_BAD_OUTPUT_PORT_EXT 0x322E 14902f4aeb0Sopenharmony_ci 15002f4aeb0Sopenharmony_ci Functions which set or query the swap interval use this attribute 15102f4aeb0Sopenharmony_ci name: 15202f4aeb0Sopenharmony_ci 15302f4aeb0Sopenharmony_ci EGL_SWAP_INTERVAL_EXT 0x322F 15402f4aeb0Sopenharmony_ci 15502f4aeb0Sopenharmony_ciAdd a new section "2.1.4 Outputs" after "2.1.3 Displays": 15602f4aeb0Sopenharmony_ci 15702f4aeb0Sopenharmony_ci An EGLDisplay may have zero or more associated EGLOutputLayerEXT 15802f4aeb0Sopenharmony_ci and EGLOutputPortEXT objects. These represent, respectively, the 15902f4aeb0Sopenharmony_ci inputs and outputs of display control hardware. 16002f4aeb0Sopenharmony_ci 16102f4aeb0Sopenharmony_ci An EGLOutputLayerEXT is an abstract handle representing an element 16202f4aeb0Sopenharmony_ci of display control hardware which receives image data and processes 16302f4aeb0Sopenharmony_ci it for display. This processing is hardware-dependent, and may 16402f4aeb0Sopenharmony_ci include, but is not limited to, color space transformation, scaling 16502f4aeb0Sopenharmony_ci and rotation, and composition/blending with images from other 16602f4aeb0Sopenharmony_ci EGLOutputLayerEXTs. 16702f4aeb0Sopenharmony_ci 16802f4aeb0Sopenharmony_ci An EGLOutputPortEXT is an abstract handle representing an element of 16902f4aeb0Sopenharmony_ci display control hardware which sends a signal to drive a display 17002f4aeb0Sopenharmony_ci screen. In general, this signal is the result of the processing of 17102f4aeb0Sopenharmony_ci one or more EGLOutputLayerEXTs. 17202f4aeb0Sopenharmony_ci 17302f4aeb0Sopenharmony_ciAdd new entries to section "3.1 Errors": 17402f4aeb0Sopenharmony_ci 17502f4aeb0Sopenharmony_ci EGL_BAD_OUTPUT_LAYER_EXT 17602f4aeb0Sopenharmony_ci An EGLOutputLayerEXT argument does not name a valid 17702f4aeb0Sopenharmony_ci EGLOutputLayerEXT. Any command taking an EGLOutputLayerEXT 17802f4aeb0Sopenharmony_ci parameter may generate this error. 17902f4aeb0Sopenharmony_ci 18002f4aeb0Sopenharmony_ci EGL_BAD_OUTPUT_PORT_EXT 18102f4aeb0Sopenharmony_ci An EGLOutputPortEXT argument does not name a valid 18202f4aeb0Sopenharmony_ci EGLOutputPortEXT. Any command taking an EGLOutputPortEXT 18302f4aeb0Sopenharmony_ci parameter may generate this error. 18402f4aeb0Sopenharmony_ci 18502f4aeb0Sopenharmony_ciAdd a new section "3.10 Device Outputs" after "3.9 Posting the Color Buffer": 18602f4aeb0Sopenharmony_ci 18702f4aeb0Sopenharmony_ci 3.10 Device Outputs 18802f4aeb0Sopenharmony_ci 18902f4aeb0Sopenharmony_ci A simple platform running a custom software suite may not require a 19002f4aeb0Sopenharmony_ci formal window system. Instead, individual applications or a 19102f4aeb0Sopenharmony_ci compositor may send rendering results directly to display control 19202f4aeb0Sopenharmony_ci hardware, represented by EGLOutputLayerEXT and EGLOutputPortEXT 19302f4aeb0Sopenharmony_ci handles. 19402f4aeb0Sopenharmony_ci 19502f4aeb0Sopenharmony_ci As with other EGL resources, EGLOutputLayerEXT and EGLOutputPortEXT 19602f4aeb0Sopenharmony_ci handles are owned by an EGLDisplay, but not all EGLDisplays are 19702f4aeb0Sopenharmony_ci required to support these objects. In general, they will only be 19802f4aeb0Sopenharmony_ci available for EGLDisplays obtained from platforms which allow direct 19902f4aeb0Sopenharmony_ci manipulation of display devices. 20002f4aeb0Sopenharmony_ci 20102f4aeb0Sopenharmony_ci 3.10.1 Acquiring Outputs 20202f4aeb0Sopenharmony_ci 20302f4aeb0Sopenharmony_ci To obtain EGLOutputLayerEXT handles associated with a display which 20402f4aeb0Sopenharmony_ci match a list of attributes, use 20502f4aeb0Sopenharmony_ci 20602f4aeb0Sopenharmony_ci EGLBoolean eglGetOutputLayersEXT( 20702f4aeb0Sopenharmony_ci EGLDisplay dpy, 20802f4aeb0Sopenharmony_ci const EGLAttrib *attrib_list, 20902f4aeb0Sopenharmony_ci EGLOutputLayerEXT *layers, 21002f4aeb0Sopenharmony_ci EGLint max_layers, 21102f4aeb0Sopenharmony_ci EGLint *num_layers) 21202f4aeb0Sopenharmony_ci 21302f4aeb0Sopenharmony_ci On success, EGL_TRUE is returned. If <layers> is NULL, <max_layers> 21402f4aeb0Sopenharmony_ci is ignored and the number of output layers which match <attrib_list> 21502f4aeb0Sopenharmony_ci is returned in <num_layers>. Otherwise, up to <max_layers> matching 21602f4aeb0Sopenharmony_ci layers will be returned in <layers> and <num_layers> will be set to 21702f4aeb0Sopenharmony_ci the number of layer handles returned. The states of the output 21802f4aeb0Sopenharmony_ci layers are not altered by this query, and output layer handles can 21902f4aeb0Sopenharmony_ci be retrieved by multiple calls to this function. 22002f4aeb0Sopenharmony_ci 22102f4aeb0Sopenharmony_ci <attrib_list> may be NULL or a list of name/value pairs terminated 22202f4aeb0Sopenharmony_ci by EGL_NONE. If no attributes are provided, all output layers 22302f4aeb0Sopenharmony_ci associated with <dpy> will match. Otherwise, only those layers 22402f4aeb0Sopenharmony_ci matching all attributes provided in the list will be returned, 22502f4aeb0Sopenharmony_ci unless the value specified is EGL_DONT_CARE. If there are no 22602f4aeb0Sopenharmony_ci matching layers but all parameters are otherwise valid, success is 22702f4aeb0Sopenharmony_ci returned but num_layers is set to 0. 22802f4aeb0Sopenharmony_ci 22902f4aeb0Sopenharmony_ci On failure, EGL_FALSE will be returned and the memory referenced by 23002f4aeb0Sopenharmony_ci <layers> and <num_layers> will be unaffected. If <dpy> is not a 23102f4aeb0Sopenharmony_ci valid, initialized EGLDisplay, an EGL_BAD_DISPLAY error is 23202f4aeb0Sopenharmony_ci generated. If any name in <attrib_list> is not a valid layer 23302f4aeb0Sopenharmony_ci attribute name defined in Table 3.10.3.1, an EGL_BAD_ATTRIBUTE error 23402f4aeb0Sopenharmony_ci is generated. If any name in <attrib_list> does not allow search 23502f4aeb0Sopenharmony_ci access, an EGL_BAD_ACCESS error is generated. 23602f4aeb0Sopenharmony_ci 23702f4aeb0Sopenharmony_ci To obtain EGLOutputPortEXT handles associated with a display which 23802f4aeb0Sopenharmony_ci match a list of attributes, use 23902f4aeb0Sopenharmony_ci 24002f4aeb0Sopenharmony_ci EGLBoolean eglGetOutputPortsEXT( 24102f4aeb0Sopenharmony_ci EGLDisplay dpy, 24202f4aeb0Sopenharmony_ci const EGLAttrib *attrib_list, 24302f4aeb0Sopenharmony_ci EGLOutputPortEXT *ports, 24402f4aeb0Sopenharmony_ci EGLint max_ports, 24502f4aeb0Sopenharmony_ci EGLint *num_ports) 24602f4aeb0Sopenharmony_ci 24702f4aeb0Sopenharmony_ci On success, EGL_TRUE is returned. If <ports> is NULL, <max_ports> is 24802f4aeb0Sopenharmony_ci ignored and the number of output ports which match <attrib_list> is 24902f4aeb0Sopenharmony_ci returned in <num_ports>. Otherwise, up to <max_ports> matching 25002f4aeb0Sopenharmony_ci layers will be returned in <ports> and <num_ports> will be set to 25102f4aeb0Sopenharmony_ci the number of port handles returned. The states of the output ports 25202f4aeb0Sopenharmony_ci are not altered by this query, and output port handles can be 25302f4aeb0Sopenharmony_ci retrieved by multiple calls to this function. 25402f4aeb0Sopenharmony_ci 25502f4aeb0Sopenharmony_ci <attrib_list> may be NULL or a list of name/value pairs terminated 25602f4aeb0Sopenharmony_ci by EGL_NONE. If no attributes are provided, all output ports 25702f4aeb0Sopenharmony_ci associated with <dpy> will match. Otherwise, only those ports 25802f4aeb0Sopenharmony_ci matching all attributes provided in the list will be returned, 25902f4aeb0Sopenharmony_ci unless the value specified is EGL_DONT_CARE. If there are no 26002f4aeb0Sopenharmony_ci matching ports but all parameters are otherwise valid, success is 26102f4aeb0Sopenharmony_ci returned but num_ports is set to 0. 26202f4aeb0Sopenharmony_ci 26302f4aeb0Sopenharmony_ci On failure, EGL_FALSE will be returned and the memory referenced by 26402f4aeb0Sopenharmony_ci <ports> and <num_ports> will be unaffected. If <dpy> is not a valid, 26502f4aeb0Sopenharmony_ci initialized EGLDisplay, an EGL_BAD_DISPLAY error is generated. If 26602f4aeb0Sopenharmony_ci any name in <attrib_list> is not a valid port attribute name defined 26702f4aeb0Sopenharmony_ci in Table 3.10.3.2, an EGL_BAD_ATTRIBUTE error is generated. If any 26802f4aeb0Sopenharmony_ci name in <attrib_list> does not allow search access, an 26902f4aeb0Sopenharmony_ci EGL_BAD_ACCESS error is generated. 27002f4aeb0Sopenharmony_ci 27102f4aeb0Sopenharmony_ci 3.10.2 Lifetime of Output Handles 27202f4aeb0Sopenharmony_ci 27302f4aeb0Sopenharmony_ci An initialized EGLDisplay has a fixed set of output layer and port 27402f4aeb0Sopenharmony_ci resources available. Implementations may defer creation of handles 27502f4aeb0Sopenharmony_ci and allocation of data structions for these objects until they are 27602f4aeb0Sopenharmony_ci first requested. However, once acquired, they remain valid as long 27702f4aeb0Sopenharmony_ci as the EGLDisplay is not terminated. 27802f4aeb0Sopenharmony_ci 27902f4aeb0Sopenharmony_ci 3.10.3 Output Attributes 28002f4aeb0Sopenharmony_ci 28102f4aeb0Sopenharmony_ci Valid attributes associated with output layers and ports are listed 28202f4aeb0Sopenharmony_ci in Tables 3.10.3.1 and 3.10.3.2, respectively. Additional attributes 28302f4aeb0Sopenharmony_ci may be defined by other extensions. The Access columns contain one 28402f4aeb0Sopenharmony_ci or more of the letters "S", "R", and W". A value of "S" indicates 28502f4aeb0Sopenharmony_ci the attribute may be used to restrict the search when obtaining a 28602f4aeb0Sopenharmony_ci list of output handles. A value of "R" indicates the value may be 28702f4aeb0Sopenharmony_ci queried from an output handle. A value of "W" indicates the value 28802f4aeb0Sopenharmony_ci may be modified using an output handle. 28902f4aeb0Sopenharmony_ci 29002f4aeb0Sopenharmony_ci Attribute Type Access 29102f4aeb0Sopenharmony_ci --------------------- ------- ------ 29202f4aeb0Sopenharmony_ci EGL_SWAP_INTERVAL_EXT integer R|W 29302f4aeb0Sopenharmony_ci EGL_MIN_SWAP_INTERVAL integer R 29402f4aeb0Sopenharmony_ci EGL_MAX_SWAP_INTERVAL integer R 29502f4aeb0Sopenharmony_ci 29602f4aeb0Sopenharmony_ci Table 3.10.3.1 Output layer attributes 29702f4aeb0Sopenharmony_ci 29802f4aeb0Sopenharmony_ci Attribute Type Access 29902f4aeb0Sopenharmony_ci --------------------- ------- ------ 30002f4aeb0Sopenharmony_ci [no attributes supported] 30102f4aeb0Sopenharmony_ci 30202f4aeb0Sopenharmony_ci Table 3.10.3.2 Output port attributes 30302f4aeb0Sopenharmony_ci 30402f4aeb0Sopenharmony_ci 3.10.3.1 Querying Output Attributes 30502f4aeb0Sopenharmony_ci 30602f4aeb0Sopenharmony_ci To query attributes of an EGLOutputLayerEXT, use 30702f4aeb0Sopenharmony_ci 30802f4aeb0Sopenharmony_ci EGLBoolean eglQueryOutputLayerAttribEXT( 30902f4aeb0Sopenharmony_ci EGLDisplay dpy, 31002f4aeb0Sopenharmony_ci EGLOutputLayerEXT layer, 31102f4aeb0Sopenharmony_ci EGLint attribute, 31202f4aeb0Sopenharmony_ci EGLAttrib *value) 31302f4aeb0Sopenharmony_ci 31402f4aeb0Sopenharmony_ci On success, this function returns EGL_TRUE and stores the value of 31502f4aeb0Sopenharmony_ci <attribute> in <value>. 31602f4aeb0Sopenharmony_ci 31702f4aeb0Sopenharmony_ci On failure, EGL_FALSE is returned. If <dpy> is not a valid, 31802f4aeb0Sopenharmony_ci initialized EGLDisplay, an EGL_BAD_DISPLAY error is generated. If 31902f4aeb0Sopenharmony_ci <layer> is not a valid EGLOutputLayerEXT associated with <dpy>, an 32002f4aeb0Sopenharmony_ci EGL_BAD_OUTPUT_LAYER_EXT error is generated. If <attribute> is not a 32102f4aeb0Sopenharmony_ci valid layer attribute name defined in Table 3.10.3.1, an 32202f4aeb0Sopenharmony_ci EGL_BAD_ATTRIBUTE error is generated. If <attribute> has string 32302f4aeb0Sopenharmony_ci type or does not allow read access, an EGL_BAD_ACCESS error is 32402f4aeb0Sopenharmony_ci generated. 32502f4aeb0Sopenharmony_ci 32602f4aeb0Sopenharmony_ci To query string properties of an EGLOutputLayerEXT, use 32702f4aeb0Sopenharmony_ci 32802f4aeb0Sopenharmony_ci const char* eglQueryOutputLayerStringEXT( 32902f4aeb0Sopenharmony_ci EGLDisplay dpy, 33002f4aeb0Sopenharmony_ci EGLOutputLayerEXT layer, 33102f4aeb0Sopenharmony_ci EGLint attribute) 33202f4aeb0Sopenharmony_ci 33302f4aeb0Sopenharmony_ci On success, this function returns a zero-terminated string 33402f4aeb0Sopenharmony_ci containing the value associated with <name>. 33502f4aeb0Sopenharmony_ci 33602f4aeb0Sopenharmony_ci On failure, NULL is returned. If <dpy> is not a valid, initialized 33702f4aeb0Sopenharmony_ci EGLDisplay, an EGL_BAD_DISPLAY error is generated. If <layer> is not 33802f4aeb0Sopenharmony_ci a valid EGLOutputLayerEXT associated with <dpy>, an 33902f4aeb0Sopenharmony_ci EGL_BAD_OUTPUT_LAYER_EXT error is generated. If <name> is not a 34002f4aeb0Sopenharmony_ci valid layer attribute name defined in Table 3.10.3.1, an 34102f4aeb0Sopenharmony_ci EGL_BAD_ATTRIBUTE error is generated. If <attribute> has non-string 34202f4aeb0Sopenharmony_ci type or does not allow read access, an EGL_BAD_ACCESS error is 34302f4aeb0Sopenharmony_ci generated. 34402f4aeb0Sopenharmony_ci 34502f4aeb0Sopenharmony_ci To query attributes of an EGLOutputPortEXT, use 34602f4aeb0Sopenharmony_ci 34702f4aeb0Sopenharmony_ci EGLBoolean eglQueryOutputPortAttribEXT( 34802f4aeb0Sopenharmony_ci EGLDisplay dpy, 34902f4aeb0Sopenharmony_ci EGLOutputPortEXT port, 35002f4aeb0Sopenharmony_ci EGLint attribute, 35102f4aeb0Sopenharmony_ci EGLAttrib *value) 35202f4aeb0Sopenharmony_ci 35302f4aeb0Sopenharmony_ci On success, this function returns EGL_TRUE and stores the value of 35402f4aeb0Sopenharmony_ci <attribute> in <value>. 35502f4aeb0Sopenharmony_ci 35602f4aeb0Sopenharmony_ci On failure, EGL_FALSE is returned. If <dpy> is not a valid, 35702f4aeb0Sopenharmony_ci initialized EGLDisplay, an EGL_BAD_DISPLAY error is generated. If 35802f4aeb0Sopenharmony_ci <port> is not a valid EGLOutputPortEXT associated with <dpy>, an 35902f4aeb0Sopenharmony_ci EGL_BAD_OUTPUT_PORT_EXT error is generated. If <attribute> is not a 36002f4aeb0Sopenharmony_ci valid port attribute name defined in Table 3.10.3.2, an 36102f4aeb0Sopenharmony_ci EGL_BAD_ATTRIBUTE error is generated. If <attribute> has string 36202f4aeb0Sopenharmony_ci type or does not allow read access, an EGL_BAD_ACCESS error is 36302f4aeb0Sopenharmony_ci generated. 36402f4aeb0Sopenharmony_ci 36502f4aeb0Sopenharmony_ci To query string properties of an EGLOutputPortEXT, use 36602f4aeb0Sopenharmony_ci 36702f4aeb0Sopenharmony_ci const char* eglQueryOutputPortStringEXT( 36802f4aeb0Sopenharmony_ci EGLDisplay dpy, 36902f4aeb0Sopenharmony_ci EGLOutputPortEXT port, 37002f4aeb0Sopenharmony_ci EGLint attribute) 37102f4aeb0Sopenharmony_ci 37202f4aeb0Sopenharmony_ci On success, this function returns a zero-terminated string 37302f4aeb0Sopenharmony_ci containing the value associated with <name>. 37402f4aeb0Sopenharmony_ci 37502f4aeb0Sopenharmony_ci On failure, NULL is returned. If <dpy> is not a valid, initialized 37602f4aeb0Sopenharmony_ci EGLDisplay, an EGL_BAD_DISPLAY error is generated. If <port> is not 37702f4aeb0Sopenharmony_ci a valid EGLOutputPortEXT associated with <dpy>, an 37802f4aeb0Sopenharmony_ci EGL_BAD_OUTPUT_PORT_EXT error is generated. If <name> is not a 37902f4aeb0Sopenharmony_ci valid port attribute name defined in Table 3.10.3.2, an 38002f4aeb0Sopenharmony_ci EGL_BAD_ATTRIBUTE error is generated. If <attribute> has non-string 38102f4aeb0Sopenharmony_ci type or does not allow read access, an EGL_BAD_ACCESS error is 38202f4aeb0Sopenharmony_ci generated. 38302f4aeb0Sopenharmony_ci 38402f4aeb0Sopenharmony_ci 3.10.3.2 Setting Output Attributes 38502f4aeb0Sopenharmony_ci 38602f4aeb0Sopenharmony_ci To set attributes of an EGLOutputLayerEXT, use 38702f4aeb0Sopenharmony_ci 38802f4aeb0Sopenharmony_ci EGLBoolean eglOutputLayerAttribEXT( 38902f4aeb0Sopenharmony_ci EGLDisplay dpy, 39002f4aeb0Sopenharmony_ci EGLOutputLayerEXT layer, 39102f4aeb0Sopenharmony_ci EGLint attribute, 39202f4aeb0Sopenharmony_ci EGLAttrib value) 39302f4aeb0Sopenharmony_ci 39402f4aeb0Sopenharmony_ci On success, this function returns EGL_TRUE and sets the value of 39502f4aeb0Sopenharmony_ci <attribute> to <value>. 39602f4aeb0Sopenharmony_ci 39702f4aeb0Sopenharmony_ci If <attribute> is EGL_SWAP_INTERVAL_EXT, the value provided will be 39802f4aeb0Sopenharmony_ci silently clamped to the range specified by the layer's 39902f4aeb0Sopenharmony_ci EGL_MIN_SWAP_INTERVAL and EGL_MAX_SWAP_INTERVAL values. 40002f4aeb0Sopenharmony_ci 40102f4aeb0Sopenharmony_ci On failure, EGL_FALSE is returned. If <dpy> is not a valid, 40202f4aeb0Sopenharmony_ci initialized EGLDisplay, an EGL_BAD_DISPLAY error is generated. If 40302f4aeb0Sopenharmony_ci <layer> is not a valid EGLOutputLayerEXT associated with <dpy>, an 40402f4aeb0Sopenharmony_ci EGL_BAD_OUTPUT_LAYER_EXT error is generated. If <attribute> is not a 40502f4aeb0Sopenharmony_ci valid layer attribute name defined in Table 3.10.3.1, an 40602f4aeb0Sopenharmony_ci EGL_BAD_ATTRIBUTE error is generated. If <attribute> does not 40702f4aeb0Sopenharmony_ci allow write access, an EGL_BAD_ACCESS error is generated. 40802f4aeb0Sopenharmony_ci 40902f4aeb0Sopenharmony_ci To set attributes of an EGLOutputPortEXT, use 41002f4aeb0Sopenharmony_ci 41102f4aeb0Sopenharmony_ci EGLBoolean eglOutputPortAttribEXT( 41202f4aeb0Sopenharmony_ci EGLDisplay dpy, 41302f4aeb0Sopenharmony_ci EGLOutputPortEXT port, 41402f4aeb0Sopenharmony_ci EGLint attribute, 41502f4aeb0Sopenharmony_ci EGLAttrib value) 41602f4aeb0Sopenharmony_ci 41702f4aeb0Sopenharmony_ci On success, this function returns EGL_TRUE and sets the value of 41802f4aeb0Sopenharmony_ci <attribute> to <value>. 41902f4aeb0Sopenharmony_ci 42002f4aeb0Sopenharmony_ci On failure, EGL_FALSE is returned. If <dpy> is not a valid, 42102f4aeb0Sopenharmony_ci initialized EGLDisplay, an EGL_BAD_DISPLAY error is generated. If 42202f4aeb0Sopenharmony_ci <port> is not a valid EGLOutputPortEXT associated with <dpy>, an 42302f4aeb0Sopenharmony_ci EGL_BAD_OUTPUT_PORT_EXT error is generated. If <attribute> is not a 42402f4aeb0Sopenharmony_ci valid port attribute name defined in Table 3.10.3.2, an 42502f4aeb0Sopenharmony_ci EGL_BAD_ATTRIBUTE error is generated. If <attribute> does not 42602f4aeb0Sopenharmony_ci allow write access, an EGL_BAD_ACCESS error is generated. 42702f4aeb0Sopenharmony_ci 42802f4aeb0Sopenharmony_ci 3.10.4 Setting Output Modes 42902f4aeb0Sopenharmony_ci 43002f4aeb0Sopenharmony_ci EGL does not currently define any mechanims to adjust display 43102f4aeb0Sopenharmony_ci modes through EGLOutputPortEXTs. These may be added via additional 43202f4aeb0Sopenharmony_ci extensions. 43302f4aeb0Sopenharmony_ci 43402f4aeb0Sopenharmony_ci 3.10.5 Posting to Outputs 43502f4aeb0Sopenharmony_ci 43602f4aeb0Sopenharmony_ci EGL does not currently define any mechanisms to post rendering 43702f4aeb0Sopenharmony_ci results to EGLOutputsLayerEXTs. These may be added via additional 43802f4aeb0Sopenharmony_ci extensions. However, unless otherwise specified, such mechanims 43902f4aeb0Sopenharmony_ci will respect the layer's EGL_SWAP_INTERVAL_EXT value, which 44002f4aeb0Sopenharmony_ci specifies the minimum number of video frame periods for which the 44102f4aeb0Sopenharmony_ci frames should be displayed, in a manner analogous to using 44202f4aeb0Sopenharmony_ci eglSwapInterval for the current draw surface. The default value of 44302f4aeb0Sopenharmony_ci EGL_SWAP_INTERVAL_EXT is 1, clamped to the layer's 44402f4aeb0Sopenharmony_ci EGL_MIN_SWAP_INTERVAL and EGL_MAX_SWAP_INTERVAL values. 44502f4aeb0Sopenharmony_ci 44602f4aeb0Sopenharmony_ci (Example: See extension specification 44702f4aeb0Sopenharmony_ci EGL_EXT_stream_consumer_egloutput) 44802f4aeb0Sopenharmony_ci 44902f4aeb0Sopenharmony_ciIssues 45002f4aeb0Sopenharmony_ci 45102f4aeb0Sopenharmony_ci 1. Should this extension provide a mechanism to enumerate outputs 45202f4aeb0Sopenharmony_ci associated with an EGLDevice and set their modes? 45302f4aeb0Sopenharmony_ci 45402f4aeb0Sopenharmony_ci RESOLVED: No. On many operating systems there already exist 45502f4aeb0Sopenharmony_ci standardized and/or widely accepted low level mechanisms for 45602f4aeb0Sopenharmony_ci performing these tasks. Duplicating this support in EGL would 45702f4aeb0Sopenharmony_ci impose an undesirable implementation burden where output handles 45802f4aeb0Sopenharmony_ci are only required as a means to direct rendering to a display 45902f4aeb0Sopenharmony_ci screen. Functions for enumerating screens or obtaining them from 46002f4aeb0Sopenharmony_ci platform-dependent representations will be provided by other 46102f4aeb0Sopenharmony_ci extensions. 46202f4aeb0Sopenharmony_ci 46302f4aeb0Sopenharmony_ci 2. Should output layer and port handles be associated with an 46402f4aeb0Sopenharmony_ci EGLDisplay, or vice versa? 46502f4aeb0Sopenharmony_ci 46602f4aeb0Sopenharmony_ci RESOLVED: Yes. Furthermore, it may only be possible to obtain 46702f4aeb0Sopenharmony_ci output handles from some EGLDisplays. The primary intended use 46802f4aeb0Sopenharmony_ci case is the EGLDisplay associated with an EGLDevice, through the 46902f4aeb0Sopenharmony_ci platform defined by EGL_EXT_platform_device. This represents raw 47002f4aeb0Sopenharmony_ci device access available in the absence of a window system. 47102f4aeb0Sopenharmony_ci EGLDisplays associated with other platforms typically represent 47202f4aeb0Sopenharmony_ci handles provided by window systems, which may not allow direct 47302f4aeb0Sopenharmony_ci access to the display control hardware. 47402f4aeb0Sopenharmony_ci 47502f4aeb0Sopenharmony_ci 3. Can the EGLDeviceEXT handle be returned by a query function 47602f4aeb0Sopenharmony_ci which returns integer attributes? 47702f4aeb0Sopenharmony_ci 47802f4aeb0Sopenharmony_ci RESOLVED: Yes. Function definition has been updated to use 47902f4aeb0Sopenharmony_ci EGLAttribEXT, which is compatible with EGL handles. 48002f4aeb0Sopenharmony_ci 48102f4aeb0Sopenharmony_ci 4. What display mode properties should be queriable by the base 48202f4aeb0Sopenharmony_ci extension? Does the application require width/height/refresh or 48302f4aeb0Sopenharmony_ci should those be left to other mechanisms or additional 48402f4aeb0Sopenharmony_ci extensions? If hardware supports selecting a portion of the 48502f4aeb0Sopenharmony_ci image for display, or restricting an image to a portion of the 48602f4aeb0Sopenharmony_ci screen, or scaling an image to a different resolution for 48702f4aeb0Sopenharmony_ci display, should all these settings be queriable? 48802f4aeb0Sopenharmony_ci 48902f4aeb0Sopenharmony_ci RESOLVED: The base extension will not define any display 49002f4aeb0Sopenharmony_ci properties. These will be left to future extensions if required. 49102f4aeb0Sopenharmony_ci 49202f4aeb0Sopenharmony_ci 5. How should stereo/multiview displays be handled? Should all 49302f4aeb0Sopenharmony_ci views share a single output or does each one have its own? 49402f4aeb0Sopenharmony_ci 49502f4aeb0Sopenharmony_ci UNRESOLVED. Left for a future extension to define. 49602f4aeb0Sopenharmony_ci 49702f4aeb0Sopenharmony_ci 6. This extension is currently focused on individual display layers 49802f4aeb0Sopenharmony_ci for the purpose of directing rendering output. An API covering 49902f4aeb0Sopenharmony_ci all hardware would associate one or more of those layers with a 50002f4aeb0Sopenharmony_ci display port. Do we need to abstract both? 50102f4aeb0Sopenharmony_ci 50202f4aeb0Sopenharmony_ci RESOLVED: Yes. Extension has been modified to abstract both 50302f4aeb0Sopenharmony_ci inputs (layers) and outputs (ports) of display control hardware. 50402f4aeb0Sopenharmony_ci An implementation is not required to return any ports in the 50502f4aeb0Sopenharmony_ci query function if it provides no means to operate on them. 50602f4aeb0Sopenharmony_ci 50702f4aeb0Sopenharmony_ciRevision History: 50802f4aeb0Sopenharmony_ci 50902f4aeb0Sopenharmony_ci #9 (August 22nd, 2014) James Jones 51002f4aeb0Sopenharmony_ci - Marked complete. 51102f4aeb0Sopenharmony_ci - Added minor coments to issue 5. 51202f4aeb0Sopenharmony_ci - Listed Daniel as the contact. 51302f4aeb0Sopenharmony_ci 51402f4aeb0Sopenharmony_ci #8 (June 10th, 2014) Daniel Kartch 51502f4aeb0Sopenharmony_ci - Fixed prototypes for layer/port attribute setting functions. 51602f4aeb0Sopenharmony_ci 51702f4aeb0Sopenharmony_ci #7 (June 5th, 2014) Daniel Kartch 51802f4aeb0Sopenharmony_ci - Assigned enumerated values for constants. 51902f4aeb0Sopenharmony_ci - Indicated default swap interval value. 52002f4aeb0Sopenharmony_ci 52102f4aeb0Sopenharmony_ci #6 (May 28th, 2014) Daniel Kartch 52202f4aeb0Sopenharmony_ci - Updated wording based on EGL 1.5 specification, using 52302f4aeb0Sopenharmony_ci EGLAttrib instead of EGLAttribEXT. 52402f4aeb0Sopenharmony_ci - Added functions to set layer and port attributes. 52502f4aeb0Sopenharmony_ci - Added table of valid attributes, with min/max/current swap 52602f4aeb0Sopenharmony_ci interval values, and adjusted function descriptions 52702f4aeb0Sopenharmony_ci accordingly. 52802f4aeb0Sopenharmony_ci - Refined description for output enumeration functions to better 52902f4aeb0Sopenharmony_ci indicate the effect of attribute list. 53002f4aeb0Sopenharmony_ci - Added effect of swap interval in posting section. 53102f4aeb0Sopenharmony_ci 53202f4aeb0Sopenharmony_ci #5 (January 31st, 2014) Daniel Kartch 53302f4aeb0Sopenharmony_ci - Added eglGetOutput* functions, folding in and generalizing 53402f4aeb0Sopenharmony_ci functionality previously provided by EXT_native_output 53502f4aeb0Sopenharmony_ci extension. 53602f4aeb0Sopenharmony_ci - Separated descriptions for layer and port query functions for 53702f4aeb0Sopenharmony_ci clarity. 53802f4aeb0Sopenharmony_ci 53902f4aeb0Sopenharmony_ci #4 (January 22nd, 2014) Daniel Kartch 54002f4aeb0Sopenharmony_ci - Added section clarifying that this extension provides no means 54102f4aeb0Sopenharmony_ci to use output ports to set display modes, but future 54202f4aeb0Sopenharmony_ci extensions may. 54302f4aeb0Sopenharmony_ci 54402f4aeb0Sopenharmony_ci #3 (January 17th, 2014) Daniel Kartch 54502f4aeb0Sopenharmony_ci - Updated names of example extension for obtaining and using 54602f4aeb0Sopenharmony_ci output handles. 54702f4aeb0Sopenharmony_ci - Fixed typos. 54802f4aeb0Sopenharmony_ci 54902f4aeb0Sopenharmony_ci #2 (November 12th, 2013) Daniel Kartch 55002f4aeb0Sopenharmony_ci - Replaced EGLOutput with EGLOutputLayer and added 55102f4aeb0Sopenharmony_ci EGLOutputPort (and modified/added corresponding functions), to 55202f4aeb0Sopenharmony_ci allow both inputs and outputs of display control hardware to 55302f4aeb0Sopenharmony_ci be abstracted. 55402f4aeb0Sopenharmony_ci - Modified attribute query functions to use EGLAttribEXT and 55502f4aeb0Sopenharmony_ci added string query functions. 55602f4aeb0Sopenharmony_ci - Removed display mode attributes. These can be defined by a 55702f4aeb0Sopenharmony_ci separate extension if desired. 55802f4aeb0Sopenharmony_ci - Removed destructor function for outputs and added section on 55902f4aeb0Sopenharmony_ci lifetime, as well as language describing their relationship to 56002f4aeb0Sopenharmony_ci EGLDisplays. 56102f4aeb0Sopenharmony_ci 56202f4aeb0Sopenharmony_ci #1 (October 25nd, 2013) Daniel Kartch 56302f4aeb0Sopenharmony_ci - Initial draft 56402f4aeb0Sopenharmony_ci 565