kdrive/fbdev: dont set DPMS mode repeatedly to the same value
This commit is contained in:
parent
99fb2eb76d
commit
090a429573
|
@ -770,14 +770,23 @@ fbdevDPMS (ScreenPtr pScreen, int mode)
|
|||
{
|
||||
KdScreenPriv(pScreen);
|
||||
FbdevPriv *priv = pScreenPriv->card->driver;
|
||||
static int oldmode = -1;
|
||||
|
||||
if (mode == oldmode)
|
||||
return TRUE;
|
||||
#ifdef FBIOPUT_POWERMODE
|
||||
if (ioctl (priv->fd, FBIOPUT_POWERMODE, &mode) >= 0)
|
||||
{
|
||||
oldmode = mode;
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
#ifdef FBIOBLANK
|
||||
if (ioctl (priv->fd, FBIOBLANK, mode ? mode + 1 : 0) >= 0)
|
||||
{
|
||||
oldmode = mode;
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user