[PATCH 30/31] xf86: detach all slave crtcs on disconnect/randr event

Dave Airlie airlied at gmail.com
Wed Jun 20 07:00:45 PDT 2012


From: Dave Airlie <airlied at redhat.com>

If we get disconnected or a randr event, disconnect the slave crtcs.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 hw/xfree86/common/xf86platformBus.c |   11 ++++++++++-
 hw/xfree86/modes/xf86RandR12.c      |    2 ++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index dbf588b..6db8fa9 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -476,7 +476,16 @@ xf86platformRemoveDevice(int index)
         goto out;
     }
 
-    DetachUnboundGPU(xf86GPUScreens[i]->pScreen);
+    switch (xf86GPUScreens[i]->current_role) {
+    case 0:
+    default:
+        DetachUnboundGPU(xf86GPUScreens[i]->pScreen);
+        break;
+    case RR_Role_Slave_Output:
+        xf86DetachAllCrtc(xf86GPUScreens[i]);
+        DetachOutputGPU(xf86GPUScreens[i]->pScreen);
+        break;
+    }
 
     xf86GPUScreens[i]->pScreen->CloseScreen(xf86GPUScreens[i]->pScreen);
 
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 0a58b58..e071d23 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -1780,6 +1780,8 @@ xf86RandR15ProviderSetRole(ScreenPtr pScreen,
 
     if (!new_role) {
         if (provider->current_role == RR_Role_Slave_Output) {
+
+            xf86DetachAllCrtc(xf86ScreenToScrn(pScreen));
             DetachOutputGPU(pScreen);
             xf86SetCurrentRole(xf86ScreenToScrn(pScreen), 0);
         }
-- 
1.7.10.2



More information about the xorg-devel mailing list