From 0e0adec81ec4a05c36ecb8f21fce7ce726a1e269 Mon Sep 17 00:00:00 2001 From: Robert Foss Date: Mon, 19 Jun 2023 13:55:22 +0200 Subject: [PATCH] egl: Expose access to DeviceList In order to not have the different dri2 platforms all build lists of available devices, use the device list provided by EGL. Signed-off-by: Robert Foss Reviewed-by: Adam Jackson Part-of: --- src/egl/main/egldevice.c | 20 ++++++++++++++++++++ src/egl/main/egldevice.h | 14 ++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/egl/main/egldevice.c b/src/egl/main/egldevice.c index 38ab12b..897610e 100644 --- a/src/egl/main/egldevice.c +++ b/src/egl/main/egldevice.c @@ -198,6 +198,26 @@ out: return dev; } +#ifdef HAVE_LIBDRM +drmDevicePtr +_eglDeviceDrm(_EGLDevice *dev) +{ + if (!dev) + return NULL; + + return dev->device; +} +#endif + +_EGLDevice * +_eglDeviceNext(_EGLDevice *dev) +{ + if (!dev) + return NULL; + + return dev->Next; +} + EGLBoolean _eglDeviceSupports(_EGLDevice *dev, _EGLDeviceExtension ext) { diff --git a/src/egl/main/egldevice.h b/src/egl/main/egldevice.h index 5998ae6..6a91c13 100644 --- a/src/egl/main/egldevice.h +++ b/src/egl/main/egldevice.h @@ -30,6 +30,10 @@ #include #include +#ifdef HAVE_LIBDRM +#include +#endif + #include "egltypedefs.h" #ifdef __cplusplus @@ -64,6 +68,16 @@ enum _egl_device_extension { typedef enum _egl_device_extension _EGLDeviceExtension; +#ifdef HAVE_LIBDRM +drmDevicePtr +_eglDeviceDrm(_EGLDevice *dev); +#else +#define _eglDeviceDrm(dev) NULL +#endif + +_EGLDevice * +_eglDeviceNext(_EGLDevice *dev); + EGLBoolean _eglDeviceSupports(_EGLDevice *dev, _EGLDeviceExtension ext); -- 2.7.4