From 1e3e65b5f30eb17262883de9862990ed05f32353 Mon Sep 17 00:00:00 2001 From: Stanislav Lisovskiy Date: Fri, 16 Nov 2018 10:45:29 +0200 Subject: [PATCH xserver] Temprorary fix, for nonworking screen after hotplug Sometimes xserver thinks that crtc didn't change and drm_mode_setcrtc ioctl is not needed. Which leads to not working external screens, happenining ocassionally after hotplug. This patch is not final and merely cancels that checking logic by forcing the mode set call to be always sent regardless of changes made. This fixes that particular issue, but it's obvious that the real fix would be something else, most likely some logic needs to be fixed. --- hw/xfree86/modes/xf86RandR12.c | 2 ++ randr/rrcrtc.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index aac02db43..4b660dacb 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -1203,6 +1203,8 @@ xf86RandR12CrtcSet(ScreenPtr pScreen, if (randr_outputs[ro]->pendingProperties) changed = TRUE; + changed = TRUE; + /* XXX need device-independent mode setting code through an API */ if (changed) { crtc->enabled = randr_mode != NULL; diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 401a1c178..149915712 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -730,6 +730,8 @@ RRCrtcSet(RRCrtcPtr crtc, } } + crtcChanged = TRUE; + /* See if nothing changed */ if (crtc->mode == mode && crtc->x == x && @@ -743,6 +745,7 @@ RRCrtcSet(RRCrtcPtr crtc, ret = TRUE; } else { + if (pScreen->isGPU) { ScreenPtr master = pScreen->current_master; int width = 0, height = 0; @@ -756,6 +759,7 @@ RRCrtcSet(RRCrtcPtr crtc, if (!ret) return FALSE; + if (pScreen->current_master) { Bool sync = rrGetPixmapSharingSyncProp(numOutputs, outputs); ret = rrSetupPixmapSharing(crtc, width, height, @@ -781,6 +785,7 @@ RRCrtcSet(RRCrtcPtr crtc, ret = TRUE; } else { + size.width = mode->mode.width; size.height = mode->mode.height; if (outputs[0]->mmWidth && outputs[0]->mmHeight) { @@ -1256,6 +1261,7 @@ ProcRRSetCrtcConfig(ClientPtr client) return BadMatch; } } + /* validate clones */ for (i = 0; i < numOutputs; i++) { for (j = 0; j < numOutputs; j++) { -- 2.17.1