[Mesa-dev] [PATCH 1/2] glx: Avoid calling __glXInitialize() in driReleaseDrawables().

Ian Romanick idr at freedesktop.org
Mon Jul 18 11:40:03 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/17/2011 04:41 PM, Henri Verbeet wrote:
> This fixes a regression introduced by commit
> a26121f37530619610a78a5fbe5ef87e44047fda (fd.o bug #39219).
> 
> Since the __glXInitialize() call should be unnecessary anyway, this is
> probably a nicer fix for the original problem too.
> 
> NOTE: This is a candidate for the 7.10 and 7.11 branches.
> 
> Signed-off-by: Henri Verbeet <hverbeet at gmail.com>

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

If this made things work on the reporter's machine, you should add a
Tested-by too.

> ---
>  src/glx/dri_common.c |    2 +-
>  src/glx/glxext.c     |   11 +++--------
>  2 files changed, 4 insertions(+), 9 deletions(-)
> 
> diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c
> index bac0c9e..e7dba5a 100644
> --- a/src/glx/dri_common.c
> +++ b/src/glx/dri_common.c
> @@ -388,7 +388,7 @@ driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable)
>  _X_HIDDEN void
>  driReleaseDrawables(struct glx_context *gc)
>  {
> -   struct glx_display *const priv = __glXInitialize(gc->psc->dpy);
> +   const struct glx_display *priv = gc->psc->display;
>     __GLXDRIdrawable *pdraw;
>  
>     if (priv == NULL)
> diff --git a/src/glx/glxext.c b/src/glx/glxext.c
> index 8704c48..8254544 100644
> --- a/src/glx/glxext.c
> +++ b/src/glx/glxext.c
> @@ -260,24 +260,19 @@ glx_display_free(struct glx_display *priv)
>  static int
>  __glXCloseDisplay(Display * dpy, XExtCodes * codes)
>  {
> -   struct glx_display *priv, **prev, *next;
> +   struct glx_display *priv, **prev;
>  
>     _XLockMutex(_Xglobal_lock);
>     prev = &glx_displays;
>     for (priv = glx_displays; priv; prev = &priv->next, priv = priv->next) {
>        if (priv->dpy == dpy) {
> +         *prev = priv->next;
>  	 break;
>        }
>     }
> +   _XUnlockMutex(_Xglobal_lock);
>  
> -   /* Only remove the display from the list after it's destroyed. The cleanup
> -    * code (e.g. driReleaseDrawables()) ends up calling __glXInitialize(),
> -    * which would create a new glx_display while we're trying to destroy this
> -    * one. */
> -   next = priv->next;
>     glx_display_free(priv);
> -   *prev = next;
> -   _XUnlockMutex(_Xglobal_lock);
>  
>     return 1;
>  }

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk4kfgMACgkQX1gOwKyEAw9O/ACdGgSVIvnuSackV4cQCR2tKnOf
hKMAn39DuCOANrqt8RBl7cEllSDZQJ4b
=KZVd
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list