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 <rfoss@kernel.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23742>
This commit is contained in:
Robert Foss 2023-06-19 13:55:22 +02:00 committed by Marge Bot
parent 3a8aae9e6a
commit 0e0adec81e
2 changed files with 34 additions and 0 deletions

View file

@ -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)
{

View file

@ -30,6 +30,10 @@
#include <stdbool.h>
#include <stddef.h>
#ifdef HAVE_LIBDRM
#include <xf86drm.h>
#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);