From bc6ccb0bdcdc27c90c95a02e821d5883ad1dc7a0 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 26 Jun 2017 12:37:56 -0400 Subject: [PATCH] modesetting: Fix PCI initialization on non-zero domains libdrm's busid matching for the legacy three-integer bus string format simply ignores the domain number, rather than what we were doing here of packing the domain into the bus number. Whatever, just use the existing code to build a busid string, since that gets the domain right. [rhel: also remove the if !pciaccess code - ajax] Signed-off-by: Adam Jackson diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index 791ab90..3fac07c 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -849,20 +849,11 @@ ms_get_drm_master_fd(ScrnInfoPtr pScrn) if (pEnt->location.type == BUS_PCI) { ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index); if (ms->PciInfo) { - BusID = XNFalloc(64); - sprintf(BusID, "PCI:%d:%d:%d", -#if XSERVER_LIBPCIACCESS - ((ms->PciInfo->domain << 8) | ms->PciInfo->bus), - ms->PciInfo->dev, ms->PciInfo->func -#else - ((pciConfigPtr) ms->PciInfo->thisCard)->busnum, - ((pciConfigPtr) ms->PciInfo->thisCard)->devnum, - ((pciConfigPtr) ms->PciInfo->thisCard)->funcnum -#endif - ); + if ((BusID = ms_DRICreatePCIBusID(ms->PciInfo)) != NULL) { + ms->fd = drmOpen(NULL, BusID); + free(BusID); + } } - ms->fd = drmOpen(NULL, BusID); - free(BusID); } else { const char *devicename; -- 2.13.0