From 53a6c15a23012385c1bb153f5b36c252e77da168 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 21 Aug 2009 12:12:41 +0100 Subject: 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. --- src/glamo-kms-exa.c | 25 +++++++------------------ 1 file 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; } -- cgit v1.2.3