diff options
author | Hans de Goede <hdegoede@redhat.com> | 2017-03-20 08:41:26 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2017-03-20 09:37:20 +0100 |
commit | efa4f2ebc1e788c3f1cfcf3842058cf838171653 (patch) | |
tree | c5f49a1862e28eb85645faefcc8178e8c892ce49 | |
parent | 57595cb0739d50a3fbd0841d7475bd775f3e24f3 (diff) |
Together with some fixes to xdriinfo this fixes xdriinfo not working
with glvnd.
Since apps (xdriinfo) expect GetDriverConfig to work without going to
need through the dance to setup a glxcontext (which is a reasonable
expectation IMHO), the dispatch for this ends up significantly different
then any other dispatch function.
This patch gets the job done, but I'm not really happy with how this
patch turned out, suggestions for a better fix are welcome.
Cc: Kyle Brenneman <kbrenneman@nvidia.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r-- | src/glx/g_glxglvnddispatchfuncs.c | 18 | ||||
-rw-r--r-- | src/glx/g_glxglvnddispatchindices.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/glx/g_glxglvnddispatchfuncs.c b/src/glx/g_glxglvnddispatchfuncs.c index b5e33981ad..040cdf82b1 100644 --- a/src/glx/g_glxglvnddispatchfuncs.c +++ b/src/glx/g_glxglvnddispatchfuncs.c @@ -4,6 +4,7 @@ */ #include <stdlib.h> +#include "glxclient.h" #include "glxglvnd.h" #include "glxglvnddispatchfuncs.h" #include "g_glxglvnddispatchindices.h" @@ -50,6 +51,7 @@ const char * const __glXDispatchTableStrings[DI_LAST_INDEX] = { __ATTRIB(GetCurrentDisplayEXT), // glXGetCurrentDrawable implemented by libglvnd // glXGetCurrentReadDrawable implemented by libglvnd + __ATTRIB(GetDriverConfig), // glXGetFBConfigAttrib implemented by libglvnd __ATTRIB(GetFBConfigAttribSGIX), __ATTRIB(GetFBConfigFromVisualSGIX), @@ -334,6 +336,21 @@ static Display *dispatch_GetCurrentDisplayEXT(void) +static const char *dispatch_GetDriverConfig(const char *driverName) +{ + /* + * The options are constant for a given driverName, so we do not need + * a context (and apps expect to be able to call this without one). + */ +#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) + return glXGetDriverConfig(driverName); +#else + return NULL; +#endif +} + + + static int dispatch_GetFBConfigAttribSGIX(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value_return) { @@ -939,6 +956,7 @@ const void * const __glXDispatchFunctions[DI_LAST_INDEX + 1] = { __ATTRIB(DestroyGLXPbufferSGIX), __ATTRIB(GetContextIDEXT), __ATTRIB(GetCurrentDisplayEXT), + __ATTRIB(GetDriverConfig), __ATTRIB(GetFBConfigAttribSGIX), __ATTRIB(GetFBConfigFromVisualSGIX), __ATTRIB(GetMscRateOML), diff --git a/src/glx/g_glxglvnddispatchindices.h b/src/glx/g_glxglvnddispatchindices.h index 05a2c8cf3c..3ba50a74ab 100644 --- a/src/glx/g_glxglvnddispatchindices.h +++ b/src/glx/g_glxglvnddispatchindices.h @@ -39,6 +39,7 @@ typedef enum __GLXdispatchIndex { DI_GetCurrentDisplayEXT, // GetCurrentDrawable implemented by libglvnd // GetCurrentReadDrawable implemented by libglvnd + DI_GetDriverConfig, // GetFBConfigAttrib implemented by libglvnd DI_GetFBConfigAttribSGIX, DI_GetFBConfigFromVisualSGIX, |