summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorDavid Nusinow <dnusinow@debian.org>2007-10-21 23:41:49 -0400
committerDavid Nusinow <dnusinow@debian.org>2007-10-21 23:41:49 -0400
commit7f5e71fa7347fb4ec2657ccc453831c04a0f288d (patch)
tree2ef6db305d0e7bbc4d1e9924bea07ac271999e50 /hw
parent4b14c9a9cd2033d3839c4ba364d41ab4c4b198ab (diff)
Make PCI text file directory configurable
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/common/Makefile.am2
-rw-r--r--hw/xfree86/common/xf86AutoConfig.c11
2 files changed, 8 insertions, 5 deletions
diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am
index db726fea1..05c088c96 100644
--- a/hw/xfree86/common/Makefile.am
+++ b/hw/xfree86/common/Makefile.am
@@ -94,4 +94,6 @@ if LNXACPI
XORG_CFLAGS += -DHAVE_ACPI
endif
+XORG_CFLAGS += -DPCITXTIDSPATH=\"$(PCI_TXT_IDS_PATH)\"
+
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
index 8117ace24..524e14eb5 100644
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -342,9 +342,10 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip
char path_name[256], vendor_str[5], chip_str[5];
uint16_t vendor, chip;
int i, j;
- idsdir = opendir("/usr/share/xserver-xorg/pci");
+ idsdir = opendir(PCITXTIDSPATH);
if (idsdir) {
+ xf86Msg(X_INFO, "Scanning %s directory for additional PCI ID's supported by the drivers\n", PCITXTIDSPATH);
direntry = readdir(idsdir);
/* Read the directory */
while (direntry) {
@@ -356,8 +357,9 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip
/* A tiny bit of sanity checking. We should probably do better */
if (strncmp(&(direntry->d_name[len-4]), ".ids", 4) == 0) {
/* We need the full path name to open the file */
- strncpy(path_name, "/usr/share/xserver-xorg/pci/", 256);
- strncat(path_name, direntry->d_name, (256 - strlen(path_name)));
+ strncpy(path_name, PCITXTIDSPATH, 256);
+ strncat(path_name, "/", 1);
+ strncat(path_name, direntry->d_name, (256 - strlen(path_name) - 1));
fp = fopen(path_name, "r");
if (fp == NULL) {
xf86Msg(X_ERROR, "Could not open %s for reading. Exiting.\n", path_name);
@@ -406,8 +408,7 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip
matches[i][j] = direntry->d_name[j];
}
}
- xf86Msg(X_INFO, "Matched %s from file name %s in autoconfig\n", matches[i], direntry->d_name);
-
+ xf86Msg(X_INFO, "Matched %s from file name %s\n", matches[i], direntry->d_name);
}
} else {
/* TODO Handle driver overrides here */