forked from pool/xorg-x11-server
- u_pci-primary-Fix-up-primary-PCI-device-detection-for-the-platfrom-bus.patch
Fix up primary device detection for the platform bus to fix the Xserver on older iMacs (boo#835975). OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=610
This commit is contained in:
parent
71dfe3aafb
commit
f4c37c56fd
@ -0,0 +1,67 @@
|
||||
From: Egbert Eich <eich@suse.de>
|
||||
Date: Wed Feb 10 15:55:51 2016 +0100
|
||||
Subject: [PATCH]pci/primary: Fix up primary PCI device detection for the platfrom bus
|
||||
Patch-mainline: to be upstreamed
|
||||
Git-commit: 85d81d3ec321572aea31d34a87632442687a54f5
|
||||
|
||||
References: boo#835975
|
||||
Signed-off-by: Egbert Eich <eich@suse.com>
|
||||
|
||||
The detection wheter a device is the primary PCI device currently
|
||||
relies on libciaccess. This checks of the PCI device is a VGA boot
|
||||
device. On some systems however, the primary card is not flagged
|
||||
like that - this it is not discovered.
|
||||
The subsequent PCI probing has a fallback heuristic designed for this
|
||||
situation. This however causes the primary device to be flagged as a
|
||||
PCI bus device, not a 'platform bus' device.
|
||||
To fix this, we check in the subsequent xf86platformPrimary() wheter
|
||||
the primary device is flagged as a PCI bus device. If this is the
|
||||
case and the same device is in the list of the 'platform bus' devices,
|
||||
we reflag it as such.
|
||||
This fixes the detection of the primary device on older iMacs.
|
||||
|
||||
Signed-off-by: Egbert Eich <eich@suse.de>
|
||||
---
|
||||
hw/xfree86/common/xf86platformBus.c | 29 +++++++++++++++++++++++++++++
|
||||
1 file changed, 29 insertions(+)
|
||||
|
||||
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
|
||||
index 8b3a862..efa6d1a 100644
|
||||
--- a/hw/xfree86/common/xf86platformBus.c
|
||||
+++ b/hw/xfree86/common/xf86platformBus.c
|
||||
@@ -622,6 +622,35 @@ void xf86platformPrimary(void)
|
||||
|
||||
xf86Msg(X_NONE, "\tfalling back to %s\n", primaryBus.id.plat->attribs->syspath);
|
||||
}
|
||||
+ } else if (xf86_num_platform_devices > 0 && primaryBus.type == BUS_PCI) {
|
||||
+ /*
|
||||
+ * FIXUP: platform_find_pci_info() may not always find the primary
|
||||
+ * platform device. If a primary device is a platform device but was
|
||||
+ * identified as PCI device, let's fix this up here.
|
||||
+ */
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < xf86_num_platform_devices; i++) {
|
||||
+ char *busid = xf86_platform_odev_attributes(i)->busid;
|
||||
+ int domain, bus, dev, func;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (strncmp(busid, "pci:", 4) != 0)
|
||||
+ continue;
|
||||
+
|
||||
+ ret = sscanf(busid, "pci:%04x:%02x:%02x.%u",
|
||||
+ &domain, &bus, &dev, &func);
|
||||
+ if (ret != 4)
|
||||
+ continue;
|
||||
+
|
||||
+ if (domain == primaryBus.id.pci->domain &&
|
||||
+ bus == primaryBus.id.pci->bus &&
|
||||
+ dev == primaryBus.id.pci->dev &&
|
||||
+ func == primaryBus.id.pci->func) {
|
||||
+ primaryBus.id.plat = &xf86_platform_devices[i];
|
||||
+ primaryBus.type = BUS_PLATFORM;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Feb 10 15:07:32 UTC 2016 - eich@suse.com
|
||||
|
||||
- u_pci-primary-Fix-up-primary-PCI-device-detection-for-the-platfrom-bus.patch
|
||||
Fix up primary device detection for the platform bus to fix the Xserver
|
||||
on older iMacs (boo#835975).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 9 20:55:28 UTC 2016 - tobias.johannes.klausmann@mni.thm.de
|
||||
|
||||
|
@ -180,6 +180,7 @@ Patch160: u_vesa-Add-VBEDPMSGetCapabilities-VBEDPMSGet.patch
|
||||
|
||||
Patch206: u_busfault_sigaction-Only-initialize-pointer-when-matched.patch
|
||||
Patch208: u_Panning-Set-panning-state-in-xf86RandR12ScreenSetSize.patch
|
||||
Patch209: u_pci-primary-Fix-up-primary-PCI-device-detection-for-the-platfrom-bus.patch
|
||||
|
||||
Patch1000: n_xserver-optimus-autoconfig-hack.patch
|
||||
|
||||
@ -283,6 +284,7 @@ sh %{SOURCE92} --verify . %{SOURCE91}
|
||||
|
||||
%patch206 -p1
|
||||
%patch208 -p1
|
||||
%patch209 -p1
|
||||
|
||||
%patch1000 -p1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user