summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2009-08-21 12:12:41 +0100
committerThomas White <taw@bitwiz.org.uk>2009-08-21 12:12:41 +0100
commit53a6c15a23012385c1bb153f5b36c252e77da168 (patch)
tree366d1cc1206b2c7b29c3dd45d14aaf27ede15084
parent7ba80e79f33439d5a97fd20a69c1ff159e7a6440 (diff)
Don't unmap on FinishAccess, and return as quickly as possible on re-map
Combined with mixed mode pixmaps, this brings the speed up to about where it should be.
-rw-r--r--src/glamo-kms-exa.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/glamo-kms-exa.c b/src/glamo-kms-exa.c
index 8779f5d..b6226a3 100644
--- a/src/glamo-kms-exa.c
+++ b/src/glamo-kms-exa.c
@@ -450,6 +450,12 @@ static Bool GlamoKMSExaPrepareAccess(PixmapPtr pPix, int index)
return TRUE;
}
+ /* Return as quickly as possible if we have a mapping already */
+ if ( driver_priv->bo->virtual ) {
+ pPix->devPrivate.ptr = driver_priv->bo->virtual;
+ return TRUE;
+ }
+
if ( glamo_bo_map(driver_priv->bo, 1) ) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"%s: bo map failed\n", __FUNCTION__);
@@ -463,24 +469,7 @@ static Bool GlamoKMSExaPrepareAccess(PixmapPtr pPix, int index)
static void GlamoKMSExaFinishAccess(PixmapPtr pPix, int index)
{
- ScreenPtr screen = pPix->drawable.pScreen;
- ScrnInfoPtr pScrn = xf86Screens[screen->myNum];
- struct glamo_exa_pixmap_priv *driver_priv;
-
- driver_priv = exaGetPixmapDriverPrivate(pPix);
- if (!driver_priv) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "%s: no driver private?\n", __FUNCTION__);
- return;
- }
-
- if (!driver_priv->bo) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "%s: no buffer object?\n", __FUNCTION__);
- return;
- }
-
- glamo_bo_unmap(driver_priv->bo);
+ /* Leave the mapping intact for fast restoration of access later */
pPix->devPrivate.ptr = NULL;
}