1Name 2 3 EXT_output_base 4 5Name Strings 6 7 EGL_EXT_output_base 8 9Contributors 10 11 Daniel Kartch 12 James Jones 13 Christopher James Halse Rogers 14 15Contacts 16 17 Daniel Kartch, NVIDIA (dkartch 'at' nvidia.com) 18 19Status 20 21 Complete 22 23Version 24 25 Version 9 - August 22, 2014 26 27Number 28 29 EGL Extension #78 30 31Extension Type 32 33 EGL display extension 34 35Dependencies 36 37 Written against the wording of EGL 1.5, plus the EGL_EXT_device_base 38 specification. 39 40 Requires EGL_EXT_device_base 41 42Overview 43 44 Increasingly, EGL and its client APIs are being used in place of 45 "native" rendering APIs to implement the basic graphics 46 functionality of native windowing systems. This creates demand 47 for a method to initialize EGL displays and surfaces directly on 48 top of native GPU or device objects rather than native window 49 system objects. The mechanics of enumerating the underlying 50 native devices and constructing EGL displays and surfaces from 51 them have been solved in various platform and implementation- 52 specific ways. The EGL device family of extensions offers a 53 standardized framework for bootstrapping EGL without the use of 54 any underlying "native" APIs or functionality. 55 56 This extension defines new EGL resource types for referencing 57 display control hardware associated with an EGL device. Its purpose 58 is to allow rendering to be directed to a screen in the absence of 59 (or bypassing) a window system. Because the use models for these 60 resources are potentially diverse, only the objects themselves and 61 basic functions to acquire and query them are defined here. More 62 detailed functions and enumerants required to operate on outputs 63 are provided by separate extensions. 64 65New Types 66 67 A handle representing a portion of display control hardware which 68 accepts a single image as input and processes it for output on a 69 display device: 70 71 typedef void* EGLOutputLayerEXT; 72 73 A handle representing a portion of display control hardware which 74 transmits a signal to a display device: 75 76 typedef void* EGLOutputPortEXT; 77 78New Functions 79 80 EGLBoolean eglGetOutputLayersEXT( 81 EGLDisplay dpy, 82 const EGLAttrib *attrib_list, 83 EGLOutputLayerEXT *layers, 84 EGLint max_layers, 85 EGLint *num_layers); 86 87 EGLBoolean eglGetOutputPortsEXT( 88 EGLDisplay dpy, 89 const EGLAttrib *attrib_list, 90 EGLOutputPortEXT *ports, 91 EGLint max_ports, 92 EGLint *num_ports); 93 94 EGLBoolean eglOutputLayerAttribEXT( 95 EGLDisplay dpy, 96 EGLOutputLayerEXT layer, 97 EGLint attribute, 98 EGLAttrib value); 99 100 EGLBoolean eglQueryOutputLayerAttribEXT( 101 EGLDisplay dpy, 102 EGLOutputLayerEXT layer, 103 EGLint attribute, 104 EGLAttrib *value); 105 106 const char* eglQueryOutputLayerStringEXT( 107 EGLDisplay dpy, 108 EGLOutputLayerEXT layer, 109 EGLint name); 110 111 EGLBoolean eglOutputPortAttribEXT( 112 EGLDisplay dpy, 113 EGLOutputPortEXT port, 114 EGLint attribute, 115 EGLAttrib value); 116 117 EGLBoolean eglQueryOutputPortAttribEXT( 118 EGLDisplay dpy, 119 EGLOutputPortEXT port, 120 EGLint attribute, 121 EGLAttrib *value); 122 123 const char* eglQueryOutputPortStringEXT( 124 EGLDisplay dpy, 125 EGLOutputPortEXT port, 126 EGLint name); 127 128New Tokens 129 130 Functions with a return type of EGLOutputLayerEXT will return this 131 value on failure: 132 133 EGL_NO_OUTPUT_LAYER_EXT ((EGLOutputLayerEXT)0) 134 135 Functions with a return type of EGLOutputPortEXT will return this 136 value on failure: 137 138 EGL_NO_OUTPUT_PORT_EXT ((EGLOutputPortEXT)0) 139 140 Functions which fail due to a bad EGLOutputLayerEXT handle will set 141 this error code: 142 143 EGL_BAD_OUTPUT_LAYER_EXT 0x322D 144 145 Functions which fail due to a bad EGLOutputPortEXT handle will set 146 this error code: 147 148 EGL_BAD_OUTPUT_PORT_EXT 0x322E 149 150 Functions which set or query the swap interval use this attribute 151 name: 152 153 EGL_SWAP_INTERVAL_EXT 0x322F 154 155Add a new section "2.1.4 Outputs" after "2.1.3 Displays": 156 157 An EGLDisplay may have zero or more associated EGLOutputLayerEXT 158 and EGLOutputPortEXT objects. These represent, respectively, the 159 inputs and outputs of display control hardware. 160 161 An EGLOutputLayerEXT is an abstract handle representing an element 162 of display control hardware which receives image data and processes 163 it for display. This processing is hardware-dependent, and may 164 include, but is not limited to, color space transformation, scaling 165 and rotation, and composition/blending with images from other 166 EGLOutputLayerEXTs. 167 168 An EGLOutputPortEXT is an abstract handle representing an element of 169 display control hardware which sends a signal to drive a display 170 screen. In general, this signal is the result of the processing of 171 one or more EGLOutputLayerEXTs. 172 173Add new entries to section "3.1 Errors": 174 175 EGL_BAD_OUTPUT_LAYER_EXT 176 An EGLOutputLayerEXT argument does not name a valid 177 EGLOutputLayerEXT. Any command taking an EGLOutputLayerEXT 178 parameter may generate this error. 179 180 EGL_BAD_OUTPUT_PORT_EXT 181 An EGLOutputPortEXT argument does not name a valid 182 EGLOutputPortEXT. Any command taking an EGLOutputPortEXT 183 parameter may generate this error. 184 185Add a new section "3.10 Device Outputs" after "3.9 Posting the Color Buffer": 186 187 3.10 Device Outputs 188 189 A simple platform running a custom software suite may not require a 190 formal window system. Instead, individual applications or a 191 compositor may send rendering results directly to display control 192 hardware, represented by EGLOutputLayerEXT and EGLOutputPortEXT 193 handles. 194 195 As with other EGL resources, EGLOutputLayerEXT and EGLOutputPortEXT 196 handles are owned by an EGLDisplay, but not all EGLDisplays are 197 required to support these objects. In general, they will only be 198 available for EGLDisplays obtained from platforms which allow direct 199 manipulation of display devices. 200 201 3.10.1 Acquiring Outputs 202 203 To obtain EGLOutputLayerEXT handles associated with a display which 204 match a list of attributes, use 205 206 EGLBoolean eglGetOutputLayersEXT( 207 EGLDisplay dpy, 208 const EGLAttrib *attrib_list, 209 EGLOutputLayerEXT *layers, 210 EGLint max_layers, 211 EGLint *num_layers) 212 213 On success, EGL_TRUE is returned. If <layers> is NULL, <max_layers> 214 is ignored and the number of output layers which match <attrib_list> 215 is returned in <num_layers>. Otherwise, up to <max_layers> matching 216 layers will be returned in <layers> and <num_layers> will be set to 217 the number of layer handles returned. The states of the output 218 layers are not altered by this query, and output layer handles can 219 be retrieved by multiple calls to this function. 220 221 <attrib_list> may be NULL or a list of name/value pairs terminated 222 by EGL_NONE. If no attributes are provided, all output layers 223 associated with <dpy> will match. Otherwise, only those layers 224 matching all attributes provided in the list will be returned, 225 unless the value specified is EGL_DONT_CARE. If there are no 226 matching layers but all parameters are otherwise valid, success is 227 returned but num_layers is set to 0. 228 229 On failure, EGL_FALSE will be returned and the memory referenced by 230 <layers> and <num_layers> will be unaffected. If <dpy> is not a 231 valid, initialized EGLDisplay, an EGL_BAD_DISPLAY error is 232 generated. If any name in <attrib_list> is not a valid layer 233 attribute name defined in Table 3.10.3.1, an EGL_BAD_ATTRIBUTE error 234 is generated. If any name in <attrib_list> does not allow search 235 access, an EGL_BAD_ACCESS error is generated. 236 237 To obtain EGLOutputPortEXT handles associated with a display which 238 match a list of attributes, use 239 240 EGLBoolean eglGetOutputPortsEXT( 241 EGLDisplay dpy, 242 const EGLAttrib *attrib_list, 243 EGLOutputPortEXT *ports, 244 EGLint max_ports, 245 EGLint *num_ports) 246 247 On success, EGL_TRUE is returned. If <ports> is NULL, <max_ports> is 248 ignored and the number of output ports which match <attrib_list> is 249 returned in <num_ports>. Otherwise, up to <max_ports> matching 250 layers will be returned in <ports> and <num_ports> will be set to 251 the number of port handles returned. The states of the output ports 252 are not altered by this query, and output port handles can be 253 retrieved by multiple calls to this function. 254 255 <attrib_list> may be NULL or a list of name/value pairs terminated 256 by EGL_NONE. If no attributes are provided, all output ports 257 associated with <dpy> will match. Otherwise, only those ports 258 matching all attributes provided in the list will be returned, 259 unless the value specified is EGL_DONT_CARE. If there are no 260 matching ports but all parameters are otherwise valid, success is 261 returned but num_ports is set to 0. 262 263 On failure, EGL_FALSE will be returned and the memory referenced by 264 <ports> and <num_ports> will be unaffected. If <dpy> is not a valid, 265 initialized EGLDisplay, an EGL_BAD_DISPLAY error is generated. If 266 any name in <attrib_list> is not a valid port attribute name defined 267 in Table 3.10.3.2, an EGL_BAD_ATTRIBUTE error is generated. If any 268 name in <attrib_list> does not allow search access, an 269 EGL_BAD_ACCESS error is generated. 270 271 3.10.2 Lifetime of Output Handles 272 273 An initialized EGLDisplay has a fixed set of output layer and port 274 resources available. Implementations may defer creation of handles 275 and allocation of data structions for these objects until they are 276 first requested. However, once acquired, they remain valid as long 277 as the EGLDisplay is not terminated. 278 279 3.10.3 Output Attributes 280 281 Valid attributes associated with output layers and ports are listed 282 in Tables 3.10.3.1 and 3.10.3.2, respectively. Additional attributes 283 may be defined by other extensions. The Access columns contain one 284 or more of the letters "S", "R", and W". A value of "S" indicates 285 the attribute may be used to restrict the search when obtaining a 286 list of output handles. A value of "R" indicates the value may be 287 queried from an output handle. A value of "W" indicates the value 288 may be modified using an output handle. 289 290 Attribute Type Access 291 --------------------- ------- ------ 292 EGL_SWAP_INTERVAL_EXT integer R|W 293 EGL_MIN_SWAP_INTERVAL integer R 294 EGL_MAX_SWAP_INTERVAL integer R 295 296 Table 3.10.3.1 Output layer attributes 297 298 Attribute Type Access 299 --------------------- ------- ------ 300 [no attributes supported] 301 302 Table 3.10.3.2 Output port attributes 303 304 3.10.3.1 Querying Output Attributes 305 306 To query attributes of an EGLOutputLayerEXT, use 307 308 EGLBoolean eglQueryOutputLayerAttribEXT( 309 EGLDisplay dpy, 310 EGLOutputLayerEXT layer, 311 EGLint attribute, 312 EGLAttrib *value) 313 314 On success, this function returns EGL_TRUE and stores the value of 315 <attribute> in <value>. 316 317 On failure, EGL_FALSE is returned. If <dpy> is not a valid, 318 initialized EGLDisplay, an EGL_BAD_DISPLAY error is generated. If 319 <layer> is not a valid EGLOutputLayerEXT associated with <dpy>, an 320 EGL_BAD_OUTPUT_LAYER_EXT error is generated. If <attribute> is not a 321 valid layer attribute name defined in Table 3.10.3.1, an 322 EGL_BAD_ATTRIBUTE error is generated. If <attribute> has string 323 type or does not allow read access, an EGL_BAD_ACCESS error is 324 generated. 325 326 To query string properties of an EGLOutputLayerEXT, use 327 328 const char* eglQueryOutputLayerStringEXT( 329 EGLDisplay dpy, 330 EGLOutputLayerEXT layer, 331 EGLint attribute) 332 333 On success, this function returns a zero-terminated string 334 containing the value associated with <name>. 335 336 On failure, NULL is returned. If <dpy> is not a valid, initialized 337 EGLDisplay, an EGL_BAD_DISPLAY error is generated. If <layer> is not 338 a valid EGLOutputLayerEXT associated with <dpy>, an 339 EGL_BAD_OUTPUT_LAYER_EXT error is generated. If <name> is not a 340 valid layer attribute name defined in Table 3.10.3.1, an 341 EGL_BAD_ATTRIBUTE error is generated. If <attribute> has non-string 342 type or does not allow read access, an EGL_BAD_ACCESS error is 343 generated. 344 345 To query attributes of an EGLOutputPortEXT, use 346 347 EGLBoolean eglQueryOutputPortAttribEXT( 348 EGLDisplay dpy, 349 EGLOutputPortEXT port, 350 EGLint attribute, 351 EGLAttrib *value) 352 353 On success, this function returns EGL_TRUE and stores the value of 354 <attribute> in <value>. 355 356 On failure, EGL_FALSE is returned. If <dpy> is not a valid, 357 initialized EGLDisplay, an EGL_BAD_DISPLAY error is generated. If 358 <port> is not a valid EGLOutputPortEXT associated with <dpy>, an 359 EGL_BAD_OUTPUT_PORT_EXT error is generated. If <attribute> is not a 360 valid port attribute name defined in Table 3.10.3.2, an 361 EGL_BAD_ATTRIBUTE error is generated. If <attribute> has string 362 type or does not allow read access, an EGL_BAD_ACCESS error is 363 generated. 364 365 To query string properties of an EGLOutputPortEXT, use 366 367 const char* eglQueryOutputPortStringEXT( 368 EGLDisplay dpy, 369 EGLOutputPortEXT port, 370 EGLint attribute) 371 372 On success, this function returns a zero-terminated string 373 containing the value associated with <name>. 374 375 On failure, NULL is returned. If <dpy> is not a valid, initialized 376 EGLDisplay, an EGL_BAD_DISPLAY error is generated. If <port> is not 377 a valid EGLOutputPortEXT associated with <dpy>, an 378 EGL_BAD_OUTPUT_PORT_EXT error is generated. If <name> is not a 379 valid port attribute name defined in Table 3.10.3.2, an 380 EGL_BAD_ATTRIBUTE error is generated. If <attribute> has non-string 381 type or does not allow read access, an EGL_BAD_ACCESS error is 382 generated. 383 384 3.10.3.2 Setting Output Attributes 385 386 To set attributes of an EGLOutputLayerEXT, use 387 388 EGLBoolean eglOutputLayerAttribEXT( 389 EGLDisplay dpy, 390 EGLOutputLayerEXT layer, 391 EGLint attribute, 392 EGLAttrib value) 393 394 On success, this function returns EGL_TRUE and sets the value of 395 <attribute> to <value>. 396 397 If <attribute> is EGL_SWAP_INTERVAL_EXT, the value provided will be 398 silently clamped to the range specified by the layer's 399 EGL_MIN_SWAP_INTERVAL and EGL_MAX_SWAP_INTERVAL values. 400 401 On failure, EGL_FALSE is returned. If <dpy> is not a valid, 402 initialized EGLDisplay, an EGL_BAD_DISPLAY error is generated. If 403 <layer> is not a valid EGLOutputLayerEXT associated with <dpy>, an 404 EGL_BAD_OUTPUT_LAYER_EXT error is generated. If <attribute> is not a 405 valid layer attribute name defined in Table 3.10.3.1, an 406 EGL_BAD_ATTRIBUTE error is generated. If <attribute> does not 407 allow write access, an EGL_BAD_ACCESS error is generated. 408 409 To set attributes of an EGLOutputPortEXT, use 410 411 EGLBoolean eglOutputPortAttribEXT( 412 EGLDisplay dpy, 413 EGLOutputPortEXT port, 414 EGLint attribute, 415 EGLAttrib value) 416 417 On success, this function returns EGL_TRUE and sets the value of 418 <attribute> to <value>. 419 420 On failure, EGL_FALSE is returned. If <dpy> is not a valid, 421 initialized EGLDisplay, an EGL_BAD_DISPLAY error is generated. If 422 <port> is not a valid EGLOutputPortEXT associated with <dpy>, an 423 EGL_BAD_OUTPUT_PORT_EXT error is generated. If <attribute> is not a 424 valid port attribute name defined in Table 3.10.3.2, an 425 EGL_BAD_ATTRIBUTE error is generated. If <attribute> does not 426 allow write access, an EGL_BAD_ACCESS error is generated. 427 428 3.10.4 Setting Output Modes 429 430 EGL does not currently define any mechanims to adjust display 431 modes through EGLOutputPortEXTs. These may be added via additional 432 extensions. 433 434 3.10.5 Posting to Outputs 435 436 EGL does not currently define any mechanisms to post rendering 437 results to EGLOutputsLayerEXTs. These may be added via additional 438 extensions. However, unless otherwise specified, such mechanims 439 will respect the layer's EGL_SWAP_INTERVAL_EXT value, which 440 specifies the minimum number of video frame periods for which the 441 frames should be displayed, in a manner analogous to using 442 eglSwapInterval for the current draw surface. The default value of 443 EGL_SWAP_INTERVAL_EXT is 1, clamped to the layer's 444 EGL_MIN_SWAP_INTERVAL and EGL_MAX_SWAP_INTERVAL values. 445 446 (Example: See extension specification 447 EGL_EXT_stream_consumer_egloutput) 448 449Issues 450 451 1. Should this extension provide a mechanism to enumerate outputs 452 associated with an EGLDevice and set their modes? 453 454 RESOLVED: No. On many operating systems there already exist 455 standardized and/or widely accepted low level mechanisms for 456 performing these tasks. Duplicating this support in EGL would 457 impose an undesirable implementation burden where output handles 458 are only required as a means to direct rendering to a display 459 screen. Functions for enumerating screens or obtaining them from 460 platform-dependent representations will be provided by other 461 extensions. 462 463 2. Should output layer and port handles be associated with an 464 EGLDisplay, or vice versa? 465 466 RESOLVED: Yes. Furthermore, it may only be possible to obtain 467 output handles from some EGLDisplays. The primary intended use 468 case is the EGLDisplay associated with an EGLDevice, through the 469 platform defined by EGL_EXT_platform_device. This represents raw 470 device access available in the absence of a window system. 471 EGLDisplays associated with other platforms typically represent 472 handles provided by window systems, which may not allow direct 473 access to the display control hardware. 474 475 3. Can the EGLDeviceEXT handle be returned by a query function 476 which returns integer attributes? 477 478 RESOLVED: Yes. Function definition has been updated to use 479 EGLAttribEXT, which is compatible with EGL handles. 480 481 4. What display mode properties should be queriable by the base 482 extension? Does the application require width/height/refresh or 483 should those be left to other mechanisms or additional 484 extensions? If hardware supports selecting a portion of the 485 image for display, or restricting an image to a portion of the 486 screen, or scaling an image to a different resolution for 487 display, should all these settings be queriable? 488 489 RESOLVED: The base extension will not define any display 490 properties. These will be left to future extensions if required. 491 492 5. How should stereo/multiview displays be handled? Should all 493 views share a single output or does each one have its own? 494 495 UNRESOLVED. Left for a future extension to define. 496 497 6. This extension is currently focused on individual display layers 498 for the purpose of directing rendering output. An API covering 499 all hardware would associate one or more of those layers with a 500 display port. Do we need to abstract both? 501 502 RESOLVED: Yes. Extension has been modified to abstract both 503 inputs (layers) and outputs (ports) of display control hardware. 504 An implementation is not required to return any ports in the 505 query function if it provides no means to operate on them. 506 507Revision History: 508 509 #9 (August 22nd, 2014) James Jones 510 - Marked complete. 511 - Added minor coments to issue 5. 512 - Listed Daniel as the contact. 513 514 #8 (June 10th, 2014) Daniel Kartch 515 - Fixed prototypes for layer/port attribute setting functions. 516 517 #7 (June 5th, 2014) Daniel Kartch 518 - Assigned enumerated values for constants. 519 - Indicated default swap interval value. 520 521 #6 (May 28th, 2014) Daniel Kartch 522 - Updated wording based on EGL 1.5 specification, using 523 EGLAttrib instead of EGLAttribEXT. 524 - Added functions to set layer and port attributes. 525 - Added table of valid attributes, with min/max/current swap 526 interval values, and adjusted function descriptions 527 accordingly. 528 - Refined description for output enumeration functions to better 529 indicate the effect of attribute list. 530 - Added effect of swap interval in posting section. 531 532 #5 (January 31st, 2014) Daniel Kartch 533 - Added eglGetOutput* functions, folding in and generalizing 534 functionality previously provided by EXT_native_output 535 extension. 536 - Separated descriptions for layer and port query functions for 537 clarity. 538 539 #4 (January 22nd, 2014) Daniel Kartch 540 - Added section clarifying that this extension provides no means 541 to use output ports to set display modes, but future 542 extensions may. 543 544 #3 (January 17th, 2014) Daniel Kartch 545 - Updated names of example extension for obtaining and using 546 output handles. 547 - Fixed typos. 548 549 #2 (November 12th, 2013) Daniel Kartch 550 - Replaced EGLOutput with EGLOutputLayer and added 551 EGLOutputPort (and modified/added corresponding functions), to 552 allow both inputs and outputs of display control hardware to 553 be abstracted. 554 - Modified attribute query functions to use EGLAttribEXT and 555 added string query functions. 556 - Removed display mode attributes. These can be defined by a 557 separate extension if desired. 558 - Removed destructor function for outputs and added section on 559 lifetime, as well as language describing their relationship to 560 EGLDisplays. 561 562 #1 (October 25nd, 2013) Daniel Kartch 563 - Initial draft 564 565