29edb58
From 7efbe71629d31d79ab95cc1dae93f0fa742e9533 Mon Sep 17 00:00:00 2001
29edb58
From: Ben Skeggs <bskeggs@redhat.com>
29edb58
Date: Thu, 22 Oct 2009 11:31:22 +1000
29edb58
Subject: [PATCH] EXA: fix mixed-pixmaps issue where we could do accel with pixmap mapped
29edb58
MIME-Version: 1.0
29edb58
Content-Type: text/plain; charset=UTF-8
29edb58
Content-Transfer-Encoding: 8bit
29edb58
29edb58
The problem occurs in the following situation:
29edb58
29edb58
1. Create Pixmap
29edb58
2. Software fallback on pixmap: pExaPixmap->pDamage created
29edb58
3. Accel to pixmap: driver pixmap created, exaPixmapIsOffscreen() now true
29edb58
4. Software fallback on pixmap
29edb58
4.1: PrepareAccess() from driver succeeds, so no DFS to system memory copy
29edb58
4.2: Software rendering...
29edb58
4.3: (pExaPixmap->pDamage && exaPixmapIsOffscreen()) is true, so we try
29edb58
     to (incorrectly) UTS the data back to the driver pixmap, when we
29edb58
     should just call the driver's FinishAccess() hook.
29edb58
4.4: fail
29edb58
29edb58
The patch adds an additional check on pExaPixmap->offscreen, which should
29edb58
(for the cases exaPixmapIsOffscreen() will return true) only be FALSE
29edb58
when we haven't used PrepareAccess() on the pixmap.
29edb58
29edb58
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
29edb58
Acked-By: Michel Dänzer <michel@daenzer.net>
29edb58
---
29edb58
 exa/exa_migration_mixed.c |    3 ++-
29edb58
 1 files changed, 2 insertions(+), 1 deletions(-)
29edb58
29edb58
diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
29edb58
index f42c9c2..52b18b4 100644
29edb58
--- a/exa/exa_migration_mixed.c
29edb58
+++ b/exa/exa_migration_mixed.c
29edb58
@@ -202,7 +202,8 @@ void exaFinishAccess_mixed(PixmapPtr pPixmap, int index)
29edb58
 {
29edb58
     ExaPixmapPriv(pPixmap);
29edb58
 
29edb58
-    if (pExaPixmap->pDamage && exaPixmapIsOffscreen(pPixmap)) {
29edb58
+    if (pExaPixmap->pDamage && exaPixmapIsOffscreen(pPixmap) &&
29edb58
+	!pExaPixmap->offscreen) {
29edb58
 	DamageRegionProcessPending(&pPixmap->drawable);
29edb58
 	exaMoveInPixmap_mixed(pPixmap);
29edb58
     }
29edb58
-- 
29edb58
1.6.5.rc2
29edb58