From 9d26e8eaf5a2d7c3e65670ac20254c60f665c463 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 9 Jan 2013 14:26:35 +1000 Subject: [PATCH] randr: report changes when we disconnect a GPU slave When we disconnect an output/offload slave set the changed bits, so a later TellChanged can do something. Then when we remove a GPU slave device, sent change notification to the protocol screen. This allows hot unplugged USB devices to disappear in clients. Reviewed-by: Peter Hutterer Signed-off-by: Dave Airlie --- hw/xfree86/common/xf86platformBus.c | 3 ++- hw/xfree86/modes/xf86RandR12.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c index 9034dad5e..bcb65ff09 100644 --- a/hw/xfree86/common/xf86platformBus.c +++ b/hw/xfree86/common/xf86platformBus.c @@ -47,6 +47,7 @@ #include "Pci.h" #include "xf86platformBus.h" +#include "randrstr.h" int platformSlotClaimed; int xf86_num_platform_devices; @@ -499,7 +500,7 @@ xf86platformRemoveDevice(int index) xf86UnclaimPlatformSlot(&xf86_platform_devices[index], NULL); xf86_remove_platform_device(index); - + RRTellChanged(xf86Screens[0]->pScreen); out: return; } diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 25beee6d2..2817aaa1f 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -1896,10 +1896,12 @@ xf86RandR14ProviderDestroy(ScreenPtr screen, RRProviderPtr provider) if (config->randr_provider->offload_sink) { DetachOffloadGPU(screen); config->randr_provider->offload_sink = NULL; + RRSetChanged(screen); } else if (config->randr_provider->output_source) { DetachOutputGPU(screen); config->randr_provider->output_source = NULL; + RRSetChanged(screen); } else if (screen->current_master) DetachUnboundGPU(screen);