From: Ville Syrjala Current console blanking code is broken. It will first do a normal blank, then start the VESA blank timer if vesa_off_interval != 0, and then proceed to do the VESA blanking directly. After the timer expires it will do the VESA blanking a second time. Also the vesa_powerdown() function doesn't allow all VESA modes to be used. With this patch the behaviour is: 1. Blank: vesa_off_interval != 0 -> Do normal blank vesa_off_interval == 0 -> Do VESA blank 2. Start the VESA blank timer if vesa_off_interval != 0 and vesa_power_mode != 0. It also gets rid of the limiting vesa_powerdown() function. Signed-off-by: Ville Syrjala Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton --- drivers/char/vt.c | 33 +++------------------------------ 1 files changed, 3 insertions(+), 30 deletions(-) diff -puN drivers/char/vt.c~fix-console-blanking drivers/char/vt.c --- devel/drivers/char/vt.c~fix-console-blanking 2005-11-08 15:41:25.000000000 -0800 +++ devel-akpm/drivers/char/vt.c 2005-11-08 15:41:25.000000000 -0800 @@ -2773,29 +2773,6 @@ static void set_vesa_blanking(char __use vesa_blank_mode = (mode < 4) ? mode : 0; } -/* - * This is called by a timer handler - */ -static void vesa_powerdown(void) -{ - struct vc_data *c = vc_cons[fg_console].d; - /* - * Power down if currently suspended (1 or 2), - * suspend if currently blanked (0), - * else do nothing (i.e. already powered down (3)). - * Called only if powerdown features are allowed. - */ - switch (vesa_blank_mode) { - case VESA_NO_BLANKING: - c->vc_sw->con_blank(c, VESA_VSYNC_SUSPEND+1, 0); - break; - case VESA_VSYNC_SUSPEND: - case VESA_HSYNC_SUSPEND: - c->vc_sw->con_blank(c, VESA_POWERDOWN+1, 0); - break; - } -} - void do_blank_screen(int entering_gfx) { struct vc_data *vc = vc_cons[fg_console].d; @@ -2806,8 +2783,7 @@ void do_blank_screen(int entering_gfx) if (console_blanked) { if (blank_state == blank_vesa_wait) { blank_state = blank_off; - vesa_powerdown(); - + vc->vc_sw->con_blank(vc, vesa_blank_mode + 1, 0); } return; } @@ -2837,7 +2813,7 @@ void do_blank_screen(int entering_gfx) save_screen(vc); /* In case we need to reset origin, blanking hook returns 1 */ - i = vc->vc_sw->con_blank(vc, 1, 0); + i = vc->vc_sw->con_blank(vc, vesa_off_interval ? 1 : (vesa_blank_mode + 1), 0); console_blanked = fg_console + 1; if (i) set_origin(vc); @@ -2845,13 +2821,10 @@ void do_blank_screen(int entering_gfx) if (console_blank_hook && console_blank_hook(1)) return; - if (vesa_off_interval) { + if (vesa_off_interval && vesa_blank_mode) { blank_state = blank_vesa_wait; mod_timer(&console_timer, jiffies + vesa_off_interval); } - - if (vesa_blank_mode) - vc->vc_sw->con_blank(vc, vesa_blank_mode + 1, 0); } EXPORT_SYMBOL(do_blank_screen); _