diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-23 22:50:23 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-23 22:52:52 +0100 |
commit | 706480bde6120f84388a99085ed3d1cc3b759697 (patch) | |
tree | 7cbaed19082441334e488d5a3870c7649f82590f /src | |
parent | 5530cb4165da60f7b929b84d733d5eefcf4ec5fe (diff) |
sna: Disable CRTC after MST topology change
In order to disable CRTC after marking outputs as removed after probing
MST topology updates, we must manually mark the CRTCs as no longer
enabled.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_display.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 59691ee4..cb2fcc32 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -3544,6 +3544,35 @@ static void sort_randr_outputs(struct sna *sna, ScreenPtr screen) } } +static void disable_unused_crtc(struct sna *sna) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); + bool update = false; + int o, c; + + for (c = 0; c < sna->mode.num_real_crtc; c++) { + xf86CrtcPtr crtc = config->crtc[c]; + + if (!crtc->enabled) + continue; + + + for (o = 0; o < sna->mode.num_real_output; o++) { + xf86OutputPtr output = config->output[o]; + if (output->crtc == crtc) + break; + } + + if (o == sna->mode.num_real_output) { + crtc->enabled = false; + update = true; + } + } + + if (update) + xf86DisableUnusedFunctions(sna->scrn); +} + void sna_mode_discover(struct sna *sna) { ScreenPtr screen = xf86ScrnToScreen(sna->scrn); @@ -3609,7 +3638,7 @@ void sna_mode_discover(struct sna *sna) sort_randr_outputs(sna, screen); if (changed & 2) - xf86DisableUnusedFunctions(sna->scrn); + disable_unused_crtc(sna); xf86RandR12TellChanged(screen); } |