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>
This commit is contained in:
Chris Wilson 2016-10-21 23:11:42 +01:00
parent f18c7620cf
commit b7d6f695dd
2 changed files with 4 additions and 1 deletions

View File

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

View File

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