Bugzilla – Attachment 779786 Details for
Bug 1103816
nvidia-prime for openSUSE
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
autobind GPUs to the screen, (v5)
n_xserver-optimus-autoconfig-hack.patch (text/plain), 3.99 KB, created by
Michal Srb
on 2018-08-15 11:58:41 UTC
(
hide
)
Description:
autobind GPUs to the screen, (v5)
Filename:
MIME Type:
Creator:
Michal Srb
Created:
2018-08-15 11:58:41 UTC
Size:
3.99 KB
patch
obsolete
>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, (v5) > >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> > >v5: do not use xf86CrtcConfig, it is not filled by nvidia proprietary driver, > only use randr structures > -- 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,34 @@ xf86DetachAllCrtc(ScrnInfoPtr scrn) > crtc->x = crtc->y = 0; > } > } >+ >+ >+void xf86AutoConfigOutputDevice(ScrnInfoPtr pScrn, ScrnInfoPtr master) >+{ >+ RRProviderPtr master_provider; >+ RRProviderPtr slave_provider; >+ rrScrPrivPtr master_rp = rrGetScrPriv(master->pScreen); >+ rrScrPrivPtr slave_rp = rrGetScrPriv(pScrn->pScreen); >+ >+ if (!master_rp || !slave_rp) >+ return; >+ >+ master_provider = master_rp->provider; >+ slave_provider = slave_rp->provider; >+ >+ if (!master_provider || !slave_provider) >+ return; >+ >+ if ((master_provider->capabilities & RR_Capability_SinkOffload) && >+ (slave_provider->capabilities & RR_Capability_SourceOffload)) { >+ /* source offload */ >+ AttachOffloadGPU(master->pScreen, pScrn->pScreen); >+ slave_provider->offload_sink = master_provider; >+ } >+ if ((master_provider->capabilities & RR_Capability_SourceOutput) && >+ (slave_provider->capabilities & RR_Capability_SinkOutput)) { >+ /* sink offload */ >+ AttachOutputGPU(master->pScreen, pScrn->pScreen); >+ slave_provider->output_source = master_provider; >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 1103816
:
778973
|
778974
| 779786 |
780409
|
785791