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>
This commit is contained in:
parent
8fcb9d91b6
commit
f2fd8ec372
|
@ -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++) {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue