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

Adam Jackson ajax at kemper.freedesktop.org
Fri Mar 14 11:22:42 PDT 2008


 hw/xfree86/dri2/dri2.c                  |   11 ++++++
 hw/xfree86/dri2/dri2.h                  |    2 +
 hw/xfree86/int10/helper_exec.c          |   57 ++++++++++++++++++++++++++++----
 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 -
 xkb/xkbUtils.c                          |    7 ++-
 12 files changed, 78 insertions(+), 99 deletions(-)

New commits:
commit 92cffb8cc2bf0e6ac79a00477d7d63950d584cd3
Author: Bart Trojanowski <bart at 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 at 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 at 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 at 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 at 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 at 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 at 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 {


More information about the xorg-commit mailing list