summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2011-09-14 18:37:48 +0200
committerMarek Olšák <maraeo@gmail.com>2011-10-02 03:54:02 +0200
commit942c1b8de16a9abde2edf9193a731984766e4913 (patch)
treec82f3a3dc217ed6f6f3094aec0efdcf64fbde7be
parent0502da1ade9d887ed4ee1a4b42ba01a5e78c8e6f (diff)
glx/dri2: Don't call X server for SwapBuffers when there's no back buffer.
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> (cherry picked from commit d8c443ddde5e9734d60b63b3ec3b5a5ba756d022)
-rw-r--r--src/glx/dri2_glx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index f093f0f31ad..2ee3cec482a 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -539,6 +539,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);