[PATCH 01/14] xfree86: use xf86PciIsolateDevice to get PCI config information

Tiago Vignatti tiago.vignatti at nokia.com
Thu Jun 3 04:48:08 PDT 2010


Make xf86IsolateDevice private on PCI common file.

Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag at dottedmag.net>
---
 hw/xfree86/common/xf86Config.c  |   13 +++----------
 hw/xfree86/common/xf86Globals.c |    4 ----
 hw/xfree86/common/xf86Priv.h    |    3 ---
 hw/xfree86/common/xf86pciBus.c  |    5 +++++
 4 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 7acb6af..da9e729 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -60,7 +60,7 @@
 #include "configProcs.h"
 #include "globals.h"
 #include "extension.h"
-#include "Pci.h"
+#include "xf86pciBus.h"
 
 #include "xf86Xinput.h"
 extern DeviceAssocRec mouse_assoc;
@@ -2535,18 +2535,11 @@ xf86HandleConfigFile(Bool autoconfig)
            scanptr = xf86ConfigLayout.screens->screen->device->busID;
     }
     if (scanptr) {
-       int bus, device, func;
        if (strncmp(scanptr, "PCI:", 4) != 0) {
            xf86Msg(X_WARNING, "Bus types other than PCI not yet isolable.\n"
                               "\tIgnoring IsolateDevice option.\n");
-       } else if (sscanf(scanptr, "PCI:%d:%d:%d", &bus, &device, &func) == 3) {
-           xf86IsolateDevice.domain = PCI_DOM_FROM_BUS(bus);
-           xf86IsolateDevice.bus = PCI_BUS_NO_DOMAIN(bus);
-           xf86IsolateDevice.dev = device;
-           xf86IsolateDevice.func = func;
-           xf86Msg(X_INFO,
-                   "Isolating PCI bus \"%d:%d:%d\"\n", bus, device, func);
-       }
+       } else
+           xf86PciIsolateDevice(scanptr);
     }
 
     /* Now process everything else */
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 8b483f3..0209e9e 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -202,7 +202,3 @@ Bool xf86VidModeAllowNonLocal = FALSE;
 RootWinPropPtr *xf86RegisteredPropertiesTable = NULL;
 Bool xf86inSuspend = FALSE;
 Bool xorgHWAccess = FALSE;
-
-struct pci_slot_match xf86IsolateDevice = {
-    PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0
-};
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index b5e7a45..08c0fa9 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -35,8 +35,6 @@
 #ifndef _XF86PRIV_H
 #define _XF86PRIV_H
 
-#include <pciaccess.h>
-
 #include "xf86Privstr.h"
 #include "propertyst.h"
 #include "input.h"
@@ -72,7 +70,6 @@ extern _X_EXPORT  rgb xf86Weight;
 extern _X_EXPORT  Bool xf86FlipPixels;
 extern _X_EXPORT  Gamma xf86Gamma;
 extern _X_EXPORT  char *xf86ServerName;
-extern _X_EXPORT  struct pci_slot_match xf86IsolateDevice;
 
 /* Other parameters */
 
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 184f221..9085ec3 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -76,6 +76,11 @@ Bool pciSlotClaimed = FALSE;
     (((c) & 0x00ffff00) \
 	 == ((PCI_CLASS_DISPLAY << 16) | (PCI_SUBCLASS_DISPLAY_VGA << 8)))
 
+
+static struct pci_slot_match xf86IsolateDevice = {
+    PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0
+};
+
 void
 xf86FormatPciBusNumber(int busnum, char *buffer)
 {
-- 
1.7.1.226.g770c5



More information about the xorg-devel mailing list