Commit 520aa095 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Console blanking fix

From: Samuel Thibault <Samuel.Thibault@ens-lyon.fr>

Some fixes for console blanking: on some laptops, doing VESA blanking after
the bios did an apm blanking because of a screen closure thrashes the
recovery (the video board doesn't seem to have synchronisation registers
correctly initialized, since the LCD panel progressively turns white, maybe
damaging it ?).

I hence moved the schedule for vesa powerdown after the apm blank hook
call, so that if it succeeds, it won't be called.  I also moved the apm
unblank & palette restoration after the vesa unblank, to have a more lifo
scheme (also required, or the screen remains black).

Btw, why del_timer_sync was called twice in timer_do_blank_screen when
vesa_off_interval==0 ?
parent daee4676
......@@ -2710,16 +2710,9 @@ static void timer_do_blank_screen(int entering_gfx, int from_timer_handler)
}
hide_cursor(currcons);
if (!from_timer_handler)
del_timer_sync(&console_timer);
if (vesa_off_interval) {
console_timer.function = vesa_powerdown_screen;
mod_timer(&console_timer, jiffies + vesa_off_interval);
} else {
if (!from_timer_handler)
del_timer_sync(&console_timer);
console_timer.function = unblank_screen_t;
}
save_screen(currcons);
/* In case we need to reset origin, blanking hook returns 1 */
......@@ -2730,6 +2723,12 @@ static void timer_do_blank_screen(int entering_gfx, int from_timer_handler)
if (console_blank_hook && console_blank_hook(1))
return;
if (vesa_off_interval) {
console_timer.function = vesa_powerdown_screen;
mod_timer(&console_timer, jiffies + vesa_off_interval);
}
if (vesa_blank_mode)
sw->con_blank(vc_cons[currcons].d, vesa_blank_mode + 1);
}
......@@ -2771,12 +2770,12 @@ void unblank_screen(void)
}
console_blanked = 0;
if (console_blank_hook)
console_blank_hook(0);
set_palette(currcons);
if (sw->con_blank(vc_cons[currcons].d, 0))
/* Low-level driver cannot restore -> do it ourselves */
update_screen(fg_console);
if (console_blank_hook)
console_blank_hook(0);
set_palette(currcons);
set_cursor(fg_console);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment