aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVille Syrjala <syrjala@sci.fi>2006-01-09 23:53:49 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 11:01:52 -0500
commitd060a3218f6a046509fa31939ce1a671b0359086 (patch)
tree376c5c5909302595e8b56cb6617c4a0246bccc0f /drivers
parentcae8a12f49972f040bae6707b7707cd93fe9c9ab (diff)
[PATCH] Fix console blanking
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 <syrjala@sci.fi> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/vt.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index e91268e86833..f1d9cb7feae6 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2758,29 +2758,6 @@ static void set_vesa_blanking(char __user *p)
2758 vesa_blank_mode = (mode < 4) ? mode : 0; 2758 vesa_blank_mode = (mode < 4) ? mode : 0;
2759} 2759}
2760 2760
2761/*
2762 * This is called by a timer handler
2763 */
2764static void vesa_powerdown(void)
2765{
2766 struct vc_data *c = vc_cons[fg_console].d;
2767 /*
2768 * Power down if currently suspended (1 or 2),
2769 * suspend if currently blanked (0),
2770 * else do nothing (i.e. already powered down (3)).
2771 * Called only if powerdown features are allowed.
2772 */
2773 switch (vesa_blank_mode) {
2774 case VESA_NO_BLANKING:
2775 c->vc_sw->con_blank(c, VESA_VSYNC_SUSPEND+1, 0);
2776 break;
2777 case VESA_VSYNC_SUSPEND:
2778 case VESA_HSYNC_SUSPEND:
2779 c->vc_sw->con_blank(c, VESA_POWERDOWN+1, 0);
2780 break;
2781 }
2782}
2783
2784void do_blank_screen(int entering_gfx) 2761void do_blank_screen(int entering_gfx)
2785{ 2762{
2786 struct vc_data *vc = vc_cons[fg_console].d; 2763 struct vc_data *vc = vc_cons[fg_console].d;
@@ -2791,8 +2768,7 @@ void do_blank_screen(int entering_gfx)
2791 if (console_blanked) { 2768 if (console_blanked) {
2792 if (blank_state == blank_vesa_wait) { 2769 if (blank_state == blank_vesa_wait) {
2793 blank_state = blank_off; 2770 blank_state = blank_off;
2794 vesa_powerdown(); 2771 vc->vc_sw->con_blank(vc, vesa_blank_mode + 1, 0);
2795
2796 } 2772 }
2797 return; 2773 return;
2798 } 2774 }
@@ -2822,7 +2798,7 @@ void do_blank_screen(int entering_gfx)
2822 2798
2823 save_screen(vc); 2799 save_screen(vc);
2824 /* In case we need to reset origin, blanking hook returns 1 */ 2800 /* In case we need to reset origin, blanking hook returns 1 */
2825 i = vc->vc_sw->con_blank(vc, 1, 0); 2801 i = vc->vc_sw->con_blank(vc, vesa_off_interval ? 1 : (vesa_blank_mode + 1), 0);
2826 console_blanked = fg_console + 1; 2802 console_blanked = fg_console + 1;
2827 if (i) 2803 if (i)
2828 set_origin(vc); 2804 set_origin(vc);
@@ -2830,13 +2806,10 @@ void do_blank_screen(int entering_gfx)
2830 if (console_blank_hook && console_blank_hook(1)) 2806 if (console_blank_hook && console_blank_hook(1))
2831 return; 2807 return;
2832 2808
2833 if (vesa_off_interval) { 2809 if (vesa_off_interval && vesa_blank_mode) {
2834 blank_state = blank_vesa_wait; 2810 blank_state = blank_vesa_wait;
2835 mod_timer(&console_timer, jiffies + vesa_off_interval); 2811 mod_timer(&console_timer, jiffies + vesa_off_interval);
2836 } 2812 }
2837
2838 if (vesa_blank_mode)
2839 vc->vc_sw->con_blank(vc, vesa_blank_mode + 1, 0);
2840} 2813}
2841EXPORT_SYMBOL(do_blank_screen); 2814EXPORT_SYMBOL(do_blank_screen);
2842 2815