mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
kdrive: add dpms code to KdSaveScreen
In preparation for adding the Xfbdev X11 kdrive server Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
committed by
Enrico Weigelt
parent
e763d02a9b
commit
6915ff3312
@@ -693,7 +693,34 @@ Bool KdCloseScreen(ScreenPtr pScreen)
|
||||
|
||||
Bool KdSaveScreen(ScreenPtr pScreen, int on)
|
||||
{
|
||||
return FALSE;
|
||||
KdScreenPriv(pScreen);
|
||||
int dpmsState;
|
||||
|
||||
if (!pScreenPriv->card->cfuncs->dpms)
|
||||
return FALSE;
|
||||
|
||||
dpmsState = pScreenPriv->dpmsState;
|
||||
switch (on) {
|
||||
case SCREEN_SAVER_OFF:
|
||||
dpmsState = KD_DPMS_NORMAL;
|
||||
break;
|
||||
case SCREEN_SAVER_ON:
|
||||
if (dpmsState == KD_DPMS_NORMAL)
|
||||
dpmsState = KD_DPMS_NORMAL + 1;
|
||||
break;
|
||||
case SCREEN_SAVER_CYCLE:
|
||||
if (dpmsState < KD_DPMS_MAX)
|
||||
dpmsState++;
|
||||
break;
|
||||
case SCREEN_SAVER_FORCER:
|
||||
break;
|
||||
}
|
||||
if (dpmsState != pScreenPriv->dpmsState) {
|
||||
if (pScreenPriv->enabled)
|
||||
(*pScreenPriv->card->cfuncs->dpms) (pScreen, dpmsState);
|
||||
pScreenPriv->dpmsState = dpmsState;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static Bool
|
||||
|
||||
Reference in New Issue
Block a user