2009/12/29 Thomas Hellstrom <thellst...@vmware.com>:
> Kristian,
> I was looking at how Swapbuffers is done with DRI2 when a fake front is
> present:
> The back buffer is copied to the real front, and then the real front is
> copied back to the fake.
> This causes some problems in the vmwgfx drivers where reading from the real
> front should be avoided if at all possible.
> Assuming that apps that really care about stuff X has rendered to the real
> frontbuffer will explicitly call glxWaitX, could we perhaps change this
> behavior to:
> 1) Copy back to fake front.
> 2) Copy fake front to real front.
> Or would that break something?

I think that should be fine, though I prefer copying the back to front
and fake front, when present?  Like the attached patch, which also
avoids flushing and creating the region twice.

diff --git a/src/glx/x11/dri2_glx.c b/src/glx/x11/dri2_glx.c
index 89efe3a..0d3b1a2 100644
--- a/src/glx/x11/dri2_glx.c
+++ b/src/glx/x11/dri2_glx.c
@@ -83,8 +83,6 @@ struct __GLXDRIdrawablePrivateRec
    int have_fake_front;
-static void dri2WaitX(__GLXDRIdrawable * pdraw);
 static void
 dri2DestroyContext(__GLXDRIcontext * context,
                    __GLXscreenConfigs * psc, Display * dpy)
@@ -223,12 +221,10 @@ dri2CopySubBuffer(__GLXDRIdrawable * pdraw,
    /* should get a fence ID back from here at some point */
    DRI2CopyRegion(pdraw->psc->dpy, pdraw->xDrawable, region,
                   DRI2BufferFrontLeft, DRI2BufferBackLeft);
+   if (!priv->have_fake_front) 
+      DRI2CopyRegion(pdraw->psc->dpy, pdraw->xDrawable, region,
+		     DRI2BufferFakerontLeft, DRI2BufferBackLeft);
    XFixesDestroyRegion(pdraw->psc->dpy, region);
-   /* Refresh the fake front (if present) after we just damaged the real
-    * front.
-    */
-   dri2WaitX(pdraw);
 static void
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
Mesa3d-dev mailing list

Reply via email to