summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander@mandriva.com.br>2009-03-05 12:57:28 -0500
committerJames Cloos <cloos@jhcloos.com>2009-03-12 14:50:59 -0400
commit544cd9e7b50cd9905afc52404de1a5a2bcff91b5 (patch)
tree7eb7a95d5a4e79ab6f5d25001cc461196eb3790a /hw
parent7abb72c5c711a26a27a82604bd2398bcb6df0a99 (diff)
Honour Option "DPMS" "off" on xorg.conf
Signed-off-by: James Cloos <cloos@jhcloos.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/common/xf86DPMS.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/hw/xfree86/common/xf86DPMS.c b/hw/xfree86/common/xf86DPMS.c
index baa093f75..85be6036a 100644
--- a/hw/xfree86/common/xf86DPMS.c
+++ b/hw/xfree86/common/xf86DPMS.c
@@ -61,7 +61,7 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
DPMSPtr pDPMS;
pointer DPMSOpt;
- MessageType enabled_from = X_INFO;
+ MessageType enabled_from;
DPMSKey = &DPMSKeyIndex;
@@ -75,23 +75,22 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
pScrn->DPMSSet = set;
pDPMS->Flags = flags;
DPMSOpt = xf86FindOption(pScrn->options, "dpms");
- if (DPMSOpt) {
- if ((pDPMS->Enabled
- = xf86SetBoolOption(pScrn->options, "dpms", FALSE))
- && !DPMSDisabledSwitch)
- DPMSEnabled = TRUE;
- enabled_from = X_CONFIG;
+ if (DPMSEnabledSwitch || DPMSDisabledSwitch) {
+ enabled_from = X_CMDLINE;
+ DPMSEnabled = !DPMSDisabledSwitch && DPMSEnabledSwitch;
+ }
+ else if (DPMSOpt) {
+ enabled_from = X_CONFIG;
+ DPMSEnabled = xf86CheckBoolOption(pScrn->options, "dpms", FALSE);
xf86MarkOptionUsed(DPMSOpt);
- } else if (DPMSEnabledSwitch) {
- if (!DPMSDisabledSwitch)
- DPMSEnabled = TRUE;
- pDPMS->Enabled = TRUE;
- }
+ }
else {
- pDPMS->Enabled = defaultDPMSEnabled;
+ enabled_from = X_DEFAULT;
+ DPMSEnabled = defaultDPMSEnabled;
}
- if (pDPMS->Enabled)
+ if (DPMSEnabled)
xf86DrvMsg(pScreen->myNum, enabled_from, "DPMS enabled\n");
+ pDPMS->Enabled = DPMSEnabled;
pDPMS->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = DPMSClose;
DPMSCount++;