[PATCH 2/4] glxdri2: Hard-code the extension version we need

Ian Romanick idr at freedesktop.org
Mon May 3 11:38:26 PDT 2010


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

Kristian Høgsberg wrote:
> If we use the #define'd version from dri_interface.h, the server will
> require at least that version of the extension.  If we're compiling against
> a dri_interface.h with a newer version we don't really require, glxdri2
> will require a too high version of the extension.
> 
> The right approach is to just hard-code the version we need instead of
> using the #defines.
> 
> Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>

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

It seems like we keep fixing instances of this problem throughout the
server. :(

> ---
>  glx/glxdri2.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/glx/glxdri2.c b/glx/glxdri2.c
> index 74d6ebc..c34e29a 100644
> --- a/glx/glxdri2.c
> +++ b/glx/glxdri2.c
> @@ -653,7 +653,7 @@ initializeExtensions(__GLXDRIscreen *screen)
>  
>  #ifdef __DRI2_FLUSH
>  	if (strcmp(extensions[i]->name, __DRI2_FLUSH) == 0 &&
> -	    extensions[i]->version >= __DRI2_FLUSH_VERSION) {
> +	    extensions[i]->version >= 3) {
>  		screen->flush = (__DRI2flushExtension *) extensions[i];
>  	}
>  #endif
> @@ -713,11 +713,11 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
>      
>      for (i = 0; extensions[i]; i++) {
>          if (strcmp(extensions[i]->name, __DRI_CORE) == 0 &&
> -	    extensions[i]->version >= __DRI_CORE_VERSION) {
> +	    extensions[i]->version >= 1) {
>  		screen->core = (const __DRIcoreExtension *) extensions[i];
>  	}
>          if (strcmp(extensions[i]->name, __DRI_DRI2) == 0 &&
> -	    extensions[i]->version >= __DRI_DRI2_VERSION) {
> +	    extensions[i]->version >= 1) {
>  		screen->dri2 = (const __DRIdri2Extension *) extensions[i];
>  	}
>      }

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

iEYEARECAAYFAkvfGCEACgkQX1gOwKyEAw85GACfd2WpiXpONJfV/kDjqgtyhvjp
bvQAn0vh3sIikOP075Laa4HhxQTgt9hI
=L4cg
-----END PGP SIGNATURE-----


More information about the xorg-devel mailing list