From 17a1614c3b7410581d885be5f8f76aa7b3e2c070 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Sat, 24 Oct 2009 10:45:49 +1000 Subject: [PATCH] EXA: fix mixed-pixmaps issue where we could do accel with pixmap mapped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The problem occurs in the following situation: 1. Create Pixmap 2. Software fallback on pixmap: pExaPixmap->pDamage created 3. Accel to pixmap: driver pixmap created, exaPixmapIsOffscreen() now true 4. Software fallback on pixmap 4.1: PrepareAccess() from driver succeeds, so no DFS to system memory copy 4.2: Software rendering... 4.3: (pExaPixmap->pDamage && exaPixmapIsOffscreen()) is true, so we try to (incorrectly) UTS the data back to the driver pixmap, when we should just call the driver's FinishAccess() hook. 4.4: fail The patch adds an additional check on pExaPixmap->offscreen, which should (for the cases exaPixmapIsOffscreen() will return true) only be FALSE when we haven't used PrepareAccess() on the pixmap. Signed-off-by: Ben Skeggs Acked-By: Michel Dänzer [ Michel Dänzer: This is a 'backport' of commit 647b79f87a9891225678dc6fc2fbda3bdef8fa9d from master - actually this patch was submitted first but didn't apply to master anymore, so technically the other change is a 'forward port' of this one ] --- exa/exa_migration_mixed.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c index f42c9c233..52b18b4cb 100644 --- a/exa/exa_migration_mixed.c +++ b/exa/exa_migration_mixed.c @@ -202,7 +202,8 @@ void exaFinishAccess_mixed(PixmapPtr pPixmap, int index) { ExaPixmapPriv(pPixmap); - if (pExaPixmap->pDamage && exaPixmapIsOffscreen(pPixmap)) { + if (pExaPixmap->pDamage && exaPixmapIsOffscreen(pPixmap) && + !pExaPixmap->offscreen) { DamageRegionProcessPending(&pPixmap->drawable); exaMoveInPixmap_mixed(pPixmap); }