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);
|
KdScreenPriv(pScreen);
|
||||||
FbdevPriv *priv = pScreenPriv->card->driver;
|
FbdevPriv *priv = pScreenPriv->card->driver;
|
||||||
|
static int oldmode = -1;
|
||||||
|
|
||||||
|
if (mode == oldmode)
|
||||||
|
return TRUE;
|
||||||
#ifdef FBIOPUT_POWERMODE
|
#ifdef FBIOPUT_POWERMODE
|
||||||
if (ioctl (priv->fd, FBIOPUT_POWERMODE, &mode) >= 0)
|
if (ioctl (priv->fd, FBIOPUT_POWERMODE, &mode) >= 0)
|
||||||
|
{
|
||||||
|
oldmode = mode;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef FBIOBLANK
|
#ifdef FBIOBLANK
|
||||||
if (ioctl (priv->fd, FBIOBLANK, mode ? mode + 1 : 0) >= 0)
|
if (ioctl (priv->fd, FBIOBLANK, mode ? mode + 1 : 0) >= 0)
|
||||||
|
{
|
||||||
|
oldmode = mode;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user