exa: fix performance regression from 736b6fbd2c
- 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.
This commit is contained in:
parent
6198373ff2
commit
46eeaf82e2
15
exa/exa.c
15
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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user