glx: drop unnecessary pointer deref for function calls

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Eric Engestrom
2018-11-22 19:47:28 +00:00
parent 9668d7f539
commit e7e3fd5c03
4 changed files with 46 additions and 46 deletions

View File

@@ -211,9 +211,9 @@ dri3_bind_context(struct glx_context *context, struct glx_context *old,
return GLXBadContext; return GLXBadContext;
if (dri_draw) if (dri_draw)
(*psc->f->invalidate)(dri_draw); psc->f->invalidate(dri_draw);
if (dri_read && dri_read != dri_draw) if (dri_read && dri_read != dri_draw)
(*psc->f->invalidate)(dri_read); psc->f->invalidate(dri_read);
return Success; return Success;
} }
@@ -502,7 +502,7 @@ dri3_flush_front_buffer(__DRIdrawable *driDrawable, void *loaderPrivate)
loader_dri3_flush(draw, __DRI2_FLUSH_DRAWABLE, __DRI2_THROTTLE_FLUSHFRONT); loader_dri3_flush(draw, __DRI2_FLUSH_DRAWABLE, __DRI2_THROTTLE_FLUSHFRONT);
(*psc->f->invalidate)(driDrawable); psc->f->invalidate(driDrawable);
loader_dri3_wait_gl(draw); loader_dri3_wait_gl(draw);
} }
@@ -682,7 +682,7 @@ dri3_bind_tex_image(Display * dpy,
if (pdraw != NULL) { if (pdraw != NULL) {
psc = (struct dri3_screen *) base->psc; psc = (struct dri3_screen *) base->psc;
(*psc->f->invalidate)(pdraw->loader_drawable.dri_drawable); psc->f->invalidate(pdraw->loader_drawable.dri_drawable);
XSync(dpy, false); XSync(dpy, false);

View File

@@ -397,7 +397,7 @@ driReleaseDrawables(struct glx_context *gc)
if (pdraw->drawable == pdraw->xDrawable) { if (pdraw->drawable == pdraw->xDrawable) {
pdraw->refcount --; pdraw->refcount --;
if (pdraw->refcount == 0) { if (pdraw->refcount == 0) {
(*pdraw->destroyDrawable)(pdraw); pdraw->destroyDrawable(pdraw);
__glxHashDelete(priv->drawHash, gc->currentDrawable); __glxHashDelete(priv->drawHash, gc->currentDrawable);
} }
} }
@@ -408,7 +408,7 @@ driReleaseDrawables(struct glx_context *gc)
if (pdraw->drawable == pdraw->xDrawable) { if (pdraw->drawable == pdraw->xDrawable) {
pdraw->refcount --; pdraw->refcount --;
if (pdraw->refcount == 0) { if (pdraw->refcount == 0) {
(*pdraw->destroyDrawable)(pdraw); pdraw->destroyDrawable(pdraw);
__glxHashDelete(priv->drawHash, gc->currentReadable); __glxHashDelete(priv->drawHash, gc->currentReadable);
} }
} }

View File

@@ -118,7 +118,7 @@ static void dispatch_BindTexImageEXT(Display *dpy, GLXDrawable drawable,
if (pBindTexImageEXT == NULL) if (pBindTexImageEXT == NULL)
return; return;
(*pBindTexImageEXT)(dpy, drawable, buffer, attrib_list); pBindTexImageEXT(dpy, drawable, buffer, attrib_list);
} }
@@ -139,7 +139,7 @@ static GLXFBConfigSGIX *dispatch_ChooseFBConfigSGIX(Display *dpy, int screen,
if (pChooseFBConfigSGIX == NULL) if (pChooseFBConfigSGIX == NULL)
return NULL; return NULL;
ret = (*pChooseFBConfigSGIX)(dpy, screen, attrib_list, nelements); ret = pChooseFBConfigSGIX(dpy, screen, attrib_list, nelements);
if (AddFBConfigsMapping(dpy, ret, nelements, dd)) { if (AddFBConfigsMapping(dpy, ret, nelements, dd)) {
free(ret); free(ret);
return NULL; return NULL;
@@ -168,7 +168,7 @@ static GLXContext dispatch_CreateContextAttribsARB(Display *dpy,
if (pCreateContextAttribsARB == NULL) if (pCreateContextAttribsARB == NULL)
return None; return None;
ret = (*pCreateContextAttribsARB)(dpy, config, share_list, direct, attrib_list); ret = pCreateContextAttribsARB(dpy, config, share_list, direct, attrib_list);
if (AddContextMapping(dpy, ret, dd)) { if (AddContextMapping(dpy, ret, dd)) {
/* XXX: Call glXDestroyContext which lives in libglvnd. If we're not /* XXX: Call glXDestroyContext which lives in libglvnd. If we're not
* allowed to call it from here, should we extend __glXDispatchTableIndices ? * allowed to call it from here, should we extend __glXDispatchTableIndices ?
@@ -199,7 +199,7 @@ static GLXContext dispatch_CreateContextWithConfigSGIX(Display *dpy,
if (pCreateContextWithConfigSGIX == NULL) if (pCreateContextWithConfigSGIX == NULL)
return None; return None;
ret = (*pCreateContextWithConfigSGIX)(dpy, config, render_type, share_list, direct); ret = pCreateContextWithConfigSGIX(dpy, config, render_type, share_list, direct);
if (AddContextMapping(dpy, ret, dd)) { if (AddContextMapping(dpy, ret, dd)) {
/* XXX: Call glXDestroyContext which lives in libglvnd. If we're not /* XXX: Call glXDestroyContext which lives in libglvnd. If we're not
* allowed to call it from here, should we extend __glXDispatchTableIndices ? * allowed to call it from here, should we extend __glXDispatchTableIndices ?
@@ -230,13 +230,13 @@ static GLXPbuffer dispatch_CreateGLXPbufferSGIX(Display *dpy,
if (pCreateGLXPbufferSGIX == NULL) if (pCreateGLXPbufferSGIX == NULL)
return None; return None;
ret = (*pCreateGLXPbufferSGIX)(dpy, config, width, height, attrib_list); ret = pCreateGLXPbufferSGIX(dpy, config, width, height, attrib_list);
if (AddDrawableMapping(dpy, ret, dd)) { if (AddDrawableMapping(dpy, ret, dd)) {
PFNGLXDESTROYGLXPBUFFERSGIXPROC pDestroyGLXPbufferSGIX; PFNGLXDESTROYGLXPBUFFERSGIXPROC pDestroyGLXPbufferSGIX;
__FETCH_FUNCTION_PTR(DestroyGLXPbufferSGIX); __FETCH_FUNCTION_PTR(DestroyGLXPbufferSGIX);
if (pDestroyGLXPbufferSGIX) if (pDestroyGLXPbufferSGIX)
(*pDestroyGLXPbufferSGIX)(dpy, ret); pDestroyGLXPbufferSGIX(dpy, ret);
return None; return None;
} }
@@ -262,7 +262,7 @@ static GLXPixmap dispatch_CreateGLXPixmapWithConfigSGIX(Display *dpy,
if (pCreateGLXPixmapWithConfigSGIX == NULL) if (pCreateGLXPixmapWithConfigSGIX == NULL)
return None; return None;
ret = (*pCreateGLXPixmapWithConfigSGIX)(dpy, config, pixmap); ret = pCreateGLXPixmapWithConfigSGIX(dpy, config, pixmap);
if (AddDrawableMapping(dpy, ret, dd)) { if (AddDrawableMapping(dpy, ret, dd)) {
/* XXX: Call glXDestroyGLXPixmap which lives in libglvnd. If we're not /* XXX: Call glXDestroyGLXPixmap which lives in libglvnd. If we're not
* allowed to call it from here, should we extend __glXDispatchTableIndices ? * allowed to call it from here, should we extend __glXDispatchTableIndices ?
@@ -288,7 +288,7 @@ static void dispatch_DestroyGLXPbufferSGIX(Display *dpy, GLXPbuffer pbuf)
if (pDestroyGLXPbufferSGIX == NULL) if (pDestroyGLXPbufferSGIX == NULL)
return; return;
(*pDestroyGLXPbufferSGIX)(dpy, pbuf); pDestroyGLXPbufferSGIX(dpy, pbuf);
} }
@@ -306,7 +306,7 @@ static GLXContextID dispatch_GetContextIDEXT(const GLXContext ctx)
if (pGetContextIDEXT == NULL) if (pGetContextIDEXT == NULL)
return None; return None;
return (*pGetContextIDEXT)(ctx); return pGetContextIDEXT(ctx);
} }
@@ -327,7 +327,7 @@ static Display *dispatch_GetCurrentDisplayEXT(void)
if (pGetCurrentDisplayEXT == NULL) if (pGetCurrentDisplayEXT == NULL)
return NULL; return NULL;
return (*pGetCurrentDisplayEXT)(); return pGetCurrentDisplayEXT();
} }
@@ -361,7 +361,7 @@ static int dispatch_GetFBConfigAttribSGIX(Display *dpy, GLXFBConfigSGIX config,
if (pGetFBConfigAttribSGIX == NULL) if (pGetFBConfigAttribSGIX == NULL)
return GLX_NO_EXTENSION; return GLX_NO_EXTENSION;
return (*pGetFBConfigAttribSGIX)(dpy, config, attribute, value_return); return pGetFBConfigAttribSGIX(dpy, config, attribute, value_return);
} }
@@ -381,7 +381,7 @@ static GLXFBConfigSGIX dispatch_GetFBConfigFromVisualSGIX(Display *dpy,
if (pGetFBConfigFromVisualSGIX == NULL) if (pGetFBConfigFromVisualSGIX == NULL)
return NULL; return NULL;
ret = (*pGetFBConfigFromVisualSGIX)(dpy, vis); ret = pGetFBConfigFromVisualSGIX(dpy, vis);
if (AddFBConfigMapping(dpy, ret, dd)) if (AddFBConfigMapping(dpy, ret, dd))
/* XXX: dealloc ret ? */ /* XXX: dealloc ret ? */
return NULL; return NULL;
@@ -405,7 +405,7 @@ static void dispatch_GetSelectedEventSGIX(Display *dpy, GLXDrawable drawable,
if (pGetSelectedEventSGIX == NULL) if (pGetSelectedEventSGIX == NULL)
return; return;
(*pGetSelectedEventSGIX)(dpy, drawable, mask); pGetSelectedEventSGIX(dpy, drawable, mask);
} }
@@ -426,7 +426,7 @@ static int dispatch_GetVideoSyncSGI(unsigned int *count)
if (pGetVideoSyncSGI == NULL) if (pGetVideoSyncSGI == NULL)
return GLX_NO_EXTENSION; return GLX_NO_EXTENSION;
return (*pGetVideoSyncSGI)(count); return pGetVideoSyncSGI(count);
} }
@@ -445,7 +445,7 @@ static XVisualInfo *dispatch_GetVisualFromFBConfigSGIX(Display *dpy,
if (pGetVisualFromFBConfigSGIX == NULL) if (pGetVisualFromFBConfigSGIX == NULL)
return NULL; return NULL;
return (*pGetVisualFromFBConfigSGIX)(dpy, config); return pGetVisualFromFBConfigSGIX(dpy, config);
} }
@@ -464,7 +464,7 @@ static int dispatch_QueryContextInfoEXT(Display *dpy, GLXContext ctx,
if (pQueryContextInfoEXT == NULL) if (pQueryContextInfoEXT == NULL)
return GLX_NO_EXTENSION; return GLX_NO_EXTENSION;
return (*pQueryContextInfoEXT)(dpy, ctx, attribute, value); return pQueryContextInfoEXT(dpy, ctx, attribute, value);
} }
@@ -483,7 +483,7 @@ static void dispatch_QueryGLXPbufferSGIX(Display *dpy, GLXPbuffer pbuf,
if (pQueryGLXPbufferSGIX == NULL) if (pQueryGLXPbufferSGIX == NULL)
return; return;
(*pQueryGLXPbufferSGIX)(dpy, pbuf, attribute, value); pQueryGLXPbufferSGIX(dpy, pbuf, attribute, value);
} }
@@ -502,7 +502,7 @@ static void dispatch_ReleaseTexImageEXT(Display *dpy, GLXDrawable drawable,
if (pReleaseTexImageEXT == NULL) if (pReleaseTexImageEXT == NULL)
return; return;
(*pReleaseTexImageEXT)(dpy, drawable, buffer); pReleaseTexImageEXT(dpy, drawable, buffer);
} }
@@ -521,7 +521,7 @@ static void dispatch_SelectEventSGIX(Display *dpy, GLXDrawable drawable,
if (pSelectEventSGIX == NULL) if (pSelectEventSGIX == NULL)
return; return;
(*pSelectEventSGIX)(dpy, drawable, mask); pSelectEventSGIX(dpy, drawable, mask);
} }
@@ -542,7 +542,7 @@ static int dispatch_SwapIntervalSGI(int interval)
if (pSwapIntervalSGI == NULL) if (pSwapIntervalSGI == NULL)
return GLX_NO_EXTENSION; return GLX_NO_EXTENSION;
return (*pSwapIntervalSGI)(interval); return pSwapIntervalSGI(interval);
} }
@@ -564,7 +564,7 @@ static int dispatch_WaitVideoSyncSGI(int divisor, int remainder,
if (pWaitVideoSyncSGI == NULL) if (pWaitVideoSyncSGI == NULL)
return GLX_NO_EXTENSION; return GLX_NO_EXTENSION;
return (*pWaitVideoSyncSGI)(divisor, remainder, count); return pWaitVideoSyncSGI(divisor, remainder, count);
} }
@@ -583,7 +583,7 @@ static void dispatch_BindSwapBarrierSGIX(Display *dpy, GLXDrawable drawable,
if (pBindSwapBarrierSGIX == NULL) if (pBindSwapBarrierSGIX == NULL)
return; return;
(*pBindSwapBarrierSGIX)(dpy, drawable, barrier); pBindSwapBarrierSGIX(dpy, drawable, barrier);
} }
@@ -602,7 +602,7 @@ static void dispatch_CopySubBufferMESA(Display *dpy, GLXDrawable drawable,
if (pCopySubBufferMESA == NULL) if (pCopySubBufferMESA == NULL)
return; return;
(*pCopySubBufferMESA)(dpy, drawable, x, y, width, height); pCopySubBufferMESA(dpy, drawable, x, y, width, height);
} }
@@ -623,7 +623,7 @@ static GLXPixmap dispatch_CreateGLXPixmapMESA(Display *dpy,
if (pCreateGLXPixmapMESA == NULL) if (pCreateGLXPixmapMESA == NULL)
return None; return None;
ret = (*pCreateGLXPixmapMESA)(dpy, visinfo, pixmap, cmap); ret = pCreateGLXPixmapMESA(dpy, visinfo, pixmap, cmap);
if (AddDrawableMapping(dpy, ret, dd)) { if (AddDrawableMapping(dpy, ret, dd)) {
/* XXX: Call glXDestroyGLXPixmap which lives in libglvnd. If we're not /* XXX: Call glXDestroyGLXPixmap which lives in libglvnd. If we're not
* allowed to call it from here, should we extend __glXDispatchTableIndices ? * allowed to call it from here, should we extend __glXDispatchTableIndices ?
@@ -650,7 +650,7 @@ static GLboolean dispatch_GetMscRateOML(Display *dpy, GLXDrawable drawable,
if (pGetMscRateOML == NULL) if (pGetMscRateOML == NULL)
return GL_FALSE; return GL_FALSE;
return (*pGetMscRateOML)(dpy, drawable, numerator, denominator); return pGetMscRateOML(dpy, drawable, numerator, denominator);
} }
@@ -669,7 +669,7 @@ static const char *dispatch_GetScreenDriver(Display *dpy, int scrNum)
if (pGetScreenDriver == NULL) if (pGetScreenDriver == NULL)
return NULL; return NULL;
return (*pGetScreenDriver)(dpy, scrNum); return pGetScreenDriver(dpy, scrNum);
} }
@@ -690,7 +690,7 @@ static int dispatch_GetSwapIntervalMESA(void)
if (pGetSwapIntervalMESA == NULL) if (pGetSwapIntervalMESA == NULL)
return 0; return 0;
return (*pGetSwapIntervalMESA)(); return pGetSwapIntervalMESA();
} }
@@ -709,7 +709,7 @@ static Bool dispatch_GetSyncValuesOML(Display *dpy, GLXDrawable drawable,
if (pGetSyncValuesOML == NULL) if (pGetSyncValuesOML == NULL)
return False; return False;
return (*pGetSyncValuesOML)(dpy, drawable, ust, msc, sbc); return pGetSyncValuesOML(dpy, drawable, ust, msc, sbc);
} }
@@ -728,7 +728,7 @@ static void dispatch_JoinSwapGroupSGIX(Display *dpy, GLXDrawable drawable,
if (pJoinSwapGroupSGIX == NULL) if (pJoinSwapGroupSGIX == NULL)
return; return;
(*pJoinSwapGroupSGIX)(dpy, drawable, member); pJoinSwapGroupSGIX(dpy, drawable, member);
} }
@@ -750,7 +750,7 @@ static Bool dispatch_QueryCurrentRendererIntegerMESA(int attribute,
if (pQueryCurrentRendererIntegerMESA == NULL) if (pQueryCurrentRendererIntegerMESA == NULL)
return False; return False;
return (*pQueryCurrentRendererIntegerMESA)(attribute, value); return pQueryCurrentRendererIntegerMESA(attribute, value);
} }
@@ -771,7 +771,7 @@ static const char *dispatch_QueryCurrentRendererStringMESA(int attribute)
if (pQueryCurrentRendererStringMESA == NULL) if (pQueryCurrentRendererStringMESA == NULL)
return NULL; return NULL;
return (*pQueryCurrentRendererStringMESA)(attribute); return pQueryCurrentRendererStringMESA(attribute);
} }
@@ -790,7 +790,7 @@ static Bool dispatch_QueryMaxSwapBarriersSGIX(Display *dpy, int screen,
if (pQueryMaxSwapBarriersSGIX == NULL) if (pQueryMaxSwapBarriersSGIX == NULL)
return False; return False;
return (*pQueryMaxSwapBarriersSGIX)(dpy, screen, max); return pQueryMaxSwapBarriersSGIX(dpy, screen, max);
} }
@@ -810,7 +810,7 @@ static Bool dispatch_QueryRendererIntegerMESA(Display *dpy, int screen,
if (pQueryRendererIntegerMESA == NULL) if (pQueryRendererIntegerMESA == NULL)
return False; return False;
return (*pQueryRendererIntegerMESA)(dpy, screen, renderer, attribute, value); return pQueryRendererIntegerMESA(dpy, screen, renderer, attribute, value);
} }
@@ -829,7 +829,7 @@ static const char *dispatch_QueryRendererStringMESA(Display *dpy, int screen,
if (pQueryRendererStringMESA == NULL) if (pQueryRendererStringMESA == NULL)
return NULL; return NULL;
return (*pQueryRendererStringMESA)(dpy, screen, renderer, attribute); return pQueryRendererStringMESA(dpy, screen, renderer, attribute);
} }
@@ -847,7 +847,7 @@ static Bool dispatch_ReleaseBuffersMESA(Display *dpy, GLXDrawable d)
if (pReleaseBuffersMESA == NULL) if (pReleaseBuffersMESA == NULL)
return False; return False;
return (*pReleaseBuffersMESA)(dpy, d); return pReleaseBuffersMESA(dpy, d);
} }
@@ -867,7 +867,7 @@ static int64_t dispatch_SwapBuffersMscOML(Display *dpy, GLXDrawable drawable,
if (pSwapBuffersMscOML == NULL) if (pSwapBuffersMscOML == NULL)
return 0; return 0;
return (*pSwapBuffersMscOML)(dpy, drawable, target_msc, divisor, remainder); return pSwapBuffersMscOML(dpy, drawable, target_msc, divisor, remainder);
} }
@@ -888,7 +888,7 @@ static int dispatch_SwapIntervalMESA(unsigned int interval)
if (pSwapIntervalMESA == NULL) if (pSwapIntervalMESA == NULL)
return 0; return 0;
return (*pSwapIntervalMESA)(interval); return pSwapIntervalMESA(interval);
} }
@@ -909,7 +909,7 @@ static Bool dispatch_WaitForMscOML(Display *dpy, GLXDrawable drawable,
if (pWaitForMscOML == NULL) if (pWaitForMscOML == NULL)
return False; return False;
return (*pWaitForMscOML)(dpy, drawable, target_msc, divisor, remainder, ust, msc, sbc); return pWaitForMscOML(dpy, drawable, target_msc, divisor, remainder, ust, msc, sbc);
} }
@@ -929,7 +929,7 @@ static Bool dispatch_WaitForSbcOML(Display *dpy, GLXDrawable drawable,
if (pWaitForSbcOML == NULL) if (pWaitForSbcOML == NULL)
return False; return False;
return (*pWaitForSbcOML)(dpy, drawable, target_sbc, ust, msc, sbc); return pWaitForSbcOML(dpy, drawable, target_sbc, ust, msc, sbc);
} }
#undef __FETCH_FUNCTION_PTR #undef __FETCH_FUNCTION_PTR

View File

@@ -854,7 +854,7 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable)
if (pdraw != NULL) { if (pdraw != NULL) {
Bool flush = gc != &dummyContext && drawable == gc->currentDrawable; Bool flush = gc != &dummyContext && drawable == gc->currentDrawable;
(*pdraw->psc->driScreen->swapBuffers)(pdraw, 0, 0, 0, flush); pdraw->psc->driScreen->swapBuffers(pdraw, 0, 0, 0, flush);
return; return;
} }
} }