sna: Disable unused CRTC after undock events

If undocking removes output (as the MST topology changes and some
outputs then become unreachable), we may leave dangling CRTC. This
confuses us, so disable any enabled but unconnected CRTC after the
undock event.

Reported-by: Sree Harsha Totakura <freedesktop@h.totakura.in>
References: https://bugs.freedesktop.org/show_bug.cgi?id=80355#c5
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-06-22 17:53:59 +01:00
parent dca0f1c2cc
commit f22ea4e821
1 changed files with 7 additions and 2 deletions

View File

@ -3506,6 +3506,7 @@ static void sna_output_del(xf86OutputPtr output)
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
int i;
DBG(("%s(%s)\n", __FUNCTION__, output->name));
assert(to_sna_output(output));
RROutputDestroy(output->randr_output);
@ -3549,7 +3550,7 @@ void sna_mode_discover(struct sna *sna)
struct drm_mode_card_res res;
uint32_t connectors[32];
int i, j, serial;
bool changed = false;
int changed = 0;
VG_CLEAR(connectors);
@ -3589,7 +3590,7 @@ void sna_mode_discover(struct sna *sna)
to_sna_output(output)->id = 0;
output->crtc = NULL;
}
changed = true;
changed |= 2;
}
}
@ -3598,6 +3599,10 @@ void sna_mode_discover(struct sna *sna)
/* Reorder user visible listing */
sort_randr_outputs(sna, screen);
if (changed & 2)
xf86DisableUnusedFunctions(sna->scrn);
xf86RandR12TellChanged(screen);
}
}