summaryrefslogtreecommitdiff
path: root/exa
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-11-07 18:56:45 +0100
committerMichel Dänzer <michel@tungstengraphics.com>2007-11-07 19:01:24 +0100
commit9bee1c6912817f65bbb8cf4078f0ad016d9d51cb (patch)
tree30b350c0947fbeadf7bc52c1ed40a4b8c7f2b7e7 /exa
parente717409bae355df9a617a226f12fbb8c54ae77e5 (diff)
EXA: Disable problematic optimization of dest pixmap migration by default.
Also add some code comments about these optimizations.
Diffstat (limited to 'exa')
-rw-r--r--exa/exa_migration.c33
-rw-r--r--exa/exa_priv.h1
2 files changed, 26 insertions, 8 deletions
diff --git a/exa/exa_migration.c b/exa/exa_migration.c
index d69526b7f..d3646b0b6 100644
--- a/exa/exa_migration.c
+++ b/exa/exa_migration.c
@@ -153,22 +153,39 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
REGION_SUBTRACT(pScreen, &CopyReg, pValidSrc, pValidDst);
if (migrate->as_dst) {
- RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage);
+ ExaScreenPriv (pPixmap->drawable.pScreen);
- if (REGION_NIL(pending_damage)) {
- static Bool firsttime = TRUE;
+ /* XXX: The pending damage region will be marked as damaged after the
+ * operation, so it should serve as an upper bound for the region that
+ * needs to be synchronized for the operation. Unfortunately, this
+ * causes corruption in some cases, e.g. when starting compiz. See
+ * https://bugs.freedesktop.org/show_bug.cgi?id=12916 .
+ */
+ if (pExaScr->optimize_migration) {
+ RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage);
+
+ if (REGION_NIL(pending_damage)) {
+ static Bool firsttime = TRUE;
- if (firsttime) {
- ErrorF("%s: Pending damage region empty!\n", __func__);
- firsttime = FALSE;
+ if (firsttime) {
+ ErrorF("%s: Pending damage region empty!\n", __func__);
+ firsttime = FALSE;
+ }
}
- }
- REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, pending_damage);
+ REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, pending_damage);
+ }
+ /* The caller may provide a region to be subtracted from the calculated
+ * dirty region. This is to avoid migration of bits that don't
+ * contribute to the result of the operation.
+ */
if (migrate->pReg)
REGION_SUBTRACT(pScreen, &CopyReg, &CopyReg, migrate->pReg);
} else {
+ /* The caller may restrict the region to be migrated for source pixmaps
+ * to what's relevant for the operation.
+ */
if (migrate->pReg)
REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, migrate->pReg);
}
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index a69536372..7656a0278 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -119,6 +119,7 @@ typedef struct {
enum ExaMigrationHeuristic migration;
Bool checkDirtyCorrectness;
unsigned disableFbCount;
+ Bool optimize_migration;
} ExaScreenPrivRec, *ExaScreenPrivPtr;
/*