xserver: Branch 'master' - 3 commits

Keith Packard keithp at kemper.freedesktop.org
Wed Feb 2 14:54:47 PST 2011


 exa/exa.c                 |    3 ++-
 exa/exa_driver.c          |    2 ++
 exa/exa_migration_mixed.c |   17 +++++++++++++----
 3 files changed, 17 insertions(+), 5 deletions(-)

New commits:
commit 541b25038a5de74411a094570b407c5ae018c2ba
Author: Maarten Maathuis <madman2003 at gmail.com>
Date:   Sun Jan 30 14:06:16 2011 +0100

    exa/mixed: Exclude frontbuffer from deferred pixmap handling.
    
    - Apps like xterm can trigger a lot of fallback rendering.
    - This can lead to (annoyingly) high latencies, because you
      have to wait for the block handler.
    - You need a driver that doesn't directly access the front
      buffer to trigger this (NV50+ nouveau for example).
    - Repeatingly doing dmesg on an xterm with a bitmap font
      will reveal that you never see part of the text.
    - I have recieved at least one complaint in the past of slow
      terminal performance, which was related to core font
      rendering.
    - This does sacrifice some throughput, roughly 33% slower.
    
    Reviewed-by: Michel Dänzer <michel at daenzer.net>
    Signed-off-by: Maarten Maathuis <madman2003 at gmail.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
index fb47151..4f49905 100644
--- a/exa/exa_migration_mixed.c
+++ b/exa/exa_migration_mixed.c
@@ -138,6 +138,7 @@ void
 exaDamageReport_mixed(DamagePtr pDamage, RegionPtr pRegion, void *closure)
 {
     PixmapPtr pPixmap = closure;
+    ScreenPtr pScreen = pPixmap->drawable.pScreen;
     ExaPixmapPriv(pPixmap);
 
     /* Move back results of software rendering on system memory copy of mixed driver
@@ -149,10 +150,18 @@ exaDamageReport_mixed(DamagePtr pDamage, RegionPtr pRegion, void *closure)
     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;
+	/* Front buffer: Don't wait for the block handler to copy back the data.
+	 * This avoids annoying latency if you encounter a lot of software rendering.
+	 */
+	if (pPixmap == pScreen->GetScreenPixmap(pScreen))
+		exaMoveInPixmap_mixed(pPixmap);
+	else {
+		if (pExaScr->deferred_mixed_pixmap &&
+		    pExaScr->deferred_mixed_pixmap != pPixmap)
+		    exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap);
+
+		pExaScr->deferred_mixed_pixmap = pPixmap;
+	}
     }
 }
 
commit af87f6367ef733d1a4f3cfca4eeb92bfd84c2b6f
Author: Maarten Maathuis <madman2003 at gmail.com>
Date:   Sun Jan 30 14:06:15 2011 +0100

    exa: Only call driver FinishAccess hook if PrepareAccess hook succeeded.
    
    Reviewed-by: Michel Dänzer <michel at daenzer.net>
    Signed-off-by: Maarten Maathuis <madman2003 at gmail.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/exa/exa.c b/exa/exa.c
index 8adf847..a4e294a 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -421,7 +421,8 @@ exaFinishAccess(DrawablePtr pDrawable, int index)
     /* We always hide the devPrivate.ptr. */
     pPixmap->devPrivate.ptr = NULL;
 
-    if (!pExaScr->info->FinishAccess || !exaPixmapHasGpuCopy(pPixmap))
+    /* Only call FinishAccess if PrepareAccess was called and succeeded. */
+    if (!pExaScr->info->FinishAccess || !pExaScr->access[i].retval)
 	return;
 
     if (i >= EXA_PREPARE_AUX_DEST &&
commit 648d4fe5172cad33c6f09e05dd3d8d7171ef1a7f
Author: Maarten Maathuis <madman2003 at gmail.com>
Date:   Sun Jan 30 14:06:14 2011 +0100

    exa/driver: set pExaPixmap->use_gpu_copy to the right value
    
    - Not sure if it was causing problems, but you never know.
    
    Reviewed-by: Michel Dänzer <michel at daenzer.net>
    Signed-off-by: Maarten Maathuis <madman2003 at gmail.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/exa/exa_driver.c b/exa/exa_driver.c
index a913cfb..b9903d1 100644
--- a/exa/exa_driver.c
+++ b/exa/exa_driver.c
@@ -115,6 +115,8 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
     exaSetAccelBlock(pExaScr, pExaPixmap,
                      w, h, bpp);
 
+    pExaPixmap->use_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
+
     /* During a fallback we must prepare access. */
     if (pExaScr->fallback_counter)
 	exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_AUX_DEST);


More information about the xorg-commit mailing list