xserver: Branch 'master' - 4 commits

Adam Jackson ajax at kemper.freedesktop.org
Thu Mar 13 14:46:09 PDT 2008


 hw/xfree86/int10/helper_exec.c          |   57 ++++++++++++++++++++++++++++----
 hw/xfree86/modes/xf86RandR12.c          |   21 +----------
 hw/xfree86/os-support/bus/Makefile.am   |   12 ------
 hw/xfree86/os-support/bus/Pci.h         |    3 -
 hw/xfree86/os-support/linux/Makefile.am |    2 -
 hw/xfree86/os-support/shared/ia64Pci.c  |   55 ------------------------------
 6 files changed, 54 insertions(+), 96 deletions(-)

New commits:
commit 1b9878ffcfc0c0dbc4a6e674827fe508ba77db4b
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 f7abe05b3306ed9a6f2cf5e3e45ed524d725d029
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 5d7437c29e686a081b20823450d78c4c2f4e0aec
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 af950e6..1dca223 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -355,8 +355,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 61c3f63a75d8b0cc47ffed4a0e30147fab2ae8f4
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 816175c..af950e6 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -145,23 +145,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;
 }
 


More information about the xorg-commit mailing list