summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2007-01-17 13:02:27 -0800
committerIan Romanick <idr@us.ibm.com>2007-01-17 13:02:27 -0800
commitc1808f148405a28256e0480d6f8714691b0e964e (patch)
tree07ce97105cbf575c033e0b0decdd83104c9a0cc5
parentd2f8c42c48ecc398d224d9e3b280a66042e68664 (diff)
Convert xf86IsolateDevice to a 'struct pci_slot_match'.
-rw-r--r--hw/xfree86/common/xf86Config.c6
-rw-r--r--hw/xfree86/common/xf86Globals.c5
-rw-r--r--hw/xfree86/common/xf86Priv.h2
-rw-r--r--hw/xfree86/common/xf86pciBus.c33
4 files changed, 17 insertions, 29 deletions
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index c0e21dd5e..676392c04 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -66,6 +66,7 @@
#include "configProcs.h"
#include "globals.h"
#include "extension.h"
+#include "Pci.h"
#ifdef XINPUT
#include "xf86Xinput.h"
@@ -2456,8 +2457,9 @@ xf86HandleConfigFile(Bool autoconfig)
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.bus = bus;
- xf86IsolateDevice.device = device;
+ 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);
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 9b23710bb..d81b5cc91 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -204,4 +204,7 @@ Bool xf86MiscModInDevAllowNonLocal = FALSE;
RootWinPropPtr *xf86RegisteredPropertiesTable = NULL;
_X_EXPORT Bool xf86inSuspend = FALSE;
Bool xorgHWAccess = FALSE;
-PciBusId xf86IsolateDevice;
+
+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 35904fc0f..60fd31ab8 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -78,7 +78,7 @@ extern Bool xf86BestRefresh;
extern Gamma xf86Gamma;
extern char *xf86ServerName;
extern Bool xf86ShowUnresolved;
-extern PciBusId xf86IsolateDevice;
+extern struct pci_slot_match xf86IsolateDevice;
/* Other parameters */
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 05e1e7ea5..5dc96b999 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -112,9 +112,8 @@ FindPCIVideoInfo(void)
{
int i = 0, k;
int num = 0;
- struct pci_device * info;
- struct pci_slot_match m;
- struct pci_device_iterator * iter;
+ struct pci_device *info;
+ struct pci_device_iterator *iter;
if (!xf86scanpci()) {
@@ -122,29 +121,13 @@ FindPCIVideoInfo(void)
return;
}
- if ( (xf86IsolateDevice.bus != 0)
- || (xf86IsolateDevice.device != 0)
- || (xf86IsolateDevice.func != 0) ) {
- m.domain = PCI_DOM_FROM_BUS( xf86IsolateDevice.bus );
- m.bus = PCI_BUS_NO_DOMAIN( xf86IsolateDevice.bus );
- m.dev = xf86IsolateDevice.device;
- m.func = xf86IsolateDevice.func;
- }
- else {
- m.domain = PCI_MATCH_ANY;
- m.bus = PCI_MATCH_ANY;
- m.dev = PCI_MATCH_ANY;
- m.func = PCI_MATCH_ANY;
- }
-
- iter = pci_slot_match_iterator_create( & m );
-
- while ( (info = pci_device_next( iter )) != NULL ) {
- if ( PCIINFOCLASSES( info->device_class ) ) {
+ iter = pci_slot_match_iterator_create(& xf86IsolateDevice);
+ while ((info = pci_device_next(iter)) != NULL) {
+ if (PCIINFOCLASSES(info->device_class)) {
num++;
- xf86PciVideoInfo = xnfrealloc( xf86PciVideoInfo,
- (sizeof( struct pci_device * )
- * (num + 1)) );
+ xf86PciVideoInfo = xnfrealloc(xf86PciVideoInfo,
+ (sizeof(struct pci_device *)
+ * (num + 1)));
xf86PciVideoInfo[num] = NULL;
xf86PciVideoInfo[num - 1] = info;