[PATCH] dri2: avoid crash with old dri drivers.

Michel Dänzer michel at daenzer.net
Mon Jun 21 01:07:40 PDT 2010


On Mon, 2010-06-21 at 14:08 +1000, Dave Airlie wrote: 
> From: Dave Airlie <airlied at redhat.com>
> 
> I built latest server and copied over a mesa 7.8 dri2 driver to use with it,
> and it crashed in here starting compiz. Looks like we need to validate the
> flush extension is registered before calling invalidate.
> 
> Signed-off-by: Dave Airlie <airlied at redhat.com>

Reviewed-by: Michel Dänzer <michel at daenzer.net>


> ---
>  glx/glxdri2.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/glx/glxdri2.c b/glx/glxdri2.c
> index 177c73c..970a51a 100644
> --- a/glx/glxdri2.c
> +++ b/glx/glxdri2.c
> @@ -435,7 +435,8 @@ __glXDRIinvalidateBuffers(DrawablePtr pDraw, void *priv)
>      __GLXDRIdrawable *private = priv;
>      __GLXDRIscreen *screen = private->screen;
>  
> -    (*screen->flush->invalidate)(private->driDrawable);
> +    if (screen->flush)
> +	(*screen->flush->invalidate)(private->driDrawable);
>  #endif
>  }


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the xorg-devel mailing list