diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-01-20 16:32:34 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2015-01-21 10:15:13 +0000 |
commit | b0f90a46111ada91f99e7babcc3dbba5780965b2 (patch) | |
tree | e066f0cbda7b6bdeed6a756c3d7e4454591ec5d2 /src/sna/sna_driver.c | |
parent | 0f15bfb190f8f4906f44f6d370dcc0a73ec4ba53 (diff) |
sna: Keep front_active consistent across DPMS events
When disabling outputs with DPMS, make sure we update front_active for
consistency.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_driver.c')
-rw-r--r-- | src/sna/sna_driver.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index 5b47bc7c..4921beab 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -289,6 +289,7 @@ static Bool sna_create_screen_resources(ScreenPtr screen) static void sna_dpms_set(ScrnInfoPtr scrn, int mode, int flags) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + struct sna *sna = to_sna(scrn); int i; DBG(("%s(mode=%d, flags=%d), vtSema=%d\n", @@ -310,8 +311,12 @@ static void sna_dpms_set(ScrnInfoPtr scrn, int mode, int flags) if (output->crtc != NULL) output->funcs->dpms(output, mode); } + sna->mode.hidden = sna->mode.front_active + 1; + sna->mode.front_active = 0; } else { /* Re-enable CRTC that have been forced off via other means */ + sna->mode.front_active = sna->mode.hidden - 1; + sna->mode.hidden = 0; for (i = 0; i < config->num_crtc; i++) { xf86CrtcPtr crtc = config->crtc[i]; if (crtc->enabled) @@ -326,8 +331,7 @@ static void sna_dpms_set(ScrnInfoPtr scrn, int mode, int flags) } sna_crtc_config_notify(xf86ScrnToScreen(scrn)); - to_sna(scrn)->mode.hidden = mode == DPMSModeOff; - DBG(("%s: hiding outputs? %d\n", __FUNCTION__, to_sna(scrn)->mode.hidden)); + DBG(("%s: hiding outputs? %d\n", __FUNCTION__, sna->mode.hidden)); } static Bool sna_save_screen(ScreenPtr screen, int mode) |