Commit 9bee1c69 authored by Michel Dänzer's avatar Michel Dänzer
Browse files

EXA: Disable problematic optimization of dest pixmap migration by default.

Also add some code comments about these optimizations.
parent e717409b
......@@ -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);
}
......
......@@ -119,6 +119,7 @@ typedef struct {
enum ExaMigrationHeuristic migration;
Bool checkDirtyCorrectness;
unsigned disableFbCount;
Bool optimize_migration;
} ExaScreenPrivRec, *ExaScreenPrivPtr;
/*
......
......@@ -31,6 +31,12 @@ Disables acceleration of downloading of pixmap data from the framebuffer.
Not usable with drivers which rely on DownloadFromScreen succeeding.
Default: No.
.TP
.BI "Option \*qEXAOptimizeMigration\*q \*q" boolean \*q
Enables an additional optimization for migration of destination pixmaps. This
may improve performance in some cases (e.g. when switching virtual desktops with
no compositing manager) but causes corruption in others (e.g. when starting
compiz). Default: No.
.TP
.BI "Option \*qMigrationHeuristic\*q \*q" anystr \*q
Chooses an alternate pixmap migration heuristic, for debugging purposes. The
default is intended to be the best performing one for general use, though others
......
......@@ -50,6 +50,7 @@ typedef enum {
EXAOPT_NO_COMPOSITE,
EXAOPT_NO_UTS,
EXAOPT_NO_DFS,
EXAOPT_OPTIMIZE_MIGRATION
} EXAOpts;
static const OptionInfoRec EXAOptions[] = {
......@@ -61,6 +62,8 @@ static const OptionInfoRec EXAOptions[] = {
OPTV_BOOLEAN, {0}, FALSE },
{ EXAOPT_NO_DFS, "EXANoDownloadFromScreen",
OPTV_BOOLEAN, {0}, FALSE },
{ EXAOPT_OPTIMIZE_MIGRATION, "EXAOptimizeMigration",
OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL,
OPTV_NONE, {0}, FALSE }
};
......@@ -144,6 +147,11 @@ exaDDXDriverInit(ScreenPtr pScreen)
heuristicName);
}
}
pExaScr->optimize_migration =
xf86ReturnOptValBool(pScreenPriv->options,
EXAOPT_OPTIMIZE_MIGRATION,
FALSE);
}
if (xf86IsOptionSet(pScreenPriv->options, EXAOPT_NO_COMPOSITE)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment