From 020c64b2cf2973b5cb41e233d2bfbd85f1b699f7 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Sat, 8 Mar 2008 21:57:29 -0500 Subject: Move DRI context functions into dri_glx.c. Also drop isDirect flag; if gc->driContext is non-NULL, it's direct. --- src/glx/x11/dri_glx.c | 95 ++++++++++++++++++++++++++++++---------- src/glx/x11/glxclient.h | 35 +++++++-------- src/glx/x11/glxcmds.c | 51 +++++++++++---------- src/glx/x11/glxext.c | 65 +++++++++------------------ src/glx/x11/indirect.c | 32 +++++++------- src/glx/x11/singlepix.c | 2 +- src/mesa/glapi/glX_proto_send.py | 2 +- 7 files changed, 153 insertions(+), 129 deletions(-) (limited to 'src') diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c index 2e883c62cb..853940bb67 100644 --- a/src/glx/x11/dri_glx.c +++ b/src/glx/x11/dri_glx.c @@ -59,6 +59,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #endif typedef struct __GLXDRIdisplayPrivateRec __GLXDRIdisplayPrivate; +typedef struct __GLXDRIcontextPrivateRec __GLXDRIcontextPrivate; + struct __GLXDRIdisplayPrivateRec { __GLXDRIdisplay base; @@ -70,6 +72,12 @@ struct __GLXDRIdisplayPrivateRec { int driPatch; }; +struct __GLXDRIcontextPrivateRec { + __GLXDRIcontext base; + __DRIcontext driContext; + XID hwContextID; +}; + #ifndef DEFAULT_DRIVER_DIR /* this is normally defined in Mesa/configs/default with DRI_DRIVER_SEARCH_PATH */ #define DEFAULT_DRIVER_DIR "/usr/X11R6/lib/modules/dri" @@ -657,40 +665,79 @@ CallCreateNewScreen(Display *dpy, int scrn, __GLXscreenConfigs *psc, return psp; } +static void driDestroyContext(__GLXDRIcontext *context, + __GLXscreenConfigs *psc, Display *dpy) +{ + __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context; + + (*pcp->driContext.destroyContext)(&pcp->driContext); + + XF86DRIDestroyContext(psc->dpy, psc->scr, pcp->hwContextID); +} -static void driCreateContext(__GLXscreenConfigs *psc, - const __GLcontextModes *mode, - GLXContext gc, - GLXContext shareList, int renderType) +static Bool driBindContext(__GLXDRIcontext *context, + __GLXDRIdrawable *draw, __GLXDRIdrawable *read) { + __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context; + + return (*pcp->driContext.bindContext)(&pcp->driContext, + &draw->driDrawable, + &read->driDrawable); +} + +static void driUnbindContext(__GLXDRIcontext *context) +{ + __GLXDRIcontextPrivate *pcp = (__GLXDRIcontextPrivate *) context; + + (*pcp->driContext.unbindContext)(&pcp->driContext); +} + +static __GLXDRIcontext *driCreateContext(__GLXscreenConfigs *psc, + const __GLcontextModes *mode, + GLXContext gc, + GLXContext shareList, int renderType) +{ + __GLXDRIcontextPrivate *pcp, *pcp_shared; drm_context_t hwContext; - __DRIcontext *shared; + __DRIcontext *shared = NULL; if (psc && psc->driScreen) { - shared = (shareList != NULL) ? &shareList->driContext : NULL; + if (shareList) { + pcp_shared = (__GLXDRIcontextPrivate *) shareList->driContext; + shared = &pcp_shared->driContext; + } + + pcp = Xmalloc(sizeof *pcp); + if (pcp == NULL) + return NULL; if (!XF86DRICreateContextWithConfig(psc->dpy, psc->scr, mode->visualID, - &gc->hwContextID, &hwContext)) - /* gah, handle this better */ - return; - - gc->driContext.private = - (*psc->__driScreen.createNewContext)( &psc->__driScreen, - mode, renderType, - shared, - hwContext, - &gc->driContext ); - if (gc->driContext.private) { - gc->isDirect = GL_TRUE; - gc->screen = mode->screen; - gc->psc = psc; - gc->mode = mode; + &pcp->hwContextID, &hwContext)) { + Xfree(pcp); + return NULL; } - else { - XF86DRIDestroyContext(psc->dpy, psc->scr, gc->hwContextID); + + pcp->driContext.private = + (*psc->__driScreen.createNewContext)(&psc->__driScreen, + mode, renderType, + shared, + hwContext, + &pcp->driContext); + if (pcp->driContext.private == NULL) { + XF86DRIDestroyContext(psc->dpy, psc->scr, pcp->hwContextID); + Xfree(pcp); + return NULL; } + + pcp->base.destroyContext = driDestroyContext; + pcp->base.bindContext = driBindContext; + pcp->base.unbindContext = driUnbindContext; + + return &pcp->base; } + + return NULL; } @@ -824,7 +871,7 @@ __GLXDRIdisplay *driCreateDisplay(Display *dpy) pdpyp->base.destroyDisplay = driDestroyDisplay; pdpyp->base.createScreen = driCreateScreen; - return (void *)pdpyp; + return &pdpyp->base; } #endif /* GLX_DIRECT_RENDERING */ diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index d99918a185..259add7595 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -95,6 +95,7 @@ typedef struct _glapi_table __GLapi; typedef struct __GLXDRIdisplayRec __GLXDRIdisplay; typedef struct __GLXDRIscreenRec __GLXDRIscreen; typedef struct __GLXDRIdrawableRec __GLXDRIdrawable; +typedef struct __GLXDRIcontextRec __GLXDRIcontext; struct __GLXDRIdisplayRec { /** @@ -110,15 +111,26 @@ struct __GLXDRIscreenRec { void (*destroyScreen)(__GLXscreenConfigs *psc); - void (*createContext)(__GLXscreenConfigs *psc, - const __GLcontextModes *mode, - GLXContext gc, GLXContext shareList, int renderType); - + __GLXDRIcontext *(*createContext)(__GLXscreenConfigs *psc, + const __GLcontextModes *mode, + GLXContext gc, + GLXContext shareList, int renderType); + __GLXDRIdrawable *(*createDrawable)(__GLXscreenConfigs *psc, GLXDrawable drawable, GLXContext gc); }; +struct __GLXDRIcontextRec { + void (*destroyContext)(__GLXDRIcontext *context, __GLXscreenConfigs *psc, + Display *dpy); + Bool (*bindContext)(__GLXDRIcontext *context, + __GLXDRIdrawable *pdraw, + __GLXDRIdrawable *pread); + + void (*unbindContext)(__GLXDRIcontext *context); +}; + struct __GLXDRIdrawableRec { XID drawable; __GLXscreenConfigs *psc; @@ -295,11 +307,6 @@ struct __GLXcontextRec { */ GLenum error; - /** - * Whether this context does direct rendering. - */ - Bool isDirect; - /** * \c dpy of current display for this context. Will be \c NULL if not * current to any display, or if this is the "dummy context". @@ -349,15 +356,7 @@ struct __GLXcontextRec { const __GLcontextModes * mode; #ifdef GLX_DIRECT_RENDERING - /** - * Per context direct rendering interface functions and data. - */ - __DRIcontext driContext; - - /** - * XID for the server side drm_context_t - */ - XID hwContextID; + __GLXDRIcontext *driContext; #endif /** diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index 6b34acfcf3..7364128242 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -313,7 +313,6 @@ GLXContext AllocateGLXContext( Display *dpy ) */ gc->fastImageUnpack = GL_FALSE; gc->fillImage = __glFillImage; - gc->isDirect = GL_FALSE; gc->pc = gc->buf; gc->bufEnd = gc->buf + bufSize; if (__glXDebug) { @@ -398,7 +397,14 @@ CreateContext(Display *dpy, XVisualInfo *vis, mode = fbconfig; } - psc->driScreen->createContext(psc, mode, gc, shareList, renderType); + gc->driContext = psc->driScreen->createContext(psc, mode, gc, + shareList, + renderType); + if (gc->driContext != NULL) { + gc->screen = mode->screen; + gc->psc = psc; + gc->mode = mode; + } } #endif @@ -414,7 +420,7 @@ CreateContext(Display *dpy, XVisualInfo *vis, req->visual = vis->visualid; req->screen = vis->screen; req->shareList = shareList ? shareList->xid : None; - req->isDirect = gc->isDirect; + req->isDirect = gc->driContext != NULL; } else if ( use_glx_1_3 ) { xGLXCreateNewContextReq *req; @@ -428,7 +434,7 @@ CreateContext(Display *dpy, XVisualInfo *vis, req->screen = fbconfig->screen; req->renderType = renderType; req->shareList = shareList ? shareList->xid : None; - req->isDirect = gc->isDirect; + req->isDirect = gc->driContext != NULL; } else { xGLXVendorPrivateWithReplyReq *vpreq; @@ -446,7 +452,7 @@ CreateContext(Display *dpy, XVisualInfo *vis, req->screen = fbconfig->screen; req->renderType = renderType; req->shareList = shareList ? shareList->xid : None; - req->isDirect = gc->isDirect; + req->isDirect = gc->driContext != NULL; } UnlockDisplay(dpy); @@ -504,12 +510,9 @@ DestroyContext(Display *dpy, GLXContext gc) #ifdef GLX_DIRECT_RENDERING /* Destroy the direct rendering context */ - if (gc->isDirect) { - if (gc->driContext.private) { - (*gc->driContext.destroyContext)(&gc->driContext); - XF86DRIDestroyContext(dpy, gc->psc->scr, gc->hwContextID); - gc->driContext.private = NULL; - } + if (gc->driContext) { + (*gc->driContext->destroyContext)(gc->driContext, gc->psc, dpy); + gc->driContext = NULL; GarbageCollectDRIDrawables(dpy, gc->psc); } #endif @@ -591,7 +594,7 @@ PUBLIC void glXWaitGL(void) __glXFlushRenderBuffer(gc, gc->pc); #ifdef GLX_DIRECT_RENDERING - if (gc->isDirect) { + if (gc->driContext) { /* This bit of ugliness unwraps the glFinish function */ #ifdef glFinish #undef glFinish @@ -627,7 +630,7 @@ PUBLIC void glXWaitX(void) __glXFlushRenderBuffer(gc, gc->pc); #ifdef GLX_DIRECT_RENDERING - if (gc->isDirect) { + if (gc->driContext) { XSync(dpy, False); return; } @@ -657,7 +660,7 @@ PUBLIC void glXUseXFont(Font font, int first, int count, int listBase) (void) __glXFlushRenderBuffer(gc, gc->pc); #ifdef GLX_DIRECT_RENDERING - if (gc->isDirect) { + if (gc->driContext) { DRI_glXUseXFont(font, first, count, listBase); return; } @@ -697,7 +700,7 @@ PUBLIC void glXCopyContext(Display *dpy, GLXContext source, } #ifdef GLX_DIRECT_RENDERING - if (gc->isDirect) { + if (gc->driContext) { /* NOT_DONE: This does not work yet */ } #endif @@ -769,7 +772,7 @@ PUBLIC Bool glXIsDirect(Display *dpy, GLXContext gc) if (!gc) { return GL_FALSE; #ifdef GLX_DIRECT_RENDERING - } else if (gc->isDirect) { + } else if (gc->driContext) { return GL_TRUE; #endif } @@ -1519,7 +1522,7 @@ glXQueryContext(Display *dpy, GLXContext ctx, int attribute, int *value) int retVal; /* get the information from the server if we don't have it already */ - if (!ctx->isDirect && (ctx->mode == NULL)) { + if (!ctx->driContext && (ctx->mode == NULL)) { retVal = __glXQueryContextInfo(dpy, ctx); if (Success != retVal) return retVal; } @@ -1713,7 +1716,7 @@ static int __glXSwapIntervalSGI(int interval) } #ifdef __DRI_SWAP_CONTROL - if ( gc->isDirect ) { + if (gc->driContext) { __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen ); __DRIdrawable * const pdraw = GetDRIDrawable( gc->currentDpy, @@ -1765,7 +1768,7 @@ static int __glXSwapIntervalMESA(unsigned int interval) return GLX_BAD_VALUE; } - if ( (gc != NULL) && gc->isDirect ) { + if (gc != NULL && gc->driContext) { __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen ); @@ -1791,7 +1794,7 @@ static int __glXGetSwapIntervalMESA(void) #ifdef __DRI_SWAP_CONTROL GLXContext gc = __glXGetCurrentContext(); - if ( (gc != NULL) && gc->isDirect ) { + if (gc != NULL && gc->driContext) { __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen ); @@ -1916,7 +1919,7 @@ static int __glXGetVideoSyncSGI(unsigned int *count) GLXContext gc = __glXGetCurrentContext(); - if ( (gc != NULL) && gc->isDirect ) { + if (gc != NULL && gc->driContext) { __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen ); if ( psc->msc && psc->driScreen ) { @@ -1945,7 +1948,7 @@ static int __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count if ( divisor <= 0 || remainder < 0 ) return GLX_BAD_VALUE; - if ( (gc != NULL) && gc->isDirect ) { + if (gc != NULL && gc->driContext) { __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen ); if (psc->msc != NULL && psc->driScreen ) { @@ -2554,7 +2557,7 @@ static void __glXBindTexImageEXT(Display *dpy, } #ifdef GLX_DIRECT_RENDERING - if (gc->isDirect) + if (gc->driContext) return; #endif @@ -2606,7 +2609,7 @@ static void __glXReleaseTexImageEXT(Display *dpy, return; #ifdef GLX_DIRECT_RENDERING - if (gc->isDirect) + if (gc->driContext) return; #endif diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c index 2f3261801a..012a910a44 100644 --- a/src/glx/x11/glxext.c +++ b/src/glx/x11/glxext.c @@ -1177,7 +1177,7 @@ static Bool SendMakeCurrentRequest(Display *dpy, CARD8 opcode, #ifdef GLX_DIRECT_RENDERING -static __DRIdrawable * +static __GLXDRIdrawable * FetchDRIDrawable(Display *dpy, GLXDrawable drawable, GLXContext gc) { __GLXdisplayPrivate * const priv = __glXInitialize(dpy); @@ -1189,26 +1189,9 @@ FetchDRIDrawable(Display *dpy, GLXDrawable drawable, GLXContext gc) psc = &priv->screenConfigs[gc->screen]; if (__glxHashLookup(psc->drawHash, drawable, (void *) &pdraw) == 0) - return &pdraw->driDrawable; + return pdraw; - pdraw = psc->driScreen->createDrawable(psc, drawable, gc); - - return &pdraw->driDrawable; -} - -static Bool BindContextWrapper( Display *dpy, GLXContext gc, - GLXDrawable draw, GLXDrawable read ) -{ - __DRIdrawable *pdraw = FetchDRIDrawable(dpy, draw, gc); - __DRIdrawable *pread = FetchDRIDrawable(dpy, read, gc); - - return (*gc->driContext.bindContext)(&gc->driContext, pdraw, pread); -} - - -static Bool UnbindContextWrapper( GLXContext gc ) -{ - return (*gc->driContext.unbindContext)(&gc->driContext); + return psc->driScreen->createDrawable(psc, drawable, gc); } #endif /* GLX_DIRECT_RENDERING */ @@ -1241,27 +1224,23 @@ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw, return GL_FALSE; } -#ifndef GLX_DIRECT_RENDERING - if (gc && gc->isDirect) { - return GL_FALSE; - } -#endif - _glapi_check_multithread(); #ifdef GLX_DIRECT_RENDERING /* Bind the direct rendering context to the drawable */ - if (gc && gc->isDirect) { - bindReturnValue = (gc->driContext.private) - ? BindContextWrapper(dpy, gc, draw, read) - : False; + if (gc && gc->driContext) { + __GLXDRIdrawable *pdraw = FetchDRIDrawable(dpy, draw, gc); + __GLXDRIdrawable *pread = FetchDRIDrawable(dpy, read, gc); + + bindReturnValue = + (gc->driContext->bindContext) (gc->driContext, pdraw, pread); } else #endif { /* Send a glXMakeCurrent request to bind the new context. */ bindReturnValue = SendMakeCurrentRequest(dpy, opcode, gc ? gc->xid : None, - ((dpy != oldGC->currentDpy) || oldGC->isDirect) + ((dpy != oldGC->currentDpy) || oldGC->driContext) ? None : oldGC->currentContextTag, draw, read, &reply); } @@ -1271,8 +1250,8 @@ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw, return False; } - if ((dpy != oldGC->currentDpy || (gc && gc->isDirect)) && - !oldGC->isDirect && oldGC != &dummyContext) { + if ((dpy != oldGC->currentDpy || (gc && gc->driContext)) && + !oldGC->driContext && oldGC != &dummyContext) { xGLXMakeCurrentReply dummy_reply; /* We are either switching from one dpy to another and have to @@ -1286,8 +1265,8 @@ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw, & dummy_reply); } #ifdef GLX_DIRECT_RENDERING - else if (oldGC->isDirect && oldGC->driContext.private) { - (void) UnbindContextWrapper(oldGC); + else if (oldGC->driContext) { + oldGC->driContext->unbindContext(oldGC->driContext); } #endif @@ -1317,15 +1296,11 @@ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw, */ #ifdef GLX_DIRECT_RENDERING /* Destroy the old direct rendering context */ - if (oldGC->isDirect) { - if (oldGC->driContext.private) { - (*oldGC->driContext.destroyContext) - (&oldGC->driContext); - XF86DRIDestroyContext(oldGC->createDpy, - oldGC->psc->scr, - gc->hwContextID); - oldGC->driContext.private = NULL; - } + if (oldGC->driContext) { + oldGC->driContext->destroyContext(oldGC->driContext, + oldGC->psc, + oldGC->createDpy); + oldGC->driContext = NULL; } #endif __glXFreeContext(oldGC); @@ -1338,7 +1313,7 @@ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw, gc->currentDrawable = draw; gc->currentReadable = read; - if (!gc->isDirect) { + if (!gc->driContext) { if (!IndirectAPI) IndirectAPI = __glXNewIndirectAPI(); _glapi_set_dispatch(IndirectAPI); diff --git a/src/glx/x11/indirect.c b/src/glx/x11/indirect.c index a8a649c5e3..871adddb95 100644 --- a/src/glx/x11/indirect.c +++ b/src/glx/x11/indirect.c @@ -5124,7 +5124,7 @@ glAreTexturesResidentEXT(GLsizei n, const GLuint * textures, { __GLXcontext *const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { return CALL_AreTexturesResident(GET_DISPATCH(), (n, textures, residences)); } else { @@ -5274,7 +5274,7 @@ glDeleteTexturesEXT(GLsizei n, const GLuint * textures) { __GLXcontext *const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { CALL_DeleteTextures(GET_DISPATCH(), (n, textures)); } else { __GLXcontext *const gc = __glXGetCurrentContext(); @@ -5342,7 +5342,7 @@ glGenTexturesEXT(GLsizei n, GLuint * textures) { __GLXcontext *const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { CALL_GenTextures(GET_DISPATCH(), (n, textures)); } else { __GLXcontext *const gc = __glXGetCurrentContext(); @@ -5404,7 +5404,7 @@ glIsTextureEXT(GLuint texture) { __GLXcontext *const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { return CALL_IsTexture(GET_DISPATCH(), (texture)); } else { __GLXcontext *const gc = __glXGetCurrentContext(); @@ -5718,7 +5718,7 @@ glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * table) { __GLXcontext *const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { CALL_GetColorTable(GET_DISPATCH(), (target, format, type, table)); } else { __GLXcontext *const gc = __glXGetCurrentContext(); @@ -5791,7 +5791,7 @@ glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params) { __GLXcontext *const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { CALL_GetColorTableParameterfv(GET_DISPATCH(), (target, pname, params)); } else { @@ -5861,7 +5861,7 @@ glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint * params) { __GLXcontext *const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { CALL_GetColorTableParameteriv(GET_DISPATCH(), (target, pname, params)); } else { @@ -6184,7 +6184,7 @@ gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type, { __GLXcontext *const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { CALL_GetConvolutionFilter(GET_DISPATCH(), (target, format, type, image)); } else { @@ -6259,7 +6259,7 @@ gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params) { __GLXcontext *const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { CALL_GetConvolutionParameterfv(GET_DISPATCH(), (target, pname, params)); } else { @@ -6329,7 +6329,7 @@ gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params) { __GLXcontext *const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { CALL_GetConvolutionParameteriv(GET_DISPATCH(), (target, pname, params)); } else { @@ -6406,7 +6406,7 @@ gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format, { __GLXcontext *const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { CALL_GetHistogram(GET_DISPATCH(), (target, reset, format, type, values)); } else { @@ -6480,7 +6480,7 @@ gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params) { __GLXcontext *const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { CALL_GetHistogramParameterfv(GET_DISPATCH(), (target, pname, params)); } else { __GLXcontext *const gc = __glXGetCurrentContext(); @@ -6548,7 +6548,7 @@ gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params) { __GLXcontext *const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { CALL_GetHistogramParameteriv(GET_DISPATCH(), (target, pname, params)); } else { __GLXcontext *const gc = __glXGetCurrentContext(); @@ -6620,7 +6620,7 @@ gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format, { __GLXcontext *const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { CALL_GetMinmax(GET_DISPATCH(), (target, reset, format, type, values)); } else { __GLXcontext *const gc = __glXGetCurrentContext(); @@ -6691,7 +6691,7 @@ gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params) { __GLXcontext *const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { CALL_GetMinmaxParameterfv(GET_DISPATCH(), (target, pname, params)); } else { __GLXcontext *const gc = __glXGetCurrentContext(); @@ -6756,7 +6756,7 @@ gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params) { __GLXcontext *const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { CALL_GetMinmaxParameteriv(GET_DISPATCH(), (target, pname, params)); } else { __GLXcontext *const gc = __glXGetCurrentContext(); diff --git a/src/glx/x11/singlepix.c b/src/glx/x11/singlepix.c index a7b5b79870..bc5b162c67 100644 --- a/src/glx/x11/singlepix.c +++ b/src/glx/x11/singlepix.c @@ -118,7 +118,7 @@ void NAME(_gloffset_GetSeparableFilter)(GLenum target, GLenum format, GLenum typ { __GLXcontext * const gc = __glXGetCurrentContext(); - if (gc->isDirect) { + if (gc->driContext) { CALL_GetSeparableFilter(GET_DISPATCH(), (target, format, type, row, column, span)); return; diff --git a/src/mesa/glapi/glX_proto_send.py b/src/mesa/glapi/glX_proto_send.py index 6207b00a94..b00b8a1ba6 100644 --- a/src/mesa/glapi/glX_proto_send.py +++ b/src/mesa/glapi/glX_proto_send.py @@ -373,7 +373,7 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; print '{' print ' __GLXcontext * const gc = __glXGetCurrentContext();' print '' - print ' if (gc->isDirect) {' + print ' if (gc->driContext) {' print ' %sCALL_%s(GET_DISPATCH(), (%s));' % (ret_string, func.name, func.get_called_parameter_string()) print ' } else {' footer = '}\n}\n' -- cgit v1.2.3