xserver: Branch 'server-1.5-branch' - 11 commits

Adam Jackson ajax at kemper.freedesktop.org
Mon Apr 7 07:34:39 PDT 2008


 .gitignore                         |    3 
 configure.ac                       |   16 ++++
 exa/exa.h                          |    2 
 exa/exa_offscreen.c                |  132 ++++++++++++++++++-------------------
 exa/exa_priv.h                     |    1 
 hw/xfree86/common/xf86AutoConfig.c |    5 -
 hw/xfree86/int10/helper_exec.c     |    2 
 hw/xfree86/modes/xf86EdidModes.c   |   19 +++--
 os/WaitFor.c                       |    6 -
 9 files changed, 102 insertions(+), 84 deletions(-)

New commits:
commit 85b855f26f1578d52e9ed1dd0e3a9a1340ef1a2d
Author: Adam Tkac <atkac at redhat.com>
Date:   Mon Apr 7 10:20:02 2008 -0400

    Fix Xvfb input when building against current X sources.
    (cherry picked from commit 726dcd9e4ebfb09c0685450dca6e9fae7e773814)

diff --git a/os/WaitFor.c b/os/WaitFor.c
index 36e01ca..da12976 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -332,13 +332,9 @@ WaitForSomething(int *pClientsReady)
 
 	    if (XFD_ANYSET (&devicesReadable) || XFD_ANYSET (&clientsReadable))
 		break;
-#ifdef WIN32
-	    /* Windows keyboard and mouse events are added to the input queue
-	       in Block- and WakupHandlers. There is no device to check if  
-	       data is ready. So check here if new input is available */
+	    /* check here for DDXes that queue events during Block/Wakeup */
 	    if (*checkForInput[0] != *checkForInput[1])
 		return 0;
-#endif
 	}
     }
 
commit fe87d921da97f498e860270e2eeb73a860f19989
Author: Julien Cristau <jcristau at debian.org>
Date:   Fri Apr 4 19:01:40 2008 +0200

    Fix the clock_gettime check for glibc-based non-Linux systems
    
    We need to define _POSIX_C_SOURCE on glibc, not just Linux, so add a new
    test for the __GLIBC__ macro.
    (cherry picked from commit 6c0cfe3d43b177c4cfaf7e228f32c655f9a98459)

diff --git a/configure.ac b/configure.ac
index c151c20..1e48b07 100644
--- a/configure.ac
+++ b/configure.ac
@@ -707,6 +707,15 @@ if test "x$NEED_DBUS" = xyes; then
 fi
 CONFIG_LIB='$(top_builddir)/config/libconfig.a'
 
+AC_MSG_CHECKING([for glibc...])
+AC_PREPROC_IFELSE([
+#include <features.h>
+#ifndef __GLIBC__
+#error
+#endif
+], glibc=yes, glibc=no)
+AC_MSG_RESULT([$glibc])
+
 AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes],
                [AC_CHECK_LIB([rt], [clock_gettime], [have_clock_gettime=-lrt],
                              [have_clock_gettime=no])])
@@ -722,11 +731,13 @@ if ! test "x$have_clock_gettime" = xno; then
 
     LIBS_SAVE="$LIBS"
     LIBS="$CLOCK_LIBS"
+    CPPFLAGS_SAVE="$CPPFLAGS"
+
+    if test x"$glibc" = xyes; then
+        CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=199309L"
+    fi
 
     AC_RUN_IFELSE([
-#ifdef __linux__
-#define _POSIX_C_SOURCE 199309L
-#endif
 #include <time.h>
 
 int main(int argc, char *argv[[]]) {
@@ -741,6 +752,7 @@ int main(int argc, char *argv[[]]) {
        [MONOTONIC_CLOCK="cross compiling"])
 
     LIBS="$LIBS_SAVE"
+    CPPFLAGS="$CPPFLAGS_SAVE"
 else
     MONOTONIC_CLOCK=no
 fi
commit 9a908769e62fe56930ad3a2d3375e29119a2fe09
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Apr 4 12:58:12 2008 -0400

    Fix PCI config space cycles from int10 emulator.
    
    The top bit of 0xCF8 is an enable bit, not part of the domain.  Sending
    cycles to domain 128 instead of domain 0 is rarely the right thing to do.
    (cherry picked from commit cc7c045bae01d90d8f1b750080ba48a96e983c68)

diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c
index 9daff22..c3af5bc 100644
--- a/hw/xfree86/int10/helper_exec.c
+++ b/hw/xfree86/int10/helper_exec.c
@@ -461,7 +461,7 @@ Mem_wl(CARD32 addr, CARD32 val)
 static CARD32 PciCfg1Addr = 0;
 
 #define PCI_OFFSET(x) ((x) & 0x000000ff)
-#define PCI_TAG(x)    ((x) & 0xffffff00)
+#define PCI_TAG(x)    ((x) & 0x7fffff00)
 
 static struct pci_device*
 pci_device_for_cfg_address (CARD32 addr)
commit bd91565ac8dc66babb011bfc63bcc071b7bf6d32
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Mar 17 14:22:39 2008 -0700

    Fix clock_gettime presence detect on FreeBSD.
    
    For non-Linux, _POSIX_C_SOURCE and friends restrict symbols defined rather
    than enabling defines of symbols.  Additionally, CLOCK_MONOTONIC was
    apparently added to the standard around 2000 anyway, not 1993.
    (cherry picked from commit d1de3dda8efe501d4192c8a99c34ab4265316c32)

diff --git a/configure.ac b/configure.ac
index bdb88d4..c151c20 100644
--- a/configure.ac
+++ b/configure.ac
@@ -724,7 +724,9 @@ if ! test "x$have_clock_gettime" = xno; then
     LIBS="$CLOCK_LIBS"
 
     AC_RUN_IFELSE([
+#ifdef __linux__
 #define _POSIX_C_SOURCE 199309L
+#endif
 #include <time.h>
 
 int main(int argc, char *argv[[]]) {
commit b2704de8a7425988ab725bfad949976dba1c0c97
Author: Dave Airlie <airlied at redhat.com>
Date:   Fri Apr 4 09:29:51 2008 +1000

    quirk: add quirk for ACER EDID
    (cherry picked from commit f0915fb3c4a9712200882440a64d11dc595a02bb)

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index d139eb3..f2814f3 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -158,6 +158,11 @@ static Bool quirk_first_detailed_preferred (int scrnIndex, xf86MonPtr DDC)
 	DDC->vendor.prod_id == 765)
 	return TRUE;
 
+    /* ACR of some sort RH #284231 */
+    if (memcmp (DDC->vendor.name, "ACR", 4) == 0 &&
+	DDC->vendor.prod_id == 2423)
+	return TRUE;
+
     return FALSE;
 }
 
commit 8ccdaa288a63cad64dd5685b5b5bcb060e3793ff
Author: Hong Liu <hong.liu at intel.com>
Date:   Wed Apr 2 10:43:19 2008 +0800

    Bug #15160: quirk Proview AY765C
    
    prefer first detailed timing
    (cherry picked from commit ebc56aca8bdfec1918cac3c8380895dfddea48ce)

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index c987f7e..d139eb3 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -153,6 +153,11 @@ static Bool quirk_first_detailed_preferred (int scrnIndex, xf86MonPtr DDC)
 	DDC->vendor.prod_id == 57364)
 	return TRUE;
 
+    /* Proview AY765C 17" LCD. See bug #15160*/
+    if (memcmp (DDC->vendor.name, "PTS", 4) == 0 &&
+	DDC->vendor.prod_id == 765)
+	return TRUE;
+
     return FALSE;
 }
 
commit 8059b57f9ba85663ee3ef8dccb46ed915368965d
Author: Goneri Le Bouder <goneri at rulezlan.org>
Date:   Tue Apr 1 20:19:40 2008 +0200

    xfree86: don't crash in AutoConfig if the primary device is not pci
    
    Only call matchDriverFromFiles() if we found a pci device.
    Debian bug#472823 (http://bugs.debian.org/472823).
    (cherry picked from commit 9500033b9ecdfaf5a56a4355ffc94d74cb17ca17)

diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
index 268b50c..3210e44 100644
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -436,9 +436,10 @@ chooseVideoDriver(void)
     if (!info) {
 	ErrorF("Primary device is not PCI\n");
     }
-
 #ifdef __linux__
-    matchDriverFromFiles(matches, info->vendor_id, info->device_id);
+    else {
+	matchDriverFromFiles(matches, info->vendor_id, info->device_id);
+    }
 #endif /* __linux__ */
 
     /* TODO Handle multiple drivers claiming to support the same PCI ID */
commit 841aa08ea435e1f1bf11d2f56c6df1e66c2de020
Author: Fredrik Höglund <fredrik at kde.org>
Date:   Mon Mar 31 21:24:59 2008 +0200

    EXA: Optimize the eviction scanning loop in exaOffscreenAlloc.
    
    Reduce the cost of the inner loop, by keeping a set of pointers to the
    first and the last areas in the series, subtracting the cost of the first
    area from the score, and adding the cost of the last area while walking
    the list.  This commit also moves the scanning loop from exaOffscreenAlloc
    into a separate function.
    
    Idea by Michel Dänzer.
    (cherry picked from commit 8074676d2df8d577b443e3fa5e22d7c71c944bd1)

diff --git a/exa/exa_offscreen.c b/exa/exa_offscreen.c
index 2701e84..85b5388 100644
--- a/exa/exa_offscreen.c
+++ b/exa/exa_offscreen.c
@@ -73,6 +73,62 @@ ExaOffscreenKickOut (ScreenPtr pScreen, ExaOffscreenArea *area)
 
 #define AREA_SCORE(area) (area->size / (double)(pExaScr->offScreenCounter - area->last_use))
 
+static ExaOffscreenArea *
+exaFindAreaToEvict(ExaScreenPrivPtr pExaScr, int size, int align)
+{
+    ExaOffscreenArea *begin, *end, *best;
+    double score, best_score;
+    int avail, real_size, tmp;
+
+    best_score = UINT_MAX;
+    begin = end = pExaScr->info->offScreenAreas;
+    avail = 0;
+    score = 0;
+    best = 0;
+
+    while (end != NULL)
+    {
+	restart:
+	while (begin != NULL && begin->state == ExaOffscreenLocked)
+	    begin = end = begin->next;
+
+	if (begin == NULL)
+	    break;
+
+	/* adjust size needed to account for alignment loss for this area */
+	real_size = size;
+	tmp = begin->base_offset % align;
+	if (tmp)
+	    real_size += (align - tmp);
+
+	while (avail < real_size && end != NULL)
+	{
+	    if (end->state == ExaOffscreenLocked) {
+		/* Can't more room here, restart after this locked area */
+		avail = 0;
+		score = 0;
+		begin = end;
+		goto restart;
+	    }
+	    avail += end->size;
+	    score += AREA_SCORE(end);
+	    end = end->next;
+	}
+
+	/* Check the score, update best */
+	if (avail >= real_size && score < best_score) {
+	    best = begin;
+	    best_score = score;
+	}
+
+	avail -= begin->size;
+	score -= AREA_SCORE(begin);
+	begin = begin->next;
+    }
+
+    return best;
+}
+
 /**
  * exaOffscreenAlloc allocates offscreen memory
  *
@@ -98,7 +154,7 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
                    ExaOffscreenSaveProc save,
                    pointer privData)
 {
-    ExaOffscreenArea *area, *begin, *best;
+    ExaOffscreenArea *area;
     ExaScreenPriv (pScreen);
     int tmp, real_size = 0;
 #if DEBUG_OFFSCREEN
@@ -145,54 +201,8 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
 
     if (!area)
     {
-	double best_score;
-	/*
-	 * Kick out existing users to make space.
-	 *
-	 * First, locate a region which can hold the desired object.
-	 */
+	area = exaFindAreaToEvict(pExaScr, size, align);
 
-	/* prev points at the first object to boot */
-	best = NULL;
-	best_score = UINT_MAX;
-	for (begin = pExaScr->info->offScreenAreas; begin != NULL;
-	     begin = begin->next)
-	{
-	    int avail;
-	    double score;
-	    ExaOffscreenArea *scan;
-
-	    if (begin->state == ExaOffscreenLocked)
-		continue;
-
-	    /* adjust size needed to account for alignment loss for this area */
-	    real_size = size;
-	    tmp = begin->base_offset % align;
-	    if (tmp)
-		real_size += (align - tmp);
-
-	    avail = 0;
-	    score = 0;
-	    /* now see if we can make room here, and how "costly" it'll be. */
-	    for (scan = begin; scan != NULL; scan = scan->next)
-	    {
-		if (scan->state == ExaOffscreenLocked) {
-		    /* Can't make room here, start after this locked area. */
-		    begin = scan;
-		    break;
-		}
-		score += AREA_SCORE(scan);
-		avail += scan->size;
-		if (avail >= real_size)
-		    break;
-	    }
-	    /* Is it the best option we've found so far? */
-	    if (avail >= real_size && score < best_score) {
-		best = begin;
-		best_score = score;
-	    }
-	}
-	area = best;
 	if (!area)
 	{
 	    DBG_OFFSCREEN (("Alloc 0x%x -> NOSPACE\n", size));
commit 2e4b72dd8485df1f89ce4533a5778514ad1fc917
Author: Fredrik Höglund <fredrik at kde.org>
Date:   Mon Mar 31 21:15:50 2008 +0200

    EXA: Improve the algorithm used for tracking offscreen pixmap use.
    
    Replace the current score keeping algorithm with a rolling counter that's
    incremented in ExaOffscreenMarkUsed, with the previous value being stored
    in the area.  exaOffscreenAlloc uses the difference between the counter
    value and the value in the area when deciding which area to evict.
    It now also takes the size of the areas into account, and favors evicting
    smaller areas.
    
    The credit for these ideas goes to Michel Dänzer.
    (cherry picked from commit 93d876891dbba41b920a9a29a5de77f647f43928)

diff --git a/exa/exa.h b/exa/exa.h
index 0774a70..97ae6c0 100644
--- a/exa/exa.h
+++ b/exa/exa.h
@@ -56,7 +56,7 @@ struct _ExaOffscreenArea {
     int                 base_offset;	/* allocation base */
     int                 offset;         /* aligned offset */
     int                 size;           /* total allocation size */
-    int                 score;
+    unsigned            last_use;
     pointer             privData;
 
     ExaOffscreenSaveProc save;
diff --git a/exa/exa_offscreen.c b/exa/exa_offscreen.c
index c666b00..2701e84 100644
--- a/exa/exa_offscreen.c
+++ b/exa/exa_offscreen.c
@@ -71,6 +71,8 @@ ExaOffscreenKickOut (ScreenPtr pScreen, ExaOffscreenArea *area)
     return exaOffscreenFree (pScreen, area);
 }
 
+#define AREA_SCORE(area) (area->size / (double)(pExaScr->offScreenCounter - area->last_use))
+
 /**
  * exaOffscreenAlloc allocates offscreen memory
  *
@@ -98,7 +100,7 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
 {
     ExaOffscreenArea *area, *begin, *best;
     ExaScreenPriv (pScreen);
-    int tmp, real_size = 0, best_score;
+    int tmp, real_size = 0;
 #if DEBUG_OFFSCREEN
     static int number = 0;
     ErrorF("================= ============ allocating a new pixmap %d\n", ++number);
@@ -143,6 +145,7 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
 
     if (!area)
     {
+	double best_score;
 	/*
 	 * Kick out existing users to make space.
 	 *
@@ -151,11 +154,12 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
 
 	/* prev points at the first object to boot */
 	best = NULL;
-	best_score = INT_MAX;
+	best_score = UINT_MAX;
 	for (begin = pExaScr->info->offScreenAreas; begin != NULL;
 	     begin = begin->next)
 	{
-	    int avail, score;
+	    int avail;
+	    double score;
 	    ExaOffscreenArea *scan;
 
 	    if (begin->state == ExaOffscreenLocked)
@@ -177,8 +181,7 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
 		    begin = scan;
 		    break;
 		}
-		/* Score should only be non-zero for ExaOffscreenRemovable */
-		score += scan->score;
+		score += AREA_SCORE(scan);
 		avail += scan->size;
 		if (avail >= real_size)
 		    break;
@@ -230,7 +233,7 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
 	new_area->size = area->size - real_size;
 	new_area->state = ExaOffscreenAvail;
 	new_area->save = NULL;
-	new_area->score = 0;
+	new_area->last_use = 0;
 	new_area->next = area->next;
 	area->next = new_area;
 	area->size = real_size;
@@ -244,7 +247,7 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
 	area->state = ExaOffscreenRemovable;
     area->privData = privData;
     area->save = save;
-    area->score = 0;
+    area->last_use = pExaScr->offScreenCounter++;
     area->offset = (area->base_offset + align - 1);
     area->offset -= area->offset % align;
 
@@ -395,7 +398,7 @@ exaOffscreenFree (ScreenPtr pScreen, ExaOffscreenArea *area)
 
     area->state = ExaOffscreenAvail;
     area->save = NULL;
-    area->score = 0;
+    area->last_use = 0;
     /*
      * Find previous area
      */
@@ -427,23 +430,11 @@ ExaOffscreenMarkUsed (PixmapPtr pPixmap)
 {
     ExaPixmapPriv (pPixmap);
     ExaScreenPriv (pPixmap->drawable.pScreen);
-    static int iter = 0;
 
     if (!pExaPixmap || !pExaPixmap->area)
 	return;
 
-    /* The numbers here are arbitrary.  We may want to tune these. */
-    pExaPixmap->area->score += 100;
-    if (++iter == 10) {
-	ExaOffscreenArea *area;
-	for (area = pExaScr->info->offScreenAreas; area != NULL;
-	     area = area->next)
-	{
-	    if (area->state == ExaOffscreenRemovable)
-		area->score = (area->score * 7) / 8;
-	}
-	iter = 0;
-    }
+    pExaPixmap->area->last_use = pExaScr->offScreenCounter++;
 }
 
 /**
@@ -472,10 +463,11 @@ exaOffscreenInit (ScreenPtr pScreen)
     area->size = pExaScr->info->memorySize - area->base_offset;
     area->save = NULL;
     area->next = NULL;
-    area->score = 0;
+    area->last_use = 0;
 
     /* Add it to the free areas */
     pExaScr->info->offScreenAreas = area;
+    pExaScr->offScreenCounter = 1;
 
     ExaOffscreenValidate (pScreen);
 
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index 89f4718..e41f46a 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -120,6 +120,7 @@ typedef struct {
     Bool			 checkDirtyCorrectness;
     unsigned			 disableFbCount;
     Bool			 optimize_migration;
+    unsigned			 offScreenCounter;
 } ExaScreenPrivRec, *ExaScreenPrivPtr;
 
 /*
commit 32b5c67145a5386613153592444c7a9b718d425a
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Fri Mar 28 10:23:36 2008 +0200

    gitignore: Add two more bits
    
    Get slightly better at ignoring vim swap files, and let people keep
    local changes if they want to.
    (cherry picked from commit 7034484f0887ea0f8ab956515f2d9301ea5842ce)

diff --git a/.gitignore b/.gitignore
index 406b74c..524cfc6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,11 +8,12 @@ Makefile.in
 *.a
 *.o
 *~
-.*.swp
+.*sw?
 *.pbxuser
 *.mode1v3
 obj*
 build*
+local
 aclocal.m4
 autom4te.cache
 compile
commit a2fcdfd5f9b98851f0e7e2b9b692fe4150a2ca0b
Author: Dave Airlie <airlied at redhat.com>
Date:   Thu Mar 27 15:18:39 2008 +1000

    quirk: fix LPL monitors properly.
    
    no point having a h cm fix when we really want to copy the sizes from the
    other place.
    
    RH BZ 435216
    (cherry picked from commit c747030a49dd289e873e2b686cd129d840e55468)

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index ea36d0a..c987f7e 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -108,13 +108,6 @@ static Bool quirk_prefer_large_75 (int scrnIndex, xf86MonPtr DDC)
 
 static Bool quirk_detailed_h_in_cm (int scrnIndex, xf86MonPtr DDC)
 {
-    /* Bug #10304: "LGPhilipsLCD LP154W01-A5" */
-    /* Bug #12784: "LGPhilipsLCD LP154W01-TLA2" */
-    /* Red Hat #435216 "LGPhilipsLCD LP154W01-TLAE" */
-    if (memcmp (DDC->vendor.name, "LPL", 4) == 0 &&
-	(DDC->vendor.prod_id == 0 || DDC->vendor.prod_id == 0x2a00))
-	return TRUE;
-
     /* Bug #11603: Funai Electronics PM36B */
     if (memcmp (DDC->vendor.name, "FCM", 4) == 0 &&
 	DDC->vendor.prod_id == 13600)
@@ -137,7 +130,7 @@ static Bool quirk_detailed_use_maximum_size (int scrnIndex, xf86MonPtr DDC)
 {
     /* Bug #10304: LGPhilipsLCD LP154W01-A5 */
     if (memcmp (DDC->vendor.name, "LPL", 4) == 0 &&
-	DDC->vendor.prod_id == 0)
+	(DDC->vendor.prod_id == 0 || DDC->vendor.prod_id == 0x2a00))
 	return TRUE;
 
     return FALSE;


More information about the xorg-commit mailing list