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

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