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 <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18473>
This commit is contained in:
Adam Jackson 2022-08-05 17:52:11 -04:00 committed by Marge Bot
parent 333895bebc
commit fed3643eb9

View file

@ -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;