Here's a compiz patch to assume the presence of a sane glXSwapBuffer
implementation (i.e. one that uses page flips synchronized to vblank).

It adds --no-wait and --always-swap options, which, if used with the
swapbuffers patchset, will make compiz use the page flipping path for
tear-free drawing.

Jesse
diff -X /home/jbarnes/dontdiff -Naur compiz-0.8.2.orig/include/compiz-core.h compiz-0.8.2/include/compiz-core.h
--- compiz-0.8.2.orig/include/compiz-core.h	2009-05-06 16:18:29.000000000 -0700
+++ compiz-0.8.2/include/compiz-core.h	2009-05-07 11:35:37.000000000 -0700
@@ -219,6 +219,8 @@
 extern Bool       noDetection;
 extern Bool	  useDesktopHints;
 extern Bool       onlyCurrentScreen;
+extern Bool       noWait;
+extern Bool       alwaysSwap;
 
 extern int  defaultRefreshRate;
 extern char *defaultTextureFilter;
diff -X /home/jbarnes/dontdiff -Naur compiz-0.8.2.orig/src/display.c compiz-0.8.2/src/display.c
--- compiz-0.8.2.orig/src/display.c	2009-05-06 16:18:29.000000000 -0700
+++ compiz-0.8.2/src/display.c	2009-05-07 11:44:51.000000000 -0700
@@ -1553,9 +1553,11 @@
 			targetScreen = NULL;
 			targetOutput = &s->outputDev[0];
 
-			waitForVideoSync (s);
+			if (!(noWait == TRUE))
+			    waitForVideoSync (s);
 
-			if (mask & COMP_SCREEN_DAMAGE_ALL_MASK)
+			if ((mask & COMP_SCREEN_DAMAGE_ALL_MASK) ||
+			    (alwaysSwap == TRUE))
 			{
 			    glXSwapBuffers (d->display, s->output);
 			}
diff -X /home/jbarnes/dontdiff -Naur compiz-0.8.2.orig/src/main.c compiz-0.8.2/src/main.c
--- compiz-0.8.2.orig/src/main.c	2009-02-16 05:57:22.000000000 -0800
+++ compiz-0.8.2/src/main.c	2009-05-07 11:34:56.000000000 -0700
@@ -63,6 +63,8 @@
 Bool noDetection = FALSE;
 Bool useDesktopHints = FALSE;
 Bool onlyCurrentScreen = FALSE;
+Bool noWait = FALSE;
+Bool alwaysSwap = FALSE;
 static Bool debugOutput = FALSE;
 
 #ifdef USE_COW
@@ -87,6 +89,8 @@
 	    "[--sm-disable] "
 	    "[--sm-client-id ID] "
 	    "[--only-current-screen]\n      "
+	    "[--no-wait]      "
+	    "[--always-swap]\n      "
 
 #ifdef USE_COW
 	    " [--use-root-window] "
@@ -373,6 +377,14 @@
 	    if (i + 1 < argc)
 		backgroundImage = argv[++i];
 	}
+	else if (!strcmp (argv[i], "--no-wait"))
+	{
+	    noWait = TRUE;
+	}
+	else if (!strcmp (argv[i], "--always-swap"))
+	{
+	    alwaysSwap = TRUE;
+	}
 	else if (*argv[i] == '-')
 	{
 	    compLogMessage ("core", CompLogLevelWarn,
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to