[PATCH 31/36] xf86: detach all slave crtcs on disconnect/randr event (v2)

Dave Airlie airlied at gmail.com
Mon Jul 2 03:13:24 PDT 2012


From: Dave Airlie <airlied at redhat.com>

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

v2: fix warning.

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

diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index 3b73212..faed37b 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -46,6 +46,7 @@
 #include "xf86Bus.h"
 #include "Pci.h"
 #include "xf86platformBus.h"
+#include "xf86Crtc.h"
 
 int platformSlotClaimed;
 
@@ -476,7 +477,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