xserver: Branch 'master' - 4 commits

Tiago Vignatti vignatti at kemper.freedesktop.org
Mon Feb 25 13:14:58 PST 2008


 hw/xfree86/common/xf86Init.c          |   14 +---
 hw/xfree86/os-support/bus/Pci.c       |  104 +++-------------------------------
 hw/xfree86/os-support/linux/lnx_pci.c |   10 ---
 3 files changed, 16 insertions(+), 112 deletions(-)

New commits:
commit c46f7b62d2bf9f35937cfef98325ed904895396a
Author: Tiago Vignatti <vignatti at c3sl.ufpr.br>
Date:   Mon Feb 25 18:14:08 2008 -0300

    Fine, we don't need pciInit() anymore. Nuke, nuke, nuke...

diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
index 8b21fad..064533c 100644
--- a/hw/xfree86/os-support/bus/Pci.c
+++ b/hw/xfree86/os-support/bus/Pci.c
@@ -148,22 +148,6 @@ _X_EXPORT int            pciNumBuses = 0;     /* Actual number of PCI buses */
 int            pciMaxBusNum = MAX_PCI_BUSES;
 
 
-/*
- * pciInit - choose correct platform/OS specific PCI init routine
- */
-static void
-pciInit(void)
-{
-	/* XXX */
-#if defined(DEBUGPCI)
-	if (DEBUGPCI >= xf86Verbose) {
-	    xf86Verbose = DEBUGPCI;
-	}
-#endif
-
-	ARCH_PCI_INIT();
-}
-
 _X_EXPORT ADDRESS
 pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr)
 {
@@ -194,7 +178,16 @@ xf86scanpci(void)
     Bool  success = FALSE;
 
     success = (pci_system_init() == 0);
-    pciInit();
+
+	/* XXX */
+#if defined(DEBUGPCI)
+	if (DEBUGPCI >= xf86Verbose) {
+	    xf86Verbose = DEBUGPCI;
+	}
+#endif
+
+    /* choose correct platform/OS specific PCI init routine */
+	ARCH_PCI_INIT();
 
     return success;
 }
commit a9050d54249ed9f54c6fe59143b846c9c7548f59
Author: Tiago Vignatti <vignatti at c3sl.ufpr.br>
Date:   Mon Feb 25 18:10:18 2008 -0300

    Jesus, pciInit() was called 32 times in my machine without need!
    
    xf86scanpci() will always call pciInit() before any other function, so
    there's no need to guarantee it after.

diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
index 2d3f748..8b21fad 100644
--- a/hw/xfree86/os-support/bus/Pci.c
+++ b/hw/xfree86/os-support/bus/Pci.c
@@ -154,11 +154,6 @@ int            pciMaxBusNum = MAX_PCI_BUSES;
 static void
 pciInit(void)
 {
-    static int pciInitialized = 0;
-
-    if (!pciInitialized) {
-	pciInitialized = 1;
-
 	/* XXX */
 #if defined(DEBUGPCI)
 	if (DEBUGPCI >= xf86Verbose) {
@@ -167,7 +162,6 @@ pciInit(void)
 #endif
 
 	ARCH_PCI_INIT();
-    }
 }
 
 _X_EXPORT ADDRESS
@@ -175,8 +169,6 @@ pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr)
 {
   int bus = PCI_BUS_FROM_TAG(tag);
 
-  pciInit();
-
   if ((bus >= 0) && (bus < pciNumBuses) && pciBusInfo[bus] &&
 	pciBusInfo[bus]->funcs->pciAddrBusToHost)
 	  return (*pciBusInfo[bus]->funcs->pciAddrBusToHost)(tag, type, addr);
commit 81272f7ec9a3465e1d102c2ce627a45f92268857
Author: Tiago Vignatti <vignatti at c3sl.ufpr.br>
Date:   Mon Feb 25 17:39:33 2008 -0300

    Some doc clean up:
        clean up legacy things in os-support/bus/Pci.c.
    
        Put InitOutput() comment to its right place.

diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 7121b02..d1603c0 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -198,13 +198,6 @@ xf86CreateRootWindow(WindowPtr pWin)
 }
 
 
-/*
- * InitOutput --
- *	Initialize screenInfo for all actually accessible framebuffers.
- *      That includes vt-manager setup, querying all possible devices and
- *      collecting the pixmap formats.
- */
-
 static void
 PostConfigInit(void)
 {
@@ -467,7 +460,12 @@ xf86CallDriverProbe( DriverPtr drv, Bool detect_only )
     return foundScreen;
 }
 
-
+/*
+ * InitOutput --
+ *	Initialize screenInfo for all actually accessible framebuffers.
+ *      That includes vt-manager setup, querying all possible devices and
+ *      collecting the pixmap formats.
+ */
 void
 InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 {
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
index 1ca0bd0..2d3f748 100644
--- a/hw/xfree86/os-support/bus/Pci.c
+++ b/hw/xfree86/os-support/bus/Pci.c
@@ -1,65 +1,4 @@
 /*
- * Pci.c - New server PCI access functions
- *
- * The XFree86 server PCI access functions have been reimplemented as a
- * framework that allows each supported platform/OS to have their own
- * platform/OS specific pci driver.
- *
- * All of the public PCI access functions exported to the other parts of
- * the server are declared in Pci.h and defined herein.  These include:
- *	pciInit()              - Initialize PCI access functions
- *	pciReadLong()          - Read a 32 bit value from a device's cfg space
- *	pciReadWord()          - Read a 16 bit value from a device's cfg space
- *	pciReadByte()          - Read an 8 bit value from a device's cfg space
- *	pciWriteLong()         - Write a 32 bit value to a device's cfg space
- *	pciWriteWord()         - Write a 16 bit value to a device's cfg space
- *	pciWriteByte()         - Write an 8 bit value to a device's cfg space
- *	pciSetBitsLong()       - Write a 32 bit value against a mask
- *	pciSetBitsByte()       - Write an 8 bit value against a mask
- *	pciTag()               - Return tag for a given PCI bus, device, &
- *                               function
- *	pciBusAddrToHostAddr() - Convert a PCI address to a host address
- *	xf86scanpci()          - Return info about all PCI devices
- *	xf86MapDomainMemory()  - Like xf86MapPciMem() but can handle
- *                               domain/host address translation
- *	xf86MapLegacyIO()      - Maps PCI I/O spaces
- *
- * The actual PCI backend driver is selected by the pciInit() function
- * (see below)  using either compile time definitions, run-time checks,
- * or both.
- *
- * Certain generic functions are provided that make the implementation
- * of certain well behaved platforms (e.g. those supporting PCI config
- * mechanism 1 or some thing close to it) very easy.
- *
- * Less well behaved platforms/OS's can roll their own functions.
- *
- * To add support for another platform/OS, add a call to fooPciInit() within
- * pciInit() below under the correct compile time definition or run-time
- * conditional.
- *
- * The fooPciInit() procedure must do three things:
- *	1) Initialize the pciBusTable[] for all primary PCI buses including
- *	   the per domain PCI access functions (readLong, writeLong,
- *	   addrBusToHost, and addrHostToBus).
- *
- *	2) Add entries to pciBusTable[] for configured secondary buses.  This
- *	   step may be skipped if a platform is using the generic findFirst/
- *	   findNext functions because these procedures will automatically
- *	   discover and add secondary buses dynamically.
- *
- *      3) Overide default settings for global PCI access functions if
- *	   required. These include pciFindFirstFP, pciFindNextFP,
- *	   Of course, if you choose not to use one of the generic
- *	   functions, you will need to provide a platform specifc replacement.
- *
- * Gary Barton
- * Concurrent Computer Corporation
- * garyb at gate.net
- *
- */
-
-/*
  * Copyright 1998 by Concurrent Computer Corporation
  *
  * Permission to use, copy, modify, distribute, and sell this software
@@ -197,14 +136,6 @@
 
 #include <pciaccess.h>
 
-#if 0
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#endif
-
 #define PCI_MFDEV_SUPPORT   1 /* Include PCI multifunction device support */
 #define PCI_BRIDGE_SUPPORT  1 /* Include support for PCI-to-PCI bridges */
 
commit 7c582dd6de27d2f4fedf73319d2dea2bfb240efa
Author: Tiago Vignatti <vignatti at c3sl.ufpr.br>
Date:   Mon Feb 25 17:31:37 2008 -0300

    remove lnxPciInit() unused function.

diff --git a/hw/xfree86/os-support/linux/lnx_pci.c b/hw/xfree86/os-support/linux/lnx_pci.c
index 53818f2..8eedfa4 100644
--- a/hw/xfree86/os-support/linux/lnx_pci.c
+++ b/hw/xfree86/os-support/linux/lnx_pci.c
@@ -25,8 +25,6 @@
 #define PCIADDR_FMT		"%lx"
 #endif
 
-int lnxPciInit(void);
-
 struct pci_dev {
     unsigned int domain;
     unsigned int bus;
@@ -139,14 +137,6 @@ static struct pci_dev *xf86OSLinuxGetPciDevs(void) {
     return ret;
 }
 
-/* not to be confused with linuxPciInit (i.e. ARCH_PCI_INIT), found in
- * os-support/bus/linuxPci.c. */
-int lnxPciInit(void) {
-    if (!xf86OSLinuxPCIDevs)
-        xf86OSLinuxPCIDevs = xf86OSLinuxGetPciDevs();
-    return xf86OSLinuxNumPciDevs;
-}
-
 /* Query the kvirt address (64bit) of a BAR range from size for a given TAG */
 unsigned long
 xf86GetOSOffsetFromPCI(PCITAG tag, int space, unsigned long base)


More information about the xorg-commit mailing list