diff --git a/OpenGL/EGL/EXT/device_base.py b/OpenGL/EGL/EXT/device_base.py index d72eeb39..d782d87e 100644 --- a/OpenGL/EGL/EXT/device_base.py +++ b/OpenGL/EGL/EXT/device_base.py @@ -23,6 +23,9 @@ def glInitDeviceBaseEXT(): ### END AUTOGENERATED SECTION eglQueryDevicesEXT.extension = None eglQueryDevicesEXT.force_extension = True +eglQueryDeviceStringEXT.extension = None +eglQueryDeviceStringEXT.force_extension = True + def egl_get_devices(max_count=10): """Utility function that retrieves platform devices""" diff --git a/OpenGL/EGL/EXT/device_query.py b/OpenGL/EGL/EXT/device_query.py index 1b11e3d9..45549198 100644 --- a/OpenGL/EGL/EXT/device_query.py +++ b/OpenGL/EGL/EXT/device_query.py @@ -20,4 +20,7 @@ def glInitDeviceQueryEXT(): return extensions.hasGLExtension( _EXTENSION_NAME ) -### END AUTOGENERATED SECTION \ No newline at end of file +### END AUTOGENERATED SECTION + +eglQueryDeviceStringEXT.extension = None +eglQueryDeviceStringEXT.force_extension = True diff --git a/tests/os_egl.py b/tests/os_egl.py index e7a42a68..86e843e1 100644 --- a/tests/os_egl.py +++ b/tests/os_egl.py @@ -47,6 +47,13 @@ def platformDisplay(device): raise RuntimeError("Unable to create EGL display on %s" % (display)) else: raise RuntimeError("eglGetPlatformDisplay has no implementation") + if not created_device: + try: + name = get_device_name(device) + if name is not None: + log.debug("DRM Name: %s", name) + except EGLError: + log.debug("Unable to retrieve the DRM name") return display, created_device @@ -227,6 +234,26 @@ def debug_info(setup): log.info("Extensions: %s", glGetString(GL_EXTENSIONS)) glFinish() +def get_device_name(device): + """Try to get the display's DRM device name + + This is almost certainly not going to work on + anything other than Linux + """ + from OpenGL.EGL.EXT.device_query import ( + eglQueryDeviceStringEXT, + ) + from OpenGL.EGL.EXT.device_drm import ( + EGL_DRM_DEVICE_FILE_EXT, + ) + if eglQueryDeviceStringEXT: + name = eglQueryDeviceStringEXT( + device, + EGL_DRM_DEVICE_FILE_EXT + ) + return name.decode('ascii',errors='ignore') + return None + def main(): # NOTE: having two different implementations here is