dri2: avoid crash with old dri drivers.

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@redhat.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Dave Airlie 2010-06-21 14:08:50 +10:00 committed by Keith Packard
parent 80d1a548d6
commit c6bc52cb66

View File

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