From 51685e4758987c878aa96309023f28e486d66ab3 Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Wed, 15 Oct 2014 02:19:32 +0200 Subject: [PATCH] Fixed blanking state set by PowerSaver Previously 1 was written to the sysfs "blank" pseudo-file, but that selects blanking state FB_BLANK_NORMAL, which does not power down the display. Instead, we should write 4 for FB_BLANK_POWERDOWN. Note that in the OpenDingux kernel, any non-zero blanking state would power down the display, so we got the desired behavior in practice, but this is not according to spec. --- src/powersaver.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/powersaver.cpp b/src/powersaver.cpp index 8ebee28..a6debb7 100644 --- a/src/powersaver.cpp +++ b/src/powersaver.cpp @@ -74,7 +74,9 @@ void PowerSaver::removeScreenTimer() { #define SCREEN_BLANK_PATH "/sys/class/graphics/fb0/blank" void PowerSaver::setScreenBlanking(bool state) { const char *path = SCREEN_BLANK_PATH; - const char *blank = state ? "0" : "1"; + const char *blank = state + ? "0" /* FB_BLANK_UNBLANK */ + : "4" /* FB_BLANK_POWERDOWN */; int fd = open(path, O_RDWR); if (fd == -1) {