summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-01-09 12:52:13 +1000
committerDave Airlie <airlied@redhat.com>2013-01-11 09:58:08 +1000
commit984b25626089df1344c2a403b398037ea57d7312 (patch)
tree65bebe2a9f699b04d66c0367cd459bc1ddb98666
parent57c54e29b931ef6bdf96eab52ec57c4ddab7e227 (diff)
gpu: call CreateScreenResources for GPU screensfor-keithp-unreviewed
I didn't think we needed this before, but after doing some more work with reverse optimus it seems like it should be called. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--dix/main.c3
-rw-r--r--hw/xfree86/common/xf86platformBus.c8
2 files changed, 11 insertions, 0 deletions
diff --git a/dix/main.c b/dix/main.c
index fb935c969..e558d702b 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -211,6 +211,9 @@ main(int argc, char *argv[], char *envp[])
ScreenPtr pScreen = screenInfo.gpuscreens[i];
if (!CreateScratchPixmapsForScreen(pScreen))
FatalError("failed to create scratch pixmaps");
+ if (pScreen->CreateScreenResources &&
+ !(*pScreen->CreateScreenResources) (pScreen))
+ FatalError("failed to create screen resources");
}
for (i = 0; i < screenInfo.numScreens; i++) {
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index ffefae6c6..8ce472f8d 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -450,6 +450,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);