diff options
author | Michel Dänzer <daenzer@vmware.com> | 2009-12-29 12:51:29 +0100 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-12-29 11:04:51 -0800 |
commit | 0c1f43c0f3e888172f11f62a2f208af70e0183cc (patch) | |
tree | c6170151897fef902c3915c3f5ad52ed11973702 /exa/exa_migration_mixed.c | |
parent | 08bf26c28fc8147b64f2fe8345b9581e0101571c (diff) |
EXA/mixed: Handle results of software fallbacks in DamageReport hook.
This is more elegant and probably also slightly more correct than doing it
at FinishAccess time.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Acked-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'exa/exa_migration_mixed.c')
-rw-r--r-- | exa/exa_migration_mixed.c | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c index 14cb5a763..6816e6c9b 100644 --- a/exa/exa_migration_mixed.c +++ b/exa/exa_migration_mixed.c @@ -134,10 +134,32 @@ exaMoveInPixmap_mixed(PixmapPtr pPixmap) exaDoMigration(pixmaps, 1, TRUE); } +void +exaDamageReport_mixed(DamagePtr pDamage, RegionPtr pRegion, void *closure) +{ + PixmapPtr pPixmap = closure; + ExaPixmapPriv(pPixmap); + + /* Move back results of software rendering on system memory copy of mixed driver + * pixmap (see exaPrepareAccessReg_mixed). + * + * Defer moving the destination back into the driver pixmap, to try and save + * overhead on multiple subsequent software fallbacks. + */ + if (!pExaPixmap->use_gpu_copy && exaPixmapHasGpuCopy(pPixmap)) { + ExaScreenPriv(pPixmap->drawable.pScreen); + + if (pExaScr->deferred_mixed_pixmap && + pExaScr->deferred_mixed_pixmap != pPixmap) + exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap); + pExaScr->deferred_mixed_pixmap = pPixmap; + } +} + /* With mixed pixmaps, if we fail to get direct access to the driver pixmap, we * use the DownloadFromScreen hook to retrieve contents to a copy in system * memory, perform software rendering on that and move back the results with the - * UploadToScreen hook (see exaFinishAccess_mixed). + * UploadToScreen hook (see exaDamageReport_mixed). */ void exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg) @@ -172,8 +194,9 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg) Bool as_dst = pixmaps[0].as_dst; /* Set up damage tracking */ - pExaPixmap->pDamage = DamageCreate(NULL, NULL, DamageReportNone, - TRUE, pPixmap->drawable.pScreen, + pExaPixmap->pDamage = DamageCreate(exaDamageReport_mixed, NULL, + DamageReportNonEmpty, TRUE, + pPixmap->drawable.pScreen, pPixmap); DamageRegister(&pPixmap->drawable, pExaPixmap->pDamage); @@ -224,29 +247,3 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg) } } -/* Move back results of software rendering on system memory copy of mixed driver - * pixmap (see exaPrepareAccessReg_mixed). - * - * Defer moving the destination back into the driver pixmap, to try and save - * overhead on multiple consequent software fallbacks. - */ -void exaFinishAccess_mixed(PixmapPtr pPixmap, int index) -{ - ExaPixmapPriv(pPixmap); - - if (pExaPixmap->pDamage && !pExaPixmap->use_gpu_copy && - exaPixmapHasGpuCopy(pPixmap)) { - DamageRegionProcessPending(&pPixmap->drawable); - - if (index == EXA_PREPARE_DEST || index == EXA_PREPARE_AUX_DEST) { - ExaScreenPriv(pPixmap->drawable.pScreen); - - if (pExaScr->deferred_mixed_pixmap && - pExaScr->deferred_mixed_pixmap != pPixmap) - exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap); - pExaScr->deferred_mixed_pixmap = pPixmap; - pPixmap->devKind = pExaPixmap->fb_pitch; - } else - exaMoveInPixmap_mixed(pPixmap); - } -} |