summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-06-26 12:43:54 -0400
committerAdam Jackson <ajax@redhat.com>2017-07-31 10:55:52 -0400
commit6f9939525c31f1f2d8d6c137a46404278384b4bf (patch)
tree6ce0cc6a95381e5c47d71e0f7f640b4045004f9b /hw
parentd16133e3e293fe16b291114d344fbd5a61d5ed65 (diff)
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. Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/drivers/modesetting/driver.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index f371198a9..21e75c762 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -851,13 +851,11 @@ ms_get_drm_master_fd(ScrnInfoPtr pScrn)
PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index);
if (PciInfo) {
- BusID = XNFalloc(64);
- sprintf(BusID, "PCI:%d:%d:%d",
- ((PciInfo->domain << 8) | PciInfo->bus),
- PciInfo->dev, PciInfo->func);
+ if ((BusID = ms_DRICreatePCIBusID(PciInfo)) != NULL) {
+ ms->fd = drmOpen(NULL, BusID);
+ free(BusID);
+ }
}
- ms->fd = drmOpen(NULL, BusID);
- free(BusID);
}
else
#endif