summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-01-09 12:52:13 +1000
committerDave Airlie <airlied@redhat.com>2013-07-12 11:23:59 +1000
commit29545a422bbdd11fda5cb61f27720332d68d0c36 (patch)
tree9c79078b0fe60f0f5d4ee652885bdaccf32ae3f8 /hw
parentf21cc327a56e3b453cf0dba04457223d61c27ea6 (diff)
gpu: call CreateScreenResources for GPU screens
I didn't think we needed this before, but after doing some more work with reverse optimus it seems like it should be called. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit f2fd8ec3725a61abbc831f0a9ec28fa2b7020c47)
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/common/xf86platformBus.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index 9034dad5e..db831a883 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -454,6 +454,14 @@ xf86platformAddDevice(int index)
CreateScratchPixmapsForScreen(xf86GPUScreens[i]->pScreen);
+ if (xf86GPUScreens[i]->pScreen->CreateScreenResources &&
+ !(*xf86GPUScreens[i]->pScreen->CreateScreenResources) (xf86GPUScreens[i]->pScreen)) {
+ RemoveGPUScreen(xf86GPUScreens[i]->pScreen);
+ xf86DeleteScreen(xf86GPUScreens[i]);
+ xf86UnclaimPlatformSlot(&xf86_platform_devices[index], NULL);
+ xf86NumGPUScreens = old_screens;
+ return -1;
+ }
/* attach unbound to 0 protocol screen */
AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);