EXA: fix mixed-pixmaps issue where we could do accel with pixmap mapped

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 <bskeggs@redhat.com>
Acked-By: Michel Dänzer <michel@daenzer.net>

[ Michel Dänzer: This is a 'backport' of commit
  647b79f87a 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 ]
This commit is contained in:
Ben Skeggs 2009-10-24 10:45:49 +10:00 committed by Michel Dänzer
parent 155e61a9f0
commit 17a1614c3b
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}