Various switchable-graphics / prime fixes from upstream, mostly

related to using the modesetting driver in prime setups
- Fix Xorg -configure not working (rhbz#1368502)
This commit is contained in:
Hans de Goede 2016-08-25 15:42:56 +02:00
parent 3a2c8d2dc3
commit e09b8dfb8f
3 changed files with 1387 additions and 34 deletions

View File

@ -45,7 +45,7 @@
Summary: X.Org X11 X server Summary: X.Org X11 X server
Name: xorg-x11-server Name: xorg-x11-server
Version: 1.18.4 Version: 1.18.4
Release: 2%{?gitdate:.%{gitdate}}%{dist} Release: 3%{?gitdate:.%{gitdate}}%{dist}
URL: http://www.x.org URL: http://www.x.org
License: MIT License: MIT
Group: User Interface/X Group: User Interface/X
@ -80,6 +80,9 @@ Source40: driver-abi-rebuild.sh
# xwayland backports from master # xwayland backports from master
Patch0: xorg-x11-server-xwayland-backports.patch Patch0: xorg-x11-server-xwayland-backports.patch
# prime fixes from master (and pending upstream review)
Patch1: xserver-prime-fixes.patch
#Patch6044: xserver-1.6.99-hush-prerelease-warning.patch #Patch6044: xserver-1.6.99-hush-prerelease-warning.patch
Patch7025: 0001-Always-install-vbe-and-int10-sdk-headers.patch Patch7025: 0001-Always-install-vbe-and-int10-sdk-headers.patch
@ -627,6 +630,11 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete
%changelog %changelog
* Thu Aug 25 2016 Hans de Goede <hdegoede@redhat.com> - 1.18.4-3
- Various switchable-graphics / prime fixes from upstream, mostly
related to using the modesetting driver in prime setups
- Fix Xorg -configure not working (rhbz#1368502)
* Fri Aug 19 2016 Kalev Lember <klember@redhat.com> - 1.18.4-2 * Fri Aug 19 2016 Kalev Lember <klember@redhat.com> - 1.18.4-2
- Backport a number of XWayland fixes from master - Backport a number of XWayland fixes from master

View File

@ -1,4 +1,4 @@
From cd6f931fb06f825f246222a4362fbf728f8dce73 Mon Sep 17 00:00:00 2001 From 2107057dc210fdbcdbdb8cf8e0b0b703cfb25767 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com> From: Dave Airlie <airlied@redhat.com>
Date: Fri, 17 Aug 2012 09:49:24 +1000 Date: Fri, 17 Aug 2012 09:49:24 +1000
Subject: [PATCH] autobind GPUs to the screen, (v3) Subject: [PATCH] autobind GPUs to the screen, (v3)
@ -13,20 +13,27 @@ DO NOT UPSTREAM.
Signed-off-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Dave Airlie <airlied@gmail.com>
--- ---
hw/xfree86/common/xf86Init.c | 12 ++++++++++++ hw/xfree86/common/xf86Init.c | 12 ++++++++++++
hw/xfree86/common/xf86platformBus.c | 3 +++ hw/xfree86/common/xf86platformBus.c | 2 ++
hw/xfree86/modes/xf86Crtc.c | 32 ++++++++++++++++++++++++++++++++ hw/xfree86/modes/xf86Crtc.c | 25 +++++++++++++++++++++++++
3 files changed, 47 insertions(+) hw/xfree86/modes/xf86Crtc.h | 3 +++
4 files changed, 42 insertions(+)
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 6282252..dc33ad1 100644 index 9bade90..33a40a5 100644
--- a/hw/xfree86/common/xf86Init.c --- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c
@@ -361,6 +361,16 @@ xf86CreateRootWindow(WindowPtr pWin) @@ -76,6 +76,7 @@
return ret; #include "xf86DDC.h"
#include "xf86Xinput.h"
#include "xf86InPriv.h"
+#include "xf86Crtc.h"
#include "picturestr.h"
#include "xf86Bus.h"
@@ -342,6 +343,15 @@ xf86CreateRootWindow(WindowPtr pWin)
} }
+extern void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master); static void
+static void
+xf86AutoConfigOutputDevices(void) +xf86AutoConfigOutputDevices(void)
+{ +{
+ int i; + int i;
@ -35,10 +42,11 @@ index 6282252..dc33ad1 100644
+ xf86AutoConfigOutputDevice(xf86GPUScreens[i], xf86Screens[0]); + xf86AutoConfigOutputDevice(xf86GPUScreens[i], xf86Screens[0]);
+} +}
+ +
static void +static void
InstallSignalHandlers(void) InstallSignalHandlers(void)
{ {
@@ -949,6 +959,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) /*
@@ -930,6 +940,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
for (i = 0; i < xf86NumGPUScreens; i++) for (i = 0; i < xf86NumGPUScreens; i++)
AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
@ -48,19 +56,18 @@ index 6282252..dc33ad1 100644
if (sigio_blocked) if (sigio_blocked)
OsReleaseSIGIO(); OsReleaseSIGIO();
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index 33b2b7d..be3bdd9 100644 index 96895a6..028db03 100644
--- a/hw/xfree86/common/xf86platformBus.c --- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c +++ b/hw/xfree86/common/xf86platformBus.c
@@ -393,6 +393,8 @@ xf86platformProbeDev(DriverPtr drvp) @@ -48,6 +48,7 @@
return foundScreen; #include "Pci.h"
} #include "xf86platformBus.h"
#include "xf86Config.h"
+#include "xf86Crtc.h"
+extern void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master); #include "randrstr.h"
+ int platformSlotClaimed;
int @@ -540,6 +541,7 @@ xf86platformAddDevice(int index)
xf86platformAddDevice(int index)
{
@@ -465,6 +467,7 @@ xf86platformAddDevice(int index)
} }
/* attach unbound to 0 protocol screen */ /* attach unbound to 0 protocol screen */
AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
@ -69,21 +76,19 @@ index 33b2b7d..be3bdd9 100644
RRResourcesChanged(xf86Screens[0]->pScreen); RRResourcesChanged(xf86Screens[0]->pScreen);
RRTellChanged(xf86Screens[0]->pScreen); RRTellChanged(xf86Screens[0]->pScreen);
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 4726f2a..e83ea13 100644 index 4a13c13..b926298 100644
--- a/hw/xfree86/modes/xf86Crtc.c --- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c
@@ -3440,3 +3440,35 @@ xf86DetachAllCrtc(ScrnInfoPtr scrn) @@ -3575,3 +3575,28 @@ xf86DetachAllCrtc(ScrnInfoPtr scrn)
crtc->x = crtc->y = 0; crtc->x = crtc->y = 0;
} }
} }
+ +
+
+void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master) +void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master)
+{ +{
+ RRProviderPtr master_provider; + RRProviderPtr master_provider;
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(master); + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(master);
+ xf86CrtcConfigPtr slave_config = XF86_CRTC_CONFIG_PTR(pScrn); + xf86CrtcConfigPtr slave_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ Bool unbound = FALSE;
+ +
+ if (!config || !slave_config) + if (!config || !slave_config)
+ return; + return;
@ -91,23 +96,30 @@ index 4726f2a..e83ea13 100644
+ master_provider = config->randr_provider; + master_provider = config->randr_provider;
+ +
+ if ((master->capabilities & RR_Capability_SinkOffload) && + if ((master->capabilities & RR_Capability_SinkOffload) &&
+ pScrn->capabilities & RR_Capability_SourceOffload) { + pScrn->capabilities & RR_Capability_SourceOffload) {
+ /* source offload */ + /* source offload */
+
+ DetachUnboundGPU(pScrn->pScreen);
+ unbound = TRUE;
+ AttachOffloadGPU(master->pScreen, pScrn->pScreen); + AttachOffloadGPU(master->pScreen, pScrn->pScreen);
+ slave_config->randr_provider->offload_sink = master_provider; + slave_config->randr_provider->offload_sink = master_provider;
+ } + }
+ if ((master->capabilities & RR_Capability_SourceOutput) && + if ((master->capabilities & RR_Capability_SourceOutput) &&
+ pScrn->capabilities & RR_Capability_SinkOutput) { + pScrn->capabilities & RR_Capability_SinkOutput) {
+ /* sink offload */ + /* sink offload */
+ if (!unbound)
+ DetachUnboundGPU(pScrn->pScreen);
+ AttachOutputGPU(master->pScreen, pScrn->pScreen); + AttachOutputGPU(master->pScreen, pScrn->pScreen);
+ slave_config->randr_provider->output_source = master_provider; + slave_config->randr_provider->output_source = master_provider;
+ } + }
+} +}
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 8b01608..05ee338 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -1046,4 +1046,7 @@ xf86ProviderSetup(ScrnInfoPtr scrn,
extern _X_EXPORT void
xf86DetachAllCrtc(ScrnInfoPtr scrn);
+extern _X_EXPORT void
+xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master);
+
#endif /* _XF86CRTC_H_ */
-- --
1.8.3.1 2.9.3

1333
xserver-prime-fixes.patch Normal file

File diff suppressed because it is too large Load Diff