summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-06-14 19:26:42 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-06-14 19:26:42 +0100
commit3a56a0b10eb3ab07efd28efdc79d0fd3a6fa20ff (patch)
tree8eda2e9e3e2f206f246881776f54b936aa20ecc3 /src
parentb415ca05c2e1c4f09f85d8769d39e5369661ed3a (diff)
sna: Make the disable-unused after vt switch distinct from DPMS off
So that we do not lose control over dpms on/off! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna.h1
-rw-r--r--src/sna/sna_display.c15
-rw-r--r--src/sna/sna_driver.c2
3 files changed, 16 insertions, 2 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h
index ce06e4d5..a426e695 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -304,6 +304,7 @@ Bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna);
void sna_mode_adjust_frame(struct sna *sna, int x, int y);
extern void sna_mode_remove_fb(struct sna *sna);
extern void sna_mode_update(struct sna *sna);
+extern void sna_mode_disable_unused(struct sna *sna);
extern void sna_mode_fini(struct sna *sna);
extern int sna_crtc_id(xf86CrtcPtr crtc);
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index a198b5cf..de834ae9 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -515,9 +515,20 @@ sna_crtc_dpms(xf86CrtcPtr crtc, int mode)
{
DBG(("%s(pipe %d, dpms mode -> %d):= active=%d\n",
__FUNCTION__, to_sna_crtc(crtc)->pipe, mode, mode == DPMSModeOn));
+}
+
+void sna_mode_disable_unused(struct sna *sna)
+{
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+ int i;
- if (mode == DPMSModeOff)
- sna_crtc_disable(crtc);
+ DBG(("%s\n", __FUNCTION__));
+
+ /* Force consistency between kernel and ourselves */
+ for (i = 0; i < xf86_config->num_crtc; i++) {
+ if (!xf86_config->crtc[i]->enabled)
+ sna_crtc_disable(xf86_config->crtc[i]);
+ }
}
static struct kgem_bo *sna_create_bo_for_fbcon(struct sna *sna,
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 2fa6adc4..76ae24ed 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -988,6 +988,8 @@ static Bool sna_enter_vt(VT_FUNC_ARGS_DECL)
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"failed to restore desired modes on VT switch\n");
+ sna_mode_disable_unused(sna);
+
return TRUE;
}