xserver: Branch 'refs/tags/XORG-7_1' - 63 commits

Eric Anholt anholt at kemper.freedesktop.org
Sat Jul 8 02:14:35 EEST 2006


Rebased ref, commits from common ancestor:
diff-tree 5c2560d47ff79afb96b1304d3995706403bfea35 (from 11afc6c64397caa5f483b6da3afcc18cdf3c955f)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon May 22 15:47:46 2006 +0000

    Bug #6924: Restore the ABI for DrawableRec and ColormapRec to the state
        they were in prior to the fix for #6438. Based on a patch from Andy
        Ritger.

diff --git a/ChangeLog b/ChangeLog
index d9b0f83..e0474b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-05-22  Adam Jackson  <ajax at freedesktop.org>
+
+	* dix/colormap.c:
+	* dix/pixmap.c:
+	* dix/window.c:
+	* include/colormapst.h:
+	* include/pixmapstr.h:
+	Bug #6924: Restore the ABI for DrawableRec and ColormapRec to 
+	the state they were in prior to the fix for #6438. Based on a 
+	patch from Andy Ritger.
+
 2006-05-19  Adam Jackson  <ajax at freedesktop.org>
 
 	* include/os.h:
diff --git a/dix/colormap.c b/dix/colormap.c
index 900949c..a448010 100644
--- a/dix/colormap.c
+++ b/dix/colormap.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xserver/xorg/dix/colormap.c,v 1.11 2005/09/05 07:40:50 daniels Exp $ */
+/* $XdotOrg: xserver/xorg/dix/colormap.c,v 1.12 2006/02/15 20:44:12 ajax Exp $ */
 /* $XFree86: xc/programs/Xserver/dix/colormap.c,v 3.11 2003/11/03 05:10:59 tsi Exp $ */
 /***********************************************************
 
@@ -280,6 +280,13 @@ CreateColormap (Colormap mid, ScreenPtr 
     pmap = (ColormapPtr) xalloc(sizebytes);
     if (!pmap)
 	return (BadAlloc);
+#if defined(_XSERVER64)
+    pmap->pad0 = 0;
+    pmap->pad1 = 0;
+#if (X_BYTE_ORDER == X_LITTLE_ENDIAN)
+    pmap->pad2 = 0;
+#endif
+#endif
     pmap->red = (EntryPtr)((char *)pmap + sizeof(ColormapRec));    
     sizebytes = size * sizeof(Entry);
     pmap->clientPixelsRed = (Pixel **)((char *)pmap->red + sizebytes);
diff --git a/dix/pixmap.c b/dix/pixmap.c
index 527b0f0..1c3d49f 100644
--- a/dix/pixmap.c
+++ b/dix/pixmap.c
@@ -141,5 +141,13 @@ AllocatePixmap(ScreenPtr pScreen, int pi
 #else
     pPixmap = (PixmapPtr)xalloc(sizeof(PixmapRec) + pixDataSize);
 #endif
+
+#ifdef _XSERVER64
+    if (pPixmap) {
+	pPixmap->drawable.pad0 = 0;
+	pPixmap->drawable.pad1 = 0;
+    }
+#endif
+
     return pPixmap;
 }
diff --git a/dix/window.c b/dix/window.c
index f00f637..9fba5f8 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xserver/xorg/dix/window.c,v 1.16 2006/03/29 17:51:54 deronj Exp $ */
+/* $XdotOrg: xserver/xorg/dix/window.c,v 1.17 2006/03/31 17:39:35 sandmann Exp $ */
 /* $Xorg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */
 /*
 
@@ -384,6 +384,10 @@ AllocateWindow(ScreenPtr pScreen)
 	    else
 		ppriv->ptr = (pointer)NULL;
 	}
+#if _XSERVER64
+	pWin->drawable.pad0 = 0;
+        pWin->drawable.pad1 = 0;
+#endif
     }
     return pWin;
 }
diff --git a/include/colormapst.h b/include/colormapst.h
index d2422ea..fdfc8f3 100644
--- a/include/colormapst.h
+++ b/include/colormapst.h
@@ -49,6 +49,8 @@ SOFTWARE.
 #ifndef CMAPSTRUCT_H
 #define CMAPSTRUCT_H 1
 
+#include <X11/Xarch.h>
+
 #include "colormap.h"
 #include "screenint.h"
 
@@ -89,15 +91,26 @@ typedef struct _CMEntry
     Bool	fShared;
 } Entry;
 
-/* COLORMAPs can be used for either Direct or Pseudo color.  PseudoColor
+/*
+ * COLORMAPs can be used for either Direct or Pseudo color.  PseudoColor
  * only needs one cell table, we arbitrarily pick red.  We keep track
- * of that table with freeRed, numPixelsRed, and clientPixelsRed */
+ * of that table with freeRed, numPixelsRed, and clientPixelsRed
+ *
+ * The padN variables are unfortunate ABI BC. See fdo bug #6924.
+ */
 
 typedef struct _ColormapRec
 {
     VisualPtr	pVisual;
     short	class;		/* PseudoColor or DirectColor */
+#if defined(_XSERVER64)
+    short	pad0;
+    XID		pad1;
+#endif
     XID		mid;		/* client's name for colormap */
+#if defined(_XSERVER64) && (X_BYTE_ORDER == X_LITTLE_ENDIAN)
+    XID		pad2;
+#endif
     ScreenPtr	pScreen;	/* screen map is associated with */
     short	flags;		/* 1 = IsDefault
 				 * 2 = AllAllocated */
diff --git a/include/pixmapstr.h b/include/pixmapstr.h
index 272ce68..291f2a2 100644
--- a/include/pixmapstr.h
+++ b/include/pixmapstr.h
@@ -49,16 +49,27 @@ SOFTWARE.
 
 #ifndef PIXMAPSTRUCT_H
 #define PIXMAPSTRUCT_H
+#include <X11/Xarch.h>
 #include "pixmap.h"
 #include "screenint.h"
 #include "regionstr.h"
 
+/*
+ * The padN members are unfortunate ABI BC.  See fdo bug #6924.
+ */
+
 typedef struct _Drawable {
     unsigned char	type;	/* DRAWABLE_<type> */
     unsigned char	class;	/* specific to type */
     unsigned char	depth;
     unsigned char	bitsPerPixel;
+#if defined(_XSERVER64)
+    XID			pad0;
+#endif
     XID			id;	/* resource id */
+#if defined(_XSERVER64)
+    XID			pad1;
+#endif
     short		x;	/* window: screen absolute, pixmap: 0 */
     short		y;	/* window: screen absolute, pixmap: 0 */
     unsigned short	width;
diff-tree 11afc6c64397caa5f483b6da3afcc18cdf3c955f (from c0ec3e73422cfa28768d3c4273d6cad8162752ef)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri May 19 20:29:37 2006 +0000

    Remove dead DPMS timer functions from the installed headers. (Fredrik
        Höglund)

diff --git a/ChangeLog b/ChangeLog
index dca46e4..d9b0f83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-05-19  Adam Jackson  <ajax at freedesktop.org>
+
+	* include/os.h:
+	Remove dead DPMS timer functions from the installed headers. 
+	(Fredrik Höglund)
+
 2006-05-18  Adam Jackson  <ajax at freedesktop.org>
 
 	* hw/xfree86/common/xf86Priv.h:
diff --git a/include/os.h b/include/os.h
index 8c46ec9..5a2e6c9 100644
--- a/include/os.h
+++ b/include/os.h
@@ -216,11 +216,6 @@ extern void TimerFree(OsTimerPtr /* pTim
 extern void SetScreenSaverTimer(void);
 extern void FreeScreenSaverTimer(void);
 
-#ifdef DPMSExtension
-extern void SetDPMSTimers(void);
-extern void FreeDPMSTimers(void);
-#endif
-
 extern SIGVAL AutoResetServer(int /*sig*/);
 
 extern SIGVAL GiveUp(int /*sig*/);
diff-tree c0ec3e73422cfa28768d3c4273d6cad8162752ef (from a3da58bf1ccaf81506fa67c0da60144ea900695c)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Thu May 18 23:52:41 2006 +0000

    Bug #4139: Fix a BAR remapping bug that could lead to IERR and system hang.
        (Egbert Eich)

diff --git a/ChangeLog b/ChangeLog
index 154f654..dca46e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2006-05-18  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/xfree86/common/xf86Priv.h:
+	* hw/xfree86/common/xf86pciBus.c:
+	* hw/xfree86/dummylib/Makefile.am:
+	* hw/xfree86/dummylib/getemptypci.c:
+	* hw/xfree86/os-support/bus/Pci.c:
+	* hw/xfree86/os-support/bus/xf86Pci.h:
+	* hw/xfree86/os-support/linux/lnx_pci.c:
+	Bug #4139: Fix a BAR remapping bug that could lead to IERR and 
+	system hang. (Egbert Eich)
+
+2006-05-18  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/xfree86/os-support/linux/lnx_pci.c:
 	Bug #6377: Ignore disabled BARs, and allow matching BARs 
 	aligned to less than 16 bytes. (Felix Kühling, ATI)
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index 4d578b8..0794de7 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -155,6 +155,7 @@ void xf86AddDevToEntity(int entityIndex,
 extern void xf86PostPreInit(void);
 extern void xf86PostScreenInit(void);
 extern memType getValidBIOSBase(PCITAG tag, int num);
+extern memType getEmptyPciRange(PCITAG tag, int base_reg);
 extern int pciTestMultiDeviceCard(int bus, int dev, int func, PCITAG** pTag);
 
 /* xf86Config.c */
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index af19b37..4d587a1 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -1498,29 +1498,117 @@ xf86ReallocatePciResources(int entityInd
 /*
  * BIOS releated
  */
-memType
-getValidBIOSBase(PCITAG tag, int num)
+static resPtr
+getOwnResources(pciVideoPtr pvp, resPtr mem)
+{
+    resRange range;
+    int i;
+    /* Make sure we don't conflict with our own mem resources */
+    for (i = 0; i < 6; i++) {
+	if (!pvp->memBase[i])
+	    continue;
+	P_M_RANGE(range,TAG(pvp),pvp->memBase[i],pvp->size[i],
+		  ResExcMemBlock);
+	mem = xf86AddResToList(mem,&range,-1);
+    }
+    return mem;
+}
+
+static void
+getPciRangesForMapping(pciVideoPtr pvp,  resPtr *map, resPtr *avoid)
 {
-    pciVideoPtr pvp = NULL;
     PciBusPtr pbp;
-    resPtr m = NULL;
-    resPtr tmp, avoid, mem = NULL;
+    resPtr tmp;
+    
+    *avoid = xf86DupResList(pciAvoidRes);
+
+    pbp = xf86PciBus;
+    while (pbp) {
+	if (pbp->secondary == pvp->bus) {
+	    if (pbp->preferred_pmem)
+		tmp = xf86DupResList(pbp->preferred_pmem);
+	    else
+		tmp = xf86DupResList(pbp->pmem);
+	    *map = xf86JoinResLists(*map,tmp);
+	    if (pbp->preferred_mem)
+		tmp = xf86DupResList(pbp->preferred_mem);
+	    else
+		tmp = xf86DupResList(pbp->mem);
+	    *map = xf86JoinResLists(*map,tmp);
+	    tmp = *map;
+	    while (tmp) {
+		tmp->block_end = min(tmp->block_end,PCI_MEM32_LENGTH_MAX);
+		tmp = tmp->next;
+	    }
+	} else if ((pbp->primary == pvp->bus) &&
+		   (pbp->secondary >= 0) &&
+		   (pbp->primary != pbp->secondary)) {
+	    tmp = xf86DupResList(pbp->preferred_pmem);
+	    *avoid = xf86JoinResLists(*avoid, tmp);
+	    tmp = xf86DupResList(pbp->pmem);
+	    *avoid = xf86JoinResLists(*avoid, tmp);
+	    tmp = xf86DupResList(pbp->preferred_mem);
+	    *avoid = xf86JoinResLists(*avoid, tmp);
+	    tmp = xf86DupResList(pbp->mem);
+	    *avoid = xf86JoinResLists(*avoid, tmp);
+	}
+	pbp = pbp->next;
+    }	
+    pciConvertListToHost(pvp->bus,pvp->device,pvp->func, *avoid);
+    pciConvertListToHost(pvp->bus,pvp->device,pvp->func, *map);
+}
+
+static memType
+findPciRange(PCITAG tag, resPtr m, resPtr avoid, CARD32 size)
+{
     resRange range;
-    memType ret;
+    CARD32 alignment = (1 << size) - 1;
+    
+    while (m) {
+	range = xf86GetBlock(RANGE_TYPE(ResExcMemBlock, xf86GetPciDomain(tag)),
+			     PCI_SIZE(ResMem, tag, 1 << size),
+			     m->block_begin, m->block_end,
+			     PCI_SIZE(ResMem, tag, alignment), 
+			     avoid);
+	if (range.type != ResEnd) {
+	    return  M2B(tag, range.rBase);
+	}
+	m = m->next;
+    }
+    return 0;
+}
+
+pciVideoPtr
+getPciVideoPtr(tag)
+{
     int n = 0;
-    int i;
-    CARD32 biosSize, alignment;
 
+    pciVideoPtr pvp = NULL;
     if (!xf86PciVideoInfo) return 0;
     
     while ((pvp = xf86PciVideoInfo[n++])) {
 	if (pciTag(pvp->bus,pvp->device,pvp->func) == tag)
-	    break;
+	    return pvp;
     }
+    return NULL;
+}
+
+memType
+getValidBIOSBase(PCITAG tag, int num)
+{
+    pciVideoPtr pvp = NULL;
+    memType ret;
+    CARD32 biosSize;
+    resPtr mem = NULL;
+    resPtr avoid = NULL, m = NULL;
+    resRange range;
+    
+    pvp = getPciVideoPtr(tag);
+    
     if (!pvp) return 0;
 
     biosSize = pvp->biosSize;
-    alignment = (1 << biosSize) - 1;
+
     if (biosSize > 24)
 	biosSize = 24;
 
@@ -1531,15 +1619,8 @@ getValidBIOSBase(PCITAG tag, int num)
 	/* In some cases the BIOS base register contains the size mask */
 	if ((memType)(-1 << biosSize) == PCIGETROM(pvp->biosBase))
 	    return 0;
-	/* Make sure we don't conflict with our own mem resources */
-	for (i = 0; i < 6; i++) {
-	    if (!pvp->memBase[i])
-		continue;
-	    P_M_RANGE(range,TAG(pvp),pvp->memBase[i],pvp->size[i],
-		      ResExcMemBlock);
-	    mem = xf86AddResToList(mem,&range,-1);
-	}
-	P_M_RANGE(range, TAG(pvp),pvp->biosBase,biosSize,ResExcMemBlock);
+	mem = getOwnResources(pvp,mem);
+	P_M_RANGE(range, tag, pvp->biosBase,biosSize,ResExcMemBlock);
 	ret = pvp->biosBase;
 	break;
     case ROM_BASE_MEM0:
@@ -1550,7 +1631,7 @@ getValidBIOSBase(PCITAG tag, int num)
     case ROM_BASE_MEM5:
 	if (!pvp->memBase[num] || (pvp->size[num] < biosSize))
 	    return 0;
-	P_M_RANGE(range, TAG(pvp),pvp->memBase[num],biosSize,
+	P_M_RANGE(range, tag ,pvp->memBase[num],biosSize,
 		  ResExcMemBlock);
 	ret = pvp->memBase[num];
 	break;
@@ -1562,59 +1643,15 @@ getValidBIOSBase(PCITAG tag, int num)
     }
 
     /* Now find the ranges for validation */
-    avoid = xf86DupResList(pciAvoidRes);
-    pbp = xf86PciBus;
-    while (pbp) {
-	if (pbp->secondary == pvp->bus) {
-	    if (pbp->preferred_pmem)
-		tmp = xf86DupResList(pbp->preferred_pmem);
-	    else
-		tmp = xf86DupResList(pbp->pmem);
-	    m = xf86JoinResLists(m,tmp);
-	    if (pbp->preferred_mem)
-		tmp = xf86DupResList(pbp->preferred_mem);
-	    else
-		tmp = xf86DupResList(pbp->mem);
-	    m = xf86JoinResLists(m,tmp);
-	    tmp = m;
-	    while (tmp) {
-		tmp->block_end = min(tmp->block_end,PCI_MEM32_LENGTH_MAX);
-		tmp = tmp->next;
-	    }
-	} else if ((pbp->primary == pvp->bus) &&
-		   (pbp->secondary >= 0) &&
-		   (pbp->primary != pbp->secondary)) {
-	    tmp = xf86DupResList(pbp->preferred_pmem);
-	    avoid = xf86JoinResLists(avoid, tmp);
-	    tmp = xf86DupResList(pbp->pmem);
-	    avoid = xf86JoinResLists(avoid, tmp);
-	    tmp = xf86DupResList(pbp->preferred_mem);
-	    avoid = xf86JoinResLists(avoid, tmp);
-	    tmp = xf86DupResList(pbp->mem);
-	    avoid = xf86JoinResLists(avoid, tmp);
-	}
-	pbp = pbp->next;
-    }	
-    pciConvertListToHost(pvp->bus,pvp->device,pvp->func, avoid);
-    if (mem)
-	pciConvertListToHost(pvp->bus,pvp->device,pvp->func, mem);
-
+    getPciRangesForMapping(pvp,&m,&avoid);
+    
     if (!ret) {
 	/* Return a possible window */
-	while (m) {
-	    range = xf86GetBlock(RANGE_TYPE(ResExcMemBlock, xf86GetPciDomain(tag)),
-				 PCI_SIZE(ResMem, TAG(pvp), 1 << biosSize),
-				 m->block_begin, m->block_end,
-				 PCI_SIZE(ResMem, TAG(pvp), alignment), 
-				 avoid);
-	    if (range.type != ResEnd) {
-		ret =  M2B(TAG(pvp), range.rBase);
-		break;
-	    }
-	    m = m->next;
-	}
+	ret = findPciRange(tag,m,avoid,biosSize);
     } else {
 #if !defined(__ia64__) /* on ia64, trust the kernel, don't look for overlaps */
+	if (mem)
+	    pciConvertListToHost(pvp->bus,pvp->device,pvp->func, mem);
 	if (!xf86IsSubsetOf(range, m) || 
 	    ChkConflict(&range, avoid, SETUP) 
 	    || (mem && ChkConflict(&range, mem, SETUP))) 
@@ -1627,6 +1664,22 @@ getValidBIOSBase(PCITAG tag, int num)
     return ret;
 }
 
+memType
+getEmptyPciRange(PCITAG tag, int base_reg)
+{
+    resPtr avoid = NULL, m = NULL;
+    memType ret;
+
+    pciVideoPtr pvp = getPciVideoPtr(tag);
+    if (!pvp) return 0;
+    getPciRangesForMapping(pvp,&m,&avoid);
+    ret = findPciRange(tag,m,avoid,pvp->size[base_reg]);
+    xf86FreeResList(avoid);
+    xf86FreeResList(m);
+
+    return ret;
+}
+
 /*
  * xf86Bus.c interface
  */
diff --git a/hw/xfree86/dummylib/Makefile.am b/hw/xfree86/dummylib/Makefile.am
index afe419a..1ea2065 100644
--- a/hw/xfree86/dummylib/Makefile.am
+++ b/hw/xfree86/dummylib/Makefile.am
@@ -8,7 +8,7 @@ INCLUDES = $(XORG_INCS)
 
 AM_CFLAGS = $(XORG_CFLAGS) @SERVER_DEFINES@ @LOADER_DEFINES@
 
-libdummy_a_SOURCES = getvalidbios.c \
+libdummy_a_SOURCES = getvalidbios.c getemptypci.c \
                      pcitestmulti.c xf86allocscripi.c \
                      xf86addrestolist.c xf86drvmsg.c xf86drvmsgverb.c \
                      xf86getverb.c \
@@ -20,6 +20,7 @@ libdummy_a_SOURCES = getvalidbios.c \
 libdummy_nonserver_a_SOURCES = \
 	fatalerror.c \
 	getvalidbios.c \
+	getemptypci.c \
 	logvwrite.c \
 	pcitestmulti.c \
 	verrorf.c \
diff --git a/hw/xfree86/dummylib/getemptypci.c b/hw/xfree86/dummylib/getemptypci.c
new file mode 100644
index 0000000..03119d3
--- /dev/null
+++ b/hw/xfree86/dummylib/getemptypci.c
@@ -0,0 +1,19 @@
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+/*
+ * Utility functions required by libxf86_os. 
+ */
+
+memType
+getEmptyPciRange(PCITAG tag, int base_reg)
+{
+    return 0;
+}
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
index 007c07a..eeed8b0 100644
--- a/hw/xfree86/os-support/bus/Pci.c
+++ b/hw/xfree86/os-support/bus/Pci.c
@@ -1068,6 +1068,20 @@ xf86scanpci(int flags)
     return pci_devp;
 }
 
+pciConfigPtr
+xf86GetPciConfigFromTag(PCITAG Tag)
+{
+    pciConfigPtr pDev;
+    int i = 0;
+
+    for (i = 0 ; (pDev = pci_devp[i]) && i <= MAX_PCI_DEVICES; i++) {
+	if (Tag == pDev->tag)
+	    return pDev;
+    }
+
+    return NULL;	/* Bad data */
+}
+
 CARD32
 pciCheckForBrokenBase(PCITAG Tag,int basereg)
 {
@@ -1158,13 +1172,18 @@ handlePciBIOS( PCITAG Tag, int basereg, 
 
 	/* if we use a mem base save it and move it out of the way */
 	if (b_reg >= 0 && b_reg <= 5) {
+	    memType emptybase;
 	    savebase = pciReadLong(Tag, PCI_MAP_REG_START+(b_reg<<2));
 	    xf86MsgVerb(X_INFO,5,"xf86ReadPciBios: modifying membase[%i]"
 			" for device %i:%i:%i\n", basereg,
 			(int)PCI_BUS_FROM_TAG(Tag), (int)PCI_DEV_FROM_TAG(Tag),
 			(int)PCI_FUNC_FROM_TAG(Tag));
+	    if (!(emptybase = getEmptyPciRange(Tag,b_reg))) {
+		xf86Msg(X_ERROR,"Cannot find empty range to map base to\n");
+		return 0;
+	    }
 	    pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2),
-			 (CARD32)~0);
+			 emptybase);
 	}
 	/* Set ROM base address and enable ROM address decoding */
 	pciWriteLong(Tag, PCI_MAP_ROM_REG, romaddr
diff --git a/hw/xfree86/os-support/bus/xf86Pci.h b/hw/xfree86/os-support/bus/xf86Pci.h
index 9c67e85..69254ce 100644
--- a/hw/xfree86/os-support/bus/xf86Pci.h
+++ b/hw/xfree86/os-support/bus/xf86Pci.h
@@ -774,6 +774,7 @@ pointer	      xf86MapPciMem(int ScreenNu
 int	      xf86ReadPciBIOS(unsigned long Offset, PCITAG Tag, int basereg,
 				unsigned char *Buf, int Len);
 pciConfigPtr *xf86scanpci(int flags);
+pciConfigPtr xf86GetPciConfigFromTag(PCITAG Tag);
 
 extern int pciNumBuses;
 
diff --git a/hw/xfree86/os-support/linux/lnx_pci.c b/hw/xfree86/os-support/linux/lnx_pci.c
index 3505887..4d88314 100644
--- a/hw/xfree86/os-support/linux/lnx_pci.c
+++ b/hw/xfree86/os-support/linux/lnx_pci.c
@@ -201,12 +201,14 @@ xf86GetOSOffsetFromPCI(PCITAG tag, int s
             fn = devfn & 0x7;
             if (tag == pciTag(bus,dev,fn)) {
                 /* ok now look through all the BAR values of this device */
+		pciConfigPtr pDev = xf86GetPciConfigFromTag(tag);
+
                 for (ndx=0; ndx<7; ndx++) {
                     unsigned long savePtr, flagMask;
 		    if (ndx == 6) 
-			savePtr = pciReadLong(tag, PCI_CMD_BIOS_REG);
+			savePtr = pDev->pci_baserom;
 		    else /* this the ROM bar */
-			savePtr = pciReadLong(tag, PCI_CMD_BASE_REG + (0x4 * ndx));
+			savePtr = (&pDev->pci_base0)[ndx];
                     /* Ignore unset base addresses. The kernel may
                      * have reported non-zero size and address even
                      * if they are disabled (e.g. disabled ROM BAR).
diff-tree a3da58bf1ccaf81506fa67c0da60144ea900695c (from e8b044ca913f1ac25cfb6aaf4c12fd87dcc1dcc3)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Thu May 18 23:48:46 2006 +0000

    Bug #6377: Ignore disabled BARs, and allow matching BARs aligned to less
        than 16 bytes. (Felix Kühling, ATI)

diff --git a/ChangeLog b/ChangeLog
index 406b740..154f654 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-05-18  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/xfree86/os-support/linux/lnx_pci.c:
+	Bug #6377: Ignore disabled BARs, and allow matching BARs 
+	aligned to less than 16 bytes. (Felix Kühling, ATI)
+
+2006-05-18  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/xfree86/os-support/linux/lnx_acpi.c:
 	Bug #5877: Avoid burning CPU when acpid dies. Require acpid to 
 	be running for ACPI support on Linux. Minor errno handling 
diff --git a/hw/xfree86/os-support/linux/lnx_pci.c b/hw/xfree86/os-support/linux/lnx_pci.c
index cec9226..3505887 100644
--- a/hw/xfree86/os-support/linux/lnx_pci.c
+++ b/hw/xfree86/os-support/linux/lnx_pci.c
@@ -202,22 +202,26 @@ xf86GetOSOffsetFromPCI(PCITAG tag, int s
             if (tag == pciTag(bus,dev,fn)) {
                 /* ok now look through all the BAR values of this device */
                 for (ndx=0; ndx<7; ndx++) {
-                    unsigned long savePtr;
-                    /*
-		     * remember to lop of the last 4bits of the BAR values as they are
-		     * memory attributes
-		     */
+                    unsigned long savePtr, flagMask;
 		    if (ndx == 6) 
-			savePtr = (0xFFFFFFF0) & 
-			    pciReadLong(tag, PCI_CMD_BIOS_REG);
+			savePtr = pciReadLong(tag, PCI_CMD_BIOS_REG);
 		    else /* this the ROM bar */
-			savePtr = (0xFFFFFFF0) & 
-			    pciReadLong(tag, PCI_CMD_BASE_REG + (0x4 * ndx));
+			savePtr = pciReadLong(tag, PCI_CMD_BASE_REG + (0x4 * ndx));
+                    /* Ignore unset base addresses. The kernel may
+                     * have reported non-zero size and address even
+                     * if they are disabled (e.g. disabled ROM BAR).
+                     */
+                    if (savePtr == 0)
+                        continue;
+                    /* Remove memory attribute bits, different for IO
+                     * and memory ranges. */
+                    flagMask = (savePtr & 0x1) ? ~0x3UL : ~0xFUL;
+                    savePtr &= flagMask;
 
                     /* find the index of the incoming base */
-                    if (base >= savePtr && base <= (savePtr + size[ndx])) {
+                    if (base >= savePtr && base < (savePtr + size[ndx])) {
                         fclose(file);
-                        return (offset[ndx] & ~(0xFUL)) + (base - savePtr);
+                        return (offset[ndx] & flagMask) + (base - savePtr);
                     }
                 }
             }
diff-tree e8b044ca913f1ac25cfb6aaf4c12fd87dcc1dcc3 (from f398a6988e3a3740419a6cbc8cbe178aebe37272)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Thu May 18 18:18:30 2006 +0000

    Bug #5877: Avoid burning CPU when acpid dies. Require acpid to be running
        for ACPI support on Linux. Minor errno handling fixes. (Valery
        Inozemtsev, Adam Jackson)

diff --git a/ChangeLog b/ChangeLog
index 7eb9257..406b740 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2006-05-18  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/xfree86/os-support/linux/lnx_acpi.c:
+	Bug #5877: Avoid burning CPU when acpid dies. Require acpid to 
+	be running for ACPI support on Linux. Minor errno handling 
+	fixes. (Valery Inozemtsev, Adam Jackson)
+
+2006-05-18  Adam Jackson  <ajax at freedesktop.org>
+
 	* fb/fbcompose.c:
 	Bug #6827: Fix texel fetch in fbFetchTransformed to avoid 
 	crashes. Still not 100% correct, but better than 7.0. (Radek 
diff --git a/hw/xfree86/os-support/linux/lnx_acpi.c b/hw/xfree86/os-support/linux/lnx_acpi.c
index 0c69ea1..6712c09 100644
--- a/hw/xfree86/os-support/linux/lnx_acpi.c
+++ b/hw/xfree86/os-support/linux/lnx_acpi.c
@@ -16,7 +16,6 @@
 #include <errno.h>
  
 #define ACPI_SOCKET  "/var/run/acpid.socket"
-#define ACPI_EVENTS  "/proc/acpi/event"
 
 #define ACPI_VIDEO_NOTIFY_SWITCH	0x80
 #define ACPI_VIDEO_NOTIFY_PROBE		0x81
@@ -47,8 +46,17 @@ lnxACPIGetEventFromOs(int fd, pmEvent *e
 
     memset(ev, 0, LINE_LENGTH);
 
-    n = read( fd, ev, LINE_LENGTH );
-
+    do {
+	n = read( fd, ev, LINE_LENGTH );
+    } while ((n == -1) && (errno == EAGAIN || errno == EINTR));
+
+    if (n <= 0) {
+	lnxCloseACPI();
+	sleep(1);
+	lnxACPIOpen();
+	return 0;
+    }
+    
     /* Check that we have a video event */
     if (strstr(ev, "video") == ev) {
 	char *video = NULL;
@@ -132,17 +140,10 @@ lnxACPIOpen(void)
 	addr.sun_family = AF_UNIX;
 	strcpy(addr.sun_path, ACPI_SOCKET);
 	if ((r = connect(fd, (struct sockaddr*)&addr, sizeof(addr))) == -1) {
+	    xf86MsgVerb(X_WARNING,3,"Open ACPI failed (%s) (%s)\n", ACPI_SOCKET,
+	    	strerror(errno));
 	    shutdown(fd, 2);
 	    close(fd);
-	    fd = -1;
-	}
-    }
-
-    /* acpid's socket isn't available, so try going direct */
-    if (fd == -1) {
-        if ((fd = open(ACPI_EVENTS, O_RDONLY)) < 0) {
-	    xf86MsgVerb(X_WARNING,3,"Open ACPI failed (%s) (%s)\n", ACPI_EVENTS,
-	    	strerror(errno));
 	    return NULL;
     	}
     }
@@ -150,7 +151,7 @@ lnxACPIOpen(void)
     xf86PMGetEventFromOs = lnxACPIGetEventFromOs;
     xf86PMConfirmEventToOs = lnxACPIConfirmEventToOs;
     ACPIihPtr = xf86AddInputHandler(fd,xf86HandlePMEvents,NULL);
-    xf86MsgVerb(X_INFO,3,"Open ACPI successful (%s)\n", (r != -1) ? ACPI_SOCKET : ACPI_EVENTS);
+    xf86MsgVerb(X_INFO,3,"Open ACPI successful (%s)\n", ACPI_SOCKET);
 
     return lnxCloseACPI;
 }
diff-tree f398a6988e3a3740419a6cbc8cbe178aebe37272 (from f7b2f4f3e5dd3bfae236ac02bb8d6b311ea2baa1)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Thu May 18 14:39:51 2006 +0000

    Bug #6827: Fix texel fetch in fbFetchTransformed to avoid crashes. Still
        not 100% correct, but better than 7.0. (Radek Doulik, Matthias Hopf)

diff --git a/ChangeLog b/ChangeLog
index 5b5b5f2..7eb9257 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-05-18  Adam Jackson  <ajax at freedesktop.org>
+
+	* fb/fbcompose.c:
+	Bug #6827: Fix texel fetch in fbFetchTransformed to avoid 
+	crashes. Still not 100% correct, but better than 7.0. (Radek 
+	Doulik, Matthias Hopf)
+
 2006-05-15  Adam Jackson  <ajax at freedesktop.org>
 
 	* configure.ac:
diff --git a/fb/fbcompose.c b/fb/fbcompose.c
index 1e25227..a9ae6da 100644
--- a/fb/fbcompose.c
+++ b/fb/fbcompose.c
@@ -1,5 +1,5 @@
 /*
- * $XdotOrg: xserver/xorg/fb/fbcompose.c,v 1.27 2006/02/10 22:00:21 anholt Exp $
+ * $XdotOrg: xserver/xorg/fb/fbcompose.c,v 1.27.4.1 2006/04/24 18:45:17 ajax Exp $
  * $XFree86: xc/programs/Xserver/fb/fbcompose.c,v 1.17tsi Exp $
  *
  * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
@@ -2887,7 +2887,7 @@ static void fbFetchTransformed(PicturePt
     FbBits     *bits;
     FbStride    stride;
     int         bpp;
-    int         xoff, yoff;
+    int         xoff, yoff, dx, dy;
     fetchPixelProc   fetch;
     PictVector	v;
     PictVector  unit;
@@ -2902,8 +2902,11 @@ static void fbFetchTransformed(PicturePt
     x += xoff;
     y += yoff;
 
-    v.vector[0] = IntToxFixed(x);
-    v.vector[1] = IntToxFixed(y);
+    dx = pict->pDrawable->x;
+    dy = pict->pDrawable->y;
+
+    v.vector[0] = IntToxFixed(x - dx);
+    v.vector[1] = IntToxFixed(y - dy);
     v.vector[2] = xFixed1;
 
     /* when using convolution filters one might get here without a transform */
@@ -2924,7 +2927,6 @@ static void fbFetchTransformed(PicturePt
     {
         if (pict->repeatType == RepeatNormal) {
             if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) {
-                box = pict->pCompositeClip->extents;
                 for (i = 0; i < width; ++i) {
                     if (!v.vector[2]) {
                         buffer[i] = 0;
@@ -2936,7 +2938,7 @@ static void fbFetchTransformed(PicturePt
                             y = MOD(v.vector[1]>>16, pict->pDrawable->height);
                             x = MOD(v.vector[0]>>16, pict->pDrawable->width);
                         }
-                        buffer[i] = fetch(bits + (y + pict->pDrawable->y)*stride, x + pict->pDrawable->x, indexed);
+                        buffer[i] = fetch(bits + (y + dy)*stride, x + dx, indexed);
                     }
                     v.vector[0] += unit.vector[0];
                     v.vector[1] += unit.vector[1];
@@ -2954,8 +2956,8 @@ static void fbFetchTransformed(PicturePt
                             y = MOD(v.vector[1]>>16, pict->pDrawable->height);
                             x = MOD(v.vector[0]>>16, pict->pDrawable->width);
                         }
-                        if (POINT_IN_REGION (0, pict->pCompositeClip, x, y, &box))
-                            buffer[i] = fetch(bits + (y + pict->pDrawable->y)*stride, x + pict->pDrawable->x, indexed);
+                        if (POINT_IN_REGION (0, pict->pCompositeClip, x + dx, y + dy, &box))
+                            buffer[i] = fetch(bits + (y + dy)*stride, x + dx, indexed);
                         else
                             buffer[i] = 0;
                     }
@@ -2978,8 +2980,8 @@ static void fbFetchTransformed(PicturePt
                             y = v.vector[1]>>16;
                             x = v.vector[0]>>16;
                         }
-                        buffer[i] = ((x < box.x1) | (x >= box.x2) | (y < box.y1) | (y >= box.y2)) ?
-                                    0 : fetch(bits + (y + pict->pDrawable->y)*stride, x + pict->pDrawable->x, indexed);
+                        buffer[i] = ((x < box.x1-dx) | (x >= box.x2-dx) | (y < box.y1-dy) | (y >= box.y2-dy)) ?
+                                    0 : fetch(bits + (y + dy)*stride, x + dx, indexed);
                     }
                     v.vector[0] += unit.vector[0];
                     v.vector[1] += unit.vector[1];
@@ -2997,8 +2999,8 @@ static void fbFetchTransformed(PicturePt
                             y = v.vector[1]>>16;
                             x = v.vector[0]>>16;
                         }
-                        if (POINT_IN_REGION (0, pict->pCompositeClip, x, y, &box))
-                            buffer[i] = fetch(bits + (y + pict->pDrawable->y)*stride, x + pict->pDrawable->x, indexed);
+                        if (POINT_IN_REGION (0, pict->pCompositeClip, x + dx, y + dy, &box))
+                            buffer[i] = fetch(bits + (y + dy)*stride, x + dx, indexed);
                         else
                             buffer[i] = 0;
                     }
@@ -3011,7 +3013,6 @@ static void fbFetchTransformed(PicturePt
     } else if (pict->filter == PictFilterBilinear) {
         if (pict->repeatType == RepeatNormal) {
             if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) {
-                box = pict->pCompositeClip->extents;
                 for (i = 0; i < width; ++i) {
                     if (!v.vector[2]) {
                         buffer[i] = 0;
@@ -3046,13 +3047,13 @@ static void fbFetchTransformed(PicturePt
                         y1 = MOD (y1, pict->pDrawable->height);
                         y2 = MOD (y2, pict->pDrawable->height);
 
-                        b = bits + (y1 + pict->pDrawable->y)*stride;
+                        b = bits + (y1 + dy)*stride;
 
-                        tl = fetch(b, x1 + pict->pDrawable->x, indexed);
-                        tr = fetch(b, x2 + pict->pDrawable->x, indexed);
-                        b = bits + (y2 + pict->pDrawable->y)*stride;
-                        bl = fetch(b, x1 + pict->pDrawable->x, indexed);
-                        br = fetch(b, x2 + pict->pDrawable->x, indexed);
+                        tl = fetch(b, x1 + dx, indexed);
+                        tr = fetch(b, x2 + dx, indexed);
+                        b = bits + (y2 + dy)*stride;
+                        bl = fetch(b, x1 + dx, indexed);
+                        br = fetch(b, x2 + dx, indexed);
 
                         ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx;
                         fb = FbGet8(bl,0) * idistx + FbGet8(br,0) * distx;
@@ -3107,17 +3108,17 @@ static void fbFetchTransformed(PicturePt
                         y1 = MOD (y1, pict->pDrawable->height);
                         y2 = MOD (y2, pict->pDrawable->height);
 
-                        b = bits + (y1 + pict->pDrawable->y)*stride;
+                        b = bits + (y1 + dy)*stride;
 
-                        tl = POINT_IN_REGION(0, pict->pCompositeClip, x1, y1, &box)
-                             ? fetch(b, x1 + pict->pDrawable->x, indexed) : 0;
-                        tr = POINT_IN_REGION(0, pict->pCompositeClip, x2, y1, &box)
-                             ? fetch(b, x2 + pict->pDrawable->x, indexed) : 0;
-                        b = bits + (y2 + pict->pDrawable->y)*stride;
-                        bl = POINT_IN_REGION(0, pict->pCompositeClip, x1, y2, &box)
-                             ? fetch(b, x1 + pict->pDrawable->x, indexed) : 0;
-                        br = POINT_IN_REGION(0, pict->pCompositeClip, x2, y2, &box)
-                             ? fetch(b, x2 + pict->pDrawable->x, indexed) : 0;
+                        tl = POINT_IN_REGION(0, pict->pCompositeClip, x1 + dx, y1 + dy, &box)
+                             ? fetch(b, x1 + dx, indexed) : 0;
+                        tr = POINT_IN_REGION(0, pict->pCompositeClip, x2 + dx, y1 + dy, &box)
+                             ? fetch(b, x2 + dx, indexed) : 0;
+                        b = bits + (y2 + dy)*stride;
+                        bl = POINT_IN_REGION(0, pict->pCompositeClip, x1 + dx, y2 + dy, &box)
+                             ? fetch(b, x1 + dx, indexed) : 0;
+                        br = POINT_IN_REGION(0, pict->pCompositeClip, x2 + dx, y2 + dy, &box)
+                             ? fetch(b, x2 + dx, indexed) : 0;
 
                         ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx;
                         fb = FbGet8(bl,0) * idistx + FbGet8(br,0) * distx;
@@ -3171,13 +3172,13 @@ static void fbFetchTransformed(PicturePt
                         idistx = 256 - distx;
                         idisty = 256 - disty;
 
-                        b = bits + (y1 + pict->pDrawable->y)*stride;
-                        x_off = x1 + pict->pDrawable->x;
+                        b = bits + (y1 + dy)*stride;
+                        x_off = x1 + dx;
 
-                        x1_out = (x1 < box.x1) | (x1 >= box.x2);
-                        x2_out = (x2 < box.x1) | (x2 >= box.x2);
-                        y1_out = (y1 < box.y1) | (y1 >= box.y2);
-                        y2_out = (y2 < box.y1) | (y2 >= box.y2);
+                        x1_out = (x1 < box.x1-dx) | (x1 >= box.x2-dx);
+                        x2_out = (x2 < box.x1-dx) | (x2 >= box.x2-dx);
+                        y1_out = (y1 < box.y1-dy) | (y1 >= box.y2-dy);
+                        y2_out = (y2 < box.y1-dy) | (y2 >= box.y2-dy);
 
                         tl = x1_out|y1_out ? 0 : fetch(b, x_off, indexed);
                         tr = x2_out|y1_out ? 0 : fetch(b, x_off + 1, indexed);
@@ -3233,17 +3234,17 @@ static void fbFetchTransformed(PicturePt
                         idistx = 256 - distx;
                         idisty = 256 - disty;
 
-                        b = bits + (y1 + pict->pDrawable->y)*stride;
-                        x_off = x1 + pict->pDrawable->x;
+                        b = bits + (y1 + dy)*stride;
+                        x_off = x1 + dx;
 
-                        tl = POINT_IN_REGION(0, pict->pCompositeClip, x1, y1, &box)
+                        tl = POINT_IN_REGION(0, pict->pCompositeClip, x1 + dx, y1 + dy, &box)
                              ? fetch(b, x_off, indexed) : 0;
-                        tr = POINT_IN_REGION(0, pict->pCompositeClip, x2, y1, &box)
+                        tr = POINT_IN_REGION(0, pict->pCompositeClip, x2 + dx, y1 + dy, &box)
                              ? fetch(b, x_off + 1, indexed) : 0;
                         b += stride;
-                        bl = POINT_IN_REGION(0, pict->pCompositeClip, x1, y2, &box)
+                        bl = POINT_IN_REGION(0, pict->pCompositeClip, x1 + dx, y2 + dy, &box)
                              ? fetch(b, x_off, indexed) : 0;
-                        br = POINT_IN_REGION(0, pict->pCompositeClip, x2, y2, &box)
+                        br = POINT_IN_REGION(0, pict->pCompositeClip, x2 + dx, y2 + dy, &box)
                              ? fetch(b, x_off + 1, indexed) : 0;
 
                         ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx;
@@ -3301,9 +3302,9 @@ static void fbFetchTransformed(PicturePt
                     for (x = x1; x < x2; x++) {
                         if (*p) {
                             int tx = (pict->repeatType == RepeatNormal) ? MOD (x, pict->pDrawable->width) : x;
-                            if (POINT_IN_REGION (0, pict->pCompositeClip, tx, ty, &box)) {
-                                FbBits *b = bits + (ty + pict->pDrawable->y)*stride;
-                                CARD32 c = fetch(b, tx + pict->pDrawable->x, indexed);
+                            if (POINT_IN_REGION (0, pict->pCompositeClip, tx + dx, ty + dy, &box)) {
+                                FbBits *b = bits + (ty + dy)*stride;
+                                CARD32 c = fetch(b, tx + dx, indexed);
 
                                 srtot += Red(c) * *p;
                                 sgtot += Green(c) * *p;
diff-tree f7b2f4f3e5dd3bfae236ac02bb8d6b311ea2baa1 (from 1a628eabafd8b204f799e5841e4efdf038deb792)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon May 15 18:27:09 2006 +0000

    Bug #5209: Fix APM/ACPI support, again. (Michel Dänzer, Valery Inozemtsev)

diff --git a/ChangeLog b/ChangeLog
index 3e891ec..5b5b5f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2006-05-15  Adam Jackson  <ajax at freedesktop.org>
 
+	* configure.ac:
+	* hw/xfree86/os-support/linux/lnx_acpi.c:
+	Bug #5209: Fix APM/ACPI support, again. (Michel Dänzer, Valery 
+	Inozemtsev)
+
+2006-05-15  Adam Jackson  <ajax at freedesktop.org>
+
 	* Xext/sync.c:
 	Bug #6903: Fix a crash in the Sync extension.  (Søren Sandmann)
 
diff --git a/configure.ac b/configure.ac
index 891537a..1f1bc45 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1065,7 +1065,7 @@ if test "x$XORG" = xyes -o "x$XGL" = xye
 			XORG_OS_PCI="axp"
 			xorg_bus_linuxpci="no"
 			;;
-		  x86*)
+		  i*86|amd64*|x86_64*)
 			linux_acpi="yes"
 			;;
 		  *)
diff --git a/hw/xfree86/os-support/linux/lnx_acpi.c b/hw/xfree86/os-support/linux/lnx_acpi.c
index 3d048c7..0c69ea1 100644
--- a/hw/xfree86/os-support/linux/lnx_acpi.c
+++ b/hw/xfree86/os-support/linux/lnx_acpi.c
@@ -1,3 +1,7 @@
+#ifdef HAVE_XORG_CONFIG_H
+#include "xorg-config.h"
+#endif
+
 #include "os.h"
 #include "xf86.h"
 #include "xf86Priv.h"
diff-tree 1a628eabafd8b204f799e5841e4efdf038deb792 (from 7dfd0bee62dc134135475e34c167e357ec3424aa)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon May 15 17:56:47 2006 +0000

    Bug #6903: Fix a crash in the Sync extension. (Søren Sandmann)

diff --git a/ChangeLog b/ChangeLog
index c800c52..3e891ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-05-15  Adam Jackson  <ajax at freedesktop.org>
 
+	* Xext/sync.c:
+	Bug #6903: Fix a crash in the Sync extension.  (Søren Sandmann)
+
+2006-05-15  Adam Jackson  <ajax at freedesktop.org>
+
 	* configure.ac:
 	Bug #6916: Build fix for non-Linux.  (Matthieu Herrb)
 
diff --git a/Xext/sync.c b/Xext/sync.c
index c88d81c..e1383ce 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -302,22 +302,33 @@ SyncDeleteTriggerFromCounter(pTrigger)
     SyncTrigger *pTrigger;
 {
     SyncTriggerList *pCur;
+    SyncTriggerList *pPrev;
 
     /* pCounter needs to be stored in pTrigger before calling here. */
 
     if (!pTrigger->pCounter)
 	return;
 
-    for (pCur = pTrigger->pCounter->pTriglist; pCur; pCur = pCur->next)
+    pPrev = NULL;
+    pCur = pTrigger->pCounter->pTriglist;
+
+    while (pCur)
     {
 	if (pCur->pTrigger == pTrigger)
 	{
-	    pTrigger->pCounter->pTriglist = pCur->next;
+	    if (pPrev)
+		pPrev->next = pCur->next;
+	    else
+		pTrigger->pCounter->pTriglist = pCur->next;
+	    
 	    xfree(pCur);
 	    break;
 	}
+	
+	pPrev = pCur;
+	pCur = pCur->next;
     }
-
+    
     if (IsSystemCounter(pTrigger->pCounter))
 	SyncComputeBracketValues(pTrigger->pCounter, /*startOver*/ TRUE);
 }
diff-tree 7dfd0bee62dc134135475e34c167e357ec3424aa (from d654dde3e042c854b5230fd2b2300567661146f4)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon May 15 17:53:59 2006 +0000

    Bug #6916: Build fix for non-Linux. (Matthieu Herrb)

diff --git a/ChangeLog b/ChangeLog
index 51584d9..c800c52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-15  Adam Jackson  <ajax at freedesktop.org>
+
+	* configure.ac:
+	Bug #6916: Build fix for non-Linux.  (Matthieu Herrb)
+
 2006-05-12  Adam Jackson  <ajax at freedesktop.org>
 
 	* configure.ac:
diff --git a/configure.ac b/configure.ac
index eb5f118..891537a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1054,11 +1054,11 @@ if test "x$XORG" = xyes -o "x$XGL" = xye
 		XORG_OS_SUBDIR="linux"
 		XORG_OS_KBD="Lnx"
 		xorg_bus_linuxpci="yes"
-		AM_CONDITIONAL(LNXACPI,false)
+		linux_acpi="no"
 		case $host_cpu in
 		  ia64*)
 			linux_ia64=yes
-			AM_CONDITIONAL(LNXACPI,true)
+			linux_acpi="yes"
 			;;
 		  alpha*)
 		  	linux_alpha=yes
@@ -1066,7 +1066,7 @@ if test "x$XORG" = xyes -o "x$XGL" = xye
 			xorg_bus_linuxpci="no"
 			;;
 		  x86*)
-			AM_CONDITIONAL(LNXACPI,true)
+			linux_acpi="yes"
 			;;
 		  *)
 			;;
@@ -1283,6 +1283,7 @@ AM_CONDITIONAL([XORG_BUS_SPARC], [test "
 AM_CONDITIONAL([XORG_LOADER_SPARC], [test "x$xorg_loader_sparcmuldiv" = xyes])
 AM_CONDITIONAL([LINUX_IA64], [test "x$linux_ia64" = xyes])
 AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes])
+AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes])
 AM_CONDITIONAL([SOLARIS_USL_CONSOLE], [test "x$solaris_usl_console" = xyes])
 AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes])
 AM_CONDITIONAL(MFB, [test "x$XORG" = xyes])
diff-tree d654dde3e042c854b5230fd2b2300567661146f4 (from ba454e6f51de4a4c55d1cf5ed02d85c258a0a777)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri May 12 20:47:46 2006 +0000

    Bump to 1.0.99.903

diff --git a/ChangeLog b/ChangeLog
index 1266462..51584d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-12  Adam Jackson  <ajax at freedesktop.org>
+
+	* configure.ac:
+	Bump to 1.0.99.903
+
 2006-05-10  Adam Jackson  <ajax at freedesktop.org>
 
 	* record/record.c:
diff --git a/configure.ac b/configure.ac
index c18fd3a..eb5f118 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,8 +24,9 @@ dnl Process this file with autoconf to c
 
 AC_PREREQ(2.57)
 dnl This is the not the Xorg version number, it's the server version number.
-dnl Yes, that's weird.
-AC_INIT([xorg-server], 1.0.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+dnl Yes, that's weird.  Also, when you change this, be sure to change the
+dnl DEFAULT_VERSION_* variables below.
+AC_INIT([xorg-server], 1.0.99.903, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
@@ -288,9 +289,9 @@ DEFAULT_VENDOR_NAME="The X.Org Foundatio
 DEFAULT_VENDOR_NAME_SHORT="X.Org"
 DEFAULT_VERSION_MAJOR=7
 DEFAULT_VERSION_MINOR=0
-DEFAULT_VERSION_PATCH=0
-DEFAULT_VERSION_SNAP=0
-DEFAULT_RELEASE_DATE="21 December 2005"
+DEFAULT_VERSION_PATCH=99
+DEFAULT_VERSION_SNAP=903
+DEFAULT_RELEASE_DATE="12 May 2006"
 DEFAULT_VENDOR_WEB="http://wiki.x.org"
 
 m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])
diff-tree ba454e6f51de4a4c55d1cf5ed02d85c258a0a777 (from 3a332610eb5853652263139bce4db4ba2242dd48)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Wed May 10 15:44:18 2006 +0000

    Bug #3561: Crash fix in the Record extension. (Paul Anderson)

diff --git a/ChangeLog b/ChangeLog
index f8a9f8b..1266462 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-10  Adam Jackson  <ajax at freedesktop.org>
+
+	* record/record.c:
+	Bug #3561: Crash fix in the Record extension. (Paul Anderson)
+
 2006-05-09  Adam Jackson  <ajax at freedesktop.org>
 
 	* render/render.c:
diff --git a/record/record.c b/record/record.c
index 8814edc..070a120 100644
--- a/record/record.c
+++ b/record/record.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xserver/xorg/record/record.c,v 1.6 2006/02/10 22:00:30 anholt Exp $ */
+/* $XdotOrg: xserver/xorg/record/record.c,v 1.7 2006/03/28 01:21:00 ajax Exp $ */
 /* $Xorg: record.c,v 1.4 2001/02/09 02:05:27 xorgcvs Exp $ */
 
 /*
@@ -785,13 +785,13 @@ RecordADeliveredEventOrError(CallbackLis
 	    xEvent *pev = pei->events;
 	    for (ev = 0; ev < pei->count; ev++, pev++)
 	    {
-		int recordit;
-		if (pev->u.u.type == X_Error)
+		int recordit = 0;
+		if (pRCAP->pErrorSet)
 		{
 		    recordit = RecordIsMemberOfSet(pRCAP->pErrorSet,
 						((xError *)(pev))->errorCode);
 		}
-		else
+		else if (pRCAP->pDeliveredEventSet)
 		{
 		    recordit = RecordIsMemberOfSet(pRCAP->pDeliveredEventSet,
 						   pev->u.u.type & 0177);
diff-tree 3a332610eb5853652263139bce4db4ba2242dd48 (from 421576f413b40ee58220e7d57fa0033f2cbee259)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Tue May 9 22:35:52 2006 +0000

    Bug #6867: Yet another Render crash fix. (Michel Dänzer)

diff --git a/ChangeLog b/ChangeLog
index 6cfcb13..f8a9f8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-05-09  Adam Jackson  <ajax at freedesktop.org>
 
+	* render/render.c:
+	Bug #6867: Yet another Render crash fix. (Michel Dänzer)
+
+2006-05-09  Adam Jackson  <ajax at freedesktop.org>
+
 	* configure.ac:
 	* hw/xfree86/Makefile.am:
 	* hw/xfree86/common/Makefile.am:
diff --git a/render/render.c b/render/render.c
index 6cd8621..73522ee 100644
--- a/render/render.c
+++ b/render/render.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xserver/xorg/render/render.c,v 1.12 2005/08/28 19:47:39 ajax Exp $ */
+/* $XdotOrg: xserver/xorg/render/render.c,v 1.13 2006/02/10 22:00:30 anholt Exp $ */
 /*
  * $XFree86: xc/programs/Xserver/render/render.c,v 1.27tsi Exp $
  *
@@ -747,7 +747,7 @@ ProcRenderComposite (ClientPtr client)
     VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, 
 		  RenderErrBase + BadPicture);
     if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
-	(pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen))
+	(pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen))
 	return BadMatch;
     CompositePicture (stuff->op,
 		      pSrc,
diff-tree 421576f413b40ee58220e7d57fa0033f2cbee259 (from a9fc172112a3eb0f6be5141756540cdd253e7831)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Tue May 9 18:04:19 2006 +0000

    Bug #5209: Re-enable building APM and ACPI support. (Michel Dänzer)

diff --git a/ChangeLog b/ChangeLog
index 8c6af18..6cfcb13 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2006-05-09  Adam Jackson  <ajax at freedesktop.org>
+
+	* configure.ac:
+	* hw/xfree86/Makefile.am:
+	* hw/xfree86/common/Makefile.am:
+	* hw/xfree86/common/xf86Globals.c:
+	* hw/xfree86/common/xf86Init.c:
+	* hw/xfree86/os-support/linux/Makefile.am:
+	* hw/xfree86/os-support/linux/lnx_acpi.c:
+	* hw/xfree86/os-support/linux/lnx_apm.c:
+	Bug #5209: Re-enable building APM and ACPI support. (Michel 
+	Dänzer)
+
 2006-05-03  Alan Coopersmith  <alan.coopersmith at sun.com>
 
         * configure.ac:
diff --git a/configure.ac b/configure.ac
index 3aa5355..c18fd3a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -111,7 +111,8 @@ AC_CHECK_HEADERS([linux/agpgart.h sys/ag
 AM_CONDITIONAL(AGP, [test "x$AGP" = xyes])
 
 dnl APM header
-AC_CHECK_HEADERS([linux/apm_bios.h])
+AC_CHECK_HEADERS([linux/apm_bios.h], LNXAPM=yes)
+AM_CONDITIONAL(LNXAPM, [test "x$LNXAPM" = xyes])
 
 dnl fbdev header
 AC_CHECK_HEADERS([linux/fb.h], FBDEV=yes)
@@ -1045,19 +1046,27 @@ if test "x$XORG" = xyes -o "x$XGL" = xye
 
 	case $host_os in
 	  linux*)
+		if test "x$LNXAPM" = xyes; then
+			XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
+		fi
 	  	XORG_OS="linux"
 		XORG_OS_SUBDIR="linux"
 		XORG_OS_KBD="Lnx"
 		xorg_bus_linuxpci="yes"
+		AM_CONDITIONAL(LNXACPI,false)
 		case $host_cpu in
 		  ia64*)
 			linux_ia64=yes
+			AM_CONDITIONAL(LNXACPI,true)
 			;;
 		  alpha*)
 		  	linux_alpha=yes
 			XORG_OS_PCI="axp"
 			xorg_bus_linuxpci="no"
 			;;
+		  x86*)
+			AM_CONDITIONAL(LNXACPI,true)
+			;;
 		  *)
 			;;
 		esac
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 1bec719..8665926 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -21,20 +21,24 @@ INCLUDES = @XORG_INCS@ 
 
 Xorg_SOURCES = xorg.c
 
-DISTCLEANFILES = xorg.c
+# libxorgos and libcommon need symbols from each other
+noinst_LTLIBRARIES = libosandcommon.la
+libosandcommon_la_SOURCES = osandcommon.c
+libosandcommon_la_LIBADD = \
+            os-support/libxorgos.la \
+            common/libcommon.la
 
-xorg.c:
+osandcommon.c xorg.c:
 	touch $@
 
-OS_LIBS = os-support/libxorgos.la
+DISTCLEANFILES = osandcommon.c xorg.c
 
 XORG_LIBS = \
             @XORG_CORE_LIBS@ \
             common/libinit.a \
             loader/libloader.a \
-            common/libcommon.a \
+            libosandcommon.la \
             parser/libxf86config.a \
-            $(OS_LIBS) \
             dummylib/libdummy.a \
 	    dixmods/libdixmods.la \
             @XORG_LIBS@
diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am
index 8dfcf36..0fe8aff 100644
--- a/hw/xfree86/common/Makefile.am
+++ b/hw/xfree86/common/Makefile.am
@@ -1,4 +1,5 @@
-noinst_LIBRARIES = libcommon.a libinit.a
+noinst_LIBRARIES = libinit.a
+noinst_LTLIBRARIES = libcommon.la
 
 if XORG_BUS_SPARC
 SBUS_SOURCES = xf86sbusBus.c
@@ -30,7 +31,7 @@ xf86DefModeSet.c: $(srcdir)/modeline2c.p
 BUILT_SOURCES = xf86DefModeSet.c
 
 AM_LDFLAGS = -r
-libcommon_a_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \
+libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \
                       xf86Cursor.c xf86DGA.c xf86DPMS.c \
                       xf86DoProbe.c xf86DoScanPci.c xf86Events.c \
                       xf86Globals.c xf86Io.c xf86AutoConfig.c \
@@ -41,7 +42,7 @@ libcommon_a_SOURCES = xf86Configure.c xf
                       $(XVSOURCES) $(BUSSOURCES) $(XKBSOURCES) \
                       $(DEBUGSOURCES) $(XISOURCES) $(RANDRSOURCES) \
                       $(KBDSOURCES)
-nodist_libcommon_a_SOURCES = xf86DefModeSet.c
+nodist_libcommon_la_SOURCES = xf86DefModeSet.c
 libinit_a_SOURCES = xf86Build.h xf86Init.c
 
 INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \
@@ -98,4 +99,8 @@ EXTRA_DIST = \
 	modeline2c.pl \
         $(DISTKBDSOURCES)
 
+if LNXACPI
+XORG_CFLAGS += -DHAVE_ACPI
+endif
+
 AM_CFLAGS = $(XORG_CFLAGS) @SERVER_DEFINES@ @LOADER_DEFINES@
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 2066a2b..49321b1 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -216,7 +216,9 @@ Bool xf86sFlag = FALSE;
 Bool xf86bsEnableFlag = FALSE;
 Bool xf86bsDisableFlag = FALSE;
 Bool xf86silkenMouseDisableFlag = FALSE;
+#ifdef HAVE_ACPI
 Bool xf86acpiDisableFlag = FALSE;
+#endif
 char *xf86LayoutName = NULL;
 char *xf86ScreenName = NULL;
 char *xf86PointerName = NULL;
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index d5741aa..e04bec8 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1,5 +1,5 @@
 /* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.212 2004/01/27 01:31:45 dawes Exp $ */
-/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Init.c,v 1.33 2006/03/25 19:52:03 ajax Exp $ */
+/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Init.c,v 1.33.2.1 2006/04/04 14:16:56 ajax Exp $ */
 
 /*
  * Loosely based on code bearing the following copyright:
@@ -1661,11 +1661,13 @@ ddxProcessArgument(int argc, char **argv
     xf86silkenMouseDisableFlag = TRUE;
     return 1;
   }
+#ifdef HAVE_ACPI
   if (!strcmp(argv[i], "-noacpi"))
   {
     xf86acpiDisableFlag = TRUE;
     return 1;
   }
+#endif
   if (!strcmp(argv[i], "-scanpci"))
   {
     DoScanPci(argc, argv, i);
diff --git a/hw/xfree86/os-support/linux/Makefile.am b/hw/xfree86/os-support/linux/Makefile.am
index 3815b28..d492f96 100644
--- a/hw/xfree86/os-support/linux/Makefile.am
+++ b/hw/xfree86/os-support/linux/Makefile.am
@@ -9,6 +9,16 @@ PLATFORM_PCI_SUPPORT = lnx_ev56.c \
        $(srcdir)/../shared/xf86Axp.c
 endif
 
+if LNXACPI
+ACPI_SOURCES = lnx_acpi.c lnx_apm.c
+XORG_CFLAGS += -DHAVE_ACPI
+endif
+
+if LNXAPM
+APM_SOURCES = lnx_apm.c
+XORG_CFLAGS += -DHAVE_APM
+endif
+
 liblinux_la_SOURCES = lnx_init.c lnx_video.c lnx_io.c lnx_kbd.c lnx_mouse.c \
                      lnx_pci.c lnx_agp.c lnx_kmod.c lnx_KbdMap.c \
                      $(srcdir)/../shared/bios_mmap.c \
@@ -20,6 +30,8 @@ liblinux_la_SOURCES = lnx_init.c lnx_vid
                      $(srcdir)/../shared/stdResource.c \
 		     $(srcdir)/../shared/libc_wrapper.c \
                      $(srcdir)/../shared/at_scancode.c \
+                     $(ACPI_SOURCES) \
+                     $(APM_SOURCES) \
                      $(PLATFORM_PCI_SUPPORT)
 
 AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) @SERVER_DEFINES@ @LOADER_DEFINES@
@@ -28,9 +40,6 @@ INCLUDES = $(XORG_INCS) -I/usr/include/d
 
 # FIXME: These need to be added to the build
 LNX_EXTRA_SOURCES = \
-	lnx_acpi.c \
-	lnx_apm.c \
-	lnx_axp.c \
 	lnx_font.c \
 	lnx_ia64.c \
 	lnx_jstk.c \
diff --git a/hw/xfree86/os-support/linux/lnx_acpi.c b/hw/xfree86/os-support/linux/lnx_acpi.c
index 9d1dea7..3d048c7 100644
--- a/hw/xfree86/os-support/linux/lnx_acpi.c
+++ b/hw/xfree86/os-support/linux/lnx_acpi.c
@@ -1,4 +1,3 @@
-#include "X.h"
 #include "os.h"
 #include "xf86.h"
 #include "xf86Priv.h"
diff --git a/hw/xfree86/os-support/linux/lnx_apm.c b/hw/xfree86/os-support/linux/lnx_apm.c
index bd78d87..a0722ed 100644
--- a/hw/xfree86/os-support/linux/lnx_apm.c
+++ b/hw/xfree86/os-support/linux/lnx_apm.c
@@ -10,6 +10,13 @@
 #include "xf86Priv.h"
 #define XF86_OS_PRIVS
 #include "xf86_OSproc.h"
+
+#ifdef HAVE_ACPI
+extern PMClose lnxACPIOpen(void);
+#endif
+
+#ifdef HAVE_APM
+
 #include "lnx.h"
 #include <linux/apm_bios.h>
 #include <unistd.h>
@@ -30,7 +37,6 @@
 #endif
 
 static PMClose lnxAPMOpen(void);
-extern PMClose lnxACPIOpen(void);
 static void lnxCloseAPM(void);
 static pointer APMihPtr = NULL;
 
@@ -126,22 +132,30 @@ lnxPMConfirmEventToOs(int fd, pmEvent ev
     }
 }
 
+#endif // HAVE_APM
+
 PMClose
 xf86OSPMOpen(void)
 {
 	PMClose ret = NULL;
 
+#ifdef HAVE_ACPI
 	/* Favour ACPI over APM, but only when enabled */
 
 	if (!xf86acpiDisableFlag)
 		ret = lnxACPIOpen();
 
 	if (!ret)
+#endif
+#ifdef HAVE_APM
 		ret = lnxAPMOpen();
+#endif
 
 	return ret;
 }
 
+#ifdef HAVE_APM
+
 static PMClose
 lnxAPMOpen(void)
 {
@@ -190,3 +204,4 @@ lnxCloseAPM(void)
     }
 }
 
+#endif // HAVE_APM
diff-tree a9fc172112a3eb0f6be5141756540cdd253e7831 (from de5979beb626521e0c45d122d9185000ddfa84fc)
Author: Alan Coopersmith <Alan.Coopersmith at sun.com>
Date:   Wed May 3 21:57:18 2006 +0000

    Fix Solaris build with Sun compilers to work when exa is built before
        hw/xfree86/os-support/solaris (as it is by default now).

diff --git a/ChangeLog b/ChangeLog
index 83a0522..8c6af18 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2006-05-03  Alan Coopersmith  <alan.coopersmith at sun.com>
 
+        * configure.ac:
+        * exa/Makefile.am:
+        Fix Solaris build with Sun compilers to work when exa is built before
+        hw/xfree86/os-support/solaris (as it is by default now).
+
+2006-05-03  Alan Coopersmith  <alan.coopersmith at sun.com>
+
 	* os/WaitFor.c:
         Use min() [defined in include/misc.h] instead of MIN() [not defined in
         any Xorg header].
diff --git a/configure.ac b/configure.ac
index c3555b8..3aa5355 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1142,7 +1142,8 @@ if test "x$XORG" = xyes -o "x$XGL" = xye
 		esac
 		AC_SUBST([SOLARIS_INOUT_ARCH])
 		if test x$solaris_asm_inline = xyes ; then
-			XORG_CFLAGS="${XORG_CFLAGS} "'$(top_srcdir)/hw/xfree86/os-support/solaris/solaris-${SOLARIS_INOUT_ARCH}.il'
+			SOLARIS_ASM_CFLAGS='$(top_srcdir)/hw/xfree86/os-support/solaris/solaris-$(SOLARIS_INOUT_ARCH).il'
+			XORG_CFLAGS="${XORG_CFLAGS} "'$(SOLARIS_ASM_CFLAGS)'
 		fi
 		;;
 	  *)
diff --git a/exa/Makefile.am b/exa/Makefile.am
index c9cbf9b..98db027 100644
--- a/exa/Makefile.am
+++ b/exa/Makefile.am
@@ -1,5 +1,9 @@
 noinst_LTLIBRARIES = libexa.la
 
+# Override these since EXA doesn't need them and the needed files aren't
+# built (in hw/xfree86/os-support/solaris) until after EXA is built
+SOLARIS_ASM_CFLAGS=""
+
 if XORG
 sdk_HEADERS = exa.h
 endif
diff-tree de5979beb626521e0c45d122d9185000ddfa84fc (from ba9d2461f97c25248e7ef0b8a0e00b244f613444)
Author: Alan Coopersmith <Alan.Coopersmith at sun.com>
Date:   Wed May 3 21:52:37 2006 +0000

    Use min() [defined in include/misc.h] instead of MIN() [not defined in any
        Xorg header].

diff --git a/ChangeLog b/ChangeLog
index 48eef69..83a0522 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-05-03  Alan Coopersmith  <alan.coopersmith at sun.com>
+
+	* os/WaitFor.c:
+        Use min() [defined in include/misc.h] instead of MIN() [not defined in
+        any Xorg header].
+
 2006-05-02  Adam Jackson  <ajax at freedesktop.org>
 
 	* render/mitri.c:
diff --git a/os/WaitFor.c b/os/WaitFor.c
index a4f0f4c..f132e0e 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -641,7 +641,7 @@ ScreenSaverTimeoutExpire(OsTimerPtr time
     if (timeout < ScreenSaverTime)
     {
 	return nextTimeout > 0 ? 
-		MIN(ScreenSaverTime - timeout, nextTimeout) :
+		min(ScreenSaverTime - timeout, nextTimeout) :
 		ScreenSaverTime - timeout;
     }
 
@@ -651,7 +651,7 @@ ScreenSaverTimeoutExpire(OsTimerPtr time
     if (ScreenSaverInterval > 0)
     {
 	nextTimeout = nextTimeout > 0 ? 
-		MIN(ScreenSaverInterval, nextTimeout) :
+		min(ScreenSaverInterval, nextTimeout) :
 		ScreenSaverInterval;
     }
 
@@ -695,7 +695,7 @@ SetScreenSaverTimer(void)
     if (ScreenSaverTime > 0)
     {
 	timeout = timeout > 0 ?
-		MIN(ScreenSaverTime, timeout) :
+		min(ScreenSaverTime, timeout) :
 		ScreenSaverTime;
     }
 
diff-tree ba9d2461f97c25248e7ef0b8a0e00b244f613444 (from 1246fc2eba3e4fd1eab1d1f9172847bea5b9f077)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Tue May 2 14:37:49 2006 +0000

    Bug #6642: Fix buffer overflow in Render. (CVE 2006-1526, patch from Eric
        Anholt)

diff --git a/ChangeLog b/ChangeLog
index 87a3558..48eef69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-05-02  Adam Jackson  <ajax at freedesktop.org>
+
+	* render/mitri.c:
+	Bug #6642: Fix buffer overflow in Render.  (CVE 2006-1526, patch
+	from Eric Anholt)
+
 2006-04-28  Adam Jackson  <ajax at freedesktop.org>
 
 	* configure.ac:
diff --git a/render/mitri.c b/render/mitri.c
index 9742253..bc26418 100644
--- a/render/mitri.c
+++ b/render/mitri.c
@@ -145,7 +145,7 @@ miTriStrip (CARD8	    op,
     if (npoint < 3)
 	return;
     ntri = npoint - 2;
-    tris = ALLOCATE_LOCAL (ntri & sizeof (xTriangle));
+    tris = ALLOCATE_LOCAL (ntri * sizeof (xTriangle));
     if (!tris)
 	return;
     for (tri = tris; npoint >= 3; npoint--, points++, tri++)
@@ -177,7 +177,7 @@ miTriFan (CARD8		op,
     if (npoint < 3)
 	return;
     ntri = npoint - 2;
-    tris = ALLOCATE_LOCAL (ntri & sizeof (xTriangle));
+    tris = ALLOCATE_LOCAL (ntri * sizeof (xTriangle));
     if (!tris)
 	return;
     first = points++;
diff-tree 1246fc2eba3e4fd1eab1d1f9172847bea5b9f077 (from a6186a51f2e61e7ed7dcddc9c51e6864d4f20d82)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 28 23:14:00 2006 +0000

    Bump to 1.0.99.902

diff --git a/ChangeLog b/ChangeLog
index 637c62b..87a3558 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-28  Adam Jackson  <ajax at freedesktop.org>
 
+	* configure.ac:
+	Bump to 1.0.99.902
+
+2006-04-28  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/xfree86/common/xf86pciBus.c:
 	* hw/xfree86/os-support/shared/stdResource.c:
 	Bug #6750: Fixup for quirky Intel bridges. (Dave Airlie)
diff --git a/configure.ac b/configure.ac
index 42653a0..c3555b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,7 +25,7 @@ dnl Process this file with autoconf to c
 AC_PREREQ(2.57)
 dnl This is the not the Xorg version number, it's the server version number.
 dnl Yes, that's weird.
-AC_INIT([xorg-server], 1.0.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+AC_INIT([xorg-server], 1.0.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
diff-tree a6186a51f2e61e7ed7dcddc9c51e6864d4f20d82 (from 267133e37732631c74d0f41b9217474188b2bcd4)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 28 22:33:12 2006 +0000

    Bug #6750: Fixup for quirky Intel bridges. (Dave Airlie)

diff --git a/ChangeLog b/ChangeLog
index 5ce62cd..637c62b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-04-28  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/xfree86/common/xf86pciBus.c:
+	* hw/xfree86/os-support/shared/stdResource.c:
+	Bug #6750: Fixup for quirky Intel bridges. (Dave Airlie)
+
+2006-04-28  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/xfree86/os-support/bus/Pci.c:
 	* hw/xfree86/os-support/bus/Pci.h:
 	* hw/xfree86/os-support/bus/linuxPci.c:
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index e06dce5..af19b37 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -1774,7 +1774,16 @@ xf86GetPciBridgeInfo(void)
 		PciBus->brfunc = pcrp->funcnum;
 
 		PciBus->subclass = sub_class;
-		PciBus->interface = pcrp->pci_prog_if;
+
+		/* The Intel bridges don't report as transparent
+		   but guess what they are - from Linux kernel - airlied */
+		if ((pcrp->pci_vendor == PCI_VENDOR_INTEL) && 
+		   ((pcrp->pci_device & 0xff00) == 0x2400)) {
+			xf86MsgVerb(X_INFO, 3, "Intel Bridge workaround enabled\n");
+			PciBus->interface = PCI_IF_BRIDGE_PCI_SUBTRACTIVE;
+		} else {
+			PciBus->interface = pcrp->pci_prog_if;
+		}
 
 		if (pBusInfo && pBusInfo->funcs->pciControlBridge)
 		    PciBus->brcontrol =
diff --git a/hw/xfree86/os-support/shared/stdResource.c b/hw/xfree86/os-support/shared/stdResource.c
index 8599973..83ad0bb 100644
--- a/hw/xfree86/os-support/shared/stdResource.c
+++ b/hw/xfree86/os-support/shared/stdResource.c
@@ -150,10 +150,11 @@ xf86StdAccResFromOS(resPtr ret)
     ret = xf86AddResToList(ret, &range, -1);
     RANGE(range, 0xfee00000, 0xfeefffff, ResExcMemBlock | ResBios);
     ret = xf86AddResToList(ret, &range, -1);
-#endif
+    /* airlied - remove BIOS range it shouldn't be here 
+       this should use E820 - or THE OS */
     RANGE(range, 0xffe00000, 0xffffffff, ResExcMemBlock | ResBios);
     ret = xf86AddResToList(ret, &range, -1);
-
+#endif
     /*
      * Fallback would be to claim well known ports in the 0x0 - 0x3ff range
      * along with their sparse I/O aliases, but that's too imprecise.  Instead
diff-tree 267133e37732631c74d0f41b9217474188b2bcd4 (from c28a0c78502757bad606dee692b8dce3d3a747f0)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 28 22:28:56 2006 +0000

    Bug #6751: Use sysfs to read card ROMs if available. (Dave Airlie)

diff --git a/ChangeLog b/ChangeLog
index bfc9b87..5ce62cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-04-28  Adam Jackson  <ajax at freedesktop.org>
+
+	* hw/xfree86/os-support/bus/Pci.c:
+	* hw/xfree86/os-support/bus/Pci.h:
+	* hw/xfree86/os-support/bus/linuxPci.c:
+	Bug #6751: Use sysfs to read card ROMs if available. (Dave 
+	Airlie)
+
 2006-04-24  Adam Jackson  <ajax at freedesktop.org>
 
 	* fb/fbcompose.c:
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
index 15cd8f4..007c07a 100644
--- a/hw/xfree86/os-support/bus/Pci.c
+++ b/hw/xfree86/os-support/bus/Pci.c
@@ -236,6 +236,8 @@ static pciConfigPtr pci_devp[MAX_PCI_DEV
 static int readPciBios( PCITAG Tag, CARD8* tmp, ADDRESS hostbase,
 			unsigned char * buf, int len, PciBiosType BiosType );
 
+static int (*pciOSHandleBIOS)(PCITAG Tag, int basereg, unsigned char *buf, int len);
+
 /*
  * Platform specific PCI function pointers.
  *
@@ -269,6 +271,11 @@ pciInit()
 #endif
 }
 
+void pciSetOSBIOSPtr(int (*bios_fn)(PCITAG Tag, int basereg, unsigned char * buf, int len))
+{
+	pciOSHandleBIOS = bios_fn;
+}
+
 _X_EXPORT PCITAG
 pciFindFirst(CARD32 id, CARD32 mask)
 {
@@ -1279,6 +1286,13 @@ HandlePciBios(PCITAG Tag, int basereg, u
   PCITAG *pTag;
   int i;
 
+  /* fall back to the old code if the OS code fails */
+  if (pciOSHandleBIOS) {
+  	n = pciOSHandleBIOS(Tag, basereg, buf, len);
+  	if (n)
+      		return n;
+  }
+
   n = handlePciBIOS( Tag, basereg, buf, len );
   if (n)
       return n;
diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h
index 833c07a..32088fe 100644
--- a/hw/xfree86/os-support/bus/Pci.h
+++ b/hw/xfree86/os-support/bus/Pci.h
@@ -425,6 +425,7 @@ CARD32        pciByteSwap(CARD32);
 Bool          pciMfDev(int, int);
 ADDRESS       pciAddrNOOP(PCITAG tag, PciAddrType type, ADDRESS);
 
+extern void pciSetOSBIOSPtr(int (*bios_fn)(PCITAG Tag, int basereg, unsigned char * buf, int len));
 extern PCITAG (*pciFindFirstFP)(void);
 extern PCITAG (*pciFindNextFP)(void);
 
diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
index 3dce431..092f28f 100644
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -73,6 +73,7 @@ static CARD8 linuxPciCfgReadByte(PCITAG 
 static void linuxPciCfgWriteByte(PCITAG tag, int off, CARD8 val);
 static CARD16 linuxPciCfgReadWord(PCITAG tag, int off);
 static void linuxPciCfgWriteWord(PCITAG tag, int off, CARD16 val);
+static int linuxPciHandleBIOS(PCITAG Tag, int basereg, unsigned char *buf, int len);
 
 static pciBusFuncs_t linuxFuncs0 = {
 /* pciReadLong      */	linuxPciCfgRead,
@@ -121,6 +122,7 @@ linuxPciInit()
 	pciBusInfo[0]  = &linuxPci0;
 	pciFindFirstFP = pciGenFindFirst;
 	pciFindNextFP  = pciGenFindNext;
+	pciSetOSBIOSPtr(linuxPciHandleBIOS);
 }
 
 static int
@@ -888,3 +890,44 @@ xf86AccResFromOS(resPtr pRes)
 }
 
 #endif /* !INCLUDE_XF86_NO_DOMAIN */
+
+int linuxPciHandleBIOS(PCITAG Tag, int basereg, unsigned char *buf, int len)
+{
+  unsigned int dom, bus, dev, func;
+  unsigned int fd;
+  char file[256];
+  struct stat st;
+  int ret;
+  int sofar = 0;
+
+  dom  = PCI_DOM_FROM_TAG(Tag);
+  bus  = PCI_BUS_FROM_TAG(Tag);
+  dev  = PCI_DEV_FROM_TAG(Tag);
+  func = PCI_FUNC_FROM_TAG(Tag);
+  sprintf(file, "/sys/bus/pci/devices/%04x:%02x:%02x.%1x/rom",
+	  dom, bus, dev, func);
+
+  if (stat(file, &st) == 0)
+  {
+    if ((fd = open(file, O_RDWR)))
+      basereg = 0x0;
+    
+    /* enable the ROM first */
+    write(fd, "1", 2);
+    lseek(fd, 0, SEEK_SET);
+    do {
+        /* copy the ROM until we hit Len, EOF or read error */
+    	ret = read(fd, buf+sofar, len-sofar);
+    	if (ret <= 0)
+		break;
+	sofar += ret;
+    } while (sofar < len);
+    
+    write(fd, "0", 2);
+    close(fd);
+    if (sofar < len)
+    	xf86MsgVerb(X_INFO, 3, "Attempted to read BIOS %dKB from %s: got %dKB\n", len/1024, file, sofar/1024);
+    return sofar;
+  }
+  return 0;
+}
diff-tree c28a0c78502757bad606dee692b8dce3d3a747f0 (from 8826dc31c75f815583845b93f3014477b0a6483e)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon Apr 24 19:22:58 2006 +0000

    Bug #6472: Fix a static buffer overflow. (David Woodhouse)

diff --git a/ChangeLog b/ChangeLog
index 6b4905a..bfc9b87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@
 	* render/picture.h:
 	Bug #6325: Add support for x4a4 picture format.
 
+	* hw/xfree86/os-support/linux/lnx_KbdMap.c:
+	Bug #6472: Fix a static buffer overflow.  (David Woodhouse)
+
 2006-04-18  Donnie Berkholz  <spyderous at gentoo.org>
 
 	reviewed by: Alan Coopersmith
diff --git a/hw/xfree86/os-support/linux/lnx_KbdMap.c b/hw/xfree86/os-support/linux/lnx_KbdMap.c
index 3a5a57b..a2a2e22 100644
--- a/hw/xfree86/os-support/linux/lnx_KbdMap.c
+++ b/hw/xfree86/os-support/linux/lnx_KbdMap.c
@@ -180,7 +180,7 @@ static KeySym linux_to_x[256] = {
 /*
  * Maps the AT keycodes to Linux keycodes
  */
-static unsigned char at2lnx[NUM_KEYCODES] =
+static unsigned char at2lnx[] =
 {
 	0x01,	/* KEY_Escape */	0x02,	/* KEY_1 */
 	0x03,	/* KEY_2 */		0x04,	/* KEY_3 */
diff-tree 8826dc31c75f815583845b93f3014477b0a6483e (from 20890f97461b7ee88906a6daf955ddd6f3efcda1)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon Apr 24 18:45:17 2006 +0000

    Bug #6325: Add support for x4a4 picture format.

diff --git a/ChangeLog b/ChangeLog
index 706f507..6b4905a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-04-24  Adam Jackson  <ajax at freedesktop.org>
+
+	* fb/fbcompose.c:
+	* render/picture.c:
+	* render/picture.h:
+	Bug #6325: Add support for x4a4 picture format.
+
 2006-04-18  Donnie Berkholz  <spyderous at gentoo.org>
 
 	reviewed by: Alan Coopersmith
diff --git a/fb/fbcompose.c b/fb/fbcompose.c
index f8e0139..1e25227 100644
--- a/fb/fbcompose.c
+++ b/fb/fbcompose.c
@@ -1,5 +1,5 @@
 /*
- * $XdotOrg: xserver/xorg/fb/fbcompose.c,v 1.26 2005/12/09 18:35:20 ajax Exp $
+ * $XdotOrg: xserver/xorg/fb/fbcompose.c,v 1.27 2006/02/10 22:00:21 anholt Exp $
  * $XFree86: xc/programs/Xserver/fb/fbcompose.c,v 1.17tsi Exp $
  *
  * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
@@ -385,6 +385,17 @@ fbFetch_c8 (const FbBits *bits, int x, i
     }
 }
 
+static FASTCALL void
+fbFetch_x4a4 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
+{
+    const CARD8 *pixel = (const CARD8 *)bits + x;
+    const CARD8 *end = pixel + width;
+    while (pixel < end) {
+	CARD8 p = (*pixel++) & 0xf;
+        *buffer++ = (p | (p << 4)) << 24;
+    }
+}
+
 #define Fetch8(l,o)    (((CARD8 *) (l))[(o) >> 2])
 #if IMAGE_BYTE_ORDER == MSBFirst
 #define Fetch4(l,o)    ((o) & 2 ? Fetch8(l,o) & 0xf : Fetch8(l,o) >> 4)
@@ -548,7 +559,8 @@ static fetchProc fetchProcForPicture (Pi
     case PICT_a2b2g2r2: return fbFetch_a2b2g2r2;
     case PICT_c8: return  fbFetch_c8;
     case PICT_g8: return  fbFetch_c8;
-
+    case PICT_x4a4: return fbFetch_x4a4;
+    
         /* 4bpp formats */
     case PICT_a4: return  fbFetch_a4;
     case PICT_r1g2b1: return fbFetch_r1g2b1;
@@ -1261,6 +1273,16 @@ fbStore_c8 (FbBits *bits, const CARD32 *
     }
 }
 
+static FASTCALL void
+fbStore_x4a4 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
+{
+    int i;
+    CARD8   *pixel = ((CARD8 *) bits) + x;
+    for (i = 0; i < width; ++i) {
+        *pixel++ = values[i] >> 28;
+    }
+}
+
 #define Store8(l,o,v)  (((CARD8 *) l)[(o) >> 3] = (v))
 #if IMAGE_BYTE_ORDER == MSBFirst
 #define Store4(l,o,v)  Store8(l,o,((o) & 4 ? \
@@ -1412,6 +1434,7 @@ static storeProc storeProcForPicture (Pi
     case PICT_a2r2g2b2: return fbStore_a2r2g2b2;
     case PICT_c8: return  fbStore_c8;
     case PICT_g8: return  fbStore_c8;
+    case PICT_x4a4: return fbStore_x4a4;
 
         /* 4bpp formats */
     case PICT_a4: return  fbStore_a4;
diff --git a/render/picture.c b/render/picture.c
index 8d4d77e..ee385e5 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -234,10 +234,14 @@ PictureCreateDefaultFormats (ScreenPtr p
     formats[nformats].format = PICT_a1;
     formats[nformats].depth = 1;
     nformats++;
-    formats[nformats].format = PICT_a8;
+    formats[nformats].format = PICT_FORMAT(BitsPerPixel(8),
+					   PICT_TYPE_A,
+					   8, 0, 0, 0);
     formats[nformats].depth = 8;
     nformats++;
-    formats[nformats].format = PICT_a4;
+    formats[nformats].format = PICT_FORMAT(BitsPerPixel(4),
+					   PICT_TYPE_A,
+					   4, 0, 0, 0);
     formats[nformats].depth = 4;
     nformats++;
     formats[nformats].format = PICT_a8r8g8b8;
diff --git a/render/picture.h b/render/picture.h
index b09d9aa..778eb5c 100644
--- a/render/picture.h
+++ b/render/picture.h
@@ -100,6 +100,15 @@ typedef struct _Picture		*PicturePtr;
 #define PICT_c8		PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0)
 #define PICT_g8		PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0)
 
+#define PICT_x4a4	PICT_FORMAT(8,PICT_TYPE_A,4,0,0,0)
+#define PICT_x4r1g2b1	PICT_FORMAT(8,PICT_TYPE_ARGB,0,1,2,1)
+#define PICT_x4b1g2r1	PICT_FORMAT(8,PICT_TYPE_ABGR,0,1,2,1)
+#define PICT_x4a1r1g1b1	PICT_FORMAT(8,PICT_TYPE_ARGB,1,1,1,1)
+#define PICT_x4a1b1g1r1	PICT_FORMAT(8,PICT_TYPE_ABGR,1,1,1,1)
+				    
+#define PICT_x4c4	PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0)
+#define PICT_x4g4	PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0)
+
 /* 4bpp formats */
 #define PICT_a4		PICT_FORMAT(4,PICT_TYPE_A,4,0,0,0)
 #define PICT_r1g2b1	PICT_FORMAT(4,PICT_TYPE_ARGB,0,1,2,1)
diff-tree 20890f97461b7ee88906a6daf955ddd6f3efcda1 (from c7a2971dc18bae08a4f25cb3e70320cb75614515)
Author: Donnie Berkholz <spyderous at gentoo.org>
Date:   Tue Apr 18 17:30:20 2006 +0000

    Update all prefixes in config tools, so they mostly work again. Also, make
        RgbPath commented out when using xorgconfig. Start using
        /dev/input/mice as the default mouse location on Linux.

diff --git a/ChangeLog b/ChangeLog
index 90e276d..706f507 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2006-04-18  Donnie Berkholz  <spyderous at gentoo.org>
+
+	reviewed by: Alan Coopersmith
+
+	* hw/xfree86/utils/xorgcfg/interface.c:
+	* hw/xfree86/utils/xorgcfg/keyboard-cfg.c:
+	* hw/xfree86/utils/xorgcfg/keyboard-cfg.h:
+	* hw/xfree86/utils/xorgcfg/loader.c:
+	* hw/xfree86/utils/xorgcfg/text-mode.c:
+	* hw/xfree86/utils/xorgconfig/cards.c:
+	* hw/xfree86/utils/xorgconfig/xorgconfig.c:
+	Update all prefixes in config tools, so they mostly work again. Also, make
+	RgbPath commented out when using xorgconfig. Start using /dev/input/mice as
+	the default mouse location on Linux.
+
 2006-04-17  Donnie Berkholz  <spyderous at gentoo.org>
 
 	reviewed by: Adam Jackson
diff --git a/hw/xfree86/utils/xorgcfg/interface.c b/hw/xfree86/utils/xorgcfg/interface.c
index e329d90..b6ac82a 100644
--- a/hw/xfree86/utils/xorgcfg/interface.c
+++ b/hw/xfree86/utils/xorgcfg/interface.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: $ */
+/* $XdotOrg: xserver/xorg/hw/xfree86/utils/xorgcfg/interface.c,v 1.8 2005/11/08 06:33:30 jkj Exp $ */
 /*
  * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
  * 
@@ -65,7 +65,7 @@
 #ifdef PROJECT_ROOT
 #define DefaultXFree86Dir	PROJECT_ROOT
 #else
-#define DefaultXFree86Dir	"/usr/X11R6"
+#define DefaultXFree86Dir	"/usr"
 #endif
 
 #define IS_KBDDRIV(S) ((strcasecmp((S),"kbd") == 0) || \
diff --git a/hw/xfree86/utils/xorgcfg/keyboard-cfg.c b/hw/xfree86/utils/xorgcfg/keyboard-cfg.c
index 334070d..991092d 100644
--- a/hw/xfree86/utils/xorgcfg/keyboard-cfg.c
+++ b/hw/xfree86/utils/xorgcfg/keyboard-cfg.c
@@ -72,7 +72,7 @@ static void UpdateRulesPopups(void);
  */
 static XF86XkbRulesDescInfo **xkb_desc, *xkb_rules;
 static int num_xkb_desc;
-static char *XkbRulesDir = "lib/X11/xkb/rules/";
+static char *XkbRulesDir = "share/X11/xkb/rules/";
 #ifdef XFREE98_XKB
 static char *XkbRulesFile = "xfree98";
 #else
diff --git a/hw/xfree86/utils/xorgcfg/keyboard-cfg.h b/hw/xfree86/utils/xorgcfg/keyboard-cfg.h
index 915bb0b..64438bd 100644
--- a/hw/xfree86/utils/xorgcfg/keyboard-cfg.h
+++ b/hw/xfree86/utils/xorgcfg/keyboard-cfg.h
@@ -38,7 +38,7 @@
 /*
  * All file names are from XProjectRoot or XWINHOME environment variable.
  */
-#define	XkbConfigDir		"lib/X11/xkb/"
+#define	XkbConfigDir		"share/X11/xkb/"
 #define	XkbConfigFile		"X0-config.keyboard"
 
 /*
diff --git a/hw/xfree86/utils/xorgcfg/loader.c b/hw/xfree86/utils/xorgcfg/loader.c
index 98a661d..3737870 100644
--- a/hw/xfree86/utils/xorgcfg/loader.c
+++ b/hw/xfree86/utils/xorgcfg/loader.c
@@ -26,7 +26,7 @@
  *
  * Author: Paulo César Pereira de Andrade <pcpa at conectiva.com.br>
  *
- * $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c,v 1.3 2004/12/04 00:43:11 kuhn Exp $
+ * $XdotOrg: xserver/xorg/hw/xfree86/utils/xorgcfg/loader.c,v 1.5 2005/12/08 17:54:40 kem Exp $
  * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c,v 1.19 2002/06/06 21:03:32 paulo Exp $
  */
 
@@ -55,7 +55,7 @@
 #include <stdarg.h>
 
 #ifndef OPTIONSPATH
-#define OPTIONSPATH "/usr/X11R6/lib/X11"
+#define OPTIONSPATH "/usr/lib/X11"
 #endif
 
 #ifndef SIGNALRETURNSINT
diff --git a/hw/xfree86/utils/xorgcfg/text-mode.c b/hw/xfree86/utils/xorgcfg/text-mode.c
index 3c6acce..bb61eae 100644
--- a/hw/xfree86/utils/xorgcfg/text-mode.c
+++ b/hw/xfree86/utils/xorgcfg/text-mode.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: $ */
+/* $XdotOrg: xserver/xorg/hw/xfree86/utils/xorgcfg/text-mode.c,v 1.6 2005/12/08 17:54:40 kem Exp $ */
 /*
  * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
  * 
@@ -52,12 +52,12 @@
 	(strcmp((X), "keyboard") == 0))
 
 #ifndef PROJECT_ROOT
-#define PROJECT_ROOT "/usr/X11R6"
+#define PROJECT_ROOT "/usr"
 #endif
 
 #ifndef XKB_RULES_DIR
 #ifndef __UNIXOS2__
-#define XKB_RULES_DIR PROJECT_ROOT "/lib/X11/xkb/rules"
+#define XKB_RULES_DIR PROJECT_ROOT "/share/X11/xkb/rules"
 #else
 #define XKB_RULES_DIR XF86CONFIGDIR "/xkb/rules"
 #endif
@@ -557,6 +557,8 @@ MouseConfig(void)
 	str = "/dev/sysmouse";
 #elif defined(__UNIXOS2__)
 	str = "mouse$";
+#elif defined(__linux__)
+	str = "/dev/input/mice";
 #else
 	str = "/dev/mouse";
 #endif
diff --git a/hw/xfree86/utils/xorgconfig/cards.c b/hw/xfree86/utils/xorgconfig/cards.c
index 29c1c0e..b5f23a0 100644
--- a/hw/xfree86/utils/xorgconfig/cards.c
+++ b/hw/xfree86/utils/xorgconfig/cards.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86config/cards.c,v 1.3 2004/08/13 23:57:38 alanc Exp $ */
+/* $XdotOrg: xserver/xorg/hw/xfree86/utils/xorgconfig/cards.c,v 1.4 2005/07/01 22:43:35 daniels Exp $ */
 /* $XConsortium: cards.c /main/9 1996/10/19 18:15:32 kaleb $ */
 
 
@@ -19,7 +19,7 @@
 
 /* Some vars to make path names in texts more flexible. */
 #ifndef PROJECTROOT
-# define PROJECTROOT		"/usr/X11R6"
+# define PROJECTROOT		"/usr"
 #endif
 #define TREEROOT		PROJECTROOT
 #define TREEROOTLX		TREEROOT "/lib/X11"
diff --git a/hw/xfree86/utils/xorgconfig/xorgconfig.c b/hw/xfree86/utils/xorgconfig/xorgconfig.c
index 227803c..4570e08 100644
--- a/hw/xfree86/utils/xorgconfig/xorgconfig.c
+++ b/hw/xfree86/utils/xorgconfig/xorgconfig.c
@@ -94,7 +94,7 @@
  *  Chisato Yamauchi(cyamauch at phyas.aichi-edu.ac.jp)
  */
 /* $XConsortium: xf86config.c /main/21 1996/10/28 05:43:57 kaleb $ */
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86config/xorgconfig.c,v 1.14 2005/05/28 00:08:03 alanc Exp $ */
+/* $XdotOrg: xserver/xorg/hw/xfree86/utils/xorgconfig/xorgconfig.c,v 1.19 2005/11/08 06:33:30 jkj Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "xorg-server.h"
@@ -157,11 +157,12 @@ static int getuid() { return 0; }
  * may be more irritated than Unix users
  */
 #ifndef PROJECTROOT
-#define PROJECTROOT		"/usr/X11R6"
+#define PROJECTROOT		"/usr"
 #endif
 #define TREEROOT		PROJECTROOT
 #define TREEROOTLX		TREEROOT "/lib/X11"
 #define TREEROOTCFG		TREEROOT "/etc/X11"
+#define TREEROOTSHARE		TREEROOT "/share/X11"
 #ifdef XDOCDIR
 # define TREEROOTDOC		XDOCDIR
 #else
@@ -494,6 +495,8 @@ struct {
 # define DEF_MOUSEDEV "/dev/wsmouse";
 #elif defined(__FreeBSD__)
 # define DEF_MOUSEDEV "/dev/sysmouse";
+#elif defined(__linux__)
+# define DEF_MOUSEDEV "/dev/input/mice";
 #else
 # define DEF_MOUSEDEV "/dev/mouse";
 #endif
@@ -1970,7 +1973,7 @@ static char *XF86Config_firstchunk_text 
 "# file minus the extension (like \".txt\" or \".db\").  There is normally\n"
 "# no need to change the default.\n"
 "\n"
-"    RgbPath	\"" TREEROOTLX "/rgb\"\n"
+"#    RgbPath	\"" TREEROOTSHARE "/rgb\"\n"
 "\n"
 "# Multiple FontPath entries are allowed (which are concatenated together),\n"
 "# as well as specifying multiple comma-separated entries in one FontPath\n"
diff-tree c7a2971dc18bae08a4f25cb3e70320cb75614515 (from 22f77bbcca23d037232199a8f59ae71364c2fbee)
Author: Donnie Berkholz <spyderous at gentoo.org>
Date:   Tue Apr 18 00:25:37 2006 +0000

    Bug #6628: Wrap a couple more SDK headers in if XORG, as per Dave Airlie's
        commit on 2006-01-18.

diff --git a/ChangeLog b/ChangeLog
index 8e31fe0..90e276d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,15 @@
 
 	reviewed by: Adam Jackson
 
+	* exa/Makefile.am:
+	* randr/Makefile.am:
+	Bug #6628: Wrap a couple more SDK headers in if XORG, as per Dave Airlie's
+	commit on 2006-01-18.
+
+2006-04-17  Donnie Berkholz  <spyderous at gentoo.org>
+
+	reviewed by: Adam Jackson
+
 	* hw/kdrive/ephyr/Makefile.am:
 	Bug #6628: Fix kdrive build by linking in libexa before KDRIVE_LIBS.
 
diff --git a/exa/Makefile.am b/exa/Makefile.am
index a499205..c9cbf9b 100644
--- a/exa/Makefile.am
+++ b/exa/Makefile.am
@@ -1,6 +1,8 @@
 noinst_LTLIBRARIES = libexa.la
 
+if XORG
 sdk_HEADERS = exa.h
+endif
 
 INCLUDES = \
 	$(XORG_INCS) \
diff --git a/randr/Makefile.am b/randr/Makefile.am
index 3070142..753eebb 100644
--- a/randr/Makefile.am
+++ b/randr/Makefile.am
@@ -2,7 +2,9 @@ noinst_LTLIBRARIES = librandr.la
 
 AM_CFLAGS = $(DIX_CFLAGS) @SERVER_DEFINES@ @LOADER_DEFINES@
 
+if XORG
 sdk_HEADERS = randrstr.h
+endif
 
 librandr_la_SOURCES =	\
 	mirandr.c	\
diff-tree 22f77bbcca23d037232199a8f59ae71364c2fbee (from c854cbcd84ea93c56635ace275f610bd6721e424)
Author: Donnie Berkholz <spyderous at gentoo.org>
Date:   Tue Apr 18 00:22:54 2006 +0000

    Bug #6628: Fix kdrive build by linking in libexa before KDRIVE_LIBS.

diff --git a/ChangeLog b/ChangeLog
index f671f5e..8e31fe0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-04-17  Donnie Berkholz  <spyderous at gentoo.org>
+
+	reviewed by: Adam Jackson
+
+	* hw/kdrive/ephyr/Makefile.am:
+	Bug #6628: Fix kdrive build by linking in libexa before KDRIVE_LIBS.
+
 2006-04-15  Luc Verhaegen  <libv at skynet.be>
 
 	* hw/xfree86/utils/cvt/cvt.c: (PrintUsage):
diff --git a/hw/kdrive/ephyr/Makefile.am b/hw/kdrive/ephyr/Makefile.am
index 43b4dcc..f423bfe 100644
--- a/hw/kdrive/ephyr/Makefile.am
+++ b/hw/kdrive/ephyr/Makefile.am
@@ -31,11 +31,11 @@ Xephyr_SOURCES = \
 Xephyr_LDADD = 						\
 	libxephyr.a					\
 	libxephyr-hostx.a			        \
+	../../../exa/libexa.la				\
 	@KDRIVE_LIBS@					\
 	@KDRIVE_LIBS@					\
         $(TSLIB_LIBS)                                   \
-        @XEPHYR_LIBS@					\
-	../../../exa/libexa.la
+        @XEPHYR_LIBS@
 
 Xephyr_DEPENDENCIES =					\
 	libxephyr.a					\
diff-tree c854cbcd84ea93c56635ace275f610bd6721e424 (from c354738e44bb1c66a0a31380f4404604bc72c883)
Author: Luc Verhaegen <libv at skynet.be>
Date:   Sat Apr 15 00:04:21 2006 +0000

    CVT means Coordinated Video Timing instead of Common.

diff --git a/ChangeLog b/ChangeLog
index 38b87a6..f671f5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-04-15  Luc Verhaegen  <libv at skynet.be>
+
+	* hw/xfree86/utils/cvt/cvt.c: (PrintUsage):
+	* hw/xfree86/utils/cvt/cvt.man.pre:
+	CVT means Coordinated Video Timing instead of Common.
+
 2006-04-14  Adam Jackson  <ajax at freedesktop.org>
 
 	* hw/dmx/dmxpixmap.c:
diff --git a/hw/xfree86/utils/cvt/cvt.c b/hw/xfree86/utils/cvt/cvt.c
index 31fa66e..b039ae6 100644
--- a/hw/xfree86/utils/cvt/cvt.c
+++ b/hw/xfree86/utils/cvt/cvt.c
@@ -341,8 +341,8 @@ PrintUsage(char *Name)
     fprintf(stderr, "      refresh : Desired refresh rate (default: 60.0Hz).\n");
     fprintf(stderr, "\n");
 
-    fprintf(stderr, "Calculates VESA CVT (Common Video Timing) modelines for"
-            " use with X.\n");
+    fprintf(stderr, "Calculates VESA CVT (Coordinated Video Timing) modelines"
+	    " for use with X.\n");
 }
 
 
diff --git a/hw/xfree86/utils/cvt/cvt.man.pre b/hw/xfree86/utils/cvt/cvt.man.pre
index 95f11cb..1090724 100644
--- a/hw/xfree86/utils/cvt/cvt.man.pre
+++ b/hw/xfree86/utils/cvt/cvt.man.pre
@@ -11,7 +11,7 @@ cvt - calculate VESA CVT mode lines
 .RB [ refresh ]
 .SH DESCRIPTION
 .I Cvt
-is a utility for calculating VESA Common Video Timing modes.  Given the
+is a utility for calculating VESA Coordinated Video Timing modes.  Given the
 desired horizontal and vertical resolutions, a modeline adhering to the CVT
 standard is printed. This modeline can be included in __xservername__ 
 .B __xconfigfile__(__filemansuffix__)
@@ -36,6 +36,7 @@ __xconfigfile__(__filemansuffix__)
 .SH AUTHOR
 Luc Verhaegen.
 .PP
-This program is based on the Common Video Timing sample implementation
-written by Graham Loveridge. This file is publically available at
-<http://www.vesa.org/Public/CVT/CVTd6r1.xls>. CVT is a VESA trademark.
+This program is based on the Coordinated Video Timing sample
+implementation written by Graham Loveridge. This file is publically
+available at <http://www.vesa.org/Public/CVT/CVTd6r1.xls>. CVT is a
+VESA trademark.
diff-tree c354738e44bb1c66a0a31380f4404604bc72c883 (from 101833e7c19550686688bfc90b3936dec5127d38)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 14 23:43:23 2006 +0000

    Coverity #804: Another leak on OOM path.

diff --git a/ChangeLog b/ChangeLog
index 0e285bd..38b87a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-14  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/dmx/dmxpixmap.c:
+	Coverity #804: Another leak on OOM path.
+
+2006-04-14  Adam Jackson  <ajax at freedesktop.org>
+
 	* mi/micmap.c:
 	Coverity #806: Another memory leak on OOM path.
 
diff --git a/hw/dmx/dmxpixmap.c b/hw/dmx/dmxpixmap.c
index e95ddd7..4a669fd 100644
--- a/hw/dmx/dmxpixmap.c
+++ b/hw/dmx/dmxpixmap.c
@@ -213,7 +213,10 @@ RegionPtr dmxBitmapToRegion(PixmapPtr pP
 
     pReg = REGION_CREATE(pScreen, NullBox, 1);
     pTmpReg = REGION_CREATE(pScreen, NullBox, 1);
-    if(!pReg || !pTmpReg) return NullRegion;
+    if(!pReg || !pTmpReg) {
+	XDestroyImage(ximage);
+	return NullRegion;
+    }
 
     for (y = 0; y < pPixmap->drawable.height; y++) {
 	Box.y1 = y;
diff-tree 101833e7c19550686688bfc90b3936dec5127d38 (from 2d5e31076b04c81156f357659af912647894e1cf)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 14 23:38:02 2006 +0000

    Coverity #806: Another memory leak on OOM path.

diff --git a/ChangeLog b/ChangeLog
index c3cc1ce..0e285bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-14  Adam Jackson  <ajax at freedesktop.org>
 
+	* mi/micmap.c:
+	Coverity #806: Another memory leak on OOM path.
+
+2006-04-14  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/xfree86/common/xf86Helper.c:
 	Coverity #847, #848, #849: Three more memory leaks.
 
diff --git a/mi/micmap.c b/mi/micmap.c
index da2f4d8..0e94606 100644
--- a/mi/micmap.c
+++ b/mi/micmap.c
@@ -587,8 +587,10 @@ miDoInitVisuals(VisualPtr *visualp, Dept
 	if (nvtype)
 	{
 	    vid = (VisualID *) xalloc (nvtype * sizeof (VisualID));
-	    if (!vid)
+	    if (!vid) {
+		xfree(preferredCVCs);
 		return FALSE;
+	    }
 	}
 	depth->depth = d;
 	depth->numVids = nvtype;
diff-tree 2d5e31076b04c81156f357659af912647894e1cf (from b584ed481f824cb54d3556f69b88c4807a774907)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 14 23:32:14 2006 +0000

    Coverity #847, #848, #849: Three more memory leaks.

diff --git a/ChangeLog b/ChangeLog
index ba71fd3..c3cc1ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-14  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/xfree86/common/xf86Helper.c:
+	Coverity #847, #848, #849: Three more memory leaks.
+
+2006-04-14  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/dmx/input/dmxcommon.c:
 	Coverity #1003, #1004: Two more useless null checks.
 
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index f417d24..1e77427 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -2677,6 +2677,7 @@ xf86ConfigIsaEntity(ScrnInfoPtr pScrn, i
     if (!pEnt->active) {
 	xf86ConfigIsaEntityInactive(pEnt, i_chip, res, init,  enter,
 				    leave,  private);
+	xfree(pEnt);
 	return pScrn;
     }
 
@@ -2714,6 +2715,7 @@ xf86ConfigPciEntity(ScrnInfoPtr pScrn, i
     if (!pEnt->active) {
 	xf86ConfigPciEntityInactive(pEnt, p_chip, res, init,  enter,
 				    leave,  private);
+	xfree(pEnt);
 	return pScrn;
     }
 
@@ -2755,6 +2757,7 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, in
 
     if (!pEnt->active) {
 	xf86ConfigFbEntityInactive(pEnt, init,  enter, leave,  private);
+	xfree(pEnt);
 	return pScrn;
     }
 
diff-tree b584ed481f824cb54d3556f69b88c4807a774907 (from d017ca616c0b37cd0f697d5786bf57ed94c3cbfb)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 14 23:10:51 2006 +0000

    Coverity #1003, #1004: Two more useless null checks.

diff --git a/ChangeLog b/ChangeLog
index 6e0a1a9..ba71fd3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-14  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/dmx/input/dmxcommon.c:
+	Coverity #1003, #1004: Two more useless null checks.
+
+2006-04-14  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/dmx/input/dmxconsole.c:
 	Coverity #1005: Avoid a null deref.
 
diff --git a/hw/dmx/input/dmxcommon.c b/hw/dmx/input/dmxcommon.c
index 6a2b840..278a74e 100644
--- a/hw/dmx/input/dmxcommon.c
+++ b/hw/dmx/input/dmxcommon.c
@@ -483,7 +483,6 @@ int dmxCommonMouOn(DevicePtr pDev)
     GETPRIVFROMPDEV;
     GETDMXINPUTFROMPRIV;
 
-    if (!priv) return -1;
     priv->eventMask |= DMX_POINTER_EVENT_MASK;
     if (dmxShadowFB) {
         XWarpPointer(priv->display, priv->window, priv->window,
@@ -509,7 +508,6 @@ void dmxCommonMouOff(DevicePtr pDev)
     GETPRIVFROMPDEV;
     GETDMXINPUTFROMPRIV;
     
-    if (!priv) return;
     priv->eventMask &= ~DMX_POINTER_EVENT_MASK;
     if (!priv->be) {
         RemoveEnabledDevice(XConnectionNumber(priv->display));
diff-tree d017ca616c0b37cd0f697d5786bf57ed94c3cbfb (from af9d7591ba0ada32bf4c22ee6c845ed85a3e3f03)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 14 23:09:30 2006 +0000

    Coverity #1005: Avoid a null deref.

diff --git a/ChangeLog b/ChangeLog
index 70ee34d..6e0a1a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-14  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/dmx/input/dmxconsole.c:
+	Coverity #1005: Avoid a null deref.
+
+2006-04-14  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/dmx/input/dmxinputinit.c:
 	Coverity #1007: Fix a silly null check.
 
diff --git a/hw/dmx/input/dmxconsole.c b/hw/dmx/input/dmxconsole.c
index 7a313aa..835909e 100644
--- a/hw/dmx/input/dmxconsole.c
+++ b/hw/dmx/input/dmxconsole.c
@@ -696,10 +696,11 @@ static void dmxConsoleComputeWidthHeight
 void dmxConsoleReInit(DevicePtr pDev)
 {
     GETPRIVFROMPDEV;
-    Display *dpy = priv->display;
+    Display *dpy;
 
     if (!priv || !priv->initialized) return;
-    
+    dpy = priv->display;
+
     dmxConsoleComputeWidthHeight(priv,
                                  &priv->width, &priv->height,
                                  &priv->xScale, &priv->yScale,
diff-tree af9d7591ba0ada32bf4c22ee6c845ed85a3e3f03 (from e47fb22c9235bc38c4f3430178a6fa733ff2c3a7)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 14 23:08:01 2006 +0000

    Coverity #1007: Fix a silly null check.

diff --git a/ChangeLog b/ChangeLog
index b10a3ce..70ee34d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-14  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/dmx/input/dmxinputinit.c:
+	Coverity #1007: Fix a silly null check.
+
+2006-04-14  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/xfree86/os-support/Makefile.am:
 	Bug #6580: Don't install xf86drm.h, that's libdrm's job.
 
diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index 5332dcc..c81eb84 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -429,7 +429,6 @@ static int dmxDeviceOnOff(DeviceIntPtr p
     int              i;
 #endif
     
-    if (!dmxLocal) return BadImplementation;
     if (dmxInput->detached) return Success;
 
     memset(&info, 0, sizeof(info));
diff-tree e47fb22c9235bc38c4f3430178a6fa733ff2c3a7 (from acd7b2c7687a5aebb1972a066916796afcd2228c)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 14 22:51:43 2006 +0000

    undo ChangeLog botching

diff --git a/ChangeLog b/ChangeLog
index e7a81a4..b10a3ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,5 @@
 2006-04-14  Adam Jackson  <ajax at freedesktop.org>
 
-	* ChangeLog:
-	* hw/xfree86/os-support/Makefile.am:
-	Bug #6580: Don't install xf86drm.h, that's libdrm's job.
-
-2006-04-14  Adam Jackson  <ajax at freedesktop.org>
-
 	* hw/xfree86/os-support/Makefile.am:
 	Bug #6580: Don't install xf86drm.h, that's libdrm's job.
 
diff-tree acd7b2c7687a5aebb1972a066916796afcd2228c (from 8def3b3b606714ef157ce600b236612a1952ef80)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 14 22:48:50 2006 +0000

    Bug #6580: Don't install xf86drm.h, that's libdrm's job.

diff --git a/ChangeLog b/ChangeLog
index 6e83e3b..e7a81a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-04-14  Adam Jackson  <ajax at freedesktop.org>
+
+	* ChangeLog:
+	* hw/xfree86/os-support/Makefile.am:
+	Bug #6580: Don't install xf86drm.h, that's libdrm's job.
+
+2006-04-14  Adam Jackson  <ajax at freedesktop.org>
+
+	* hw/xfree86/os-support/Makefile.am:
+	Bug #6580: Don't install xf86drm.h, that's libdrm's job.
+
 Mon Apr 10 11:00:46 2006  Søren Sandmann  <sandmann at redhat.com>
 
 	* composite/compext.c (ProcCompositeReleaseOverlayWindow): Use
diff --git a/hw/xfree86/os-support/Makefile.am b/hw/xfree86/os-support/Makefile.am
index 917b2cb..7897674 100644
--- a/hw/xfree86/os-support/Makefile.am
+++ b/hw/xfree86/os-support/Makefile.am
@@ -5,10 +5,10 @@ endif
 SUBDIRS = bus @XORG_OS_SUBDIR@ misc $(DRI_SUBDIRS)
 DIST_SUBDIRS = bsd bus drm misc linux lynxos solaris sysv sco usl
 
-sdk_HEADERS = xf86_OSproc.h xf86_OSlib.h xf86_ansic.h xf86_libc.h xf86drm.h \
-              xf86drmCompat.h assyntax.h xf86OSKbd.h xf86OSmouse.h
+sdk_HEADERS = xf86_OSproc.h xf86_OSlib.h xf86_ansic.h xf86_libc.h \
+              assyntax.h xf86OSKbd.h xf86OSmouse.h
 
-EXTRA_DIST = int10Defines.h xf86OSpriv.h README.OS-lib
+EXTRA_DIST = int10Defines.h xf86OSpriv.h README.OS-lib xf86drm.h
 
 # to get the grouping semantics right, you have to glom these three together
 # as one library, otherwise libtool will actively defeat your attempts to
diff-tree 8def3b3b606714ef157ce600b236612a1952ef80 (from fbdacb28f2ea54ce924dbb370bbc89407683786a)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 14 22:47:45 2006 +0000

    Bump to 1.0.99.901; don't know how this got missed.

diff --git a/configure.ac b/configure.ac
index 8e78d8b..42653a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,7 +25,7 @@ dnl Process this file with autoconf to c
 AC_PREREQ(2.57)
 dnl This is the not the Xorg version number, it's the server version number.
 dnl Yes, that's weird.
-AC_INIT([xorg-server], 1.0.99.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+AC_INIT([xorg-server], 1.0.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
diff-tree fbdacb28f2ea54ce924dbb370bbc89407683786a (from 476b68cc667cd72c188a2c7d50e3b5ae63fd3bb4)
Author: Søren Sandmann Pedersen <sandmann at daimi.au.dk>
Date:   Mon Apr 10 15:01:30 2006 +0000

    Mon Apr 10 11:00:46 2006 Søren Sandmann <sandmann at redhat.com>
    Use FreeResource() instead of deleteCompOverlayClient().

diff --git a/ChangeLog b/ChangeLog
index 9a66521..6e83e3b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Apr 10 11:00:46 2006  Søren Sandmann  <sandmann at redhat.com>
+
+	* composite/compext.c (ProcCompositeReleaseOverlayWindow): Use
+	FreeResource() instead of deleteCompOverlayClient().
+
 2006-04-07  Aaron Plattner  <aplattner at nvidia.com>
 
 	* hw/xfree86/common/xf86Module.h:
diff --git a/composite/compext.c b/composite/compext.c
index cc9b665..b80a9e6 100644
--- a/composite/compext.c
+++ b/composite/compext.c
@@ -501,7 +501,7 @@ ProcCompositeReleaseOverlayWindow (Clien
 	return BadMatch;
     }
 
-    deleteCompOverlayClient(pOc, pOc->pScreen);
+    FreeResource(pOc->resource, 0);
 
     cs = GetCompScreen(pScreen);
     if (cs->pOverlayClients == NULL) {
diff-tree 476b68cc667cd72c188a2c7d50e3b5ae63fd3bb4 (from 4d5ca0f06c919e6a335739c25161badce37cfff8)
Author: Aaron Plattner <aplattner at nvidia.com>
Date:   Fri Apr 7 19:27:11 2006 +0000

    Bump the ABI versions. Due to Glyph privates and the XV update below, the
        video driver ABI needs to be bumped to 1.0. The rest of the ABI minor
        versions were bumped to include the LoaderGetABIVersion function.
    Add a DrawblePtr argument to the XV hooks. This allows drivers to determine
        that the target window is redirected and draw to the appropriate place.

diff --git a/ChangeLog b/ChangeLog
index d254d40..9a66521 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2006-04-07  Aaron Plattner  <aplattner at nvidia.com>
+
+	* hw/xfree86/common/xf86Module.h:
+	Bump the ABI versions.  Due to Glyph privates and the XV update below,
+	the video driver ABI needs to be bumped to 1.0.  The rest of the ABI
+	minor versions were bumped to include the LoaderGetABIVersion
+	function.
+	* hw/xfree86/common/xf86xv.c: (xf86XVRegetVideo),
+	(xf86XVReputVideo), (xf86XVReputImage), (xf86XVPutStill),
+	(xf86XVGetStill), (xf86XVPutImage):
+	* hw/xfree86/common/xf86xv.h:
+	Add a DrawblePtr argument to the XV hooks.  This allows drivers to
+	determine that the target window is redirected and draw to the
+	appropriate place.
+
 2006-04-07  Adam Jackson  <ajax at freedesktop.org>
 
 	* hw/xfree86/common/xisb.c:
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index fafedba..a325699 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -84,11 +84,11 @@ typedef enum {
  * changed.  The minor revision mask is 0x0000FFFF and the major revision
  * mask is 0xFFFF0000.
  */
-#define ABI_ANSIC_VERSION	SET_ABI_VERSION(0, 2)
-#define ABI_VIDEODRV_VERSION	SET_ABI_VERSION(0, 8)
-#define ABI_XINPUT_VERSION	SET_ABI_VERSION(0, 5)
-#define ABI_EXTENSION_VERSION	SET_ABI_VERSION(0, 2)
-#define ABI_FONT_VERSION	SET_ABI_VERSION(0, 4)
+#define ABI_ANSIC_VERSION	SET_ABI_VERSION(0, 3)
+#define ABI_VIDEODRV_VERSION	SET_ABI_VERSION(1, 0)
+#define ABI_XINPUT_VERSION	SET_ABI_VERSION(0, 6)
+#define ABI_EXTENSION_VERSION	SET_ABI_VERSION(0, 3)
+#define ABI_FONT_VERSION	SET_ABI_VERSION(0, 5)
 
 #define MODINFOSTRING1	0xef23fdc5
 #define MODINFOSTRING2	0x10dc023a
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index 0caca80..ede2e06 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -748,7 +748,8 @@ xf86XVRegetVideo(XvPortRecPrivatePtr por
 			WinBox.x1, WinBox.y1,
 			portPriv->vid_w, portPriv->vid_h,
 			portPriv->drw_w, portPriv->drw_h,
-			&ClipRegion, portPriv->DevPriv.ptr);
+			&ClipRegion, portPriv->DevPriv.ptr,
+			portPriv->pDraw);
 
   if(ret == Success)
 	portPriv->isOn = XV_ON;
@@ -839,7 +840,8 @@ xf86XVReputVideo(XvPortRecPrivatePtr por
 			WinBox.x1, WinBox.y1,
 			portPriv->vid_w, portPriv->vid_h,
 			portPriv->drw_w, portPriv->drw_h,
-			&ClipRegion, portPriv->DevPriv.ptr);
+			&ClipRegion, portPriv->DevPriv.ptr,
+			portPriv->pDraw);
 
   if(ret == Success) portPriv->isOn = XV_ON;
 
@@ -925,7 +927,8 @@ xf86XVReputImage(XvPortRecPrivatePtr por
 
   ret = (*portPriv->AdaptorRec->ReputImage)(portPriv->pScrn,
 			WinBox.x1, WinBox.y1,
-			&ClipRegion, portPriv->DevPriv.ptr);
+			&ClipRegion, portPriv->DevPriv.ptr,
+			portPriv->pDraw);
 
   portPriv->isOn = (ret == Success) ? XV_ON : XV_OFF;
 
@@ -1471,7 +1474,8 @@ xf86XVPutStill(
   ret = (*portPriv->AdaptorRec->PutStill)(portPriv->pScrn,
 		vid_x, vid_y, WinBox.x1, WinBox.y1,
 		vid_w, vid_h, drw_w, drw_h,
-		&ClipRegion, portPriv->DevPriv.ptr);
+		&ClipRegion, portPriv->DevPriv.ptr,
+		pDraw);
 
   if((ret == Success) &&
 	(portPriv->AdaptorRec->flags & VIDEO_OVERLAID_STILLS)) {
@@ -1599,7 +1603,8 @@ xf86XVGetStill(
   ret = (*portPriv->AdaptorRec->GetStill)(portPriv->pScrn,
 		vid_x, vid_y, WinBox.x1, WinBox.y1,
 		vid_w, vid_h, drw_w, drw_h,
-		&ClipRegion, portPriv->DevPriv.ptr);
+		&ClipRegion, portPriv->DevPriv.ptr,
+		pDraw);
 
 GET_STILL_BAILOUT:
 
@@ -1771,7 +1776,8 @@ xf86XVPutImage(
   ret = (*portPriv->AdaptorRec->PutImage)(portPriv->pScrn,
 		src_x, src_y, WinBox.x1, WinBox.y1,
 		src_w, src_h, drw_w, drw_h, format->id, data, width, height,
-		sync, &ClipRegion, portPriv->DevPriv.ptr);
+		sync, &ClipRegion, portPriv->DevPriv.ptr,
+		pDraw);
 
   if((ret == Success) &&
 	(portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) {
diff --git a/hw/xfree86/common/xf86xv.h b/hw/xfree86/common/xf86xv.h
index 316d6c9..fbe60cb 100644
--- a/hw/xfree86/common/xf86xv.h
+++ b/hw/xfree86/common/xf86xv.h
@@ -82,19 +82,19 @@ typedef struct {
 typedef int (* PutVideoFuncPtr)( ScrnInfoPtr pScrn, 
 	short vid_x, short vid_y, short drw_x, short drw_y,
 	short vid_w, short vid_h, short drw_w, short drw_h,
-	RegionPtr clipBoxes, pointer data );
+	RegionPtr clipBoxes, pointer data, DrawablePtr pDraw );
 typedef int (* PutStillFuncPtr)( ScrnInfoPtr pScrn, 
 	short vid_x, short vid_y, short drw_x, short drw_y,
 	short vid_w, short vid_h, short drw_w, short drw_h,
-	RegionPtr clipBoxes, pointer data );
+	RegionPtr clipBoxes, pointer data, DrawablePtr pDraw );
 typedef int (* GetVideoFuncPtr)( ScrnInfoPtr pScrn, 
 	short vid_x, short vid_y, short drw_x, short drw_y,
 	short vid_w, short vid_h, short drw_w, short drw_h,
-	RegionPtr clipBoxes, pointer data );
+	RegionPtr clipBoxes, pointer data, DrawablePtr pDraw );
 typedef int (* GetStillFuncPtr)( ScrnInfoPtr pScrn, 
 	short vid_x, short vid_y, short drw_x, short drw_y,
 	short vid_w, short vid_h, short drw_w, short drw_h,
-	RegionPtr clipBoxes, pointer data );
+	RegionPtr clipBoxes, pointer data, DrawablePtr pDraw );
 typedef void (* StopVideoFuncPtr)(ScrnInfoPtr pScrn, pointer data, Bool Exit);
 typedef int (* SetPortAttributeFuncPtr)(ScrnInfoPtr pScrn, Atom attribute,
 	INT32 value, pointer data);
@@ -107,9 +107,9 @@ typedef int (* PutImageFuncPtr)( ScrnInf
 	short src_x, short src_y, short drw_x, short drw_y,
 	short src_w, short src_h, short drw_w, short drw_h,
 	int image, unsigned char* buf, short width, short height, Bool Sync,
-	RegionPtr clipBoxes, pointer data );
+	RegionPtr clipBoxes, pointer data, DrawablePtr pDraw );
 typedef int (* ReputImageFuncPtr)( ScrnInfoPtr pScrn, short drw_x, short drw_y,
-        RegionPtr clipBoxes, pointer data );
+	RegionPtr clipBoxes, pointer data, DrawablePtr pDraw );
 typedef int (*QueryImageAttributesFuncPtr)(ScrnInfoPtr pScrn, 
 	int image, unsigned short *width, unsigned short *height, 
 	int *pitches, int *offsets);
diff-tree 4d5ca0f06c919e6a335739c25161badce37cfff8 (from 9707962ca5309e48d55c15eae3c9bc22872d3d47)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 7 16:08:39 2006 +0000

    Remove libc wrapper types from Xisb interfaces.

diff --git a/ChangeLog b/ChangeLog
index 2088df5..d254d40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-04-07  Adam Jackson  <ajax at freedesktop.org>
+
+	* hw/xfree86/common/xisb.c:
+	* hw/xfree86/common/xisb.h:
+	Remove libc wrapper types from Xisb interfaces.
+
 2006-04-06  Adam Jackson  <ajax at freedesktop.org>
 
 	* hw/xfree86/parser/Monitor.c:
diff --git a/hw/xfree86/common/xisb.c b/hw/xfree86/common/xisb.c
index 8ec6f4c..9160660 100644
--- a/hw/xfree86/common/xisb.c
+++ b/hw/xfree86/common/xisb.c
@@ -69,7 +69,7 @@
  ****************************************************************************/
 
 _X_EXPORT XISBuffer *
-XisbNew (int fd, xf86ssize_t size)
+XisbNew (int fd, ssize_t size)
 {
 	XISBuffer *b;
 
@@ -142,8 +142,8 @@ XisbRead (XISBuffer *b)
 }
 
 /* the only purpose of this function is to provide output tracing */
-_X_EXPORT xf86ssize_t
-XisbWrite (XISBuffer *b, unsigned char *msg, xf86ssize_t len)
+_X_EXPORT ssize_t
+XisbWrite (XISBuffer *b, unsigned char *msg, ssize_t len)
 {
     if (b->trace)
     {
diff --git a/hw/xfree86/common/xisb.h b/hw/xfree86/common/xisb.h
index 39ae2ee..01ae675 100644
--- a/hw/xfree86/common/xisb.h
+++ b/hw/xfree86/common/xisb.h
@@ -29,6 +29,8 @@
 #ifndef	_xisb_H_
 #define _xisb_H_
 
+#include <unistd.h>
+
 /******************************************************************************
  *		Definitions
  *									structs, typedefs, #defines, enums
@@ -39,9 +41,9 @@ typedef struct _XISBuffer
 	int fd;
 	int trace;
 	int block_duration;
-	xf86ssize_t current;	/* bytes read */
-	xf86ssize_t end;
-	xf86ssize_t buffer_size;
+	ssize_t current;	/* bytes read */
+	ssize_t end;
+	ssize_t buffer_size;
 	unsigned char *buf;
 } XISBuffer;
 
@@ -51,10 +53,10 @@ typedef struct _XISBuffer
  *											of globals.
  *											put locals in the .c file.
  *****************************************************************************/
-XISBuffer * XisbNew (int fd, xf86ssize_t size);
+XISBuffer * XisbNew (int fd, ssize_t size);
 void XisbFree (XISBuffer *b);
 int XisbRead (XISBuffer *b);
-xf86ssize_t XisbWrite (XISBuffer *b, unsigned char *msg, xf86ssize_t len);
+ssize_t XisbWrite (XISBuffer *b, unsigned char *msg, ssize_t len);
 void XisbTrace (XISBuffer *b, int trace);
 void XisbBlockDuration (XISBuffer *b, int block_duration);
 
diff-tree 9707962ca5309e48d55c15eae3c9bc22872d3d47 (from 250a39279ced41b755f109acd6b49fec7a11986e)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 7 01:53:35 2006 +0000

    Coverity #488: Avoid smashing an array on malformed config files.

diff --git a/ChangeLog b/ChangeLog
index 7b35c53..2088df5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-04-06  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/xfree86/parser/Monitor.c:
+	Coverity #488: Avoid smashing an array on malformed config 
+	files.
+
+2006-04-06  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/dmx/glxProxy/glxsingle.c:
 	Coverity #769: Fix a potential memory leak for systems that 
 	allocate on malloc(0)
diff --git a/hw/xfree86/parser/Monitor.c b/hw/xfree86/parser/Monitor.c
index 52ff5a7..f8e42d0 100644
--- a/hw/xfree86/parser/Monitor.c
+++ b/hw/xfree86/parser/Monitor.c
@@ -460,6 +460,8 @@ xf86parseMonitorSection (void)
 			if (xf86getSubToken (&(ptr->mon_comment)) != NUMBER)
 				Error (HORIZSYNC_MSG, NULL);
 			do {
+				if (ptr->mon_n_hsync >= CONF_MAX_HSYNC)
+					Error ("Sorry. Too many horizontal sync intervals.", NULL);
 				ptr->mon_hsync[ptr->mon_n_hsync].lo = val.realnum;
 				switch (token = xf86getSubToken (&(ptr->mon_comment)))
 				{
@@ -485,8 +487,6 @@ xf86parseMonitorSection (void)
 						ptr->mon_n_hsync++;
 						goto HorizDone;
 				}
-				if (ptr->mon_n_hsync >= CONF_MAX_HSYNC)
-					Error ("Sorry. Too many horizontal sync intervals.", NULL);
 				ptr->mon_n_hsync++;
 			} while ((token = xf86getSubToken (&(ptr->mon_comment))) == NUMBER);
 HorizDone:
diff-tree 250a39279ced41b755f109acd6b49fec7a11986e (from eea26623a847dd5bdd175541a43fc3cc1414ff82)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 7 01:49:56 2006 +0000

    Coverity #769: Fix a potential memory leak for systems that allocate on
        malloc(0)

diff --git a/ChangeLog b/ChangeLog
index 766a7c9..7b35c53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-04-06  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/dmx/glxProxy/glxsingle.c:
+	Coverity #769: Fix a potential memory leak for systems that 
+	allocate on malloc(0)
+
+2006-04-06  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/xfree86/common/xf86Config.c:
 	Coverity #838: Plug two more memory leaks.
 
diff --git a/hw/dmx/glxProxy/glxsingle.c b/hw/dmx/glxProxy/glxsingle.c
index 5a8f727..e353263 100644
--- a/hw/dmx/glxProxy/glxsingle.c
+++ b/hw/dmx/glxProxy/glxsingle.c
@@ -801,7 +801,7 @@ int __glXDisp_ReadPixels(__GLXclientStat
     }
 
     buf_size = __glReadPixels_size(format,type,width,height, &ebits, &rowsize);
-    if (buf_size >= 0) {
+    if (buf_size > 0) {
        buf = (char *) Xalloc( buf_size );
        if ( !buf ) {
 	  return( BadAlloc );
diff-tree eea26623a847dd5bdd175541a43fc3cc1414ff82 (from 11b55c80b160efdd1c30c923e682128311bde418)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 7 01:40:52 2006 +0000

    Coverity #838: Plug two more memory leaks.

diff --git a/ChangeLog b/ChangeLog
index ef29009..766a7c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
 2006-04-06  Adam Jackson  <ajax at freedesktop.org>
 
 	* hw/xfree86/common/xf86Config.c:
+	Coverity #838: Plug two more memory leaks.
+
+2006-04-06  Adam Jackson  <ajax at freedesktop.org>
+
+	* hw/xfree86/common/xf86Config.c:
 	Coverity #837: Fix another another memory leak.
 
 2006-04-06  Adam Jackson  <ajax at freedesktop.org>
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index f002678..45cbb76 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Config.c,v 1.23.2.3 2006/04/07 01:35:35 ajax Exp $ */
+/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Config.c,v 1.23.2.4 2006/04/07 01:37:03 ajax Exp $ */
 /* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.276 2003/10/08 14:58:26 dawes Exp $ */
 
 
@@ -1952,8 +1952,10 @@ configLayout(serverLayoutPtr servlayoutp
     idp = conf_layout->lay_inactive_lst;
     count = 0;
     while (idp) {
-	if (!configDevice(&gdp[count], idp->inactive_device, FALSE))
+	if (!configDevice(&gdp[count], idp->inactive_device, FALSE)) {
+	    xfree(gdp);
 	    return FALSE;
+	}
         count++;
         idp = (XF86ConfInactivePtr)idp->list.next;
     }
@@ -1975,8 +1977,10 @@ configLayout(serverLayoutPtr servlayoutp
     irp = conf_layout->lay_input_lst;
     count = 0;
     while (irp) {
-	if (!configInput(&indp[count], irp->iref_inputdev, X_CONFIG))
+	if (!configInput(&indp[count], irp->iref_inputdev, X_CONFIG)) {
+	    xfree(indp);
 	    return FALSE;
+	}
 	indp[count].extraOptions = irp->iref_option_lst;
         count++;
         irp = (XF86ConfInputrefPtr)irp->list.next;
diff-tree 11b55c80b160efdd1c30c923e682128311bde418 (from 2d4a789f438e872d57c8a463c2fb0561cc5f4f32)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 7 01:37:03 2006 +0000

    Coverity #837: Fix another another memory leak.

diff --git a/ChangeLog b/ChangeLog
index e9f13a0..ef29009 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
 2006-04-06  Adam Jackson  <ajax at freedesktop.org>
 
 	* hw/xfree86/common/xf86Config.c:
+	Coverity #837: Fix another another memory leak.
+
+2006-04-06  Adam Jackson  <ajax at freedesktop.org>
+
+	* hw/xfree86/common/xf86Config.c:
 	Coverity #836: Fix another memory leak.
 
 2006-04-06  Adam Jackson  <ajax at freedesktop.org>
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 9b3008f..f002678 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Config.c,v 1.23.2.2 2006/04/07 01:34:20 ajax Exp $ */
+/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Config.c,v 1.23.2.3 2006/04/07 01:35:35 ajax Exp $ */
 /* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.276 2003/10/08 14:58:26 dawes Exp $ */
 
 
@@ -1820,8 +1820,10 @@ configLayout(serverLayoutPtr servlayoutp
 	else
 	    scrnum = adjp->adj_scrnum;
 	if (!configScreen(slp[count].screen, adjp->adj_screen, scrnum,
-			  X_CONFIG))
+			  X_CONFIG)) {
+	    xfree(slp);
 	    return FALSE;
+	}
 	slp[count].x = adjp->adj_x;
 	slp[count].y = adjp->adj_y;
 	slp[count].refname = adjp->adj_refscreen;
diff-tree 2d4a789f438e872d57c8a463c2fb0561cc5f4f32 (from ebd7d7b7c9f2cbeeabe88a0154ffaeed031c4b9b)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 7 01:35:35 2006 +0000

    Coverity #836: Fix another memory leak.

diff --git a/ChangeLog b/ChangeLog
index e3fd9e9..e9f13a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
 2006-04-06  Adam Jackson  <ajax at freedesktop.org>
 
 	* hw/xfree86/common/xf86Config.c:
+	Coverity #836: Fix another memory leak.
+
+2006-04-06  Adam Jackson  <ajax at freedesktop.org>
+
+	* hw/xfree86/common/xf86Config.c:
 	Coverity #835: Plug memory leak in extension section parsing.
 
 2006-04-06  Adam Jackson  <ajax at freedesktop.org>
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 4eba06d..9b3008f 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Config.c,v 1.23.2.1 2006/04/03 21:59:58 ajax Exp $ */
+/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Config.c,v 1.23.2.2 2006/04/07 01:34:20 ajax Exp $ */
 /* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.276 2003/10/08 14:58:26 dawes Exp $ */
 
 
@@ -2034,8 +2034,10 @@ configImpliedLayout(serverLayoutPtr serv
     slp = xnfcalloc(1, 2 * sizeof(screenLayoutRec));
     slp[0].screen = xnfcalloc(1, sizeof(confScreenRec));
     slp[1].screen = NULL;
-    if (!configScreen(slp[0].screen, conf_screen, 0, from))
+    if (!configScreen(slp[0].screen, conf_screen, 0, from)) {
+	xfree(slp);
 	return FALSE;
+    }
     servlayoutp->id = "(implicit)";
     servlayoutp->screens = slp;
     servlayoutp->inactives = xnfcalloc(1, sizeof(GDevRec));
diff-tree ebd7d7b7c9f2cbeeabe88a0154ffaeed031c4b9b (from 725622e863857df7e2eabe8db06765555fb0ae25)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 7 01:34:20 2006 +0000

    Coverity #835: Plug memory leak in extension section parsing.

diff --git a/ChangeLog b/ChangeLog
index 620ec39..e3fd9e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-06  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/xfree86/common/xf86Config.c:
+	Coverity #835: Plug memory leak in extension section parsing.
+
+2006-04-06  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/xfree86/parser/Keyboard.c:
 	Coverity #812: Fix parser memory leak.
 
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 96904c4..4eba06d 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Config.c,v 1.23 2006/03/12 00:11:33 krh Exp $ */
+/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Config.c,v 1.23.2.1 2006/04/03 21:59:58 ajax Exp $ */
 /* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.276 2003/10/08 14:58:26 dawes Exp $ */
 
 
@@ -2549,6 +2549,7 @@ configExtensions(XF86ConfExtensionsPtr c
 		xf86Msg(X_ERROR,
 			"%s is not a valid value for the Extension option\n",
 			val);
+		xfree(n);
 		return FALSE;
 	    }
 
@@ -2559,6 +2560,7 @@ configExtensions(XF86ConfExtensionsPtr c
 		xf86Msg(X_WARNING, "Ignoring unrecognized extension \"%s\"\n",
                         name);
 	    }
+	    xfree(n);
 	}
     }
 
diff-tree 725622e863857df7e2eabe8db06765555fb0ae25 (from b4bb7c10eb3e72d8e0c655bff1876046dc7d7e4d)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 7 01:29:31 2006 +0000

    Coverity #812: Fix parser memory leak.

diff --git a/ChangeLog b/ChangeLog
index 9e999d8..620ec39 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-06  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/xfree86/parser/Keyboard.c:
+	Coverity #812: Fix parser memory leak.
+
+2006-04-06  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/xfree86/dixmods/extmod/xf86vmode.c:
 	Coverity #818: Avoid memory leak on error path.
 
diff --git a/hw/xfree86/parser/Keyboard.c b/hw/xfree86/parser/Keyboard.c
index e1f8b05..62031f6 100644
--- a/hw/xfree86/parser/Keyboard.c
+++ b/hw/xfree86/parser/Keyboard.c
@@ -167,6 +167,7 @@ xf86parseKeyboardSection (void)
 				xf86conffree(s1);
 			}
 			xf86unGetToken (token);
+			xf86conffree(s);
 			break;
 		case SERVERNUM:
 			xf86parseWarning(OBSOLETE_MSG, xf86tokenString());
diff-tree b4bb7c10eb3e72d8e0c655bff1876046dc7d7e4d (from 7ca0036d96369a5674496fb221030f256a10bc08)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 7 01:26:25 2006 +0000

    Coverity #818: Avoid memory leak on error path.

diff --git a/ChangeLog b/ChangeLog
index 16cffcb..9e999d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-06  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/xfree86/dixmods/extmod/xf86vmode.c:
+	Coverity #818: Avoid memory leak on error path.
+
+2006-04-06  Adam Jackson  <ajax at freedesktop.org>
+
 	* GL/glx/single2.c:
 	Coverity #985: Avoid segfault on malloc failure.
 
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
index 2a3037c..bcd08bf 100644
--- a/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ b/hw/xfree86/dixmods/extmod/xf86vmode.c
@@ -29,7 +29,7 @@ or other dealings in this Software witho
 from Kaleb S. KEITHLEY
 
 */
-/* $XdotOrg: xserver/xorg/hw/xfree86/dixmods/extmod/xf86vmode.c,v 1.8 2005/07/16 03:49:58 kem Exp $ */
+/* $XdotOrg: xserver/xorg/hw/xfree86/dixmods/extmod/xf86vmode.c,v 1.9 2006/02/10 22:00:24 anholt Exp $ */
 /* $Xorg: xf86vmode.c,v 1.3 2000/08/17 19:47:59 cpqbld Exp $ */
 /* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
 
@@ -1589,8 +1589,10 @@ ProcXF86VidModeGetGammaRamp(ClientPtr cl
 	    return BadAlloc;
    
         if (!VidModeGetGammaRamp(stuff->screen, stuff->size, 
-		ramp, ramp + length, ramp + (length * 2)))
+		ramp, ramp + length, ramp + (length * 2))) {
+	    xfree(ramp);
             return BadValue;
+	}
     }
 
     rep.type = X_Reply;
diff-tree 7ca0036d96369a5674496fb221030f256a10bc08 (from 6ebe2ac6839db0649c6259f04788c106b2cdaf13)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 7 01:23:42 2006 +0000

    Coverity #985: Avoid segfault on malloc failure.

diff --git a/ChangeLog b/ChangeLog
index bc18681..16cffcb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-06  Adam Jackson  <ajax at freedesktop.org>
 
+	* GL/glx/single2.c:
+	Coverity #985: Avoid segfault on malloc failure.
+
+2006-04-06  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/dmx/dmxextension.c:
 	Coverity #1037: Sanity check idx before use.
 
diff --git a/GL/glx/single2.c b/GL/glx/single2.c
index 383c8e7..efc7220 100644
--- a/GL/glx/single2.c
+++ b/GL/glx/single2.c
@@ -270,12 +270,12 @@ char *__glXcombine_strings(const char *c
    if (clen > slen) {
 	combo_string = (char *) xalloc(slen + 2);
 	s1 = (char *) xalloc(slen + 2);
-	strcpy(s1, sext_string);
+	if (s1) strcpy(s1, sext_string);
 	s2 = cext_string;
    } else {
 	combo_string = (char *) xalloc(clen + 2);
 	s1 = (char *) xalloc(clen + 2);
-	strcpy(s1, cext_string);
+	if (s1) strcpy(s1, cext_string);
 	s2 = sext_string;
    }
    if (!combo_string || !s1) {
diff-tree 6ebe2ac6839db0649c6259f04788c106b2cdaf13 (from 916b7b95be502a4bd514353f274a5061c0d913d3)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Fri Apr 7 01:17:52 2006 +0000

    Coverity #1037: Sanity check idx before use.

diff --git a/ChangeLog b/ChangeLog
index 9b5f180..bc18681 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-06  Adam Jackson  <ajax at freedesktop.org>
+
+	* hw/dmx/dmxextension.c:
+	Coverity #1037: Sanity check idx before use.
+
 2006-04-05  Fredrik Höglund  <fredrik at kde.org>
 
 	* Xext/Makefile.am:
diff --git a/hw/dmx/dmxextension.c b/hw/dmx/dmxextension.c
index feadb5e..24f7969 100644
--- a/hw/dmx/dmxextension.c
+++ b/hw/dmx/dmxextension.c
@@ -1062,8 +1062,8 @@ static Bool dmxCompareScreens(DMXScreenI
 /** Reattach previously detached back-end screen. */
 int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
 {
-    ScreenPtr      pScreen   = screenInfo.screens[idx];
-    DMXScreenInfo *dmxScreen = &dmxScreens[idx];
+    ScreenPtr      pScreen;
+    DMXScreenInfo *dmxScreen;
     CARD32         scrnNum   = idx;
     DMXScreenInfo  oldDMXScreen;
     int            i;
@@ -1083,6 +1083,8 @@ int dmxAttachScreen(int idx, DMXScreenAt
 
     /* Cannot add a screen that does not exist */
     if (idx < 0 || idx >= dmxNumScreens) return 1;
+    pScreen = screenInfo.screens[idx];
+    dmxScreen = &dmxScreens[idx];
 
     /* Cannot attach to a screen that is already opened */
     if (dmxScreen->beDisplay) {
diff-tree 916b7b95be502a4bd514353f274a5061c0d913d3 (from 49bd7d71329f2ec9e37668d3c93f064fbfbed665)
Author: Fredrik Höglund <fredrik at kde.org>
Date:   Wed Apr 5 21:23:06 2006 +0000

    Put the screensaver extension back in the Xext module.
    Move the screenSaverSuspended variable to DIX globals.
    Restore the old link order for the Xorg and Xdmx binaries.

diff --git a/ChangeLog b/ChangeLog
index fd6d3fa..9b5f180 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2006-04-05  Fredrik Höglund  <fredrik at kde.org>
+
+	* Xext/Makefile.am:
+	Put the screensaver extension back in the Xext module.
+
+	* Xext/saver.c:
+	* dix/globals.c:
+	* include/globals.h:
+	* os/WaitFor.c:
+	Move the screenSaverSuspended variable to DIX globals.
+
+	* configure.ac:
+	Restore the old link order for the Xorg and Xdmx binaries.
+
 2006-04-04  Adam Jackson  <ajax at freedesktop.org>
 
 	* hw/darwin/darwin.c:
diff --git a/Xext/Makefile.am b/Xext/Makefile.am
index 2e573c1..8ab4c86 100644
--- a/Xext/Makefile.am
+++ b/Xext/Makefile.am
@@ -59,7 +59,7 @@ endif
 # MIT ScreenSaver extension
 SCREENSAVER_SRCS = saver.c
 if SCREENSAVER
-BUILTIN_SRCS  += $(SCREENSAVER_SRCS)
+MODULE_SRCS  += $(SCREENSAVER_SRCS)
 endif
 
 # Xinerama extension: making multiple video devices act as one virtual screen
diff --git a/Xext/saver.c b/Xext/saver.c
index f2c2fdf..d873ffd 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xserver/xorg/Xext/saver.c,v 1.11 2006/02/10 22:00:20 anholt Exp $ */
+/* $XdotOrg: xserver/xorg/Xext/saver.c,v 1.12 2006/03/31 18:49:38 fredrik Exp $ */
 /*
  * $XConsortium: saver.c,v 1.12 94/04/17 20:59:36 dpw Exp $
  *
@@ -121,8 +121,6 @@ static void ScreenSaverResetProc (
 
 static RESTYPE SuspendType;  /* resource type for suspension records */
 
-_X_EXPORT Bool screenSaverSuspended = FALSE; /* used in os/WaitFor.c */
-
 typedef struct _ScreenSaverSuspension *ScreenSaverSuspensionPtr;
 
 /* List of clients that are suspending the screensaver. */
diff --git a/configure.ac b/configure.ac
index 6df4b7d..8e78d8b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -897,7 +897,7 @@ if test "x$DMX" = xyes; then
 		              modules not found.])
 	fi
 	DMX_INCLUDES="$XEXT_INC $RENDER_INC $XTRAP_INC $RECORD_INC"
-	XDMX_LIBS="$FB_LIB $MI_LIB $RENDER_LIB $XTRAP_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_DAMAGE_LIB $LBX_LIB $MIEXT_SHADOW_LIB $OS_LIB $XEXT_LIB $CWRAP_LIB"
+	XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $XTRAP_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_DAMAGE_LIB $LBX_LIB $MIEXT_SHADOW_LIB $OS_LIB $CWRAP_LIB"
 	AC_SUBST([XDMX_LIBS])
 
 dnl USB sources in DMX require <linux/input.h>
@@ -1039,7 +1039,7 @@ if test "x$XORG" = xyes -o "x$XGL" = xye
 	XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
 	XORG_INCS="$XORG_DDXINCS $XORG_OSINCS"
 	XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H"
-	XORG_LIBS="$MI_LIB $FIXES_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $LBX_LIB $COMPOSITE_LIB $XPSTUBS_LIB $OS_LIB $XEXTXORG_LIB"
+	XORG_LIBS="$MI_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $LBX_LIB $COMPOSITE_LIB $XPSTUBS_LIB $OS_LIB"
 
 	AC_CHECK_LIB([dl], [dlopen], XORG_LIBS="$XORG_LIBS -ldl")
 
diff --git a/dix/globals.c b/dix/globals.c
index f8b4e3e..d686baf 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xserver/xorg/dix/globals.c,v 1.7 2005/07/03 08:53:38 daniels Exp $ */
+/* $XdotOrg: xserver/xorg/dix/globals.c,v 1.8 2006/02/15 20:44:12 ajax Exp $ */
 /* $XFree86: xc/programs/Xserver/dix/globals.c,v 1.12tsi Exp $ */
 /************************************************************
 
@@ -132,6 +132,10 @@ int  defaultScreenSaverAllowExposures = 
 int  logoScreenSaver = DEFAULT_LOGO_SCREEN_SAVER;
 #endif
 
+#ifdef SCREENSAVER
+Bool screenSaverSuspended = FALSE;
+#endif
+
 char *defaultFontPath = COMPILEDDEFAULTFONTPATH;
 char *defaultTextFont = COMPILEDDEFAULTFONT;
 char *defaultCursorFont = COMPILEDCURSORFONT;
diff --git a/include/globals.h b/include/globals.h
index 911d0c0..a661d8b 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/include/globals.h,v 1.6 2005/05/19 18:53:49 ajax Exp $ */
+/* $XdotOrg: xserver/xorg/include/globals.h,v 1.10 2006/01/08 23:43:54 ajax Exp $ */
 /* $XFree86: xc/programs/Xserver/include/globals.h,v 1.3 1999/09/25 14:38:21 dawes Exp $ */
 
 #ifndef _XSERV_GLOBAL_H_
@@ -13,6 +13,10 @@ extern CARD32 defaultScreenSaverInterval
 extern CARD32 ScreenSaverTime;
 extern CARD32 ScreenSaverInterval;
 
+#ifdef SCREENSAVER
+extern Bool screenSaverSuspended;
+#endif
+
 extern char *defaultFontPath;
 extern char *rgbPath;
 extern int monitorResolution;
diff --git a/os/WaitFor.c b/os/WaitFor.c
index 7810190..a4f0f4c 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -669,16 +669,6 @@ FreeScreenSaverTimer(void)
     }
 }
 
-#ifdef SCREENSAVER
-/*
- * When this variable is set a client has temporarily suspended the
- * screensaver and DPMS, so SetScreenSaverTimer should be a noop.
- * The screensaver extension is responsible for stopping and
- * restarting the timer when suspension is enabled/disabled.
- */
-extern Bool screenSaverSuspended; /* declared in Xext/saver.c */
-#endif  /* SCREENSAVER */
-
 void
 SetScreenSaverTimer(void)
 {
diff-tree 49bd7d71329f2ec9e37668d3c93f064fbfbed665 (from b73852760d134aae6e17e5134a77dc0a098bcdc1)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Tue Apr 4 14:16:56 2006 +0000

    Bug #5300: Fix missing spaces in the Build OS line in the log. (Egmont
        Koblinger)

diff --git a/ChangeLog b/ChangeLog
index b6c1677..fd6d3fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-04-04  Adam Jackson  <ajax at freedesktop.org>
+
+	* hw/darwin/darwin.c:
+	* hw/xfree86/common/xf86Init.c:
+	Bug #5300: Fix missing spaces in the Build OS line in the log. 
+	(Egmont Koblinger)
+
 2006-04-03  Adam Jackson  <ajax at freedesktop.org>
 
 	* hw/xfree86/common/xf86Config.c:
diff --git a/hw/darwin/darwin.c b/hw/darwin/darwin.c
index fe8cd2f..10afbaf 100644
--- a/hw/darwin/darwin.c
+++ b/hw/darwin/darwin.c
@@ -29,7 +29,7 @@
  * holders shall not be used in advertising or otherwise to promote the sale,
  * use or other dealings in this Software without prior written authorization.
  */
-/* $XdotOrg: xc/programs/Xserver/hw/darwin/darwin.c,v 1.6 2005/04/20 12:25:19 daniels Exp $ */
+/* $XdotOrg: xserver/xorg/hw/darwin/darwin.c,v 1.8 2005/07/03 08:53:38 daniels Exp $ */
 /* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.55 2003/11/15 00:07:09 torrey Exp $ */
 
 #include <X11/X.h>
@@ -155,7 +155,7 @@ DarwinPrintBanner()
   ErrorF("\nRelease Date: %s\n", XF86_DATE);
   ErrorF("X Protocol Version %d, Revision %d, %s\n",
          X_PROTOCOL, X_PROTOCOL_REVISION, XORG_RELEASE );
-  ErrorF("Build Operating System:%s%s\n", OSNAME, OSVENDOR);
+  ErrorF("Build Operating System: %s %s\n", OSNAME, OSVENDOR);
 #ifdef HAS_UTSNAME
   {
     struct utsname name;
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 30431a3..d5741aa 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1,5 +1,5 @@
 /* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.212 2004/01/27 01:31:45 dawes Exp $ */
-/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Init.c,v 1.32 2006/03/20 14:01:05 ajax Exp $ */
+/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Init.c,v 1.33 2006/03/25 19:52:03 ajax Exp $ */
 
 /*
  * Loosely based on code bearing the following copyright:
@@ -1829,7 +1829,7 @@ xf86PrintBanner()
   ErrorF("\nRelease Date: %s\n", XORG_DATE);
   ErrorF("X Protocol Version %d, Revision %d, %s\n",
          X_PROTOCOL, X_PROTOCOL_REVISION, XORG_RELEASE );
-  ErrorF("Build Operating System:%s%s\n", OSNAME, OSVENDOR);
+  ErrorF("Build Operating System: %s %s\n", OSNAME, OSVENDOR);
 #ifdef HAS_UTSNAME
   {
     struct utsname name;
diff-tree b73852760d134aae6e17e5134a77dc0a098bcdc1 (from 58e15efc0540997c89d1712d8f91a292239ce476)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon Apr 3 21:59:58 2006 +0000

    Bug #2142: Make font path logging more readable. (Eduard Fuchs)

diff --git a/ChangeLog b/ChangeLog
index 13a53e3..b6c1677 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-03  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/xfree86/common/xf86Config.c:
+	Bug #2142: Make font path logging more readable. (Eduard Fuchs)
+
+2006-04-03  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/dmx/glxProxy/glxcmds.c:
 	Fix a server crash due to memsetting beyond allocated memory 
 	when running GL applications. (Alan Hourihane, backported from 
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 448f855..96904c4 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Config.c,v 1.22.8.2 2006/02/28 23:55:03 krh Exp $ */
+/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Config.c,v 1.23 2006/03/12 00:11:33 krh Exp $ */
 /* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.276 2003/10/08 14:58:26 dawes Exp $ */
 
 
@@ -666,7 +666,36 @@ configFiles(XF86ConfFilesPtr fileconf)
   if (! *defaultFontPath)
     FatalError("No valid FontPath could be found.");
 
-  xf86Msg(pathFrom, "FontPath set to \"%s\"\n", defaultFontPath);
+  /* make fontpath more readable in the logfiles */
+  int countDirs = 1;
+  char *temp_path = defaultFontPath;
+  while((temp_path = index(temp_path, ',')) != NULL) {
+    countDirs++;
+    temp_path++;
+  }
+  char *log_buf = xnfalloc(strlen(defaultFontPath) + (2 * countDirs) + 1);
+  if(!log_buf) /* fallback to old method */
+    xf86Msg(pathFrom, "FontPath set to \"%s\"\n", defaultFontPath);
+  else {
+    char *start, *end;
+    int size;
+    temp_path = log_buf;
+    start = defaultFontPath;
+    while((end = index(start, ',')) != NULL) {
+      size = (end - start) + 1;
+      *(temp_path++) = '\t';
+      strncpy(temp_path, start, size);
+      temp_path += size;
+      *(temp_path++) = '\n';
+      start += size;
+    }
+    /* copy last entry */
+    *(temp_path++) = '\t';
+    strcpy(temp_path, start);
+    xf86Msg(pathFrom, "FontPath set to:\n%s\n", log_buf);
+    xfree(log_buf);
+  }
+
 
   /* RgbPath */
 
diff-tree 58e15efc0540997c89d1712d8f91a292239ce476 (from 851a13eead745c4f1b278aa0f9d47f75dd2e0a52)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon Apr 3 20:58:20 2006 +0000

    Fix a server crash due to memsetting beyond allocated memory when running
        GL applications. (Alan Hourihane, backported from head)

diff --git a/ChangeLog b/ChangeLog
index ac973dd..13a53e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2006-04-03  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/dmx/glxProxy/glxcmds.c:
+	Fix a server crash due to memsetting beyond allocated memory 
+	when running GL applications. (Alan Hourihane, backported from 
+	head)
+
+2006-04-03  Adam Jackson  <ajax at freedesktop.org>
+
 	* fb/fbmmx.c:
 	Bug #6346: Build fix when using gcc -mno-sse. (Jonathan 
 	Adamczewski)
diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c
index fe1d357..d7ea707 100644
--- a/hw/dmx/glxProxy/glxcmds.c
+++ b/hw/dmx/glxProxy/glxcmds.c
@@ -611,7 +611,7 @@ static int AddCurrentContext(__GLXclient
     cl->numCurrentContexts++;
 
     __glXMemset(cl->be_currentCTag + num*screenInfo.numScreens, 0, 
-	         screenInfo.numScreens * sizeof(Display *));
+	         screenInfo.numScreens * sizeof(GLXContextTag));
 
     return num+1;
 }
diff-tree 851a13eead745c4f1b278aa0f9d47f75dd2e0a52 (from 109eeb2bfcd96bb88e90ce3e3be44407d1929d41)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon Apr 3 19:50:07 2006 +0000

    Bug #6346: Build fix when using gcc -mno-sse. (Jonathan Adamczewski)

diff --git a/ChangeLog b/ChangeLog
index c54825a..ac973dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-04-03  Adam Jackson  <ajax at freedesktop.org>
+
+	* fb/fbmmx.c:
+	Bug #6346: Build fix when using gcc -mno-sse. (Jonathan 
+	Adamczewski)
+
 2006-04-02  Adam Jackson  <ajax at freedesktop.org>
 
 	* hw/dmx/glxProxy/glxcmds.c:
diff --git a/fb/fbmmx.c b/fb/fbmmx.c
index db06ea2..d058ffa 100644
--- a/fb/fbmmx.c
+++ b/fb/fbmmx.c
@@ -41,7 +41,9 @@
 #endif
 
 #include <mmintrin.h>
+#ifdef USE_SSE
 #include <xmmintrin.h> /* for _mm_shuffle_pi16 and _MM_SHUFFLE */
+#endif
 
 #ifdef RENDER
 
diff-tree 109eeb2bfcd96bb88e90ce3e3be44407d1929d41 (from bb883133ef22b38a8fd4194d217aa0f612635651)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon Apr 3 02:15:47 2006 +0000

    Coverity #38: Dead branch elimination.

diff --git a/ChangeLog b/ChangeLog
index 275f958..c54825a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-02  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/dmx/glxProxy/glxcmds.c:
+	Coverity #38: Dead branch elimination.
+
+2006-04-02  Adam Jackson  <ajax at freedesktop.org>
+
 	* Xext/sync.c:
 	Coverity #75: Dead variable elimination.
 
diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c
index 8c466e1..fe1d357 100644
--- a/hw/dmx/glxProxy/glxcmds.c
+++ b/hw/dmx/glxProxy/glxcmds.c
@@ -3619,7 +3619,7 @@ int __glXSendLargeCommand(__GLXclientSta
 	   GetReq(GLXRenderLarge,req); 
 	   req->reqType = dmxScreen->glxMajorOpcode;
 	   req->glxCode = X_GLXRenderLarge; 
-	   req->contextTag = (glxc ? GetCurrentBackEndTag(cl,contextTag,s) : 0);
+	   req->contextTag = GetCurrentBackEndTag(cl,contextTag,s);
 	   req->length += (amount + 3) >> 2;
 	   req->requestNumber = requestNumber++;
 	   req->requestTotal = totalRequests;
diff-tree bb883133ef22b38a8fd4194d217aa0f612635651 (from a192e71b7010475b99fd6ac223f3e4b3c3d8438d)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon Apr 3 02:13:39 2006 +0000

    Coverity #75: Dead variable elimination.

diff --git a/ChangeLog b/ChangeLog
index 8bc62a2..275f958 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-02  Adam Jackson  <ajax at freedesktop.org>
 
+	* Xext/sync.c:
+	Coverity #75: Dead variable elimination.
+
+2006-04-02  Adam Jackson  <ajax at freedesktop.org>
+
 	* os/xdmauth.c:
 	Coverity #82: Dead variable elimination.
 
diff --git a/Xext/sync.c b/Xext/sync.c
index 3d3d675..c88d81c 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -301,7 +301,7 @@ static void
 SyncDeleteTriggerFromCounter(pTrigger)
     SyncTrigger *pTrigger;
 {
-    SyncTriggerList *pCur, *pPrev = NULL;
+    SyncTriggerList *pCur;
 
     /* pCounter needs to be stored in pTrigger before calling here. */
 
@@ -312,10 +312,7 @@ SyncDeleteTriggerFromCounter(pTrigger)
     {
 	if (pCur->pTrigger == pTrigger)
 	{
-	    if (pPrev)
-		pPrev->next = pCur->next;
-	    else
-		pTrigger->pCounter->pTriglist = pCur->next;
+	    pTrigger->pCounter->pTriglist = pCur->next;
 	    xfree(pCur);
 	    break;
 	}
diff-tree a192e71b7010475b99fd6ac223f3e4b3c3d8438d (from 1c6dbfa12f8111f58e79fe79f266ebb908a2fa84)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon Apr 3 02:12:03 2006 +0000

    Coverity #82: Dead variable elimination.

diff --git a/ChangeLog b/ChangeLog
index cd43881..8bc62a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-02  Adam Jackson  <ajax at freedesktop.org>
 
+	* os/xdmauth.c:
+	Coverity #82: Dead variable elimination.
+
+2006-04-02  Adam Jackson  <ajax at freedesktop.org>
+
 	* GL/glx/glxcmdsswap.c:
 	Coverity #271: Fix an unbelievably boneheaded NULL chase.
 
diff --git a/os/xdmauth.c b/os/xdmauth.c
index 0d7691e..7742981 100644
--- a/os/xdmauth.c
+++ b/os/xdmauth.c
@@ -463,10 +463,9 @@ XdmFromID (XID id, unsigned short *data_
 int
 XdmRemoveCookie (unsigned short data_length, char *data)
 {
-    XdmAuthorizationPtr	auth, prev;
+    XdmAuthorizationPtr	auth;
     XdmAuthKeyPtr	key_bits, rho_bits;
 
-    prev = 0;
     switch (data_length)
     {
     case 16:
@@ -486,10 +485,7 @@ XdmRemoveCookie (unsigned short data_len
 	if (XdmcpCompareKeys (rho_bits, &auth->rho) &&
 	    XdmcpCompareKeys (key_bits, &auth->key))
  	{
-	    if (prev)
-		prev->next = auth->next;
-	    else
-		xdmAuth = auth->next;
+	    xdmAuth = auth->next;
 	    xfree (auth);
 	    return 1;
 	}
diff-tree 1c6dbfa12f8111f58e79fe79f266ebb908a2fa84 (from 59a90e8af9f35e301f26b63fe4cf3583128dd45e)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon Apr 3 02:08:57 2006 +0000

    Coverity #271: Fix an unbelievably boneheaded NULL chase.

diff --git a/ChangeLog b/ChangeLog
index 94373a2..cd43881 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-02  Adam Jackson  <ajax at freedesktop.org>
 
+	* GL/glx/glxcmdsswap.c:
+	Coverity #271: Fix an unbelievably boneheaded NULL chase.
+
+2006-04-02  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/xnest/Pixmap.c:
 	Coverity #616: Fix a rare memory leak.
 
diff --git a/GL/glx/glxcmdsswap.c b/GL/glx/glxcmdsswap.c
index ed1276f..0f8b674 100644
--- a/GL/glx/glxcmdsswap.c
+++ b/GL/glx/glxcmdsswap.c
@@ -345,7 +345,7 @@ int __glXSwapUseXFont(__GLXclientState *
 
 int __glXSwapQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
 {
-    xGLXQueryExtensionsStringReq *req = NULL;
+    xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *)pc;
     __GLX_DECLARE_SWAP_VARIABLES;
 
     __GLX_SWAP_SHORT(&req->length);
diff-tree 59a90e8af9f35e301f26b63fe4cf3583128dd45e (from a9585b9b6bcf807a92dcb306761d69eb8e8a8c7a)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon Apr 3 01:51:46 2006 +0000

    Coverity #616: Fix a rare memory leak.

diff --git a/ChangeLog b/ChangeLog
index dcb11e2..94373a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-02  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/xnest/Pixmap.c:
+	Coverity #616: Fix a rare memory leak.
+
+2006-04-02  Adam Jackson  <ajax at freedesktop.org>
+
 	* os/xdmauth.c:
 	Coverity #833: Fix a rather nasty memory leak.
 
diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c
index 30ffbc6..046b739 100644
--- a/hw/xnest/Pixmap.c
+++ b/hw/xnest/Pixmap.c
@@ -102,7 +102,10 @@ xnestPixmapToRegion(PixmapPtr pPixmap)
   
   pReg = REGION_CREATE(pPixmap->drawable.pScreen, NULL, 1);
   pTmpReg = REGION_CREATE(pPixmap->drawable.pScreen, NULL, 1);
-  if(!pReg || !pTmpReg) return NullRegion;
+  if(!pReg || !pTmpReg) {
+      XDestroyImage(ximage);
+      return NullRegion;
+  }
   
   for (y = 0; y < pPixmap->drawable.height; y++) {
     Box.y1 = y;
diff-tree a9585b9b6bcf807a92dcb306761d69eb8e8a8c7a (from c01c1588b6a7e97fb1dc242c0a49be51725033be)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon Apr 3 01:43:25 2006 +0000

    Coverity #833: Fix a rather nasty memory leak.

diff --git a/ChangeLog b/ChangeLog
index 35a69ac..dcb11e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-02  Adam Jackson  <ajax at freedesktop.org>
 
+	* os/xdmauth.c:
+	Coverity #833: Fix a rather nasty memory leak.
+
+2006-04-02  Adam Jackson  <ajax at freedesktop.org>
+
 	* hw/xfree86/dri/dri.c:
 	Coverity #983: Move some risky debugging code inside #ifdef 
 	DEBUG.
diff --git a/os/xdmauth.c b/os/xdmauth.c
index f88d25a..0d7691e 100644
--- a/os/xdmauth.c
+++ b/os/xdmauth.c
@@ -436,10 +436,12 @@ XdmToID (unsigned short cookie_length, c
 	{
 	    xfree (client);
 	    xfree (cookie);
+	    xfree (plain);
 	    return auth->id;
 	}
     }
     xfree (cookie);
+    xfree (plain);
     return (XID) -1;
 }
 
diff-tree c01c1588b6a7e97fb1dc242c0a49be51725033be (from d922e9efa25e663af2bd03cb28d36e1478239301)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon Apr 3 01:34:56 2006 +0000

    Coverity #983: Move some risky debugging code inside #ifdef DEBUG.

diff --git a/ChangeLog b/ChangeLog
index 35f4115..35a69ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-04-02  Adam Jackson  <ajax at freedesktop.org>
 
+	* hw/xfree86/dri/dri.c:
+	Coverity #983: Move some risky debugging code inside #ifdef 
+	DEBUG.
+
+2006-04-02  Adam Jackson  <ajax at freedesktop.org>
+
 	* GL/glx/glxcmds.c:
 	Coverity #986: Prevent a NULL chase.
 
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 8d28510..b58b670 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -1427,7 +1427,6 @@ DRISwapContext(int drmFD, void *oldctx, 
     DRISyncType       syncType;
 #ifdef DEBUG
     static int        count = 0;
-#endif
 
     if (!newContext) {
 	DRIDrvMsg(pScreen->myNum, X_ERROR,
@@ -1436,7 +1435,6 @@ DRISwapContext(int drmFD, void *oldctx, 
 	return;
     }
 
-#ifdef DEBUG
     /* usefull for debugging, just print out after n context switches */
     if (!count || !(count % 1)) {
 	DRIDrvMsg(pScreen->myNum, X_INFO,
diff-tree d922e9efa25e663af2bd03cb28d36e1478239301 (from 1ce955e2cbefed927d91bdd0cb051b9442fbfa89)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon Apr 3 01:31:51 2006 +0000

    Coverity #986: Prevent a NULL chase.

diff --git a/ChangeLog b/ChangeLog
index dc4ac83..35f4115 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-04-02  Adam Jackson  <ajax at freedesktop.org>
 
+	* GL/glx/glxcmds.c:
+	Coverity #986: Prevent a NULL chase.
+
+2006-04-02  Adam Jackson  <ajax at freedesktop.org>
+
 	* Xext/sync.c:
 	Coverity #992: Prevent a NULL chase.
 
diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c
index 0b7525e..3845c92 100644
--- a/GL/glx/glxcmds.c
+++ b/GL/glx/glxcmds.c
@@ -1926,10 +1926,10 @@ static int __glXBindSwapBarrierSGIX(__GL
     XID drawable = req->drawable;
     int barrier = req->barrier;
     DrawablePtr pDraw = (DrawablePtr) LookupDrawable(drawable, client);
-    int screen = pDraw->pScreen->myNum;
-
+    int screen;
 
     if (pDraw && (pDraw->type == DRAWABLE_WINDOW)) {
+	screen = pDraw->pScreen->myNum;
         if (__glXSwapBarrierFuncs &&
             __glXSwapBarrierFuncs[screen].bindSwapBarrierFunc) {
             int ret = __glXSwapBarrierFuncs[screen].bindSwapBarrierFunc(screen, drawable, barrier);
diff-tree 1ce955e2cbefed927d91bdd0cb051b9442fbfa89 (from 7a30a006b8544476f8d1eb511f906a6a167cb294)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Mon Apr 3 01:28:03 2006 +0000

    Coverity #992: Prevent a NULL chase.

diff --git a/ChangeLog b/ChangeLog
index 3cd2e1a..dc4ac83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-02  Adam Jackson  <ajax at freedesktop.org>
+
+	* Xext/sync.c:
+	Coverity #992: Prevent a NULL chase.
+
 2006-04-02  Kristian Høgsberg  <krh at redhat.com>
 
 	* GL/glx/glxdri.c (__glXDRIscreenProbe): Use xf86LoaderCheckSymbol
diff --git a/Xext/sync.c b/Xext/sync.c
index c43c4af..3d3d675 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -1112,7 +1112,7 @@ SyncComputeBracketValues(pCounter, start
 {
     SyncTriggerList *pCur;
     SyncTrigger *pTrigger;
-    SysCounterInfo *psci = pCounter->pSysCounterInfo;
+    SysCounterInfo *psci;
     CARD64 *pnewgtval = NULL;
     CARD64 *pnewltval = NULL;
     SyncCounterType ct;
@@ -1120,6 +1120,7 @@ SyncComputeBracketValues(pCounter, start
     if (!pCounter)
 	return;
 
+    psci = pCounter->pSysCounterInfo;
     ct = pCounter->pSysCounterInfo->counterType;
     if (ct == XSyncCounterNeverChanges)
 	return;
diff-tree 7a30a006b8544476f8d1eb511f906a6a167cb294 (from fe034fa77b15c1a1fe3764ba7029f6aded978fdd)
Author: Kristian Høgsberg <krh at redhat.com>
Date:   Sun Apr 2 22:37:05 2006 +0000

    Use xf86LoaderCheckSymbol to check for DRI symbols instead of dlsym,
        avoiding RTLD_DEFAULT. (__glXDRIscreenProbe): Change GLX-DRI to AIGLX
        in LogMessage for consitency.

diff --git a/ChangeLog b/ChangeLog
index 4c8f402..3cd2e1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-04-02  Kristian Høgsberg  <krh at redhat.com>
+
+	* GL/glx/glxdri.c (__glXDRIscreenProbe): Use xf86LoaderCheckSymbol
+	to check for DRI symbols instead of dlsym, avoiding RTLD_DEFAULT.
+	(__glXDRIscreenProbe): Change GLX-DRI to AIGLX in LogMessage for
+	consitency.
+
 2006-04-02  Adam Jackson  <ajax at freedesktop.org>
 
 	* hw/kdrive/ati/Makefile.am:
diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c
index 385a8fa..4935b0a 100644
--- a/GL/glx/glxdri.c
+++ b/GL/glx/glxdri.c
@@ -724,7 +724,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
     char filename[128];
     Bool isCapable;
 
-    if (dlsym (NULL, "DRIQueryDirectRenderingCapable") == NULL) {
+    if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable")) {
 	LogMessage(X_ERROR, "AIGLX: DRI module not loaded\n");
 	return NULL;
     }
@@ -917,7 +917,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 
     xfree(screen);
 
-    LogMessage(X_ERROR, "GLX-DRI: reverting to software rendering\n");
+    LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n");
 
     return NULL;
 }
diff-tree fe034fa77b15c1a1fe3764ba7029f6aded978fdd (from 323fec20292fc5ad90bfee9015ecccdc13c968ad)
Author: Adam Jackson <ajax at nwnk.net>
Date:   Sun Apr 2 21:44:55 2006 +0000

    ../stub

diff --git a/ChangeLog b/ChangeLog
index b6ba434..4c8f402 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-04-02  Adam Jackson  <ajax at freedesktop.org>
+
+	* hw/kdrive/ati/Makefile.am:
+	* hw/kdrive/ati/ati.h:
+	Disable building DRI support in Xati for now.
+
 2006-04-01  Adam Jackson  <ajax at freedesktop.org>
 
 	* configure.ac:
diff --git a/hw/kdrive/ati/Makefile.am b/hw/kdrive/ati/Makefile.am
index 22f763b..b234181 100644
--- a/hw/kdrive/ati/Makefile.am
+++ b/hw/kdrive/ati/Makefile.am
@@ -1,16 +1,16 @@
-if DRI
-DRI_INCLUDES = 	-I$(top_srcdir)/dri	\
-		-I$(top_srcdir)/drm
-DRI_LIBS = 	$(top_builddir)/dri/libdri.a	\
-		$(top_builddir)/drm/libdrm.a
-DRI_SOURCES =	ati_dri.c	\
-		ati_dri.h	\
-		ati_dripriv.h	\
-		r128_common.h	\
-		r128_sarea.h	\
-		radeon_common.h	\
-		radeon_sarea.h
-endif
+#if DRI
+#DRI_INCLUDES = 	-I$(top_srcdir)/dri	\
+#		-I$(top_srcdir)/drm
+#DRI_LIBS = 	$(top_builddir)/dri/libdri.a	\
+#		$(top_builddir)/drm/libdrm.a
+#DRI_SOURCES =	ati_dri.c	\
+#		ati_dri.h	\
+#		ati_dripriv.h	\
+#		r128_common.h	\
+#		r128_sarea.h	\
+#		radeon_common.h	\
+#		radeon_sarea.h
+#endif
 
 if KDRIVEFBDEV
 FBDEV_INCLUDES =-I$(top_srcdir)/hw/kdrive/fbdev
diff --git a/hw/kdrive/ati/ati.h b/hw/kdrive/ati/ati.h
index 5ffd227..188d0b0 100644
--- a/hw/kdrive/ati/ati.h
+++ b/hw/kdrive/ati/ati.h
@@ -39,9 +39,10 @@
 
 #include "kxv.h"
 
+#undef XF86DRI
 #ifdef XF86DRI
 #define USE_DRI
-#include "libdrm.h"
+#include "xf86drm.h"
 #include "dri.h"
 #ifdef GLXEXT
 #include "GL/glxint.h"
diff --git a/hw/xfree86/os-support/README.OS-lib b/hw/xfree86/os-support/README.OS-lib
index 27af6b3..43312e4 100644
--- a/hw/xfree86/os-support/README.OS-lib
+++ b/hw/xfree86/os-support/README.OS-lib
@@ -497,7 +497,7 @@ xf86cos(double x)
 
 
 
-$XFree86: xc/programs/Xserver/hw/xfree86/os-support/README.OS-lib,v 3.10 2001/12/17 20:00:45 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/os-support/README.OS-lib,v 3.9 2001/07/23 13:15:48 dawes Exp $
 
 
 
diff --git a/hw/xfree86/os-support/bsd/bsd_kbd.h b/hw/xfree86/os-support/bsd/bsd_kbd.h
index c042d88..7b9cd43 100644
--- a/hw/xfree86/os-support/bsd/bsd_kbd.h
+++ b/hw/xfree86/os-support/bsd/bsd_kbd.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.h,v 1.1 2002/10/11 01:40:34 dawes Exp $ */
+/* $XFree86$ */
 
 extern void KbdGetMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms,
 				CARD8 *pModMap);
diff --git a/hw/xfree86/os-support/bsd/libusb/usb.3 b/hw/xfree86/os-support/bsd/libusb/usb.3
index f88a28c..db0b1b0 100644
--- a/hw/xfree86/os-support/bsd/libusb/usb.3
+++ b/hw/xfree86/os-support/bsd/libusb/usb.3
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usb.3,v 1.1 2000/02/11 18:06:50 dawes Exp $ 
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/os-support/libusb/usb.3,v 1.1.2.2 1999/12/03 10:12:42 hohndel Exp $ 
 .\"
 .Dd May 11, 1999
 .Dt USB 3
diff --git a/hw/xfree86/os-support/bsd/libusb/usb.h b/hw/xfree86/os-support/bsd/libusb/usb.h
index 69ef79a..4454281 100644
--- a/hw/xfree86/os-support/bsd/libusb/usb.h
+++ b/hw/xfree86/os-support/bsd/libusb/usb.h
@@ -25,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usb.h,v 1.1 2000/02/11 18:06:51 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/libusb/usb.h,v 1.1.2.2 1999/12/03 10:12:43 hohndel Exp $ */
 
 #define _DIAGASSERT(e) assert(e)
 
diff --git a/hw/xfree86/os-support/bsd/libusb/usbvar.h b/hw/xfree86/os-support/bsd/libusb/usbvar.h
index cb0bf33..60883dd 100644
--- a/hw/xfree86/os-support/bsd/libusb/usbvar.h
+++ b/hw/xfree86/os-support/bsd/libusb/usbvar.h
@@ -25,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usbvar.h,v 1.1 2000/02/11 18:06:51 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/libusb/usbvar.h,v 1.1.2.2 1999/12/03 10:12:43 hohndel Exp $ */
 
 struct report_desc {
 	unsigned int size;
diff --git a/hw/xfree86/os-support/linux/lnx_kbd.h b/hw/xfree86/os-support/linux/lnx_kbd.h
index ac783bf..7b9cd43 100644
--- a/hw/xfree86/os-support/linux/lnx_kbd.h
+++ b/hw/xfree86/os-support/linux/lnx_kbd.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.h,v 1.1 2002/10/11 01:40:35 dawes Exp $ */
+/* $XFree86$ */
 
 extern void KbdGetMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms,
 				CARD8 *pModMap);
diff --git a/hw/xfree86/os-support/lynxos/lynx_ppc.c b/hw/xfree86/os-support/lynxos/lynx_ppc.c
index e587b7e..12fa3bc 100644
--- a/hw/xfree86/os-support/lynxos/lynx_ppc.c
+++ b/hw/xfree86/os-support/lynxos/lynx_ppc.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_ppc.c,v 1.1 2002/12/14 04:41:14 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_ppc.S,v 1.1 1999/07/10 07:24:49 dawes Exp $ */
 /*
  * Copyright 1998 by Metro Link Incorporated
  *
diff --git a/hw/xfree86/os-support/misc/IODelay.S b/hw/xfree86/os-support/misc/IODelay.S
index 4c6e32f..6855846 100644
--- a/hw/xfree86/os-support/misc/IODelay.S
+++ b/hw/xfree86/os-support/misc/IODelay.S
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/IODelay.S,v 1.1 1999/07/10 07:24:50 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/IODelay.s,v 1.2 1998/07/25 16:56:49 dawes Exp $ */
 /*******************************************************************************
                         Copyright 1994 by Glenn G. Lai
 
diff --git a/hw/xfree86/os-support/misc/SlowBcopy.S b/hw/xfree86/os-support/misc/SlowBcopy.S
index 9b6af1d..9fd73a0 100644
--- a/hw/xfree86/os-support/misc/SlowBcopy.S
+++ b/hw/xfree86/os-support/misc/SlowBcopy.S
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/SlowBcopy.S,v 1.1 1999/07/10 07:24:51 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/SlowBcopy.s,v 1.2 1998/07/25 16:56:50 dawes Exp $ */
 /*******************************************************************************
                         Copyright 1994 by Glenn G. Lai
 
diff --git a/hw/xfree86/os-support/shared/inout.S b/hw/xfree86/os-support/shared/inout.S
index 80c47c4..73a2cbb 100644
--- a/hw/xfree86/os-support/shared/inout.S
+++ b/hw/xfree86/os-support/shared/inout.S
@@ -4,7 +4,7 @@
 
 
 
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/inout.S,v 1.1 1999/07/10 07:24:52 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/inout.s,v 3.5 1996/12/23 06:50:58 dawes Exp $ */
 
 #include "assyntax.h"
 
diff --git a/hw/xfree86/os-support/solaris/sun_inout.s b/hw/xfree86/os-support/solaris/sun_inout.s
index e8f03d0..5c0b23e 100644
--- a/hw/xfree86/os-support/solaris/sun_inout.s
+++ b/hw/xfree86/os-support/solaris/sun_inout.s
@@ -1,4 +1,4 @@
-/ $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_inout.s,v 1.1 2001/05/28 02:42:31 tsi Exp $
+/ $XFree86$
 /
 / Copyright 1994-2001 The XFree86 Project, Inc.  All Rights Reserved.
 /



More information about the xorg-commit mailing list