From ffce7eb36404a96b860586d79f50dac820700e51 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 29 Sep 2015 13:24:31 -0400 Subject: [PATCH] modesetting: Claim PCI devices as PCI not platform The X -configure code is hideously bad, and the platform bus path in it doesn't claim devices the same way the PCI path does, nDevToConfig is never incremented so nothing looks configurable. For most devices we can work around this by claiming the device as PCI not as platform, since both will be scanned. This probably doesn't fix X -configure on non-PCI devices with this driver, but those are pretty rare in comparison. A proper fix would involve rewriting the autoconfig code to be comprehensible, which is too invasive to consider doing downstream. --- hw/xfree86/drivers/modesetting/driver.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index b0c2f17..4989069 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -370,6 +370,11 @@ ms_platform_probe(DriverPtr driver, const char *path = xf86_platform_device_odev_attributes(dev)->path; int scr_flags = 0; + if (dev->pdev) { + /* claim pci devices later, not here */ + return FALSE; + } + if (flags & PLATFORM_PROBE_GPU_SCREEN) scr_flags = XF86_ALLOCATE_GPU_SCREEN; -- 2.4.3