summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2015-07-21 09:28:51 +0200
committerJonny Lamb <jonny.lamb@collabora.co.uk>2015-07-22 17:05:17 +0200
commitf9b879e0c73e03d135fd54215792710b55275336 (patch)
tree29c8cba82d2e218e2ea77cfd370f7cbc7e4fca9c
parentfd12aa36b59cc6dc0f085532e60049775b8e3fed (diff)
egldevice: implement eglQueryDeviceStringEXT
EGL_EXT_platform_query only defines one value for <name> at the moment, so just implement that. Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--src/egl/main/eglapi.c9
-rw-r--r--src/egl/main/egldevice.c32
-rw-r--r--src/egl/main/egldevice.h4
3 files changed, 44 insertions, 1 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index b87bac8e6d..0f010d007a 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -1838,7 +1838,14 @@ static const char * EGLAPIENTRY
eglQueryDeviceStringEXT(EGLDeviceEXT device,
EGLint name)
{
- RETURN_EGL_SUCCESS(NULL, "eglQueryDeviceStringEXT");
+ _EGLDevice *dev;
+ const char *ret;
+
+ _EGL_CHECK_DEVICE(device, NULL, dev);
+
+ ret = _eglQueryDeviceStringEXT(dev, name);
+
+ RETURN_EGL_SUCCESS(NULL, ret);
}
static EGLBoolean EGLAPIENTRY
diff --git a/src/egl/main/egldevice.c b/src/egl/main/egldevice.c
index 33473df620..6fc02f818d 100644
--- a/src/egl/main/egldevice.c
+++ b/src/egl/main/egldevice.c
@@ -46,6 +46,8 @@ typedef struct {
_EGLDevice *devices;
EGLBoolean got_devices;
+ const char *extensions;
+
#ifdef HAVE_LIBUDEV
struct udev *udev;
#endif
@@ -71,6 +73,10 @@ _eglEnsureDeviceInfo(EGLBoolean get_devices)
info->devices = NULL;
info->got_devices = EGL_FALSE;
+ /* update this string like in eglglobals.c to add support for a device
+ * extension */
+ info->extensions = "";
+
#ifdef HAVE_LIBUDEV
info->udev = NULL;
#endif
@@ -206,6 +212,32 @@ _eglFiniDeviceInfo(void)
_eglGlobal.DeviceInfo = NULL;
}
+/**
+ * Get string about a specific device.
+ */
+const char *
+_eglQueryDeviceStringEXT(_EGLDevice *device, EGLint name)
+{
+ _EGLDeviceInfo *info;
+
+ info =_eglEnsureDeviceInfo(EGL_FALSE);
+ if (!info) {
+ _eglError(EGL_BAD_ALLOC, "eglQueryDeviceStringEXT");
+ return NULL;
+ }
+
+ switch (name) {
+ case EGL_EXTENSIONS:
+ return info->extensions;
+ break;
+
+ default:
+ _eglError(EGL_BAD_PARAMETER, "eglQueryDeviceStringEXT");
+ return NULL;
+ break;
+ };
+}
+
static EGLBoolean
_eglFillDeviceList(_EGLDeviceInfo *info)
{
diff --git a/src/egl/main/egldevice.h b/src/egl/main/egldevice.h
index 5ea2df8286..51c6066672 100644
--- a/src/egl/main/egldevice.h
+++ b/src/egl/main/egldevice.h
@@ -48,6 +48,10 @@ _EGLDevice *
_eglLookupDevice(EGLDeviceEXT device);
+const char *
+_eglQueryDeviceStringEXT(_EGLDevice *device, EGLint name);
+
+
EGLBoolean
_eglQueryDevicesEXT(EGLint max_devices, _EGLDevice **devices,
EGLint *num_devices);