aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2018-03-07 02:01:39 +0100
committerMihai Moldovan <ionic@ionic.de>2018-03-07 11:57:35 +0100
commit76e7d26b8b9efd6811970968d8b03d63b8aaf338 (patch)
treea42153a8cc5e3c9962c68e60a6187a2975a6adda
parentadb582abd7f29b4d210f4f189472474be2933d63 (diff)
downloadnx-libs-76e7d26b8b9efd6811970968d8b03d63b8aaf338.tar.gz
nx-libs-76e7d26b8b9efd6811970968d8b03d63b8aaf338.tar.bz2
nx-libs-76e7d26b8b9efd6811970968d8b03d63b8aaf338.zip
nx-X11/programs/Xserver/hw/nxagent/Init.c: disable DPMS support within nxagent.
Keeping it enabled leads to nxagent consuming 100% of CPU resources after some time. Older code used three different timers for each DPMS mode (standby, suspend, off), with each timer checking that the elapsed idle time is strictly less than the DPMS mode timeout value. Newer code started merging DPMS and ScreenSaver timers into a single one, with checking DPMS modes and timeouts in a fall-through fashion. The code expects that, if a timeout is reached, the mode is set accordingly, so that the old timeout is disregarded next time. Since we stub out DPMSSetMode() in nxagent, this doesn't happen. In this case, the old DPMS timeout will be checked the next time around and we will be calculating DPMS_MODE_TIMEOUT - IDLE_TIME. If IDLE_TIME is bigger than DPMS_MODE_TIMEOUT, we run into problems with unsigned integers. What happens next will be *another* overflow once DoTimers() is executed and from that function SetTimers(), which will add the current timestamp to the timeout value. Later functions subtract the current timestamp again (which will be even higher since some time elapsed) and underflow the value again. It looks like this leads to consistent firing of the timer - something we do not want to have. For new, disable DPMS support in nxagent. We do not execute it on actual hardware that could change DPMS modes. At a later time, implementing a DPMS timeout/mode passthrough to the connected X server/display might be beneficial. Fixes: ArcticaProject/nx-libs#671
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c
index 598077bba..12f7f0b06 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Init.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c
@@ -572,7 +572,7 @@ int DPMSGet(int *level)
Bool DPMSSupported(void)
{
- return 1;
+ return 0;
}
#endif