From b9cebe59f9ddc1b38e47514e04a37b6de4efe2df Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 21 Oct 2016 09:52:18 +0100 Subject: [PATCH] sna: Ignore the current CRTC mode following a hotplug event If we detect a change in the output status, ignore the residual mode on the CRTC. We use this CRTC mode during inheritance to provide continuity and to make xrandr look neat we ensure that the mode is included in the output list. However, following a hotplug event the current mode may now be invalid and needs to be pruned. Signed-off-by: Chris Wilson --- src/sna/sna_display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 5e8c50a5..9d60d9a0 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -272,6 +272,7 @@ struct sna_output { uint32_t last_detect; uint32_t status; + unsigned int hotplug_count; bool update_properties; bool reprobe; @@ -3971,7 +3972,7 @@ sna_output_get_modes(xf86OutputPtr output) sna_output_attach_tile(output); current = NULL; - if (output->crtc) { + if (output->crtc && !sna_output->hotplug_count) { struct drm_mode_crtc mode; VG_CLEAR(mode); @@ -5302,6 +5303,7 @@ void sna_mode_discover(struct sna *sna, bool tell) } else { DBG(("%s: output %s (id=%d), changed state, reprobing\n", __FUNCTION__, output->name, sna_output->id)); + sna_output->hotplug_count++; sna_output->last_detect = 0; changed |= 4; }