mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 14:00:03 +01:00
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 f2fd8ec372)
This commit is contained in:
parent
f21cc327a5
commit
29545a422b
2 changed files with 11 additions and 0 deletions
|
|
@ -211,6 +211,9 @@ main(int argc, char *argv[], char *envp[])
|
||||||
ScreenPtr pScreen = screenInfo.gpuscreens[i];
|
ScreenPtr pScreen = screenInfo.gpuscreens[i];
|
||||||
if (!CreateScratchPixmapsForScreen(pScreen))
|
if (!CreateScratchPixmapsForScreen(pScreen))
|
||||||
FatalError("failed to create scratch pixmaps");
|
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++) {
|
for (i = 0; i < screenInfo.numScreens; i++) {
|
||||||
|
|
|
||||||
|
|
@ -454,6 +454,14 @@ xf86platformAddDevice(int index)
|
||||||
|
|
||||||
CreateScratchPixmapsForScreen(xf86GPUScreens[i]->pScreen);
|
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 */
|
/* attach unbound to 0 protocol screen */
|
||||||
AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
|
AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue