1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-09-29 02:04:46 +03:00

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.
This commit is contained in:
Maarten ter Huurne 2014-10-15 02:19:32 +02:00
parent 7e2bdcc922
commit 51685e4758

View File

@ -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) {