XGL/Compiz: Hack against compiz to suppress pixmap corruption and improve performance

Matthias Hopf mhopf at suse.de
Thu Mar 9 06:44:51 PST 2006


On Mar 08, 06 14:31:26 +0100, Francesco Biscani wrote:
> On Monday 06 March 2006 17:00, David Reveman wrote:
> > I think the real problem was a missing call to glFinish in Xgl. It's now
> > fixed in CVS. Let me know if it's still not working properly.
> 
> I tried yesterday's versions of Xgl+Mesa+compiz but the problem is still there 
> for me, unchanged. Erik's patch still solves the issues (both performance and 
> artifact-wise). Let me know if you need more info.

Erik's patch really changed the control flow logic. This shouldn't
happen.

Please try the attached patch, which has even more glFlush() added. This
is a rather inexpensive operation, so it shouldn't do any harm, except
if called in a tight loop.

CU

Matthias

-- 
Matthias Hopf <mhopf at suse.de>       __        __   __
Maxfeldstr. 5 / 90409 Nuernberg    (_   | |  (_   |__         mat at mshopf.de
Phone +49-911-74053-715            __)  |_|  __)  |__  labs   www.mshopf.de
-------------- next part --------------
Index: src/paint.c
===================================================================
RCS file: /cvs/xorg/app/compiz/src/paint.c,v
retrieving revision 1.4
diff -u -p -r1.4 paint.c
--- src/paint.c	1 Mar 2006 16:35:49 -0000	1.4
+++ src/paint.c	9 Mar 2006 14:42:57 -0000
@@ -105,7 +105,7 @@ paintTransformedScreen (CompScreen		*scr
 	    glDisable (GL_STENCIL_TEST);
 
 	    glPopMatrix ();
-
+	    glFlush();
 	    return;
 	}
     }
@@ -124,6 +124,7 @@ paintTransformedScreen (CompScreen		*scr
     }
 
     glPopMatrix ();
+    glFlush();
 }
 
 Bool
@@ -142,7 +143,7 @@ paintScreen (CompScreen		     *screen,
 	    if (mask & PAINT_SCREEN_FULL_MASK)
 	    {
 		(*screen->paintTransformedScreen) (screen, sAttrib, mask);
-
+		glFlush();
 		return TRUE;
 	    }
 
@@ -154,11 +155,14 @@ paintScreen (CompScreen		     *screen,
     else if (mask & PAINT_SCREEN_FULL_MASK)
     {
 	(*screen->paintTransformedScreen) (screen, sAttrib, mask);
-
+	glFlush();
 	return TRUE;
     }
     else
+    {
+	glFlush();
 	return FALSE;
+    }
 
     screenLighting (screen, FALSE);
 
@@ -225,7 +229,7 @@ paintScreen (CompScreen		     *screen,
     }
 
     glPopMatrix ();
-
+    glFlush();
     return TRUE;
 }
 


More information about the xorg mailing list