[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'upstream-experimental'



 GL/glx/glxcmds.c                        |    6 +++
 GL/glx/glxdri.c                         |    2 -
 GL/glx/glxdri2.c                        |   26 +++-----------
 Xext/xselinux.c                         |   32 +++++++++++++++--
 hw/xfree86/common/modeline2c.awk        |    3 +
 hw/xfree86/common/xf86AutoConfig.c      |    5 +-
 hw/xfree86/common/xf86Config.c          |   30 +++++-----------
 hw/xfree86/common/xf86Priv.h            |    1 
 hw/xfree86/dri2/dri2.c                  |   16 +++++++-
 hw/xfree86/dri2/dri2.h                  |    5 ++
 hw/xfree86/int10/helper_exec.c          |   57 ++++++++++++++++++++++++++++----
 hw/xfree86/modes/xf86Crtc.c             |   52 ++++++++++++++++-------------
 hw/xfree86/modes/xf86Modes.c            |   28 ++-------------
 hw/xfree86/modes/xf86RandR12.c          |   21 +----------
 hw/xfree86/os-support/bsd/i386_video.c  |    3 +
 hw/xfree86/os-support/bus/Makefile.am   |   12 ------
 hw/xfree86/os-support/bus/Pci.h         |    3 -
 hw/xfree86/os-support/bus/bsd_pci.c     |    2 +
 hw/xfree86/os-support/linux/Makefile.am |    2 -
 hw/xfree86/os-support/shared/ia64Pci.c  |   55 ------------------------------
 hw/xfree86/utils/ioport/Makefile.am     |    2 -
 hw/xfree86/xf4bpp/ppcSpMcro.h           |    6 +--
 xkb/xkbUtils.c                          |    7 ++-
 23 files changed, 176 insertions(+), 200 deletions(-)

New commits:
commit 98249dfa98b53a238b7d881beb5ec8b85f28ecd0
Author: Eamon Walsh <ewalsh@tycho.nsa.gov>
Date:   Thu Mar 20 20:03:02 2008 -0400

    XSELinux: Do a check for whether background "None" is allowed.
    (cherry picked from commit 3bbd77ff98478153afe3251de9ba11d757218213)

diff --git a/Xext/xselinux.c b/Xext/xselinux.c
index 3035898..17ce7af 100644
--- a/Xext/xselinux.c
+++ b/Xext/xselinux.c
@@ -1026,6 +1026,13 @@ SELinuxResource(CallbackListPtr *pcbl, pointer unused, pointer calldata)
     rc = SELinuxDoCheck(subj, obj, class, access_mode, &auditdata);
     if (rc != Success)
 	rec->status = rc;
+
+    /* Perform the background none check on windows */
+    if (access_mode & DixCreateAccess && rec->rtype == RT_WINDOW) {
+	rc = SELinuxDoCheck(subj, obj, class, DixBlendAccess, &auditdata);
+	if (rc != Success)
+	    ((WindowPtr)rec->res)->forcedBG = TRUE;
+    }
 }
 
 static void

commit d08bb7040cd5ba2d438dec614ff1b4dd0f9b33d5
Author: Eamon Walsh <ewalsh@tycho.nsa.gov>
Date:   Thu Mar 20 19:42:09 2008 -0400

    XSELinux: Correctly handle some permission bits that are used more than once.
    (cherry picked from commit e323bb426ce8a072d119cb2720b773241259c137)

diff --git a/Xext/xselinux.c b/Xext/xselinux.c
index 18c6526..3035898 100644
--- a/Xext/xselinux.c
+++ b/Xext/xselinux.c
@@ -152,6 +152,12 @@ static struct security_class_mapping map[] = {
     { NULL }
 };
 
+/* x_resource "read" bits from the list above */
+#define SELinuxReadMask (DixReadAccess|DixGetAttrAccess|DixListPropAccess| \
+			 DixGetPropAccess|DixGetFocusAccess|DixListAccess| \
+			 DixShowAccess|DixBlendAccess|DixReceiveAccess| \
+			 DixUseAccess|DixDebugAccess)
+
 /* forward declarations */
 static void SELinuxScreen(CallbackListPtr *, pointer, pointer);
 
@@ -853,6 +859,7 @@ SELinuxSelection(CallbackListPtr *pcbl, pointer unused, pointer calldata)
     SELinuxObjectRec *obj, *data;
     Selection *pSel = *rec->ppSel;
     Atom name = pSel->selection;
+    Mask access_mode = rec->access_mode;
     SELinuxAuditRec auditdata = { .client = rec->client, .selection = name };
     security_id_t tsid;
     int rc;
@@ -861,11 +868,12 @@ SELinuxSelection(CallbackListPtr *pcbl, pointer unused, pointer calldata)
     obj = dixLookupPrivate(&pSel->devPrivates, objectKey);
 
     /* If this is a new object that needs labeling, do it now */
-    if (rec->access_mode & DixCreateAccess) {
+    if (access_mode & DixCreateAccess) {
 	sidput(obj->sid);
 	rc = SELinuxSelectionToSID(name, subj, &obj->sid, &obj->poly);
 	if (rc != Success)
 	    obj->sid = unlabeled_sid;
+	access_mode = DixSetAttrAccess;
     }
     /* If this is a polyinstantiated object, find the right instance */
     else if (obj->poly) {
@@ -890,13 +898,13 @@ SELinuxSelection(CallbackListPtr *pcbl, pointer unused, pointer calldata)
     }
 
     /* Perform the security check */
-    rc = SELinuxDoCheck(subj, obj, SECCLASS_X_SELECTION, rec->access_mode,
+    rc = SELinuxDoCheck(subj, obj, SECCLASS_X_SELECTION, access_mode,
 			&auditdata);
     if (rc != Success)
 	rec->status = rc;
 
     /* Label the content (advisory only) */
-    if (rec->access_mode & DixSetAttrAccess) {
+    if (access_mode & DixSetAttrAccess) {
 	data = dixLookupPrivate(&pSel->devPrivates, dataKey);
 	sidput(data->sid);
 	if (subj->sel_create_sid)
@@ -976,6 +984,7 @@ SELinuxResource(CallbackListPtr *pcbl, pointer unused, pointer calldata)
     SELinuxSubjectRec *subj;
     SELinuxObjectRec *obj;
     SELinuxAuditRec auditdata = { .client = rec->client };
+    Mask access_mode = rec->access_mode;
     PrivateRec **privatePtr;
     security_class_t class;
     int rc, offset;
@@ -997,7 +1006,7 @@ SELinuxResource(CallbackListPtr *pcbl, pointer unused, pointer calldata)
     }
 
     /* If this is a new object that needs labeling, do it now */
-    if (rec->access_mode & DixCreateAccess && offset >= 0) {
+    if (access_mode & DixCreateAccess && offset >= 0) {
 	rc = SELinuxLabelResource(rec, subj, obj, class);
 	if (rc != Success) {
 	    rec->status = rc;
@@ -1005,10 +1014,16 @@ SELinuxResource(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 	}
     }
 
+    /* Collapse generic resource permissions down to read/write */
+    if (class == SECCLASS_X_RESOURCE) {
+	access_mode = !!(rec->access_mode & SELinuxReadMask); /* rd */
+	access_mode |= !!(rec->access_mode & ~SELinuxReadMask) << 1; /* wr */
+    }
+
     /* Perform the security check */
     auditdata.restype = rec->rtype;
     auditdata.id = rec->id;
-    rc = SELinuxDoCheck(subj, obj, class, rec->access_mode, &auditdata);
+    rc = SELinuxDoCheck(subj, obj, class, access_mode, &auditdata);
     if (rc != Success)
 	rec->status = rc;
 }

commit c6ac4d4f4dfe3d792c77c48b009abc6e7103fbad
Author: Eamon Walsh <ewalsh@tycho.nsa.gov>
Date:   Tue Mar 18 17:51:21 2008 -0400

    Apply __glXDisp_GetVisualConfigs message patch
    From http://bugs.freedesktop.org/show_bug.cgi?id=13863
    
    Problem was that the glxcmds.c __glXDisp_GetVisualConfigs
    function left garbage in the tail end of the message used for extensions.
    (cherry picked from commit edad0a9dfebcce5c54b2f9c32bd9d45549e20c51)

diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c
index 32d1bc8..3b79cca 100644
--- a/GL/glx/glxcmds.c
+++ b/GL/glx/glxcmds.c
@@ -944,6 +944,12 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
 	buf[p++] = modes->transparentAlpha;
 	buf[p++] = GLX_TRANSPARENT_INDEX_VALUE;
 	buf[p++] = modes->transparentIndex;
+	buf[p++] = 0;
+	buf[p++] = 0;
+	buf[p++] = 0;
+	buf[p++] = 0;
+	buf[p++] = 0;
+	buf[p++] = 0;
 
 	if (client->swapped) {
 	    __GLX_SWAP_INT_ARRAY(buf, __GLX_TOTAL_CONFIG);

commit 4a61cf3b08942895868e18bff11e0e4e12f69a7e
Author: Adam Jackson <ajax@redhat.com>
Date:   Fri Mar 14 14:37:42 2008 -0400

    Fix a stray use of ALLOCATE_LOCAL.
    (cherry picked from commit 57d48d94b8947c571925e6fd4c9bf041fbd1b2ac)

diff --git a/hw/xfree86/xf4bpp/ppcSpMcro.h b/hw/xfree86/xf4bpp/ppcSpMcro.h
index 2b7f951..655a883 100644
--- a/hw/xfree86/xf4bpp/ppcSpMcro.h
+++ b/hw/xfree86/xf4bpp/ppcSpMcro.h
@@ -28,11 +28,11 @@
 #define SETSPANPTRS(IN,N,IPW,PW,IPPT,PPT,FPW,FPPT,FSORT)		\
 	{								\
 	N = IN * miFindMaxBand(pGC->pCompositeClip);			\
-	if(!(PW = (int *)ALLOCATE_LOCAL(N * sizeof(int))))		\
+	if(!(PW = (int *)xalloc(N * sizeof(int))))		\
 		return;							\
-	if(!(PPT = (DDXPointRec *)ALLOCATE_LOCAL(N * sizeof(DDXPointRec)))) \
+	if(!(PPT = (DDXPointRec *)xalloc(N * sizeof(DDXPointRec)))) \
 		{							\
-		DEALLOCATE_LOCAL(PW);					\
+		free(PW);					\
 		return;							\
     		}							\
 	FPW = PW;							\

commit 43739b9a32cbe45139935bbeb39aecf7b7dd017c
Author: Adam Jackson <ajax@redhat.com>
Date:   Fri Mar 14 14:24:21 2008 -0400

    RANDR 1.2: Fix initial mode aspect ratio match in a corner case.
    
    Actually more like in the mainline case, where the ideal mode happens to
    be the very first aspect match on the first monitor.  But let's not
    split hairs.
    (cherry picked from commit 824853772241acf64bc37ac8b85254194741ae13)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 0bef5b4..2b07421 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1674,14 +1674,19 @@ aspectMatch(float a, float b)
 }
 
 static DisplayModePtr
-nextAspectMode(DisplayModePtr start, float aspect)
+nextAspectMode(xf86OutputPtr o, DisplayModePtr last, float aspect)
 {
-    DisplayModePtr m = start;
+    DisplayModePtr m = NULL;
 
-    if (!m)
+    if (!o)
 	return NULL;
 
-    for (m = m->next; m; m = m->next)
+    if (!last)
+	m = o->probed_modes;
+    else
+	m = last->next;
+
+    for (; m; m = m->next)
 	if (aspectMatch(aspect, (float)m->HDisplay / (float)m->VDisplay))
 	    return m;
 
@@ -1691,31 +1696,29 @@ nextAspectMode(DisplayModePtr start, float aspect)
 static DisplayModePtr
 bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect)
 {
-    int o, p;
-    DisplayModePtr mode, test = NULL, match = NULL;
+    int o = -1, p;
+    DisplayModePtr mode = NULL, test = NULL, match = NULL;
 
-    for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
-	mode = config->output[o]->probed_modes;
-	while ((mode = nextAspectMode(mode, aspect))) {
-	    for (p = o; nextEnabledOutput(config, enabled, &p); ) {
-		test = xf86OutputFindClosestMode(config->output[p], mode);
-		if (!test)
-		    break;
-		if (test->HDisplay != mode->HDisplay ||
+    nextEnabledOutput(config, enabled, &o);
+    while ((mode = nextAspectMode(config->output[o], mode, aspect))) {
+	for (p = o; nextEnabledOutput(config, enabled, &p); ) {
+	    test = xf86OutputFindClosestMode(config->output[p], mode);
+	    if (!test)
+		break;
+	    if (test->HDisplay != mode->HDisplay ||
 		    test->VDisplay != mode->VDisplay) {
-		    test = NULL;
-		    break;
-		}
+		test = NULL;
+		break;
 	    }
+	}
 
-	    /* if we didn't match it on all outputs, try the next one */
-	    if (!test)
-		continue;
+	/* if we didn't match it on all outputs, try the next one */
+	if (!test)
+	    continue;
 
-	    /* if it's bigger than the last one, save it */
-	    if (!match || (test->HDisplay > match->HDisplay))
-		match = test;
-	}
+	/* if it's bigger than the last one, save it */
+	if (!match || (test->HDisplay > match->HDisplay))
+	    match = test;
     }
 
     /* return the biggest one found */

commit 92cffb8cc2bf0e6ac79a00477d7d63950d584cd3
Author: Bart Trojanowski <bart@jukie.net>
Date:   Thu Mar 13 17:42:16 2008 -0400

    Bug #14332: Fix PCI access cycles from x86emu.
    
    The address written to 0xcf8 contains the PCI slot address to send the
    config cycle to.  However, we would ignore that and always send the
    cycle to the device whose BIOS we were running.  This breaks some
    integrated graphics platforms that have explicit knowledge about the
    system's host bridge, for example.

diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c
index de6fde5..9daff22 100644
--- a/hw/xfree86/int10/helper_exec.c
+++ b/hw/xfree86/int10/helper_exec.c
@@ -33,6 +33,7 @@
 #ifdef _X86EMU
 #include "x86emu/x86emui.h"
 #endif
+#include <pciaccess.h>
 
 static int pciCfg1in(CARD16 addr, CARD32 *val);
 static int pciCfg1out(CARD16 addr, CARD32 val);
@@ -459,7 +460,43 @@ Mem_wl(CARD32 addr, CARD32 val)
 
 static CARD32 PciCfg1Addr = 0;
 
-#define OFFSET(Cfg1Addr) (Cfg1Addr & 0xff)
+#define PCI_OFFSET(x) ((x) & 0x000000ff)
+#define PCI_TAG(x)    ((x) & 0xffffff00)
+
+static struct pci_device*
+pci_device_for_cfg_address (CARD32 addr)
+{
+	struct pci_device *dev = NULL;
+	PCITAG tag = PCI_TAG(addr);
+	struct pci_slot_match slot_match = {
+		.domain = PCI_DOM_FROM_TAG(tag),
+		.bus = PCI_BUS_NO_DOMAIN(PCI_BUS_FROM_TAG(tag)),
+		.dev = PCI_DEV_FROM_TAG(tag),
+		.func = PCI_FUNC_FROM_TAG(tag),
+		.match_data = 0
+	};
+
+	struct pci_device_iterator *iter =
+	    pci_slot_match_iterator_create (&slot_match);
+	if (iter)
+		dev = pci_device_next(iter);
+	if (!dev) {
+		char buf[128]; /* enough to store "%u@%u" */
+		xf86FormatPciBusNumber(tag >> 16, buf);
+		ErrorF("Failed to find device matching %s:%u:%u\n",
+				buf, slot_match.dev, slot_match.func);
+		return NULL;
+	}
+
+	if (pci_device_next(iter)) {
+		char buf[128]; /* enough to store "%u@%u" */
+		xf86FormatPciBusNumber(tag >> 16, buf);
+		ErrorF("Multiple devices matching %s:%u:%u\n",
+				buf, slot_match.dev, slot_match.func);
+	}
+
+	return dev;
+}
 
 static int
 pciCfg1in(CARD16 addr, CARD32 *val)
@@ -469,7 +506,8 @@ pciCfg1in(CARD16 addr, CARD32 *val)
 	return 1;
     }
     if (addr == 0xCFC) {
-	pci_device_cfg_read_u32(Int10Current->dev, val, OFFSET(PciCfg1Addr));
+	pci_device_cfg_read_u32(pci_device_for_cfg_address(PciCfg1Addr),
+			val, PCI_OFFSET(PciCfg1Addr));
 	if (PRINT_PORT && DEBUG_IO_TRACE())
 	    ErrorF(" cfg_inl(%#x) = %8.8x\n", PciCfg1Addr, *val);
 	return 1;
@@ -487,7 +525,8 @@ pciCfg1out(CARD16 addr, CARD32 val)
     if (addr == 0xCFC) {
 	if (PRINT_PORT && DEBUG_IO_TRACE())
 	    ErrorF(" cfg_outl(%#x, %8.8x)\n", PciCfg1Addr, val);
-	pci_device_cfg_write_u32(Int10Current->dev, val, OFFSET(PciCfg1Addr));
+	pci_device_cfg_write_u32(pci_device_for_cfg_address(PciCfg1Addr),
+			val, PCI_OFFSET(PciCfg1Addr));
 	return 1;
     }
     return 0;
@@ -506,7 +545,8 @@ pciCfg1inw(CARD16 addr, CARD16 *val)
     if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
 	const unsigned offset = addr - 0xCFC;
 
-	pci_device_cfg_read_u16(Int10Current->dev, val, OFFSET(PciCfg1Addr) + offset);
+	pci_device_cfg_read_u16(pci_device_for_cfg_address(PciCfg1Addr),
+			val, PCI_OFFSET(PciCfg1Addr) + offset);
 	if (PRINT_PORT && DEBUG_IO_TRACE())
 	    ErrorF(" cfg_inw(%#x) = %4.4x\n", PciCfg1Addr + offset, *val);
 	return 1;
@@ -530,7 +570,8 @@ pciCfg1outw(CARD16 addr, CARD16 val)
 
 	if (PRINT_PORT && DEBUG_IO_TRACE())
 	    ErrorF(" cfg_outw(%#x, %4.4x)\n", PciCfg1Addr + offset, val);
-	pci_device_cfg_write_u16(Int10Current->dev, val, OFFSET(PciCfg1Addr) + offset);
+	pci_device_cfg_write_u16(pci_device_for_cfg_address(PciCfg1Addr),
+			val, PCI_OFFSET(PciCfg1Addr) + offset);
 	return 1;
     }
     return 0;
@@ -549,7 +590,8 @@ pciCfg1inb(CARD16 addr, CARD8 *val)
     if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
 	const unsigned offset = addr - 0xCFC;
 
-	pci_device_cfg_read_u8(Int10Current->dev, val, OFFSET(PciCfg1Addr) + offset);
+	pci_device_cfg_read_u8(pci_device_for_cfg_address(PciCfg1Addr),
+			val, PCI_OFFSET(PciCfg1Addr) + offset);
 	if (PRINT_PORT && DEBUG_IO_TRACE())
 	    ErrorF(" cfg_inb(%#x) = %2.2x\n", PciCfg1Addr + offset, *val);
 	return 1;
@@ -573,7 +615,8 @@ pciCfg1outb(CARD16 addr, CARD8 val)
 
 	if (PRINT_PORT && DEBUG_IO_TRACE())
 	    ErrorF(" cfg_outb(%#x, %2.2x)\n", PciCfg1Addr + offset, val);
-	pci_device_cfg_write_u8(Int10Current->dev, val, OFFSET(PciCfg1Addr) + offset);
+	pci_device_cfg_write_u8(pci_device_for_cfg_address(PciCfg1Addr),
+			val, PCI_OFFSET(PciCfg1Addr) + offset);
 	return 1;
     }
     return 0;

commit db26f32d0d0e2d6d11129ddfe46931308e536206
Author: Doug Chapman <doug.chapman@hp.com>
Date:   Thu Mar 13 17:40:34 2008 -0400

    Bug #14091: Fix build (and runtime) on ia64.

diff --git a/hw/xfree86/os-support/bus/Makefile.am b/hw/xfree86/os-support/bus/Makefile.am
index 381b992..5a15430 100644
--- a/hw/xfree86/os-support/bus/Makefile.am
+++ b/hw/xfree86/os-support/bus/Makefile.am
@@ -27,18 +27,6 @@ if LINUX_ALPHA
 PCI_SOURCES += axpPci.c
 endif
 
-if LINUX_IA64
-PLATFORM_PCI_SOURCES = \
-	460gxPCI.c \
-	460gxPCI.h \
-	altixPCI.c \
-	altixPCI.h \
-	e8870PCI.c \
-	e8870PCI.h \
-	zx1PCI.c \
-	zx1PCI.h
-endif
-
 if XORG_BUS_SPARC
 PLATFORM_SOURCES = Sbus.c
 sdk_HEADERS += xf86Sbus.h
diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h
index 0abb34f..ebac090 100644
--- a/hw/xfree86/os-support/bus/Pci.h
+++ b/hw/xfree86/os-support/bus/Pci.h
@@ -207,9 +207,8 @@
 # endif
 #elif defined(__ia64__)
 # if defined(linux)
-#  define ARCH_PCI_INIT ia64linuxPciInit
+#  define ARCH_PCI_INIT linuxPciInit
 # endif
-# define XF86SCANPCI_WRAPPER ia64ScanPCIWrapper
 #elif defined(__i386__) || defined(__i386)
 # if defined(linux)
 #  define ARCH_PCI_INIT linuxPciInit
diff --git a/hw/xfree86/os-support/linux/Makefile.am b/hw/xfree86/os-support/linux/Makefile.am
index 5a52ffd..beaae3d 100644
--- a/hw/xfree86/os-support/linux/Makefile.am
+++ b/hw/xfree86/os-support/linux/Makefile.am
@@ -1,7 +1,7 @@
 noinst_LTLIBRARIES = liblinux.la
 
 if LINUX_IA64
-PLATFORM_PCI_SUPPORT = $(srcdir)/lnx_ia64.c $(srcdir)/../shared/ia64Pci.c
+PLATFORM_PCI_SUPPORT = $(srcdir)/../shared/ia64Pci.c
 PLATFORM_DEFINES = -DOS_PROBE_PCI_CHIPSET=lnxProbePciChipset
 PLATFORM_INCLUDES = -I$(srcdir)/../shared
 endif
diff --git a/hw/xfree86/os-support/shared/ia64Pci.c b/hw/xfree86/os-support/shared/ia64Pci.c
index 45522e9..6f6924b 100644
--- a/hw/xfree86/os-support/shared/ia64Pci.c
+++ b/hw/xfree86/os-support/shared/ia64Pci.c
@@ -42,12 +42,7 @@
 #include <linux/pci.h>
 
 #include "compiler.h"
-#include "460gxPCI.h"
-#include "e8870PCI.h"
-#include "zx1PCI.h"
-#include "altixPCI.h"
 #include "Pci.h"
-#include "ia64Pci.h"
 
 /*
  * We use special in/out routines here since Altix platforms require the
@@ -191,53 +186,3 @@ _X_EXPORT unsigned int inl(unsigned long port)
     return val;
 }
 
-void
-ia64ScanPCIWrapper(scanpciWrapperOpt flags)
-{
-    static IA64Chipset chipset = NONE_CHIPSET;
-    
-    if (flags == SCANPCI_INIT) {
-
-	/* PCI configuration space probes should be done first */
-	if (xorgProbe460GX(flags)) {
-	    chipset = I460GX_CHIPSET;
-	    xf86PreScan460GX();	
-	    return;
-	} else if (xorgProbeE8870(flags)) {
-	    chipset = E8870_CHIPSET;
-	    xf86PreScanE8870();
-	    return;
-	}
-#ifdef OS_PROBE_PCI_CHIPSET
-	chipset = OS_PROBE_PCI_CHIPSET(flags);
-	switch (chipset) {
-	    case ZX1_CHIPSET:
-		xf86PreScanZX1();
-		return;
-	    case ALTIX_CHIPSET:
-		xf86PreScanAltix();
-		return;
-	    default:
-		return;
-	}
-#endif
-    } else /* if (flags == SCANPCI_TERM) */ {
-
-	switch (chipset) {
-	    case I460GX_CHIPSET:
-		xf86PostScan460GX();
-		return;
-	    case E8870_CHIPSET:
-		xf86PostScanE8870();
-		return;
-	    case ZX1_CHIPSET:
-		xf86PostScanZX1();
-		return;
-	    case ALTIX_CHIPSET:
-		xf86PostScanAltix();
-		return;
-	    default:
-		return;
-	}
-    }
-}

commit 95f6d8822da22518c6e1fb3988f12edd7267d7f8
Author: Adam Jackson <ajax@redhat.com>
Date:   Thu Mar 13 17:37:12 2008 -0400

    RANDR 1.2: Fix the RANDR 1.1 screen size estimation to approach reality.
    
    While the ScreenRec's notion of size in millimeters would get updates,
    the RANDR 1.1 notion wouldn't, so your screen would appear to be square
    and probably at some ludicrous DPI.

diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 90ca81a..9671839 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -341,8 +341,8 @@ xf86RandR12ScreenSetSize (ScreenPtr	pScreen,
 
     pScreen->width = pScrnPix->drawable.width = width;
     pScreen->height = pScrnPix->drawable.height = height;
-    pScreen->mmWidth = mmWidth;
-    pScreen->mmHeight = mmHeight;
+    randrp->mmWidth = pScreen->mmWidth = mmWidth;
+    randrp->mmHeight = pScreen->mmHeight = mmHeight;
 
     xf86SetViewport (pScreen, pScreen->width-1, pScreen->height-1);
     xf86SetViewport (pScreen, 0, 0);

commit e4dee1626dd97632a6df053f10ef732de341a2f6
Author: Adam Jackson <ajax@redhat.com>
Date:   Thu Mar 13 17:34:54 2008 -0400

    RANDR 1.2: Don't report a square resolution to RANDR 1.1 clients.
    
    It can't possibly do anything useful, and older versions of Gnome (and
    proably others) get very confused by it.  So do the drivers, for that
    matter.

diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index e2668fb..90ca81a 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -135,23 +135,6 @@ xf86RandR12GetInfo (ScreenPtr pScreen, Rotation *rotations)
 	randrp->maxY = maxY;
     }
 
-    if (scrp->currentMode->HDisplay != randrp->virtualX ||
-	scrp->currentMode->VDisplay != randrp->virtualY)
-    {
-	pSize = RRRegisterSize (pScreen,
-				randrp->virtualX, randrp->virtualY,
-				randrp->mmWidth,
-				randrp->mmHeight);
-	if (!pSize)
-	    return FALSE;
-	RRRegisterRate (pScreen, pSize, refresh0);
-	if (scrp->virtualX == randrp->virtualX &&
-	    scrp->virtualY == randrp->virtualY)
-	{
-	    RRSetCurrentConfig (pScreen, randrp->rotation, refresh0, pSize);
-	}
-    }
-
     return TRUE;
 }
 

commit ce70eb1fe333c1a0d4bb259532f547884daa8f26
Author: Mark Kettenis <mark.kettenis@xs4all.nl>
Date:   Wed Mar 12 21:45:37 2008 +0100

    OpenBSD support for libpciaccess.
    
    xserver and libpciaccess both need to open /dev/xf86, which can only
    be opened once.  I implemented pci_system_init_dev_mem() like Ian
    suggested.  This requires some minor changes to the BSD-specific
    os-support code.  Since pci_system_init_dev_mem() is a no-op on
    FreeBSD this should be no problem.

diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c
index 0dcff66..7e4a4d2 100644
--- a/hw/xfree86/os-support/bsd/i386_video.c
+++ b/hw/xfree86/os-support/bsd/i386_video.c
@@ -212,6 +212,9 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
 	pVidMem->mapMem = mapVidMem;
 	pVidMem->unmapMem = unmapVidMem;
 
+	if (useDevMem)
+		pci_system_init_dev_mem(devMemFd);
+
 #ifdef HAS_MTRR_SUPPORT
 	if (useDevMem) {
 		if (cleanMTRR()) {
diff --git a/hw/xfree86/os-support/bus/bsd_pci.c b/hw/xfree86/os-support/bus/bsd_pci.c
index bceb108..57ad09b 100644
--- a/hw/xfree86/os-support/bus/bsd_pci.c
+++ b/hw/xfree86/os-support/bus/bsd_pci.c
@@ -81,4 +81,6 @@ bsdPciInit(void)
 {
     pciNumBuses = 1;
     pciBusInfo[0] = &bsd_pci;
+
+    xf86InitVidMem();
 }
diff --git a/hw/xfree86/utils/ioport/Makefile.am b/hw/xfree86/utils/ioport/Makefile.am
index c1f9453..12f8613 100644
--- a/hw/xfree86/utils/ioport/Makefile.am
+++ b/hw/xfree86/utils/ioport/Makefile.am
@@ -37,7 +37,7 @@ ioport_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
 ioport_LDADD = \
 	../../os-support/libxorgos.la \
 	../../dummylib/libdummy-nonserver.a \
-	${UTILS_SYS_LIBS}
+	${UTILS_SYS_LIBS} ${PCIACCESS_LIBS}
 
 
 ioport_SOURCES =	\

commit b02d11e629cceb8f14e1c8854a2a02411ff071c0
Author: Kristian Høgsberg <krh@redhat.com>
Date:   Tue Mar 11 00:35:31 2008 -0400

    DRI2: Add DRI2AuthConnection().
    
    DRI2 uses the same authentication scheme as XF86DRI, so implement this
    entry point so DRI2 protocol code can access it.

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index d2664b1..d527387 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -342,6 +342,17 @@ DRI2Connect(ScreenPtr pScreen, int *fd, const char **driverName,
     return TRUE;
 }
 
+Bool
+DRI2AuthConnection(ScreenPtr pScreen, drm_magic_t magic)
+{
+    DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
+
+    if (ds == NULL || drmAuthMagic(ds->fd, magic))
+	return FALSE;
+
+    return TRUE;
+}
+
 unsigned int
 DRI2GetPixmapHandle(PixmapPtr pPixmap, unsigned int *flags)
 {
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index a319085..126087a 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -58,6 +58,8 @@ Bool DRI2Connect(ScreenPtr pScreen,
 		 const char **driverName,
 		 unsigned int *sareaHandle);
 
+Bool DRI2AuthConnection(ScreenPtr pScreen, drm_magic_t magic);
+
 unsigned int DRI2GetPixmapHandle(PixmapPtr pPixmap,
 				 unsigned int *flags);
 

commit 54c31572d53ffc1844cba3fa2f748717665381f0
Author: Keith Packard <keithp@keithp.com>
Date:   Wed Feb 6 16:51:57 2008 -0800

    XkbCopyKeymap was mangling doodads and overlays

diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index b313270..a3ae655 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -1796,6 +1796,7 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies)
                   dsection = dst->geom->sections;
                  i < src->geom->num_sections;
                  i++, ssection++, dsection++) {
+		*dsection = *ssection;
                 if (ssection->num_rows) {
                     tmp = xcalloc(ssection->num_rows, sizeof(XkbRowRec));
                     if (!tmp)
@@ -1830,6 +1831,7 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies)
                     dsection->doodads = NULL;
                 }
 
+                dsection->sz_doodads = ssection->num_doodads;
                 for (k = 0,
                       sdoodad = ssection->doodads,
                       ddoodad = dsection->doodads;
@@ -1850,8 +1852,9 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies)
                     }
                     ddoodad->any.type = sdoodad->any.type;
                 }
-                dsection->num_doodads = ssection->num_doodads;
-                dsection->sz_doodads = ssection->num_doodads;
+		dsection->overlays = NULL;
+		dsection->sz_overlays = 0;
+		dsection->num_overlays = 0;
             }
         }
         else {

commit 02feb14a678e3b8ad9acf0b6db8d159b4fd64147
Author: Kristian Høgsberg <krh@sasori.boston.redhat.com>
Date:   Sun Mar 9 21:40:27 2008 -0400

    GLX: Track changes to DRI_TEX_BUFFER extension.
    
    We now just pass in the __DRIdrawable.
    (cherry picked from commit 01c2e01f2aee580438b74bfb9da8f584f3878e6b)

diff --git a/GL/glx/glxdri2.c b/GL/glx/glxdri2.c
index fbc018c..fecfb19 100644
--- a/GL/glx/glxdri2.c
+++ b/GL/glx/glxdri2.c
@@ -225,7 +225,7 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
     __GLXDRIscreen * const screen = (__GLXDRIscreen *) glxGetScreen(pScreen);
     PixmapPtr pixmap;
     __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
-    unsigned int flags;
+    __GLXDRIdrawable *drawable = (__GLXDRIdrawable *) glxPixmap;
 
     if (screen->texBuffer == NULL)
         return Success;
@@ -233,10 +233,7 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
     pixmap = (PixmapPtr) glxPixmap->pDraw;
     screen->texBuffer->setTexBuffer(&context->driContext,
 				    glxPixmap->target,
-				    DRI2GetPixmapHandle(pixmap, &flags),
-				    pixmap->drawable.depth,
-				    pixmap->devKind,
-				    pixmap->drawable.height);
+				    &drawable->driDrawable);
 
     return Success;
 }

commit 12829f1e9158445dd66d32885ff9e3f902bf8c0e
Author: Kristian Høgsberg <krh@sasori.boston.redhat.com>
Date:   Sun Mar 9 21:39:19 2008 -0400

    DRI2: Return event buffer head index in DRI2CreateDrawable.
    
    And pass it to the DRI driver in AIGLX.
    (cherry picked from commit acedc03367e9e69f03b4838f0f0e8d8a8e872b9b)

diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c
index dc15b0f..1e17911 100644
--- a/GL/glx/glxdri.c
+++ b/GL/glx/glxdri.c
@@ -704,7 +704,7 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
 	(driScreen->driScreen.createNewDrawable)(&driScreen->driScreen,
 						 modes,
 						 &private->driDrawable,
-						 hwDrawable, 0, NULL);
+						 hwDrawable, 0, 0, NULL);
 
     if (private->driDrawable.private == NULL) {
 	__glXenterServer(GL_FALSE);
diff --git a/GL/glx/glxdri2.c b/GL/glx/glxdri2.c
index 27257d3..fbc018c 100644
--- a/GL/glx/glxdri2.c
+++ b/GL/glx/glxdri2.c
@@ -341,6 +341,7 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
     __GLXDRIdrawable *private;
     GLboolean retval;
     drm_drawable_t hwDrawable;
+    unsigned int head;
 
     private = xalloc(sizeof *private);
     if (private == NULL)
@@ -359,13 +360,14 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
     private->base.swapBuffers   = __glXDRIdrawableSwapBuffers;
     private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer;
 
-    retval = DRI2CreateDrawable(screen->pScreen, pDraw, &hwDrawable);
+    retval = DRI2CreateDrawable(screen->pScreen, pDraw,
+				&hwDrawable, &head);
 
     private->driDrawable.private =
 	(driScreen->driScreen.createNewDrawable)(&driScreen->driScreen,
 						 modes,
 						 &private->driDrawable,
-						 hwDrawable, 0, NULL);
+						 hwDrawable, head, 0, NULL);
 
     return &private->base;
 }
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 9b4c18c..d2664b1 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -262,8 +262,8 @@ DRI2CloseScreen(ScreenPtr pScreen)
 }
 
 Bool
-DRI2CreateDrawable(ScreenPtr pScreen,
-		   DrawablePtr pDraw, drm_drawable_t *pDrmDrawable)
+DRI2CreateDrawable(ScreenPtr pScreen, DrawablePtr pDraw,
+		   drm_drawable_t *pDrmDrawable, unsigned int *head)
 {
     DRI2ScreenPtr	ds = DRI2GetScreen(pScreen);
     WindowPtr		pWin;
@@ -293,6 +293,7 @@ DRI2CreateDrawable(ScreenPtr pScreen,
 
     *pDrmDrawable = pPriv->drawable;
 
+    *head = ds->buffer->head;
     DRI2PostDrawableConfig(pDraw);
     DRI2PostBufferAttach(pDraw);
     DRI2ScreenCommitEvents(ds);
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index c848247..a319085 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -66,7 +66,8 @@ void DRI2Unlock(ScreenPtr pScreen);
 
 Bool DRI2CreateDrawable(ScreenPtr	 pScreen,
 			DrawablePtr	 pDraw,
-			drm_drawable_t	*pDrmDrawable);
+			drm_drawable_t	*pDrmDrawable,
+			unsigned int    *head);
 
 void DRI2DestroyDrawable(ScreenPtr	pScreen,
 			 DrawablePtr	pDraw);

commit 4aaf048b5a00ee4f91c2a1d026cd313f0207f0bc
Author: Kristian Høgsberg <krh@redhat.com>
Date:   Fri Mar 7 14:12:28 2008 -0500

    Fix DRI2 texture target for GLX_EXT_texture_from_pixmap.
    
    Thanks to Dennis Kasprzyk for pointing it out and for reminding me to
    commit it.
    (cherry picked from commit 9abaad115cb6245b12b2adb3552ace99b634ab4a)

diff --git a/GL/glx/glxdri2.c b/GL/glx/glxdri2.c
index b0082a0..27257d3 100644
--- a/GL/glx/glxdri2.c
+++ b/GL/glx/glxdri2.c
@@ -216,8 +216,6 @@ __glXDRIcontextForceCurrent(__GLXcontext *baseContext)
 
 #ifdef __DRI_TEX_BUFFER
 
-#define isPowerOfTwo(n) (((n) & ((n) - 1 )) == 0)
-
 static int
 __glXDRIbindTexImage(__GLXcontext *baseContext,
 		     int buffer,
@@ -228,26 +226,17 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
     PixmapPtr pixmap;
     __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
     unsigned int flags;
-    int w, h, target;
 
     if (screen->texBuffer == NULL)
         return Success;
 
     pixmap = (PixmapPtr) glxPixmap->pDraw;
-    w = pixmap->drawable.width;
-    h = pixmap->drawable.height;
-
-    if (!isPowerOfTwo(w) || !isPowerOfTwo(h))
-	target = GL_TEXTURE_RECTANGLE_ARB;
-    else
-	target = GL_TEXTURE_2D;
-
     screen->texBuffer->setTexBuffer(&context->driContext,
-				    target,
+				    glxPixmap->target,
 				    DRI2GetPixmapHandle(pixmap, &flags),
 				    pixmap->drawable.depth,
 				    pixmap->devKind,
-				    h);
+				    pixmap->drawable.height);
 
     return Success;
 }

commit 921cbc58036491eab491b4c7b07111f04aa58d40
Author: Adam Jackson <ajax@redhat.com>
Date:   Mon Mar 10 13:40:00 2008 -0400

    Add the "amd" driver to magic driver selection.

diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
index e3e0bb3..268b50c 100644
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -140,12 +140,13 @@ videoPtrToDriverName(struct pci_device *dev)
 {
     /*
      * things not handled yet:
-     * amd/cyrix/nsc
-     * xgi
+     * cyrix/nsc.  should be merged into geode anyway.
+     * xgi.
      */
 
     switch (dev->vendor_id)
     {
+	case 0x1022:		    return "amd";
 	case 0x1142:		    return "apm";
 	case 0xedd8:		    return "ark";
 	case 0x1a03:		    return "ast";

commit e5bd75e11f1ac6b01d408166e628e9bbdb218b71
Author: Adam Jackson <ajax@redhat.com>
Date:   Mon Mar 10 09:14:20 2008 -0400

    Bug #14927: Fix the math for xf86NumDefaultModes.
    (cherry picked from commit 0f6aaf636b7ac4c98467284ff7baf1b83e0b72e7)

diff --git a/hw/xfree86/common/modeline2c.awk b/hw/xfree86/common/modeline2c.awk
index ca32e2f..71a956e 100644
--- a/hw/xfree86/common/modeline2c.awk
+++ b/hw/xfree86/common/modeline2c.awk
@@ -92,5 +92,5 @@ BEGIN {
 
 END {
 	print "};"
-	printf "const int xf86NumDefaultModes = sizeof(xf86NumDefaultModes) / sizeof(DisplayModeRec);"
+	printf "const int xf86NumDefaultModes = sizeof(xf86DefaultModes) / sizeof(DisplayModeRec);"
 }

commit ef702d586697c4ae9092ab0a412719c11973ec60
Author: Adam Jackson <ajax@redhat.com>
Date:   Fri Mar 7 09:25:06 2008 -0500

    Size xf86DefaultModes explicitly.
    
    i.e., don't check for the end of the list by ->name == NULL, since that
    won't work now.  Fix the consumers of xf86DefaultModes to use the new
    explicit size as well.

diff --git a/hw/xfree86/common/modeline2c.awk b/hw/xfree86/common/modeline2c.awk
index b9ad3cd..ca32e2f 100644
--- a/hw/xfree86/common/modeline2c.awk
+++ b/hw/xfree86/common/modeline2c.awk
@@ -91,5 +91,6 @@ BEGIN {
 }
 
 END {
-	printf("\t{MODEPREFIX,0,0,0,0,0,0,0,0,0,0,0,0,MODESUFFIX}\n};\n")
+	print "};"
+	printf "const int xf86NumDefaultModes = sizeof(xf86NumDefaultModes) / sizeof(DisplayModeRec);"
 }


Reply to: