[PATCH 4/4] gpu: call CreateScreenResources for GPU screens

Aaron Plattner aplattner at nvidia.com
Mon Apr 29 16:57:24 PDT 2013


On 01/07/2013 05:31 PM, Dave Airlie wrote:
> From: Fedora X Ninjas <x at fedoraproject.org>
>
> 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 at redhat.com>

This patch is shipping in Ubuntu 13.04 and it breaks "forward optimus" 
setups with nvidia as the display offload source and intel or 
modesetting as the offload sink.  The modeset claims to succeed but the 
screen remains black.  I'll see if I can figure out why sometime this week.

-- Aaron

> ---
>   dix/main.c                          | 3 +++
>   hw/xfree86/common/xf86platformBus.c | 8 ++++++++
>   2 files changed, 11 insertions(+)
>
> diff --git a/dix/main.c b/dix/main.c
> index fb935c9..e558d70 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 5866333..9ff1a08 100644
> --- a/hw/xfree86/common/xf86platformBus.c
> +++ b/hw/xfree86/common/xf86platformBus.c
> @@ -449,6 +449,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);
>



More information about the xorg-devel mailing list