Support code for the DPMS extension is included in the XFree86 common layer. This code provides an interface between the main extension code, and a means for drivers to initialise DPMS when they support it. One function is available to drivers to do this initialisation, and it is always available, even when the DPMS extension is not supported by the core server (in which case it returns a failure result).
Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
This function registers a driver's DPMS level programming function
set
. It also checkspScrn->options
for the "dpms" option, and when present marks DPMS as being enabled for that screen. Theset
function is called whenever the DPMS level changes, and is used to program the requested level.flags
is currently not used, and should be0
. If the initialisation fails for any reason, including when there is no DPMS support in the core server, the function returnsFALSE
.
Drivers that implement DPMS support must provide the following function, that gets called when the DPMS level is changed:
void ChipDPMSSet(ScrnInfoPtr pScrn, int level, int flags)
Program the DPMS level specified by
level
. Valid values oflevel
areDPMSModeOn
,DPMSModeStandby
,DPMSModeSuspend
,DPMSModeOff
. These values are defined in"extensions/dpms.h"
.