Blame SOURCES/0001-mustard-xfree86-Disable-the-PCI-probe-path.patch

55d6a0
From b3afd9ccefe156ab2dee993118fcdba40341f66e Mon Sep 17 00:00:00 2001
55d6a0
From: Adam Jackson <ajax@redhat.com>
55d6a0
Date: Fri, 1 Oct 2021 11:47:21 -0400
55d6a0
Subject: [PATCH xserver] mustard: xfree86: Disable the PCI probe path
55d6a0
55d6a0
RHEL 9 does not support userspace modesetting drivers for Xorg. Ideally
55d6a0
it would only support DRM drivers, but there are some fallback paths
55d6a0
(efifb mainly) that still require fbdev support. Since the primary use
55d6a0
of the PCI probe path is devices _without_ kernel support, we can safely
55d6a0
disable it. And indeed we want to, because there are some devices
55d6a0
(hyperv v1 e.g.) with both a platform and a PCI presentation, which the
55d6a0
PCI probe code fails to handle such that the server fails to start.
55d6a0
55d6a0
Thus: we #if 0 out the PCI probe in xf86CallDriverProbe.
55d6a0
55d6a0
It might be nice if the platform code knew about fbdev devices, but it
55d6a0
does not, and teaching it would be a large change for little benefit
55d6a0
given we do intend to sunset the fbdev path as well. Since the fbdev
55d6a0
path exists solely for cases where we have only the rudimentary firmare
55d6a0
framebuffer, we should only use it if _no_ platform driver is available.
55d6a0
55d6a0
Thus: we only call the legacy probe method if xf86ProbeIgnorePrimary.
55d6a0
55d6a0
Having done this, we need to go back into fbdevhw and undo fc78bcca:
55d6a0
55d6a0
    commit fc78bcca21e767697de6ad4d8e03b6728856f613 (merge-requests/38)
55d6a0
    Author: Adam Jackson <ajax@redhat.com>
55d6a0
    Date:   Wed Oct 10 14:09:11 2018 -0400
55d6a0
55d6a0
    fbdevhw: Refuse to touch PCI devices on the fallback probe path
55d6a0
55d6a0
Which was well intentioned, but given the above changes we know by the
55d6a0
time we're trying to probe fbdev we really do want it, either because of
55d6a0
the above fallback path or because xorg.conf asked for it. In either
55d6a0
case we shouldn't spuriously fail just because it happens to be PCI.
55d6a0
55d6a0
Thus: We if (0) out the code added in fc78bcca.
55d6a0
55d6a0
Any one of the above might be questionable upstream, hence the mustard
55d6a0
nature of this patch.
55d6a0
---
55d6a0
 hw/xfree86/common/xf86Bus.c  | 4 ++--
55d6a0
 hw/xfree86/fbdevhw/fbdevhw.c | 2 +-
55d6a0
 2 files changed, 3 insertions(+), 3 deletions(-)
55d6a0
55d6a0
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
55d6a0
index fd144dbe7a..844ce5a890 100644
55d6a0
--- a/hw/xfree86/common/xf86Bus.c
55d6a0
+++ b/hw/xfree86/common/xf86Bus.c
55d6a0
@@ -84,7 +84,7 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only)
55d6a0
     }
55d6a0
 #endif
55d6a0
 
55d6a0
-#ifdef XSERVER_LIBPCIACCESS
55d6a0
+#if 0
55d6a0
     if (!foundScreen && (drv->PciProbe != NULL)) {
55d6a0
         if (xf86DoConfigure && xf86DoConfigurePass1) {
55d6a0
             assert(detect_only);
55d6a0
@@ -96,7 +96,7 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only)
55d6a0
         }
55d6a0
     }
55d6a0
 #endif
55d6a0
-    if (!foundScreen && (drv->Probe != NULL)) {
55d6a0
+    if (!foundScreen && xf86ProbeIgnorePrimary && (drv->Probe != NULL)) {
55d6a0
         xf86Msg(X_WARNING, "Falling back to old probe method for %s\n",
55d6a0
                 drv->driverName);
55d6a0
         foundScreen = (*drv->Probe) (drv, (detect_only) ? PROBE_DETECT
55d6a0
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
55d6a0
index 3d8b92e669..171038f46d 100644
55d6a0
--- a/hw/xfree86/fbdevhw/fbdevhw.c
55d6a0
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
55d6a0
@@ -330,7 +330,7 @@ fbdev_open(int scrnIndex, const char *dev, char **namep)
55d6a0
     }
55d6a0
 
55d6a0
     /* only touch non-PCI devices on this path */
55d6a0
-    {
55d6a0
+    if (0) {
55d6a0
         char buf[PATH_MAX];
55d6a0
         char *sysfs_path = NULL;
55d6a0
         char *node = strrchr(dev, '/') + 1;
55d6a0
-- 
55d6a0
2.31.1
55d6a0