Implement EGL API for MESA_query_driver
authorVeluri Mithun <velurimithun38@gmail.com>
Wed, 23 Jan 2019 17:14:25 +0000 (22:44 +0530)
committerRob Clark <robdclark@gmail.com>
Wed, 23 Jan 2019 22:29:14 +0000 (22:29 +0000)
Signed-off-by: Veluri Mithun <velurimithun38@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
src/egl/main/eglapi.c
src/egl/main/eglapi.h
src/egl/main/egldisplay.h
src/egl/main/eglentrypoint.h

index bfd79a5952d6c9972747992537eaa0c9a47b6d44..35618680e853629dc988a5da93759728850f6800 100644 (file)
@@ -528,6 +528,7 @@ _eglCreateExtensionsString(_EGLDisplay *dpy)
       _eglAppendExtension(&exts, "EGL_MESA_configless_context");
    _EGL_CHECK_EXTENSION(MESA_drm_image);
    _EGL_CHECK_EXTENSION(MESA_image_dma_buf_export);
+   _EGL_CHECK_EXTENSION(MESA_query_driver);
 
    _EGL_CHECK_EXTENSION(NOK_swap_region);
    _EGL_CHECK_EXTENSION(NOK_texture_from_pixmap);
@@ -2649,6 +2650,38 @@ eglQueryDisplayAttribEXT(EGLDisplay dpy,
    RETURN_EGL_SUCCESS(disp, EGL_TRUE);
 }
 
+char * EGLAPIENTRY
+eglGetDisplayDriverConfig(EGLDisplay dpy)
+{
+    _EGLDisplay *disp = _eglLockDisplay(dpy);
+    _EGLDriver *drv;
+    char *ret;
+
+    _EGL_FUNC_START(disp, EGL_NONE, NULL, NULL);
+    _EGL_CHECK_DISPLAY(disp, NULL, drv);
+
+    assert(disp->Extensions.MESA_query_driver);
+
+    ret = drv->API.QueryDriverConfig(disp);
+    RETURN_EGL_EVAL(disp, ret);
+}
+
+const char * EGLAPIENTRY
+eglGetDisplayDriverName(EGLDisplay dpy)
+{
+    _EGLDisplay *disp = _eglLockDisplay(dpy);
+    _EGLDriver *drv;
+    const char *ret;
+
+    _EGL_FUNC_START(disp, EGL_NONE, NULL, NULL);
+    _EGL_CHECK_DISPLAY(disp, NULL, drv);
+
+    assert(disp->Extensions.MESA_query_driver);
+
+    ret = drv->API.QueryDriverName(disp);
+    RETURN_EGL_EVAL(disp, ret);
+}
+
 __eglMustCastToProperFunctionPointerType EGLAPIENTRY
 eglGetProcAddress(const char *procname)
 {
index 07ddf34a0320db6516db06fd8996c475d6f77108..5e1581b9ce50efaccc1dd39c4b1a4afddd47acea 100644 (file)
@@ -55,6 +55,8 @@ struct _egl_api
    /* driver funcs */
    EGLBoolean (*Initialize)(_EGLDriver *, _EGLDisplay *dpy);
    EGLBoolean (*Terminate)(_EGLDriver *, _EGLDisplay *dpy);
+   const char *(*QueryDriverName)(_EGLDisplay *dpy);
+   char *(*QueryDriverConfig)(_EGLDisplay *dpy);
 
    /* config funcs */
    EGLBoolean (*GetConfigs)(_EGLDriver *drv, _EGLDisplay *dpy,
index fae90520368dd7304aafcca18aa0c13875e04a00..5cc503734bccf029fff4cc1d08d539dfc0ff0a69 100644 (file)
@@ -138,6 +138,7 @@ struct _egl_extensions
 
    EGLBoolean MESA_drm_image;
    EGLBoolean MESA_image_dma_buf_export;
+   EGLBoolean MESA_query_driver;
 
    EGLBoolean NOK_swap_region;
    EGLBoolean NOK_texture_from_pixmap;
index 69a6c1bf4c7a2598e23d82e59542c90ed9fbe43f..44e971e023a56c82d42a4c7b989b051de17ead0f 100644 (file)
@@ -42,6 +42,8 @@ EGL_ENTRYPOINT(eglGetCurrentContext)
 EGL_ENTRYPOINT(eglGetCurrentDisplay)
 EGL_ENTRYPOINT(eglGetCurrentSurface)
 EGL_ENTRYPOINT(eglGetDisplay)
+EGL_ENTRYPOINT(eglGetDisplayDriverConfig)
+EGL_ENTRYPOINT(eglGetDisplayDriverName)
 EGL_ENTRYPOINT(eglGetError)
 EGL_ENTRYPOINT(eglGetPlatformDisplay)
 EGL_ENTRYPOINT(eglGetPlatformDisplayEXT)