diff options
author | Alan Hourihane <[email protected]> | 2008-11-28 16:19:10 +0000 |
---|---|---|
committer | Alan Hourihane <[email protected]> | 2008-11-28 16:19:10 +0000 |
commit | c4c86bbd16688ee4a0afb32efa27ba52abceb1ca (patch) | |
tree | 6b16fae74e49122a86ecf18b4a427b80d5a8e812 /src/glx/x11/glxext.c | |
parent | 5b714723895d321db753f896576de5e2c27778c3 (diff) | |
parent | c303e7299b5f95d4728c3710c56f50b1fefca09d (diff) |
Merge commit 'origin/master' into gallium-0.2
Diffstat (limited to 'src/glx/x11/glxext.c')
-rw-r--r-- | src/glx/x11/glxext.c | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c index b6bdbd52bb5..be6edf9b193 100644 --- a/src/glx/x11/glxext.c +++ b/src/glx/x11/glxext.c @@ -139,7 +139,8 @@ XEXT_GENERATE_FIND_DISPLAY(__glXFindDisplay, __glXExtensionInfo, ** Free the per screen configs data as well as the array of ** __glXScreenConfigs. */ - static void FreeScreenConfigs(__GLXdisplayPrivate * priv) +static void +FreeScreenConfigs(__GLXdisplayPrivate * priv) { __GLXscreenConfigs *psc; GLint i, screens; @@ -221,6 +222,25 @@ __glXFreeDisplayPrivate(XExtData * extension) static Bool QueryVersion(Display * dpy, int opcode, int *major, int *minor) { +#ifdef USE_XCB + xcb_connection_t *c = XGetXCBConnection(dpy); + xcb_glx_query_version_reply_t* reply = + xcb_glx_query_version_reply(c, + xcb_glx_query_version(c, + GLX_MAJOR_VERSION, + GLX_MINOR_VERSION), + NULL); + + if(reply->major_version != GLX_MAJOR_VERSION) + { + free(reply); + return GL_FALSE; + } + *major = reply->major_version; + *minor = min(reply->minor_version, GLX_MINOR_VERSION); + free(reply); + return GL_TRUE; +#else xGLXQueryVersionReq *req; xGLXQueryVersionReply reply; @@ -245,6 +265,7 @@ QueryVersion(Display * dpy, int opcode, int *major, int *minor) *major = reply.majorVersion; *minor = min(reply.minorVersion, GLX_MINOR_VERSION); return GL_TRUE; +#endif /* USE_XCB */ } @@ -529,9 +550,7 @@ getFBConfigs(Display * dpy, __GLXdisplayPrivate * priv, int screen) __GLXscreenConfigs *psc; psc = priv->screenConfigs + screen; - psc->serverGLXexts = __glXGetStringFromServer(dpy, priv->majorOpcode, - X_GLXQueryServerString, - screen, GLX_EXTENSIONS); + psc->serverGLXexts = __glXQueryServerString(dpy, priv->majorOpcode, screen, GLX_EXTENSIONS); LockDisplay(dpy); @@ -589,9 +608,7 @@ AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv) memset(psc, 0, screens * sizeof(__GLXscreenConfigs)); priv->screenConfigs = psc; - priv->serverGLXversion = __glXGetStringFromServer(dpy, priv->majorOpcode, - X_GLXQueryServerString, - 0, GLX_VERSION); + priv->serverGLXversion = __glXQueryServerString(dpy, priv->majorOpcode, 0, GLX_VERSION); if (priv->serverGLXversion == NULL) { FreeScreenConfigs(priv); return GL_FALSE; |