summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Maathuis <madman2003@gmail.com>2009-02-16 17:17:14 +0100
committerMaarten Maathuis <madman2003@gmail.com>2009-02-16 17:41:51 +0100
commit46eeaf82e228df1c5971a24dc815566516e19be9 (patch)
tree103eb0223746a15e455f3da182319c14cbc208a8
parent6198373ff2a8e36113bb1dcaebe975530ff01b86 (diff)
exa: fix performance regression from 736b6fbd2c941b6276066cd1503523edebe7bf3d
- The src optimisation is more aggressive and possibly harmful in light of the new initial state of pixmaps. - There is now actually a performance improvement by almost always keeping the number of rects low.
-rw-r--r--exa/exa.c15
-rw-r--r--exa/exa_migration.c7
2 files changed, 12 insertions, 10 deletions
diff --git a/exa/exa.c b/exa/exa.c
index a77033234..f1ccf9d27 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -285,6 +285,7 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
{
PixmapPtr pPixmap;
ExaPixmapPrivPtr pExaPixmap;
+ BoxRec box;
int driver_alloc = 0;
int bpp;
ExaScreenPriv(pScreen);
@@ -390,9 +391,17 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
pExaPixmap->area = NULL;
- /* None of the pixmap bits are valid initially */
- REGION_NULL(pScreen, &pExaPixmap->validSys);
- REGION_NULL(pScreen, &pExaPixmap->validFB);
+ /* We set the initial pixmap as completely valid for a simple reason.
+ * Imagine a 1000x1000 pixmap, it has 1 million pixels, 250000 of which
+ * could form single pixel rects as part of a region. Setting the complete region
+ * as valid is a natural defragmentation of the region.
+ */
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = w;
+ box.y2 = h;
+ REGION_INIT(pScreen, &pExaPixmap->validSys, &box, 0);
+ REGION_INIT(pScreen, &pExaPixmap->validFB, &box, 0);
exaSetAccelBlock(pExaScr, pExaPixmap,
w, h, bpp);
diff --git a/exa/exa_migration.c b/exa/exa_migration.c
index 861ff2363..59db25b72 100644
--- a/exa/exa_migration.c
+++ b/exa/exa_migration.c
@@ -257,13 +257,6 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
pExaPixmap->offscreen = save_offscreen;
pPixmap->devKind = save_pitch;
- /* Try to prevent source valid region from growing too many rects by
- * removing parts of it which are also in the destination valid region.
- * Removing anything beyond that would lead to data loss.
- */
- if (REGION_NUM_RECTS(pValidSrc) > 10)
- REGION_SUBTRACT(pScreen, pValidSrc, pValidSrc, pValidDst);
-
/* The copied bits are now valid in destination */
REGION_UNION(pScreen, pValidDst, pValidDst, &CopyReg);