<div dir="ltr"><pre style="color:rgb(0,0,0);white-space:pre-wrap">- Try to retrieve driver name from dri2_egl_display
Signed-off-by: Veluri Mithun <<a href="mailto:velurimithun38@gmail.com">velurimithun38@gmail.com</a>>
---
docs/specs/EGL_MESA_query_driver.txt | 54 ++++++++++++++++++++++++++++
src/egl/main/eglapi.c | 13 +++++++
src/egl/main/egldriver.c | 8 +++++
src/egl/main/egldriver.h | 3 ++
src/egl/main/eglentrypoint.h | 1 +
5 files changed, 79 insertions(+)
create mode 100644 docs/specs/EGL_MESA_query_driver.txt
diff --git a/docs/specs/EGL_MESA_query_driver.txt b/docs/specs/EGL_MESA_query_driver.txt
new file mode 100644
index 0000000000..bec7d4a15d
--- /dev/null
+++ b/docs/specs/EGL_MESA_query_driver.txt
@@ -0,0 +1,54 @@
+Name
+
+ MESA_query_driver
+
+Name Strings
+
+ EGL_MESA_query_driver
+
+Contact
+
+ Rob Clark <robdclark 'at' <a href="http://gmail.com">gmail.com</a>>
+ Nicolai Hähnle <Nicolai.Haehnle 'at' <a href="http://amd.com">amd.com</a>>
+
+Contibutors
+
+ Veluri Mithun <velurimithun38 'at' <a href="http://gmail.com">gmail.com</a>>
+
+Status
+
+ XXX - Not complete yet!!! (draft)
+
+Version
+
+ Version 1, 2018-11-05
+
+Number
+
+ EGL Extension ###
+
+Dependencies
+
+ EGL 1.4 is required.
+
+Overview
+
+ When an application has to query the name of a DRI driver and for
+ obtaining driver's option list (UTF-8 encoded XML) of a DRI
+ driver the below functions are useful.
+
+New Procedures and Functions
+
+ const char* eglGetDriverConfig(EGLDisplay *disp, EGLDeviceEXT device,
+ const char *driverName);
+ const char* eglGetDisplayDriverName(EGLDisplay *disp);
+
+New Tokens
+
+ No new tokens
+
+Issues
+
+
+
+Revision History
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 3afdfd40e4..93d69127e7 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -2647,6 +2647,19 @@ eglQueryDisplayAttribEXT(EGLDisplay dpy,
RETURN_EGL_SUCCESS(disp, EGL_TRUE);
}
+static const char * EGLAPIENTRY
+eglGetDisplayDriverName(EGLDisplay dpy)
+{
+ _EGLDisplay *disp = _eglLockDisplay(dpy);
+ _EGLDriver *drv;
+
+ _EGL_FUNC_START(NULL, EGL_NONE, NULL, EGL_FALSE);
+ _EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
+
+ assert(disp->Initialized);
+ RETURN_EGL_EVAL(disp, _eglGetDriverName(disp));
+}
+
__eglMustCastToProperFunctionPointerType EGLAPIENTRY
eglGetProcAddress(const char *procname)
{
diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c
index b20652ed8c..a8b7d7dc94 100644
--- a/src/egl/main/egldriver.c
+++ b/src/egl/main/egldriver.c
@@ -45,6 +45,7 @@
#include "egllog.h"
#include "util/debug.h"
+#include "egl_dri2.h"
static mtx_t _eglModuleMutex = _MTX_INITIALIZER_NP;
static _EGLDriver *_eglDriver;
@@ -125,3 +126,10 @@ _eglUnloadDrivers(void)
free(_eglDriver);
_eglDriver = NULL;
}
+
+const char *
+_eglGetDriverName(_EGLDisplay *disp)
+{
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ return dri2_dpy->driver_name;
+}
diff --git a/src/egl/main/egldriver.h b/src/egl/main/egldriver.h
index 5695fc06ff..c5b330b6cb 100644
--- a/src/egl/main/egldriver.h
+++ b/src/egl/main/egldriver.h
@@ -78,6 +78,9 @@ struct _egl_driver
_EGLAPI API; /**< EGL API dispatch table */
};
+extern const char *
+_eglGetDriverName(_EGLDisplay *disp);
+
extern void
_eglInitDriver(_EGLDriver *driver);
diff --git a/src/egl/main/eglentrypoint.h b/src/egl/main/eglentrypoint.h
index 69a6c1bf4c..5621b45d91 100644
--- a/src/egl/main/eglentrypoint.h
+++ b/src/egl/main/eglentrypoint.h
@@ -42,6 +42,7 @@ EGL_ENTRYPOINT(eglGetCurrentContext)
EGL_ENTRYPOINT(eglGetCurrentDisplay)
EGL_ENTRYPOINT(eglGetCurrentSurface)
EGL_ENTRYPOINT(eglGetDisplay)
+EGL_ENTRYPOINT(eglGetDisplayDriverName)
EGL_ENTRYPOINT(eglGetError)
EGL_ENTRYPOINT(eglGetPlatformDisplay)
EGL_ENTRYPOINT(eglGetPlatformDisplayEXT)
--
2.18.1
</pre><br class="gmail-Apple-interchange-newline"></div>