diff --git a/dix/main.c b/dix/main.c index bea1a8d5a..c46e40ab7 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 bcb65ff09..e368deeb8 100644 --- a/hw/xfree86/common/xf86platformBus.c +++ b/hw/xfree86/common/xf86platformBus.c @@ -455,6 +455,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);