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:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user