/**************************************************************************1*2* Copyright 2015, 2018 Collabora3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR18* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,19* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL20* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER21* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING22* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER23* DEALINGS IN THE SOFTWARE.24*25**************************************************************************/262728#ifndef EGLDEVICE_INCLUDED29#define EGLDEVICE_INCLUDED303132#include <stdbool.h>33#include <stddef.h>34#include "egltypedefs.h"3536#ifdef __cplusplus37extern "C" {38#endif3940extern _EGLDevice _eglSoftwareDevice;4142void43_eglFiniDevice(void);4445EGLBoolean46_eglCheckDeviceHandle(EGLDeviceEXT device);4748static inline _EGLDevice *49_eglLookupDevice(EGLDeviceEXT device)50{51_EGLDevice *dev = (_EGLDevice *) device;52if (!_eglCheckDeviceHandle(device))53dev = NULL;54return dev;55}5657_EGLDevice *58_eglAddDevice(int fd, bool software);5960enum _egl_device_extension {61_EGL_DEVICE_SOFTWARE,62_EGL_DEVICE_DRM,63};6465typedef enum _egl_device_extension _EGLDeviceExtension;6667EGLBoolean68_eglDeviceSupports(_EGLDevice *dev, _EGLDeviceExtension ext);6970const char *71_eglGetDRMDeviceRenderNode(_EGLDevice *dev);7273EGLBoolean74_eglQueryDeviceAttribEXT(_EGLDevice *dev, EGLint attribute,75EGLAttrib *value);7677const char *78_eglQueryDeviceStringEXT(_EGLDevice *dev, EGLint name);7980EGLBoolean81_eglQueryDevicesEXT(EGLint max_devices, _EGLDevice **devices,82EGLint *num_devices);8384#ifdef __cplusplus85}86#endif8788#endif /* EGLDEVICE_INCLUDED */899091