The driver only has one reasonable place to look for its context to
flush anything, which is the current context. Don't bother it with
having to check.
CARD64 ret = 0;
#ifdef __DRI2_FLUSH
- if (psc->f)
- (*psc->f->flush)(priv->driDrawable);
+ if (psc->f) {
+ struct glx_context *gc = __glXGetCurrentContext();
+
+ if (gc) {
+ (*psc->f->flush)(priv->driDrawable);
+ }
+ }
#endif
/* Old servers don't send invalidate events */