Skip to content

Commit

Permalink
add EGL_EXT_device_query_pci_id
Browse files Browse the repository at this point in the history
  • Loading branch information
1ace committed Jul 5, 2020
1 parent d7ddb16 commit 457aa86
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 4 deletions.
14 changes: 12 additions & 2 deletions api/EGL/eglext.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ extern "C" {
** used to make the header, and the header can be found at
** http://www.khronos.org/registry/egl
**
** Khronos $Git commit SHA1: ad06e1c38e $ on $Git commit date: 2020-04-09 18:40:05 +0200 $
** Khronos $Git commit SHA1: 1b7e4d00d3 $ on $Git commit date: 2020-06-10 00:11:35 +0200 $
*/

#include <EGL/eglplatform.h>

#define EGL_EGLEXT_VERSION 20200505
#define EGL_EGLEXT_VERSION 20200705

/* Generated C header for:
* API: egl
Expand Down Expand Up @@ -707,6 +707,16 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint a
#define EGL_EXT_device_query 1
#endif /* EGL_EXT_device_query */

#ifndef EGL_EXT_device_query_pci
#define EGL_EXT_device_query_pci 1
#define EGL_QUERY_PCI_VENDOR_ID_EXT 0x3290
#define EGL_QUERY_PCI_DEVICE_ID_EXT 0x3291
#define EGL_QUERY_PCI_DOMAIN_EXT 0x3292
#define EGL_QUERY_PCI_BUS_EXT 0x3293
#define EGL_QUERY_PCI_SLOT_EXT 0x3294
#define EGL_QUERY_PCI_FUNCTION_EXT 0x3295
#endif /* EGL_EXT_device_query_pci */

#ifndef EGL_EXT_gl_colorspace_bt2020_linear
#define EGL_EXT_gl_colorspace_bt2020_linear 1
#define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F
Expand Down
18 changes: 17 additions & 1 deletion api/egl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,13 @@
</enums>

<enums namespace="EGL" start="0x3290" end="0x329F" vendor="MESA" comment="Reserved for John K&#229;re Alsaker (Public bug 757)">
<unused start="0x3290" end="0x329F"/>
<enum value="0x3290" name="EGL_QUERY_PCI_VENDOR_ID_EXT"/>
<enum value="0x3291" name="EGL_QUERY_PCI_DEVICE_ID_EXT"/>
<enum value="0x3292" name="EGL_QUERY_PCI_DOMAIN_EXT"/>
<enum value="0x3293" name="EGL_QUERY_PCI_BUS_EXT"/>
<enum value="0x3294" name="EGL_QUERY_PCI_SLOT_EXT"/>
<enum value="0x3295" name="EGL_QUERY_PCI_FUNCTION_EXT"/>
<unused start="0x3296" end="0x329F"/>
</enums>

<enums namespace="EGL" start="0x32A0" end="0x32AF" vendor="Samsung" comment="Reserved for Dongyeon Kim (Public bug 880)">
Expand Down Expand Up @@ -2429,6 +2435,16 @@
<command name="eglQueryDisplayAttribEXT"/>
</require>
</extension>
<extension name="EGL_EXT_device_query_pci" supported="egl">
<require>
<enum name="EGL_QUERY_PCI_VENDOR_ID_EXT"/>
<enum name="EGL_QUERY_PCI_DEVICE_ID_EXT"/>
<enum name="EGL_QUERY_PCI_DOMAIN_EXT"/>
<enum name="EGL_QUERY_PCI_BUS_EXT"/>
<enum name="EGL_QUERY_PCI_SLOT_EXT"/>
<enum name="EGL_QUERY_PCI_FUNCTION_EXT"/>
</require>
</extension>
<extension name="EGL_EXT_gl_colorspace_bt2020_linear" supported="egl">
<require>
<enum name="EGL_GL_COLORSPACE_BT2020_LINEAR_EXT"/>
Expand Down
92 changes: 92 additions & 0 deletions extensions/EXT/EGL_EXT_device_query_pci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
Name

EXT_device_query_pci

Name Strings

EGL_EXT_device_query_pci

Contributors

Eric Engestrom (eric 'at' engestrom.ch)

Contact

Eric Engestrom (eric 'at' engestrom.ch)

Status

Draft

Version

Version 1, Jun 06, 2020

Number

EGL Extension #140

Extension Type

EGL device extension

Dependencies

This extension is written against the language of EGL 1.5 as
modified by EGL_EXT_device_query.

EGL_EXT_device_query is required.

The EGL device must be a PCI device.

Overview

This extension adds a simple way to query a few PCI attributes from an EGL Device,
namely its vendor and device PCI ID, and its PCI domain/bus/slot/function.

IP Status

No known claims.

New Types

None.

New Procedures and Functions

None.

New Tokens

Accepted as the <attribute> argument of eglQueryDeviceAttribEXT:

EGL_QUERY_PCI_VENDOR_ID_EXT 0x3290
EGL_QUERY_PCI_DEVICE_ID_EXT 0x3291
EGL_QUERY_PCI_DOMAIN_EXT 0x3292
EGL_QUERY_PCI_BUS_EXT 0x3293
EGL_QUERY_PCI_SLOT_EXT 0x3294
EGL_QUERY_PCI_FUNCTION_EXT 0x3295

Changes to section 3.2 (Devices)

Replace the paragraph immediately following the prototype for
eglQueryDeviceAttribEXT:

<attribute> must be one of EGL_QUERY_PCI_VENDOR_ID_EXT,
EGL_QUERY_PCI_DEVICE_ID_EXT, EGL_QUERY_PCI_DOMAIN_EXT,
EGL_QUERY_PCI_BUS_EXT, EGL_QUERY_PCI_SLOT_EXT or
EGL_QUERY_PCI_FUNCTION_EXT. The query always succeeds and returns
EGL_TRUE, and <value> is set appropriately.

Issues

1. Should the extension be exposed on a device that might not be on
a PCI bus, and fail queries?

RESOLVED: No, if the extension is exposed then the device *is* on
a PCI bus, and all associated queries will succeed.

Revision History

Version 1, Jun 06, 2020 (Eric Engestrom)
- Initial Draft
2 changes: 2 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@
</li>
<li value=139> <a href="extensions/NV/EGL_NV_stream_consumer_eglimage.txt">EGL_NV_stream_consumer_eglimage</a>
</li>
<li value=140> <a href="extensions/EXT/EGL_EXT_device_query_pci.txt">EGL_EXT_device_query_pci</a>
</li>
</ol>

<h6> Providing Feedback on the Registry </h6>
Expand Down
7 changes: 6 additions & 1 deletion registry.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -719,4 +719,9 @@ extension EGL_NV_stream_consumer_eglimage {
flags public
filename extensions/NV/EGL_NV_stream_consumer_eglimage.txt
}
# Next free extension number: 140
extension EGL_EXT_device_query_pci {
number 140
flags public
filename extensions/EXT/EGL_EXT_device_query_pci.txt
}
# Next free extension number: 141

0 comments on commit 457aa86

Please sign in to comment.