diff options
author | Daniel Mack <daniel@caiaq.de> | 2009-06-16 18:33:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-16 22:47:52 -0400 |
commit | f324edc85e5c1137e49e3b36a58cf436ab5b1fb3 (patch) | |
tree | fa9aa0d219c10e5db6e459c4ea64884135e93c03 | |
parent | 4764e280dc7dde1534161e148d38dbd792a2b8ab (diff) |
console: make blank timeout value a boot option
The console blank timer is currently hardcoded to 10*60 seconds which
might be annoying on systems with no input devices attached to wake up the
console again. Especially during development, disabling the screen saver
can be handy - for example when debugging the root fs mount mechanism or
other scenarios where no userspace program could be started to do that at
runtime from userspace.
This patch defines a core_param for the variable in charge which allows
users to entirely disable the blank feature at boot time by setting it 0.
The value can still be overwritten at runtime using the standard ioctl
call - this just allows to conditionally change the default.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | Documentation/kernel-parameters.txt | 4 | ||||
-rw-r--r-- | drivers/char/vt.c | 13 |
2 files changed, 11 insertions, 6 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index ad3800630772..5578248c18a4 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -546,6 +546,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
546 | console=brl,ttyS0 | 546 | console=brl,ttyS0 |
547 | For now, only VisioBraille is supported. | 547 | For now, only VisioBraille is supported. |
548 | 548 | ||
549 | consoleblank= [KNL] The console blank (screen saver) timeout in | ||
550 | seconds. Defaults to 10*60 = 10mins. A value of 0 | ||
551 | disables the blank timer. | ||
552 | |||
549 | coredump_filter= | 553 | coredump_filter= |
550 | [KNL] Change the default value for | 554 | [KNL] Change the default value for |
551 | /proc/<pid>/coredump_filter. | 555 | /proc/<pid>/coredump_filter. |
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index c796a86ab7f3..d9113b4c76e3 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -171,8 +171,9 @@ int do_poke_blanked_console; | |||
171 | int console_blanked; | 171 | int console_blanked; |
172 | 172 | ||
173 | static int vesa_blank_mode; /* 0:none 1:suspendV 2:suspendH 3:powerdown */ | 173 | static int vesa_blank_mode; /* 0:none 1:suspendV 2:suspendH 3:powerdown */ |
174 | static int blankinterval = 10*60*HZ; | ||
175 | static int vesa_off_interval; | 174 | static int vesa_off_interval; |
175 | static int blankinterval = 10*60; | ||
176 | core_param(consoleblank, blankinterval, int, 0444); | ||
176 | 177 | ||
177 | static DECLARE_WORK(console_work, console_callback); | 178 | static DECLARE_WORK(console_work, console_callback); |
178 | 179 | ||
@@ -1485,7 +1486,7 @@ static void setterm_command(struct vc_data *vc) | |||
1485 | update_attr(vc); | 1486 | update_attr(vc); |
1486 | break; | 1487 | break; |
1487 | case 9: /* set blanking interval */ | 1488 | case 9: /* set blanking interval */ |
1488 | blankinterval = ((vc->vc_par[1] < 60) ? vc->vc_par[1] : 60) * 60 * HZ; | 1489 | blankinterval = ((vc->vc_par[1] < 60) ? vc->vc_par[1] : 60) * 60; |
1489 | poke_blanked_console(); | 1490 | poke_blanked_console(); |
1490 | break; | 1491 | break; |
1491 | case 10: /* set bell frequency in Hz */ | 1492 | case 10: /* set bell frequency in Hz */ |
@@ -2871,7 +2872,7 @@ static int __init con_init(void) | |||
2871 | 2872 | ||
2872 | if (blankinterval) { | 2873 | if (blankinterval) { |
2873 | blank_state = blank_normal_wait; | 2874 | blank_state = blank_normal_wait; |
2874 | mod_timer(&console_timer, jiffies + blankinterval); | 2875 | mod_timer(&console_timer, jiffies + (blankinterval * HZ)); |
2875 | } | 2876 | } |
2876 | 2877 | ||
2877 | for (currcons = 0; currcons < MIN_NR_CONSOLES; currcons++) { | 2878 | for (currcons = 0; currcons < MIN_NR_CONSOLES; currcons++) { |
@@ -3677,7 +3678,7 @@ void do_unblank_screen(int leaving_gfx) | |||
3677 | return; /* but leave console_blanked != 0 */ | 3678 | return; /* but leave console_blanked != 0 */ |
3678 | 3679 | ||
3679 | if (blankinterval) { | 3680 | if (blankinterval) { |
3680 | mod_timer(&console_timer, jiffies + blankinterval); | 3681 | mod_timer(&console_timer, jiffies + (blankinterval * HZ)); |
3681 | blank_state = blank_normal_wait; | 3682 | blank_state = blank_normal_wait; |
3682 | } | 3683 | } |
3683 | 3684 | ||
@@ -3711,7 +3712,7 @@ void unblank_screen(void) | |||
3711 | static void blank_screen_t(unsigned long dummy) | 3712 | static void blank_screen_t(unsigned long dummy) |
3712 | { | 3713 | { |
3713 | if (unlikely(!keventd_up())) { | 3714 | if (unlikely(!keventd_up())) { |
3714 | mod_timer(&console_timer, jiffies + blankinterval); | 3715 | mod_timer(&console_timer, jiffies + (blankinterval * HZ)); |
3715 | return; | 3716 | return; |
3716 | } | 3717 | } |
3717 | blank_timer_expired = 1; | 3718 | blank_timer_expired = 1; |
@@ -3741,7 +3742,7 @@ void poke_blanked_console(void) | |||
3741 | if (console_blanked) | 3742 | if (console_blanked) |
3742 | unblank_screen(); | 3743 | unblank_screen(); |
3743 | else if (blankinterval) { | 3744 | else if (blankinterval) { |
3744 | mod_timer(&console_timer, jiffies + blankinterval); | 3745 | mod_timer(&console_timer, jiffies + (blankinterval * HZ)); |
3745 | blank_state = blank_normal_wait; | 3746 | blank_state = blank_normal_wait; |
3746 | } | 3747 | } |
3747 | } | 3748 | } |