_EGLDevice *Next;
const char *extensions;
+
+ EGLBoolean MESA_device_software;
};
void
/* atexit function is called with global mutex locked */
dev_list = _eglGlobal.DeviceList;
+
+ /* The first device is static allocated SW device */
+ assert(dev_list);
+ assert(_eglDeviceSupports(dev_list, _EGL_DEVICE_SOFTWARE));
+ dev_list = dev_list->Next;
+
while (dev_list) {
/* pop list head */
dev = dev_list;
return (cur != NULL);
}
+_EGLDevice _eglSoftwareDevice = {
+ .extensions = "EGL_MESA_device_software",
+ .MESA_device_software = EGL_TRUE,
+};
+
/* Adds a device in DeviceList, if needed for the given fd.
*
* If a software device, the fd is ignored.
_EGLDevice *dev;
mtx_lock(_eglGlobal.Mutex);
+ dev = _eglGlobal.DeviceList;
+
+ /* The first device is always software */
+ assert(dev);
+ assert(_eglDeviceSupports(dev, _EGL_DEVICE_SOFTWARE));
+ if (software)
+ goto out;
dev = NULL;
_eglDeviceSupports(_EGLDevice *dev, _EGLDeviceExtension ext)
{
switch (ext) {
+ case _EGL_DEVICE_SOFTWARE:
+ return dev->MESA_device_software;
default:
assert(0);
return EGL_FALSE;
dev = _eglGlobal.DeviceList;
+ /* The first device is always software */
+ assert(dev);
+ assert(_eglDeviceSupports(dev, _EGL_DEVICE_SOFTWARE));
+ count++;
+
return count;
}
extern "C" {
#endif
+extern _EGLDevice _eglSoftwareDevice;
+
void
_eglFiniDevice(void);
_eglAddDevice(int fd, bool software);
enum _egl_device_extension {
- EGL_FOOBAR, /* A temporary entry, since enum with zero entries is illegal */
+ _EGL_DEVICE_SOFTWARE,
};
typedef enum _egl_device_extension _EGLDeviceExtension;