From 7e1cada6c6b9fa41ef3ead00bf7725d626dda193 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 19 Oct 2007 15:16:19 -0700 Subject: [PATCH] Disable debian pci-id-list autoconfig code on non-linux. It contains static paths, fails to build on non-glibc, and apparently just exists to support distributions managing binary drivers and open-source drivers together. Also restores previous code for fallback to vesa if nothing is detected. --- hw/xfree86/common/xf86AutoConfig.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index a6bfc0190..8117ace24 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -329,6 +329,7 @@ autoConfigDevice(GDevPtr preconf_device) return ptr; } +#ifdef __linux__ static void matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip) { @@ -421,6 +422,7 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip xfree(line); closedir(idsdir); } +#endif /* __linux__ */ char* chooseVideoDriver(void) @@ -448,24 +450,27 @@ chooseVideoDriver(void) ErrorF("Primary device is not PCI\n"); } +#ifdef __linux__ matchDriverFromFiles(matches, info->vendor_id, info->device_id); +#endif /* __linux__ */ /* TODO Handle multiple drivers claiming to support the same PCI ID */ if (matches[0]) { chosen_driver = matches[0]; } else { - chosen_driver = videoPtrToDriverName(info); - #if 0 /* Save for later */ - #if defined __i386__ || defined __amd64__ || defined __hurd__ - chosen_driver = "vesa"; - #elif defined __alpha__ - chosen_driver = "vga"; - #elif defined __sparc__ - chosen_driver = "sunffb"; - #else - chosen_driver = "fbdev"; - #endif - #endif + if (info != NULL) + chosen_driver = videoPtrToDriverName(info); + if (chosen_driver == NULL) { +#if defined __i386__ || defined __amd64__ || defined __hurd__ + chosen_driver = "vesa"; +#elif defined __alpha__ + chosen_driver = "vga"; +#elif defined __sparc__ + chosen_driver = "sunffb"; +#else + chosen_driver = "fbdev"; +#endif + } } xf86Msg(X_DEFAULT, "Matched %s for the autoconfigured driver\n", chosen_driver);