[Mesa-dev] [PATCH 7/8] egldevice: add simple eglQueryDeviceAttribEXT implementation

Jonny Lamb jonny.lamb at collabora.co.uk
Fri Jul 24 07:20:01 PDT 2015


EGL_EXT_device_query itself doesn't define any valid values for
<attribute> so leave this function looking simple for values in the
future.

Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
---
 src/egl/main/eglapi.c    |  9 ++++++++-
 src/egl/main/egldevice.c | 17 +++++++++++++++++
 src/egl/main/egldevice.h |  5 +++++
 3 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 17ecd8a..cc03fec 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -1832,7 +1832,14 @@ eglQueryDeviceAttribEXT(EGLDeviceEXT device,
                         EGLint attribute,
                         EGLAttrib *value)
 {
-   RETURN_EGL_SUCCESS(NULL, EGL_TRUE);
+   _EGLDevice *dev;
+   EGLBoolean ret;
+
+   _EGL_CHECK_DEVICE(device, EGL_FALSE, dev);
+
+   ret = _eglQueryDeviceAttribEXT(dev, attribute, value);
+
+   RETURN_EGL_EVAL(NULL, ret);
 }
 
 static const char * EGLAPIENTRY
diff --git a/src/egl/main/egldevice.c b/src/egl/main/egldevice.c
index cf83847..596b891 100644
--- a/src/egl/main/egldevice.c
+++ b/src/egl/main/egldevice.c
@@ -213,6 +213,23 @@ _eglFiniDeviceInfo(void)
 }
 
 /**
+ * Get attribute about specific device
+ */
+EGLBoolean
+_eglQueryDeviceAttribEXT(_EGLDevice *device,
+                         EGLint attribute,
+                         EGLAttrib *value)
+{
+   if (!value)
+      return _eglError(EGL_BAD_PARAMETER, "eglQueryDeviceAttribEXT");
+
+   switch (attribute) {
+   default:
+      return _eglError(EGL_BAD_ATTRIBUTE, "eglQueryDeviceAttribEXT");
+   }
+}
+
+/**
  * Get string about a specific device.
  */
 const char *
diff --git a/src/egl/main/egldevice.h b/src/egl/main/egldevice.h
index 51c6066..14f0c1f 100644
--- a/src/egl/main/egldevice.h
+++ b/src/egl/main/egldevice.h
@@ -48,6 +48,11 @@ _EGLDevice *
 _eglLookupDevice(EGLDeviceEXT device);
 
 
+EGLBoolean
+_eglQueryDeviceAttribEXT(_EGLDevice *device, EGLint attribute,
+                         EGLAttrib *value);
+
+
 const char *
 _eglQueryDeviceStringEXT(_EGLDevice *device, EGLint name);
 
-- 
2.4.6



More information about the mesa-dev mailing list