diff options
author | Eric Anholt <eric@anholt.net> | 2006-12-12 18:08:57 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2006-12-12 18:08:57 -0800 |
commit | 41444183b59ed84c09749ca89afbef036d42ec5f (patch) | |
tree | c3dc60b74aabe082f0d16dcec3485eccf2e57c46 /src/i830_xf86Crtc.c | |
parent | 7ed1b05922c07ff45a5794a992fd3d59ab55aa73 (diff) |
Replace custom, partially broken DPMS implementation with a generic one.
Diffstat (limited to 'src/i830_xf86Crtc.c')
-rw-r--r-- | src/i830_xf86Crtc.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/i830_xf86Crtc.c b/src/i830_xf86Crtc.c index 448d4f94..a222382d 100644 --- a/src/i830_xf86Crtc.c +++ b/src/i830_xf86Crtc.c @@ -590,3 +590,38 @@ xf86InitialConfiguration (ScrnInfoPtr pScrn) xfree (modes); return TRUE; } + +/** + * Set the DPMS power mode of all outputs and CRTCs. + * + * If the new mode is off, it will turn off outputs and then CRTCs. + * Otherwise, it will affect CRTCs before outputs. + */ +void +xf86DPMSSet(ScrnInfoPtr pScrn, int mode, int flags) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + int i; + + if (mode == DPMSModeOff) { + for (i = 0; i < config->num_output; i++) { + xf86OutputPtr output = config->output[i]; + if (output->crtc != NULL) + (*output->funcs->dpms) (output, mode); + } + } + + for (i = 0; i < config->num_crtc; i++) { + xf86CrtcPtr crtc = config->crtc[i]; + if (crtc->enabled) + (*crtc->funcs->dpms) (crtc, mode); + } + + if (mode != DPMSModeOff) { + for (i = 0; i < config->num_output; i++) { + xf86OutputPtr output = config->output[i]; + if (output->crtc != NULL) + (*output->funcs->dpms) (output, mode); + } + } +} |