summaryrefslogtreecommitdiff
blob: b6dd10a36dc64a3aa790fe3b5253b4b0f122d20f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Patch from Michel Dänzer on xorg mailing list in the thread
"ProcPutImage calls exaDoMoveOutPixmap, 4x slowdown":

"Looks like we are we're syncing unnecessarily in the migration no-op case"

diff --git a/exa/exa_migration.c b/exa/exa_migration.c
index 56b6945..c68cd76 100644
--- a/exa/exa_migration.c
+++ b/exa/exa_migration.c
@@ -129,6 +131,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
     BoxPtr pBox;
     int nbox;
     Bool access_prepared = FALSE;
+    Bool need_sync = FALSE;
 
     /* Damaged bits are valid in current copy but invalid in other one */
     if (exaPixmapIsOffscreen(pPixmap)) {
@@ -220,14 +253,15 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
 	    exaMemcpyBox (pPixmap, pBox,
 			  fallback_src, fallback_srcpitch,
 			  fallback_dst, fallback_dstpitch);
-	}
+	} else
+	    need_sync = TRUE;
 
 	pBox++;
     }
 
     if (access_prepared)
 	exaFinishAccess(&pPixmap->drawable, fallback_index);
-    else
+    else if (need_sync)
 	sync (pPixmap->drawable.pScreen);
 
     pExaPixmap->offscreen = save_offscreen;