glx/dri2: Don't call X server for SwapBuffers when there's no back buffer.
authorMichel Dänzer <michel.daenzer@amd.com>
Wed, 14 Sep 2011 16:37:48 +0000 (18:37 +0200)
committerMichel Dänzer <michel@daenzer.net>
Wed, 14 Sep 2011 16:40:16 +0000 (18:40 +0200)
As already done in dri2CopySubBuffer().

Should fix:

https://bugs.freedesktop.org/show_bug.cgi?id=36371
https://bugs.freedesktop.org/show_bug.cgi?id=40533

Might fix:

https://bugs.freedesktop.org/show_bug.cgi?id=32589

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
src/glx/dri2_glx.c

index b83da60fe77c687a8b1b5fb430b4a3de881f8f31..2d72ae05f04c42b203f99ffb39c83d0e112d8616 100644 (file)
@@ -543,6 +543,10 @@ dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor,
        (struct dri2_display *)dpyPriv->dri2Display;
     CARD64 ret = 0;
 
+    /* Check we have the right attachments */
+    if (!priv->have_back)
+       return ret;
+
     /* Old servers can't handle swapbuffers */
     if (!pdp->swapAvailable) {
        dri2CopySubBuffer(pdraw, 0, 0, priv->width, priv->height);