diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-08-19 20:05:08 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-08-19 20:05:08 +0100 |
commit | 8b04b350a983b89eb2d741f55baa297a933ac6ea (patch) | |
tree | 968de4b527091e2ffdeaeccb8423dffa78742257 /src | |
parent | c882f6a22a862c1664c375e05e5e6fc4bdb04edb (diff) |
Open-code DRICreatePCIBusID()
During -configure we would attempt to query the availablility of KMS
before the DRI module was loaded, thus we were unable to create a valid
bus identifier and so the query failed and we disowned the device.
Fixes:
Bug 29611 - Xorg -configure fails
https://bugs.freedesktop.org/show_bug.cgi?id=29611
Reported-by: Sergey Samokhin <prikrutil@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/intel_driver.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/intel_driver.c b/src/intel_driver.c index 23df87be..9b2fdaf1 100644 --- a/src/intel_driver.c +++ b/src/intel_driver.c @@ -266,32 +266,25 @@ static void PreInitCleanup(ScrnInfoPtr scrn) */ static Bool intel_kernel_mode_enabled(ScrnInfoPtr scrn) { - struct pci_device *PciInfo; - EntityInfoPtr pEnt; - char *busIdString; + struct pci_device *dev; + char id[20]; int ret; - pEnt = xf86GetEntityInfo(scrn->entityList[0]); - PciInfo = xf86GetPciInfoForEntity(pEnt->index); - - if (!xf86LoaderCheckSymbol("DRICreatePCIBusID")) - return FALSE; - - busIdString = DRICreatePCIBusID(PciInfo); + dev = xf86GetPciInfoForEntity(xf86GetEntityInfo(scrn->entityList[0])->index); + snprintf(id, sizeof(id), + "pci:%04x:%02x:%02x.%d", + dev->domain, dev->bus, dev->dev, dev->func); - ret = drmCheckModesettingSupported(busIdString); + ret = drmCheckModesettingSupported(id); if (ret) { if (xf86LoadKernelModule("i915")) - ret = drmCheckModesettingSupported(busIdString); + ret = drmCheckModesettingSupported(id); } /* Be nice to the user and load fbcon too */ if (!ret) (void)xf86LoadKernelModule("fbcon"); - free(busIdString); - if (ret) - return FALSE; - return TRUE; + return ret == 0; } static void intel_check_chipset_option(ScrnInfoPtr scrn) |