summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScot Doyle <lkml14@scotdoyle.com>2015-03-26 09:54:39 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-10 13:15:52 -0400
commitbd63364caa8df38bad2b25b11b2a1b849475cce5 (patch)
tree738316f02af4692362da1d39f6a7917a60cc0dee
parentad909b3f8b162a61ce9e32726dadb380e51f8949 (diff)
vt: add cursor blink interval escape sequence
Add an escape sequence to specify the current console's cursor blink interval. The interval is specified as a number of milliseconds until the next cursor display state toggle, from 50 to 65535. /proc/loadavg did not show a difference with a one msec interval, but the lower bound is set to 50 msecs since slower hardware wasn't tested. Store the interval in the vc_data structure for later access by fbcon, initializing the value to fbcon's current hardcoded value of 200 msecs. Signed-off-by: Scot Doyle <lkml14@scotdoyle.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/vt/vt.c9
-rw-r--r--include/linux/console_struct.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 4a24eb2b0ede..b075489f314e 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -135,6 +135,7 @@ const struct consw *conswitchp;
135 */ 135 */
136#define DEFAULT_BELL_PITCH 750 136#define DEFAULT_BELL_PITCH 750
137#define DEFAULT_BELL_DURATION (HZ/8) 137#define DEFAULT_BELL_DURATION (HZ/8)
138#define DEFAULT_CURSOR_BLINK_MS 200
138 139
139struct vc vc_cons [MAX_NR_CONSOLES]; 140struct vc vc_cons [MAX_NR_CONSOLES];
140 141
@@ -1590,6 +1591,13 @@ static void setterm_command(struct vc_data *vc)
1590 case 15: /* activate the previous console */ 1591 case 15: /* activate the previous console */
1591 set_console(last_console); 1592 set_console(last_console);
1592 break; 1593 break;
1594 case 16: /* set cursor blink duration in msec */
1595 if (vc->vc_npar >= 1 && vc->vc_par[1] >= 50 &&
1596 vc->vc_par[1] <= USHRT_MAX)
1597 vc->vc_cur_blink_ms = vc->vc_par[1];
1598 else
1599 vc->vc_cur_blink_ms = DEFAULT_CURSOR_BLINK_MS;
1600 break;
1593 } 1601 }
1594} 1602}
1595 1603
@@ -1717,6 +1725,7 @@ static void reset_terminal(struct vc_data *vc, int do_clear)
1717 1725
1718 vc->vc_bell_pitch = DEFAULT_BELL_PITCH; 1726 vc->vc_bell_pitch = DEFAULT_BELL_PITCH;
1719 vc->vc_bell_duration = DEFAULT_BELL_DURATION; 1727 vc->vc_bell_duration = DEFAULT_BELL_DURATION;
1728 vc->vc_cur_blink_ms = DEFAULT_CURSOR_BLINK_MS;
1720 1729
1721 gotoxy(vc, 0, 0); 1730 gotoxy(vc, 0, 0);
1722 save_cur(vc); 1731 save_cur(vc);
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index e859c98d1767..e329ee2667e1 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -104,6 +104,7 @@ struct vc_data {
104 unsigned int vc_resize_user; /* resize request from user */ 104 unsigned int vc_resize_user; /* resize request from user */
105 unsigned int vc_bell_pitch; /* Console bell pitch */ 105 unsigned int vc_bell_pitch; /* Console bell pitch */
106 unsigned int vc_bell_duration; /* Console bell duration */ 106 unsigned int vc_bell_duration; /* Console bell duration */
107 unsigned short vc_cur_blink_ms; /* Cursor blink duration */
107 struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */ 108 struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */
108 struct uni_pagedir *vc_uni_pagedir; 109 struct uni_pagedir *vc_uni_pagedir;
109 struct uni_pagedir **vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */ 110 struct uni_pagedir **vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */