summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-06-18 14:11:58 +0100
committerDave Airlie <airlied@redhat.com>2012-06-25 11:55:03 +0100
commitd0ea4e49643d9002af7cd5e927815c96cfed9d06 (patch)
tree469610c4021e6a38653759f2c46a8f23e0783671
parent55c4429219cff976e2ce071dbfc6907f2bd6f55b (diff)
xf86: detach all slave crtcs on disconnect/randr event (v2)
If we get disconnected or a randr event, disconnect the slave crtcs. v2: fix warning. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--hw/xfree86/common/xf86platformBus.c12
-rw-r--r--hw/xfree86/modes/xf86RandR12.c2
2 files changed, 13 insertions, 1 deletions
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index 3b73212a7..faed37bf6 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 0a58b5830..e071d23c2 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);
}