6f76b1d
From 6aa11e40ec75fb31d0c611f9d578427941379c0d Mon Sep 17 00:00:00 2001
c1e706d
From: Fedora X Ninjas <x@fedoraproject.org>
c1e706d
Date: Tue, 8 Jan 2013 09:42:44 +1000
c1e706d
Subject: [PATCH] xserver: call CSR for gpus
c1e706d
c1e706d
---
6f76b1d
 dix/main.c                          | 3 +++
6f76b1d
 hw/xfree86/common/xf86platformBus.c | 8 ++++++++
6f76b1d
 2 files changed, 11 insertions(+)
c1e706d
c1e706d
diff --git a/dix/main.c b/dix/main.c
c1e706d
index fb935c9..e558d70 100644
c1e706d
--- a/dix/main.c
c1e706d
+++ b/dix/main.c
c1e706d
@@ -211,6 +211,9 @@ main(int argc, char *argv[], char *envp[])
c1e706d
             ScreenPtr pScreen = screenInfo.gpuscreens[i];
c1e706d
             if (!CreateScratchPixmapsForScreen(pScreen))
c1e706d
                 FatalError("failed to create scratch pixmaps");
c1e706d
+            if (pScreen->CreateScreenResources &&
c1e706d
+                !(*pScreen->CreateScreenResources) (pScreen))
c1e706d
+                FatalError("failed to create screen resources");
c1e706d
         }
c1e706d
 
c1e706d
         for (i = 0; i < screenInfo.numScreens; i++) {
6f76b1d
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
6f76b1d
index 67d03eb..8f73c3a 100644
6f76b1d
--- a/hw/xfree86/common/xf86platformBus.c
6f76b1d
+++ b/hw/xfree86/common/xf86platformBus.c
6f76b1d
@@ -452,6 +452,14 @@ xf86platformAddDevice(int index)
6f76b1d
 
6f76b1d
    CreateScratchPixmapsForScreen(xf86GPUScreens[i]->pScreen);
6f76b1d
 
6f76b1d
+   if (xf86GPUScreens[i]->pScreen->CreateScreenResources &&
6f76b1d
+       !(*xf86GPUScreens[i]->pScreen->CreateScreenResources) (xf86GPUScreens[i]->pScreen)) {
6f76b1d
+       RemoveGPUScreen(xf86GPUScreens[i]->pScreen);
6f76b1d
+       xf86DeleteScreen(xf86GPUScreens[i]);
6f76b1d
+       xf86UnclaimPlatformSlot(&xf86_platform_devices[index], NULL);
6f76b1d
+       xf86NumGPUScreens = old_screens;
6f76b1d
+       return -1;
6f76b1d
+   }
6f76b1d
    /* attach unbound to 0 protocol screen */
6f76b1d
    AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
6f76b1d
    xf86AutoConfigOutputDevice(xf86GPUScreens[i], xf86Screens[0]);
c1e706d
-- 
c1e706d
1.8.1
c1e706d