[PATCH 10/11] dix: attach unbound screens to protocol screen 0

Dave Airlie airlied at gmail.com
Wed Jun 13 06:53:22 PDT 2012


From: Dave Airlie <airlied at redhat.com>

This is the default attachment, unbound gpu screens get
attached to the 0 protocol screen.

detach on hotunplug.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 hw/xfree86/common/xf86Init.c        |    3 +++
 hw/xfree86/common/xf86platformBus.c |    5 +++++
 2 files changed, 8 insertions(+)

diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 6dbb10a..745532b 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -920,6 +920,9 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
 #endif
     }
 
+    for (i = 0; i < xf86NumGPUScreens; i++)
+        AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
+
     xf86VGAarbiterWrapFunctions();
     xf86UnblockSIGIO(was_blocked);
 
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index b98d15c..549e3e1 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -435,6 +435,9 @@ xf86platformAddDevice(int index)
                  xf86ScreenKey, xf86GPUScreens[i]);
 
    CreateScratchPixmapsForScreen(xf86GPUScreens[i]->pScreen);
+
+   /* attach unbound to 0 protocol screen */
+   AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
   
    return 0;
 }
@@ -470,6 +473,8 @@ xf86platformRemoveDevice(int index)
         goto out;
     }
 
+    DetachUnboundGPU(xf86GPUScreens[i]->pScreen);
+
     xf86GPUScreens[i]->pScreen->CloseScreen(xf86GPUScreens[i]->pScreen);
 
     RemoveGPUScreen(xf86GPUScreens[i]->pScreen);
-- 
1.7.10.2



More information about the xorg-devel mailing list