Drop Fedora specific xorg-non-pci.patch, replace with solution from
upstream
This commit is contained in:
parent
410f73f8b4
commit
ccee953146
@ -0,0 +1,74 @@
|
||||
From 5823527cf87c781df10620048c984d52fa529647 Mon Sep 17 00:00:00 2001
|
||||
From: Thierry Reding <treding@nvidia.com>
|
||||
Date: Thu, 13 Feb 2014 13:31:31 +0100
|
||||
Subject: [PATCH v2 1/2] xfree86: Fallback to first platform device as primary
|
||||
|
||||
When neither of the various bus implementations was able to find a
|
||||
primary bus and device, fallback to using the platform bus as primary
|
||||
bus and the first platform device as primary device.
|
||||
|
||||
Signed-off-by: Thierry Reding <treding@nvidia.com>
|
||||
Reviewed-by: Rob Clark <robdclark@gmail.com>
|
||||
Tested-by: Rob Clark <robdclark@gmail.com>
|
||||
Signed-off-by: Keith Packard <keithp@keithp.com>
|
||||
---
|
||||
hw/xfree86/common/xf86Bus.c | 3 +++
|
||||
hw/xfree86/common/xf86platformBus.c | 15 +++++++++++++++
|
||||
hw/xfree86/common/xf86platformBus.h | 1 +
|
||||
3 files changed, 19 insertions(+)
|
||||
|
||||
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
|
||||
index b3b3f8c..bd3e4e3 100644
|
||||
--- a/hw/xfree86/common/xf86Bus.c
|
||||
+++ b/hw/xfree86/common/xf86Bus.c
|
||||
@@ -210,6 +210,9 @@ xf86BusProbe(void)
|
||||
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
|
||||
xf86SbusProbe();
|
||||
#endif
|
||||
+#ifdef XSERVER_PLATFORM_BUS
|
||||
+ xf86platformPrimary();
|
||||
+#endif
|
||||
}
|
||||
|
||||
/*
|
||||
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
|
||||
index eb1a3fb..74d63c2 100644
|
||||
--- a/hw/xfree86/common/xf86platformBus.c
|
||||
+++ b/hw/xfree86/common/xf86platformBus.c
|
||||
@@ -635,4 +635,21 @@ void xf86platformVTProbe(void)
|
||||
xf86PlatformReprobeDevice(i, xf86_platform_devices[i].attribs);
|
||||
}
|
||||
}
|
||||
+
|
||||
+void xf86platformPrimary(void)
|
||||
+{
|
||||
+ /* use the first platform device as a fallback */
|
||||
+ if (primaryBus.type == BUS_NONE) {
|
||||
+ xf86Msg(X_INFO, "no primary bus or device found\n");
|
||||
+
|
||||
+ if (xf86_num_platform_devices > 0) {
|
||||
+ char *syspath = xf86_get_platform_attrib(0, ODEV_ATTRIB_SYSPATH);
|
||||
+
|
||||
+ primaryBus.id.plat = &xf86_platform_devices[0];
|
||||
+ primaryBus.type = BUS_PLATFORM;
|
||||
+
|
||||
+ xf86Msg(X_NONE, "\tfalling back to %s\n", syspath);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
#endif
|
||||
diff --git a/hw/xfree86/common/xf86platformBus.h b/hw/xfree86/common/xf86platformBus.h
|
||||
index 5dee4e0..dec1956 100644
|
||||
--- a/hw/xfree86/common/xf86platformBus.h
|
||||
+++ b/hw/xfree86/common/xf86platformBus.h
|
||||
@@ -77,6 +77,7 @@ extern _X_EXPORT int
|
||||
xf86PlatformMatchDriver(char *matches[], int nmatches);
|
||||
|
||||
extern void xf86platformVTProbe(void);
|
||||
+extern void xf86platformPrimary(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
--
|
||||
2.1.0
|
||||
|
37
0002-xfree86-Allow-non-PCI-devices-as-primary.patch
Normal file
37
0002-xfree86-Allow-non-PCI-devices-as-primary.patch
Normal file
@ -0,0 +1,37 @@
|
||||
From 570ce9d0e7cfc06cd8892a5aab471768aaa9b2f1 Mon Sep 17 00:00:00 2001
|
||||
From: Thierry Reding <treding@nvidia.com>
|
||||
Date: Thu, 13 Feb 2014 13:36:12 +0100
|
||||
Subject: [PATCH v2 2/2] xfree86: Allow non-PCI devices as primary
|
||||
|
||||
On platforms that don't support PCI or have no GPU attached to the PCI
|
||||
bus, there can still be a primary device on a non-PCI bus.
|
||||
|
||||
Signed-off-by: Thierry Reding <treding@nvidia.com>
|
||||
Reviewed-by: Rob Clark <robdclark@gmail.com>
|
||||
Tested-by: Rob Clark <robdclark@gmail.com>
|
||||
Signed-off-by: Keith Packard <keithp@keithp.com>
|
||||
---
|
||||
hw/xfree86/common/xf86platformBus.c | 7 +++----
|
||||
1 file changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
|
||||
index 74d63c2..fe0880e 100644
|
||||
--- a/hw/xfree86/common/xf86platformBus.c
|
||||
+++ b/hw/xfree86/common/xf86platformBus.c
|
||||
@@ -476,10 +476,9 @@ xf86platformProbeDev(DriverPtr drvp)
|
||||
/* for non-seat0 servers assume first device is the master */
|
||||
if (ServerIsNotSeat0())
|
||||
break;
|
||||
- if (xf86_platform_devices[j].pdev) {
|
||||
- if (xf86IsPrimaryPlatform(&xf86_platform_devices[j]))
|
||||
- break;
|
||||
- }
|
||||
+
|
||||
+ if (xf86IsPrimaryPlatform(&xf86_platform_devices[j]))
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.1.0
|
||||
|
@ -1,136 +0,0 @@
|
||||
From: Peter Robinson <pbrobinson@fedoraproject.org>
|
||||
|
||||
--- xorg-server-1.16.0/hw/xfree86/common/xf86Init.c.orig 2014-08-26 19:29:26.802470808 +0100
|
||||
+++ xorg-server-1.16.0/hw/xfree86/common/xf86Init.c 2014-08-26 19:31:21.495368739 +0100
|
||||
@@ -546,10 +546,18 @@
|
||||
if (xf86DriverList[i]->Identify != NULL)
|
||||
xf86DriverList[i]->Identify(0);
|
||||
|
||||
- if (xf86DriverList[i]->driverFunc)
|
||||
+ if (xf86DriverList[i]->driverFunc) {
|
||||
xf86DriverList[i]->driverFunc(NULL,
|
||||
GET_REQUIRED_HW_INTERFACES,
|
||||
&flags);
|
||||
+ /* also let the driver know that it is safe to
|
||||
+ * allow platformProbe() to claim the device
|
||||
+ * if it is a non-pci platform device:
|
||||
+ */
|
||||
+ xf86DriverList[i]->driverFunc(NULL,
|
||||
+ SERVER_SUPPORTS_NON_PCI_PLATFORM_DEVS,
|
||||
+ NULL);
|
||||
+ }
|
||||
|
||||
if (NEED_IO_ENABLED(flags))
|
||||
want_hw_access = TRUE;
|
||||
--- xorg-server-1.16.0/hw/xfree86/common/xf86str.h.orig 2014-08-26 19:29:39.158675241 +0100
|
||||
+++ xorg-server-1.16.0/hw/xfree86/common/xf86str.h 2014-08-26 19:31:21.495368739 +0100
|
||||
@@ -258,6 +258,7 @@
|
||||
RR_GET_MODE_MM,
|
||||
GET_REQUIRED_HW_INTERFACES = 10,
|
||||
SUPPORTS_SERVER_FDS = 11,
|
||||
+ SERVER_SUPPORTS_NON_PCI_PLATFORM_DEVS = 12,
|
||||
} xorgDriverFuncOp;
|
||||
|
||||
typedef Bool xorgDriverFuncProc(ScrnInfoPtr, xorgDriverFuncOp, void *);
|
||||
--- xorg-server-1.16.0/hw/xfree86/common/xf86platformBus.c.orig 2014-07-16 19:57:12.000000000 +0100
|
||||
+++ xorg-server-1.16.0/hw/xfree86/common/xf86platformBus.c 2014-08-26 19:31:26.483451297 +0100
|
||||
@@ -275,6 +275,41 @@
|
||||
return i;
|
||||
}
|
||||
|
||||
+static int
|
||||
+find_non_pci_driver(const char *busid, char *returnList[], int returnListMax)
|
||||
+{
|
||||
+ /* Add more entries here if we ever return more than 4 drivers for
|
||||
+ any device */
|
||||
+ const char *driverList[5] = { NULL, NULL, NULL, NULL, NULL };
|
||||
+ int i = 0;
|
||||
+ char *p, *s;
|
||||
+
|
||||
+ s = xstrdup(busid);
|
||||
+ p = strtok(s, ":");
|
||||
+
|
||||
+ if (strcmp(p, "platform"))
|
||||
+ goto out;
|
||||
+
|
||||
+ /* extract device name: */
|
||||
+ p = strtok(NULL, ":");
|
||||
+
|
||||
+ /* check for special cases where DDX driver name does not match busid: */
|
||||
+ if (!strcmp(p, "mdp")) {
|
||||
+ driverList[i++] = "freedreno";
|
||||
+ }
|
||||
+
|
||||
+ /* add name derived from busid last: */
|
||||
+ driverList[i++] = p;
|
||||
+
|
||||
+ for (i = 0; (i < returnListMax) && (driverList[i] != NULL); i++) {
|
||||
+ returnList[i] = xnfstrdup(driverList[i]);
|
||||
+ }
|
||||
+
|
||||
+out:
|
||||
+ free(s);
|
||||
+ return i; /* Number of entries added */
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* @return The numbers of found devices that match with the current system
|
||||
* drivers.
|
||||
@@ -305,6 +340,9 @@
|
||||
|
||||
if ((info != NULL) && (j < nmatches)) {
|
||||
j += xf86VideoPtrToDriverList(info, &(matches[j]), nmatches - j);
|
||||
+ } else if (j < nmatches) {
|
||||
+ char *busid = xf86_get_platform_attrib(i, ODEV_ATTRIB_BUSID);
|
||||
+ j += find_non_pci_driver(busid, &(matches[j]), nmatches - j);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -323,6 +361,9 @@
|
||||
pci = FALSE;
|
||||
}
|
||||
|
||||
+ /* First pass, look for PCI devices. If we find a suitable
|
||||
+ * PCI device that takes priority.
|
||||
+ */
|
||||
for (i = 0; i < xf86_num_platform_devices; i++) {
|
||||
char *busid = xf86_get_platform_attrib(i, ODEV_ATTRIB_BUSID);
|
||||
|
||||
@@ -330,6 +371,24 @@
|
||||
platform_find_pci_info(&xf86_platform_devices[i], busid);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ /* if we found something, we are done: */
|
||||
+ if (primaryBus.type != BUS_NONE)
|
||||
+ return 0;
|
||||
+
|
||||
+ /* Second pass, look for real platform devices (ie. in the linux-
|
||||
+ * kernel sense of platform device.. something that is not pci)
|
||||
+ */
|
||||
+ for (i = 0; i < xf86_num_platform_devices; i++) {
|
||||
+ char *busid = xf86_get_platform_attrib(i, ODEV_ATTRIB_BUSID);
|
||||
+
|
||||
+ if (strncmp(busid, "platform:", 9) == 0) {
|
||||
+ primaryBus.type = BUS_PLATFORM;
|
||||
+ primaryBus.id.plat = &xf86_platform_devices[i];
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -476,10 +535,8 @@
|
||||
/* for non-seat0 servers assume first device is the master */
|
||||
if (ServerIsNotSeat0())
|
||||
break;
|
||||
- if (xf86_platform_devices[j].pdev) {
|
||||
- if (xf86IsPrimaryPlatform(&xf86_platform_devices[j]))
|
||||
- break;
|
||||
- }
|
||||
+ if (xf86IsPrimaryPlatform(&xf86_platform_devices[j]))
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@
|
||||
Summary: X.Org X11 X server
|
||||
Name: xorg-x11-server
|
||||
Version: 1.16.0
|
||||
Release: 6%{?gitdate:.%{gitdate}}%{dist}
|
||||
Release: 7%{?gitdate:.%{gitdate}}%{dist}
|
||||
URL: http://www.x.org
|
||||
License: MIT
|
||||
Group: User Interface/X
|
||||
@ -99,11 +99,10 @@ Patch10000: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch
|
||||
# submitted http://lists.x.org/archives/xorg-devel/2014-July/042936.html
|
||||
Patch10200: 0001-xwayland-Snap-damage-reports-to-the-bounding-box.patch
|
||||
|
||||
# submitted http://lists.x.org/archives/xorg-devel/2014-June/042826.html
|
||||
# cherry picked from upstream
|
||||
# needed to allow X to start on arm and other devices without video on pci buses
|
||||
# There's a slight variant upstream but it doesn't build against 1.16.0 atm
|
||||
# rebase of Rob Clark's patches
|
||||
Patch10300: xorg-non-pci.patch
|
||||
Patch10301: 0001-xfree86-Fallback-to-first-platform-device-as-primary.patch
|
||||
Patch10302: 0002-xfree86-Allow-non-PCI-devices-as-primary.patch
|
||||
|
||||
%global moduledir %{_libdir}/xorg/modules
|
||||
%global drimoduledir %{_libdir}/dri
|
||||
@ -641,6 +640,10 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Sep 2 2014 Hans de Goede <hdegoede@redhat.com> - 1.16.0-7
|
||||
- Drop Fedora specific xorg-non-pci.patch, replace with solution from
|
||||
upstream
|
||||
|
||||
* Thu Aug 28 2014 Hans de Goede <hdegoede@redhat.com> - 1.16.0-6
|
||||
- drop no longer valid configure arguments (rhbz#1133350)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user