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

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