From d90f2cd98a97e6534792d3867b3fba70d850b706 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 27 May 2010 13:26:23 +0100 Subject: [PATCH] xfree86: Unbreak autoconfig following 0abf065e38c4 The move of the PCI device id probing into a separate file neglected to return the number of found devices, and so the PCI devices were being overwritten by the default entries for vesa and fbdev. Signed-off-by: Chris Wilson Cc: Tiago Vignatti Cc: Alex Deucher Reviewed-by: Julien Cristau Reviewed-by: Tiago Vignatti Signed-off-by: Keith Packard --- hw/xfree86/common/xf86AutoConfig.c | 2 +- hw/xfree86/common/xf86pciBus.c | 8 +++++++- hw/xfree86/common/xf86pciBus.h | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index 8947a4f06..5b236af78 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -257,7 +257,7 @@ listPossibleVideoDrivers(char *matches[], int nmatches) } #endif - xf86PciMatchDriver(matches, nmatches); + i = xf86PciMatchDriver(matches, nmatches); /* Fallback to platform default hardware */ if (i < (nmatches - 1)) { diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c index 085be0143..184f2213e 100644 --- a/hw/xfree86/common/xf86pciBus.c +++ b/hw/xfree86/common/xf86pciBus.c @@ -1294,7 +1294,11 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip } #endif /* __linux__ */ -void +/** + * @return The numbers of found devices that match with the current system + * drivers. + */ +int xf86PciMatchDriver(char* matches[], int nmatches) { int i; struct pci_device * info = NULL; @@ -1326,4 +1330,6 @@ xf86PciMatchDriver(char* matches[], int nmatches) { if ((info != NULL) && (i < nmatches)) { i += videoPtrToDriverList(info, &(matches[i]), nmatches - i); } + + return i; } diff --git a/hw/xfree86/common/xf86pciBus.h b/hw/xfree86/common/xf86pciBus.h index f84a496df..3f02b9330 100644 --- a/hw/xfree86/common/xf86pciBus.h +++ b/hw/xfree86/common/xf86pciBus.h @@ -37,6 +37,6 @@ void xf86PciProbe(void); Bool xf86PciAddMatchingDev(DriverPtr drvp); Bool xf86PciProbeDev(DriverPtr drvp); void xf86PciIsolateDevice(char *argument); -void xf86PciMatchDriver(char* matches[], int nmatches); +int xf86PciMatchDriver(char* matches[], int nmatches); #endif /* _XF86_PCI_BUS_H */