From fed3643eb9a25e2d1a2cd44e641a12d72cd6daee Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 5 Aug 2022 17:52:11 -0400 Subject: [PATCH] glx/dri: Avoid a weird indirection in driFetchDrawable The gc already has ->psc set, just use it rather than walking all the way back to the display private to find it. Reviewed-by: Emma Anholt Part-of: --- src/glx/dri_common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c index 16f1613013e..d806d8cab41 100644 --- a/src/glx/dri_common.c +++ b/src/glx/dri_common.c @@ -342,7 +342,7 @@ driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable) Display *dpy = gc->psc->dpy; struct glx_display *const priv = __glXInitialize(dpy); __GLXDRIdrawable *pdraw; - struct glx_screen *psc; + struct glx_screen *psc = gc->psc; struct glx_config *config = gc->config; unsigned int type; @@ -352,7 +352,6 @@ driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable) if (glxDrawable == None) return NULL; - psc = priv->screens[gc->screen]; if (priv->drawHash == NULL) return NULL; @@ -366,7 +365,7 @@ driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable) /* if this is a no-config context, infer the fbconfig from the drawable */ if (config == NULL) - config = driInferDrawableConfig(gc->psc, glxDrawable); + config = driInferDrawableConfig(psc, glxDrawable); if (config == NULL) return NULL;