diff options
author | Maarten Maathuis <madman2003@gmail.com> | 2009-02-26 22:18:03 +0100 |
---|---|---|
committer | Maarten Maathuis <madman2003@gmail.com> | 2009-02-27 17:11:35 +0100 |
commit | ed00515ec54b294f304b8ae2857e3073f97860d2 (patch) | |
tree | 30de04d33e9fb54526cf32663d67ff95626e8902 /exa/exa_migration.c | |
parent | 2e88b6004f09dbcb888abf05d4d5554231b2bd1a (diff) |
exa: fixup exaAssertNotDirty.
- Do the right thing based on prepare access.
Diffstat (limited to 'exa/exa_migration.c')
-rw-r--r-- | exa/exa_migration.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/exa/exa_migration.c b/exa/exa_migration.c index 9d0eda0de..8b911500b 100644 --- a/exa/exa_migration.c +++ b/exa/exa_migration.c @@ -545,9 +545,9 @@ exaAssertNotDirty (PixmapPtr pPixmap) ExaPixmapPriv (pPixmap); CARD8 *dst, *src; RegionRec ValidReg; - int dst_pitch, src_pitch, cpp, y, nbox; + int dst_pitch, src_pitch, cpp, y, nbox, save_pitch; BoxPtr pBox; - Bool ret = TRUE; + Bool ret = TRUE, save_offscreen; if (exaPixmapIsPinned(pPixmap) || pExaPixmap->area == NULL) return ret; @@ -566,7 +566,14 @@ exaAssertNotDirty (PixmapPtr pPixmap) src_pitch = pExaPixmap->fb_pitch; cpp = pPixmap->drawable.bitsPerPixel / 8; - ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC); + save_offscreen = pExaPixmap->offscreen; + save_pitch = pPixmap->devKind; + pExaPixmap->offscreen = TRUE; + pPixmap->devKind = pExaPixmap->fb_pitch; + + if (!ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC)) + goto skip; + while (nbox--) { int rowbytes; @@ -579,7 +586,7 @@ exaAssertNotDirty (PixmapPtr pPixmap) continue; rowbytes = (pBox->x2 - pBox->x1) * cpp; - src = pExaPixmap->fb_ptr + pBox->y1 * src_pitch + pBox->x1 * cpp; + src = (CARD8 *) pPixmap->devPrivate.ptr + pBox->y1 * src_pitch + pBox->x1 * cpp; dst = pExaPixmap->sys_ptr + pBox->y1 * dst_pitch + pBox->x1 * cpp; for (y = pBox->y1; y < pBox->y2; @@ -592,8 +599,13 @@ exaAssertNotDirty (PixmapPtr pPixmap) } } } + +skip: exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC); + pExaPixmap->offscreen = save_offscreen; + pPixmap->devKind = save_pitch; + out: REGION_UNINIT(pScreen, &ValidReg); return ret; |