From ce3de2dcb1b3bd99a693c828278a416c245acc37 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 9 Jan 2013 14:23:57 +1000 Subject: [PATCH] randr upstream set changed fixes Signed-off-by: Dave Airlie --- hw/xfree86/common/xf86platformBus.c | 3 ++- hw/xfree86/modes/xf86RandR12.c | 2 ++ randr/randr.c | 24 +++++++++++++++++++++++- randr/randrstr.h | 4 ++++ randr/rrcrtc.c | 2 +- randr/rrinfo.c | 2 +- randr/rroutput.c | 2 +- randr/rrscreen.c | 2 +- 8 files changed, 35 insertions(+), 6 deletions(-) diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c index 9034dad..bcb65ff 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 01fc9c5..7f570cf 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -1895,10 +1895,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); diff --git a/randr/randr.c b/randr/randr.c index f0decfc..cb6fce7 100644 --- a/randr/randr.c +++ b/randr/randr.c @@ -464,6 +464,28 @@ TellChanged(WindowPtr pWin, pointer value) return WT_WALKCHILDREN; } +void +RRSetChanged(ScreenPtr pScreen) +{ + /* set changed bits on the master screen only */ + ScreenPtr master; + rrScrPriv(pScreen); + rrScrPrivPtr mastersp; + + if (pScreen->isGPU) { + master = pScreen->current_master; + if (!master) + return; + mastersp = rrGetScrPriv(master); + } + else { + master = pScreen; + mastersp = pScrPriv; + } + + mastersp->changed = TRUE; +} + /* * Something changed; send events and adjust pointer position */ @@ -484,7 +506,7 @@ RRTellChanged(ScreenPtr pScreen) mastersp = pScrPriv; } - if (pScrPriv->changed) { + if (mastersp->changed) { UpdateCurrentTimeIf(); if (mastersp->configChanged) { mastersp->lastConfigTime = currentTime; diff --git a/randr/randrstr.h b/randr/randrstr.h index 2517479..2babfed 100644 --- a/randr/randrstr.h +++ b/randr/randrstr.h @@ -486,6 +486,10 @@ extern _X_EXPORT void RRDeliverScreenEvent(ClientPtr client, WindowPtr pWin, ScreenPtr pScreen); /* randr.c */ +/* set a screen change on the primary screen */ +extern _X_EXPORT void +RRSetChanged(ScreenPtr pScreen); + /* * Send all pending events */ diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 6e2eca5..b3fb5bd 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -39,7 +39,7 @@ RRCrtcChanged(RRCrtcPtr crtc, Bool layoutChanged) if (pScreen) { rrScrPriv(pScreen); - pScrPriv->changed = TRUE; + RRSetChanged(pScreen); /* * Send ConfigureNotify on any layout change */ diff --git a/randr/rrinfo.c b/randr/rrinfo.c index 1408d6f..fc57bd4 100644 --- a/randr/rrinfo.c +++ b/randr/rrinfo.c @@ -225,7 +225,7 @@ RRScreenSetSizeRange(ScreenPtr pScreen, pScrPriv->minHeight = minHeight; pScrPriv->maxWidth = maxWidth; pScrPriv->maxHeight = maxHeight; - pScrPriv->changed = TRUE; + RRSetChanged(pScreen); pScrPriv->configChanged = TRUE; } diff --git a/randr/rroutput.c b/randr/rroutput.c index 88781ba..922d61f 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -36,7 +36,7 @@ RROutputChanged(RROutputPtr output, Bool configChanged) output->changed = TRUE; if (pScreen) { rrScrPriv(pScreen); - pScrPriv->changed = TRUE; + RRSetChanged(pScreen); if (configChanged) pScrPriv->configChanged = TRUE; } diff --git a/randr/rrscreen.c b/randr/rrscreen.c index 39340cc..36179ae 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -143,7 +143,7 @@ RRScreenSizeNotify(ScreenPtr pScreen) pScrPriv->height = pScreen->height; pScrPriv->mmWidth = pScreen->mmWidth; pScrPriv->mmHeight = pScreen->mmHeight; - pScrPriv->changed = TRUE; + RRSetChanged(pScreen); /* pScrPriv->sizeChanged = TRUE; */ RRTellChanged(pScreen); -- 1.8.2