summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-10-21 23:11:42 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-10-21 23:11:42 +0100
commitb7d6f695ddab02b7afef0f1ca3ae132f4fdbfd43 (patch)
treecd5f34273c1844bc9de9b18d3db762c3237c3c81
parentf18c7620cfba8412b0d141748fbb195670984ad2 (diff)
sna: Disable screen saver if Option "DPMS" is specified
The defacto standard is that the screensaver only blanks the screen but keeps the outputs alive. We differ by actually disabling the CRTC when the screen saver kicks in (to save power), however this circumvents Option "DPMS". Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98375 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna.h1
-rw-r--r--src/sna/sna_driver.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 09f57cc8..4f9fc89a 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -264,6 +264,7 @@ struct sna {
#define SNA_FLUSH_GTT 0x800
#define SNA_PERFORMANCE 0x1000
#define SNA_POWERSAVE 0x2000
+#define SNA_NO_DPMS 0x4000
#define SNA_HAS_FLIP 0x10000
#define SNA_HAS_ASYNC_FLIP 0x20000
#define SNA_LINEAR_FB 0x40000
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index c731e581..3e9cf86c 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -296,7 +296,7 @@ static void sna_dpms_set(ScrnInfoPtr scrn, int mode, int flags)
DBG(("%s(mode=%d, flags=%d), vtSema=%d => off?=%d\n",
__FUNCTION__, mode, flags, scrn->vtSema, mode!=DPMSModeOn));
- if (!scrn->vtSema)
+ if (!scrn->vtSema || sna->flags & SNA_NO_DPMS)
return;
/* Opencoded version of xf86DPMSSet().
@@ -1209,6 +1209,8 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL)
CMAP_PALETTED_TRUECOLOR))
return FALSE;
+ if (!xf86CheckBoolOption(scrn->options, "dpms", TRUE))
+ sna->flags |= SNA_NO_DPMS;
xf86DPMSInit(screen, sna_dpms_set, 0);
sna_uevent_init(sna);