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 <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2016-10-21 09:52:18 +01:00
parent 6a2e5bca42
commit b9cebe59f9
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}