On Wed, Jun 01, 2011 at 02:49:03PM -0700, Eric Anholt wrote: > This fixes piglit glx-swap-singlebuffer (but not glx-swap-pixmap, > which hits a BadMatch elsewhere that I haven't tracked down), and the > original bug report of glean clipFlat, which was trying to do exactly > this. > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32589 > --- > hw/xfree86/dri2/dri2.c | 18 ++++++++++++++++-- > 1 files changed, 16 insertions(+), 2 deletions(-) > > diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c > index 9ca378f..571f7cf 100644 > --- a/hw/xfree86/dri2/dri2.c > +++ b/hw/xfree86/dri2/dri2.c > @@ -802,9 +802,23 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, > CARD64 target_msc, > if (pPriv->buffers[i]->attachment == DRI2BufferBackLeft) > pSrcBuffer = (DRI2BufferPtr) pPriv->buffers[i]; > } > - if (pSrcBuffer == NULL || pDestBuffer == NULL) { > + > + /* From the GLX 1.4 specification page 34 (page 40 of the PDF): > + * > + * This operation is a no-op if draw was created with a > + * non-double-buffered GLXFBConfig, or if draw is a GLXPixmap. > + * > + * We interpret this as "anything with no backbuffer does nothing > + * for glXSwapBuffers(). See piglit glx-swap-pixmap and > + * glx-swap-singlebuffer. > + */
Shouldn't this be handled in some GLX code? Doing it client side would also avoid the pointless X request. > + if (pSrcBuffer == NULL) { > + return Success; > + } > + > + if (pDestBuffer == NULL) { > xf86DrvMsg(pScreen->myNum, X_ERROR, > - "[DRI2] %s: drawable has no back or front?\n", __func__); > + "[DRI2] %s: drawable has no front?\n", __func__); > return BadDrawable; > } The dest buffer check should happen before the src buffer check to catch clients that attempt to swap without even a dest buffer. -- Ville Syrjälä syrj...@sci.fi http://www.sci.fi/~syrjala/ _______________________________________________ xorg@lists.freedesktop.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: http://lists.freedesktop.org/mailman/listinfo/xorg Your subscription address: arch...@mail-archive.com