1
0
xorg-x11-server/n_xserver-optimus-autoconfig-hack.patch
Stefan Dirsch 3768f92469 Accepting request 610640 from home:tobijk:X11:XOrg
- Update to version 1.20.0:
  New features:
  + RANDR 1.6, which enables leasing RANDR resources to a client for its 
    exclusive use (e.g. head mounted displays)
  + Depth 30 support in glamor and the modesetting driver
  + A meson-based build system, parallel to autotools
  + Pageflipping support for PRIME output sinks
  + OutputClass device matching for xorg.conf
  + Input grab and tablet support in Xwayland
- Remove upstream patches:
  + u_xorg-x11-server-reproducible.patch
     Solved slightly different
  + u_os-inputthread-Force-unlock-when-stopping-thread.patch
  + u_xfree86-add-default-modes-for-16-9-and-16-10.patch
  + U_xwayland-Don-t-process-cursor-warping-without-an-xwl.patch
  + U_xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch
  + U_xwayland-avoid-race-condition-on-new-keymap.patch
  + U_xwayland-remove-dirty-window-unconditionally-on-unre.patch
- Adapt patches to work with the new release:
  + N_zap_warning_xserver.diff
  + N_fix_fglrx_screendepth_issue.patch
  + n_xserver-optimus-autoconfig-hack.patch
  + u_Use-better-fallbacks-to-generate-cookies-if-arc4rand.patch
  + u_xorg-wrapper-build-Build-position-independent-code.patch

OBS-URL: https://build.opensuse.org/request/show/610640
OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=702
2018-05-19 18:13:03 +00:00

110 lines
3.8 KiB
Diff

From 3216e0c618cc330f053ed36a749c8d8cfeb87a2f Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Fri, 17 Aug 2012 09:49:24 +1000
Subject: [PATCH] autobind GPUs to the screen, (v3)
this is racy and really not what we want for hotplug going forward,
but until DE support is in GNOME its probably for the best.
v2: fix if config or slave config is NULL
v3: fix multi useful slaves
v4: do not unbound GPUs before attaching them
compatibility fix for 5c7af02b10
-- Michal Srb <msrb@suse.com>
DO NOT UPSTREAM.
Signed-off-by: Dave Airlie <airlied@gmail.com>
---
hw/xfree86/common/xf86Init.c | 12 ++++++++++++
hw/xfree86/common/xf86platformBus.c | 3 +++
hw/xfree86/modes/xf86Crtc.c | 32 ++++++++++++++++++++++++++++++++
3 files changed, 47 insertions(+)
Index: xorg-server-1.19.6/hw/xfree86/common/xf86Init.c
===================================================================
--- xorg-server-1.19.6.orig/hw/xfree86/common/xf86Init.c
+++ xorg-server-1.19.6/hw/xfree86/common/xf86Init.c
@@ -297,6 +297,16 @@ xf86PrivsElevated(void)
return PrivsElevated();
}
+extern void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master);
+static void
+xf86AutoConfigOutputDevices(void)
+{
+ int i;
+
+ for (i = 0; i < xf86NumGPUScreens; i++)
+ xf86AutoConfigOutputDevice(xf86GPUScreens[i], xf86Screens[0]);
+}
+
static void
TrapSignals(void)
{
@@ -872,6 +882,8 @@ InitOutput(ScreenInfo * pScreenInfo, int
for (i = 0; i < xf86NumGPUScreens; i++)
AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
+ xf86AutoConfigOutputDevices();
+
xf86VGAarbiterWrapFunctions();
if (sigio_blocked)
input_unlock();
Index: xorg-server-1.19.6/hw/xfree86/common/xf86platformBus.c
===================================================================
--- xorg-server-1.19.6.orig/hw/xfree86/common/xf86platformBus.c
+++ xorg-server-1.19.6/hw/xfree86/common/xf86platformBus.c
@@ -489,6 +489,8 @@ xf86platformProbeDev(DriverPtr drvp)
return foundScreen;
}
+extern void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master);
+
int
xf86platformAddDevice(int index)
{
@@ -560,6 +562,7 @@ xf86platformAddDevice(int index)
}
/* attach unbound to 0 protocol screen */
AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
+ xf86AutoConfigOutputDevice(xf86GPUScreens[i], xf86Screens[0]);
RRResourcesChanged(xf86Screens[0]->pScreen);
RRTellChanged(xf86Screens[0]->pScreen);
Index: xorg-server-1.19.6/hw/xfree86/modes/xf86Crtc.c
===================================================================
--- xorg-server-1.19.6.orig/hw/xfree86/modes/xf86Crtc.c
+++ xorg-server-1.19.6/hw/xfree86/modes/xf86Crtc.c
@@ -3462,3 +3462,29 @@ xf86DetachAllCrtc(ScrnInfoPtr scrn)
crtc->x = crtc->y = 0;
}
}
+
+
+void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master)
+{
+ RRProviderPtr master_provider;
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(master);
+ xf86CrtcConfigPtr slave_config = XF86_CRTC_CONFIG_PTR(pScrn);
+
+ if (!config || !slave_config)
+ return;
+
+ master_provider = config->randr_provider;
+
+ if ((master->capabilities & RR_Capability_SinkOffload) &&
+ pScrn->capabilities & RR_Capability_SourceOffload) {
+ /* source offload */
+ AttachOffloadGPU(master->pScreen, pScrn->pScreen);
+ slave_config->randr_provider->offload_sink = master_provider;
+ }
+ if ((master->capabilities & RR_Capability_SourceOutput) &&
+ pScrn->capabilities & RR_Capability_SinkOutput) {
+ /* sink offload */
+ AttachOutputGPU(master->pScreen, pScrn->pScreen);
+ slave_config->randr_provider->output_source = master_provider;
+ }
+}