xserver: Branch 'server-1.7-nominations' - 2 commits

Michel Dänzer daenzer at kemper.freedesktop.org
Tue Dec 1 07:52:30 PST 2009


 exa/exa_migration_mixed.c |    3 ++-
 exa/exa_offscreen.c       |   25 +------------------------
 2 files changed, 3 insertions(+), 25 deletions(-)

New commits:
commit dde1f688006e08e26a8a43d0dbb877b8ea169825
Author: Michel Dänzer <daenzer at vmware.com>
Date:   Mon Nov 30 13:17:52 2009 +0100

    EXA: Don't defragment offscreen memory at allocation time.
    
    Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24300 .
    
    Offscreen memory allocation can occur from various places, and apparently
    doing defragmentation from at least some of them can confuse some driver
    acceleration code.
    
    There's still the regular background defragmentation in the WakeupHandler,
    which should manage to keep fragmentation at a reasonable level.
    
    Signed-off-by: Michel Dänzer <daenzer at vmware.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 8754db77d8169e5ea506a963cebee1a651bcf094)

diff --git a/exa/exa_offscreen.c b/exa/exa_offscreen.c
index eb53b2a..2ec4174 100644
--- a/exa/exa_offscreen.c
+++ b/exa/exa_offscreen.c
@@ -169,7 +169,7 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
 {
     ExaOffscreenArea *area;
     ExaScreenPriv (pScreen);
-    int real_size = 0, free_total = 0, largest_avail = 0;
+    int real_size = 0, largest_avail = 0;
 #if DEBUG_OFFSCREEN
     static int number = 0;
     ErrorF("================= ============ allocating a new pixmap %d\n", ++number);
@@ -208,33 +208,10 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
 	if (real_size <= area->size)
 	    break;
 
-	free_total += area->size;
-
 	if (area->size > largest_avail)
 	    largest_avail = area->size;
     }
 
-    if (!area && free_total >= size) {
-	CARD32 now = GetTimeInMillis();
-
-	/* Don't defragment more than once per second, to avoid adding more
-	 * overhead than we're trying to prevent
-	 */
-	if (abs((INT32) (now - pExaScr->lastDefragment)) > 1000) {
-	    area = ExaOffscreenDefragment(pScreen);
-	    pExaScr->lastDefragment = now;
-
-	    if (area) {
-		/* adjust size to match alignment requirement */
-		real_size = size + (area->base_offset + area->size - size) % align;
-
-		/* does it fit? */
-		if (real_size > area->size)
-		    area = NULL;
-	    }
-	}
-    }
-
     if (!area)
     {
 	area = exaFindAreaToEvict(pExaScr, size, align);
commit 17a1614c3b7410581d885be5f8f76aa7b3e2c070
Author: Ben Skeggs <bskeggs at redhat.com>
Date:   Sat Oct 24 10:45:49 2009 +1000

    EXA: fix mixed-pixmaps issue where we could do accel with pixmap mapped
    
    The problem occurs in the following situation:
    
    1. Create Pixmap
    2. Software fallback on pixmap: pExaPixmap->pDamage created
    3. Accel to pixmap: driver pixmap created, exaPixmapIsOffscreen() now true
    4. Software fallback on pixmap
    4.1: PrepareAccess() from driver succeeds, so no DFS to system memory copy
    4.2: Software rendering...
    4.3: (pExaPixmap->pDamage && exaPixmapIsOffscreen()) is true, so we try
         to (incorrectly) UTS the data back to the driver pixmap, when we
         should just call the driver's FinishAccess() hook.
    4.4: fail
    
    The patch adds an additional check on pExaPixmap->offscreen, which should
    (for the cases exaPixmapIsOffscreen() will return true) only be FALSE
    when we haven't used PrepareAccess() on the pixmap.
    
    Signed-off-by: Ben Skeggs <bskeggs at redhat.com>
    Acked-By: Michel Dänzer <michel at daenzer.net>
    
    [ Michel Dänzer: This is a 'backport' of commit
      647b79f87a9891225678dc6fc2fbda3bdef8fa9d from master - actually this patch
      was submitted first but didn't apply to master anymore, so technically the
      other change is a 'forward port' of this one ]

diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
index f42c9c2..52b18b4 100644
--- a/exa/exa_migration_mixed.c
+++ b/exa/exa_migration_mixed.c
@@ -202,7 +202,8 @@ void exaFinishAccess_mixed(PixmapPtr pPixmap, int index)
 {
     ExaPixmapPriv(pPixmap);
 
-    if (pExaPixmap->pDamage && exaPixmapIsOffscreen(pPixmap)) {
+    if (pExaPixmap->pDamage && exaPixmapIsOffscreen(pPixmap) &&
+	!pExaPixmap->offscreen) {
 	DamageRegionProcessPending(&pPixmap->drawable);
 	exaMoveInPixmap_mixed(pPixmap);
     }


More information about the xorg-commit mailing list