Blame SOURCES/0001-modesetting-Fix-PCI-initialization-on-non-zero-domai.patch

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