From 3d13865e7dc977840be7a7078d37d9b61fa70f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 5 Apr 2012 13:18:15 +0200 Subject: [PATCH 1/2] EXA/mixed: Always create damage record for pixmaps initially. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise there will be no damage information available when it's needed for the first time. --- exa/exa_mixed.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c index 0b1a4a4..35de068 100644 --- a/exa/exa_mixed.c +++ b/exa/exa_mixed.c @@ -81,7 +81,16 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth, pExaPixmap->area = NULL; pExaPixmap->fb_ptr = NULL; - pExaPixmap->pDamage = NULL; + + /* Set up damage tracking */ + pExaPixmap->pDamage = DamageCreate(exaDamageReport_mixed, NULL, + DamageReportNonEmpty, TRUE, + pPixmap->drawable.pScreen, + pPixmap); + DamageRegister(&pPixmap->drawable, pExaPixmap->pDamage); + /* This ensures that pending damage reflects the current operation. */ + /* This is used by exa to optimize migration. */ + DamageSetReportAfterOp(pExaPixmap->pDamage, TRUE); exaSetFbPitch(pExaScr, pExaPixmap, w, h, bpp); exaSetAccelBlock(pExaScr, pExaPixmap, @@ -99,17 +108,6 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth, if (w == 1 && h == 1) { pExaPixmap->sys_ptr = malloc(paddedWidth); - - /* Set up damage tracking */ - pExaPixmap->pDamage = DamageCreate(exaDamageReport_mixed, NULL, - DamageReportNonEmpty, TRUE, - pPixmap->drawable.pScreen, - pPixmap); - - DamageRegister(&pPixmap->drawable, pExaPixmap->pDamage); - /* This ensures that pending damage reflects the current operation. */ - /* This is used by exa to optimize migration. */ - DamageSetReportAfterOp(pExaPixmap->pDamage, TRUE); } } @@ -190,9 +188,6 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth, if (pExaPixmap->sys_ptr) { free(pExaPixmap->sys_ptr); pExaPixmap->sys_ptr = NULL; - DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage); - DamageDestroy(pExaPixmap->pDamage); - pExaPixmap->pDamage = NULL; RegionEmpty(&pExaPixmap->validSys); if (pExaScr->deferred_mixed_pixmap == pPixmap) -- 1.7.10