All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vt: add init_hide parameter to suppress boot output
@ 2013-02-19  9:38 Kirill A. Shutemov
  2013-02-19 10:14 ` Pavel Machek
  2013-02-19 12:31 ` Jiri Slaby
  0 siblings, 2 replies; 3+ messages in thread
From: Kirill A. Shutemov @ 2013-02-19  9:38 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby
  Cc: Pavel Machek, Rafael J. Wysocki, Len Brown, linux-kernel,
	linux-pm, Andy Ross, Kirill A. Shutemov

From: Andy Ross <andy.ross@windriver.com>

When vt.init_hide=1 is set, suppress output on newly created consoles
until an affirmative switched to that console.  This prevents boot
output from displaying (and clobbering splash screens, etc...) without
disabling the console entirely.

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
 drivers/tty/vt/vt.c            |    7 +++++++
 include/linux/console_struct.h |    3 ++-
 include/linux/vt.h             |    2 ++
 kernel/power/console.c         |    2 --
 4 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 8fd8968..3966ff5 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -165,6 +165,9 @@ module_param(global_cursor_default, int, S_IRUGO | S_IWUSR);
 static int cur_default = CUR_DEFAULT;
 module_param(cur_default, int, S_IRUGO | S_IWUSR);
 
+static int init_hide;
+module_param(init_hide, int, S_IRUGO);
+
 /*
  * ignore_poke: don't unblank the screen when things are typed.  This is
  * mainly for the privacy of braille terminal users.
@@ -734,6 +737,7 @@ static void visual_init(struct vc_data *vc, int num, int init)
 	__module_get(vc->vc_sw->owner);
 	vc->vc_num = num;
 	vc->vc_display_fg = &master_display_fg;
+	vc->vc_hidden = init_hide;
 	vc->vc_uni_pagedir_loc = &vc->vc_uni_pagedir;
 	vc->vc_uni_pagedir = 0;
 	vc->vc_hi_font_mask = 0;
@@ -2336,6 +2340,9 @@ static void console_callback(struct work_struct *ignored)
 	if (want_console >= 0) {
 		if (want_console != fg_console &&
 		    vc_cons_allocated(want_console)) {
+			if(want_console != SUSPEND_CONSOLE &&
+			   fg_console != SUSPEND_CONSOLE)
+				vc_cons[want_console].d->vc_hidden = 0;
 			hide_cursor(vc_cons[fg_console].d);
 			change_console(vc_cons[want_console].d);
 			/* we only changed when the console had already
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index 7f0c329..817db0e 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -91,6 +91,7 @@ struct vc_data {
 	unsigned int	vc_can_do_color	: 1;
 	unsigned int	vc_report_mouse : 2;
 	unsigned char	vc_utf		: 1;	/* Unicode UTF-8 encoding */
+	unsigned int    vc_hidden	: 1;    /* Set by vt.init_hide=1 */
 	unsigned char	vc_utf_count;
 		 int	vc_utf_char;
 	unsigned int	vc_tab_stop[8];		/* Tab stops. 256 columns. */
@@ -134,6 +135,6 @@ extern void vc_SAK(struct work_struct *work);
 
 #define CUR_DEFAULT CUR_UNDERLINE
 
-#define CON_IS_VISIBLE(conp) (*conp->vc_display_fg == conp)
+#define CON_IS_VISIBLE(conp) (*conp->vc_display_fg == conp && !conp->vc_hidden)
 
 #endif /* _LINUX_CONSOLE_STRUCT_H */
diff --git a/include/linux/vt.h b/include/linux/vt.h
index b186e04..0dc3e89 100644
--- a/include/linux/vt.h
+++ b/include/linux/vt.h
@@ -11,6 +11,8 @@
 #define VT_UPDATE		0x0004 /* A bigger update occurred */
 #define VT_PREWRITE		0x0005 /* A char is about to be written to the console */
 
+#define SUSPEND_CONSOLE	(MAX_NR_CONSOLES-1)
+
 #ifdef CONFIG_VT_CONSOLE
 
 extern int vt_kmsg_redirect(int new);
diff --git a/kernel/power/console.c b/kernel/power/console.c
index b1dc456..b74bdb8 100644
--- a/kernel/power/console.c
+++ b/kernel/power/console.c
@@ -10,8 +10,6 @@
 #include <linux/module.h>
 #include "power.h"
 
-#define SUSPEND_CONSOLE	(MAX_NR_CONSOLES-1)
-
 static int orig_fgconsole, orig_kmsg;
 
 int pm_prepare_console(void)
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] vt: add init_hide parameter to suppress boot output
  2013-02-19  9:38 [PATCH] vt: add init_hide parameter to suppress boot output Kirill A. Shutemov
@ 2013-02-19 10:14 ` Pavel Machek
  2013-02-19 12:31 ` Jiri Slaby
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2013-02-19 10:14 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Greg Kroah-Hartman, Jiri Slaby, Rafael J. Wysocki, Len Brown,
	linux-kernel, linux-pm, Andy Ross

Hi!

> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c
> @@ -165,6 +165,9 @@ module_param(global_cursor_default, int, S_IRUGO | S_IWUSR);
>  static int cur_default = CUR_DEFAULT;
>  module_param(cur_default, int, S_IRUGO | S_IWUSR);
>  
> +static int init_hide;
> +module_param(init_hide, int, S_IRUGO);
> +
>  /*
>   * ignore_poke: don't unblank the screen when things are typed.  This is
>   * mainly for the privacy of braille terminal users.
> @@ -734,6 +737,7 @@ static void visual_init(struct vc_data *vc, int num, int init)
>  	__module_get(vc->vc_sw->owner);
>  	vc->vc_num = num;
>  	vc->vc_display_fg = &master_display_fg;
> +	vc->vc_hidden = init_hide;
>  	vc->vc_uni_pagedir_loc = &vc->vc_uni_pagedir;
>  	vc->vc_uni_pagedir = 0;
>  	vc->vc_hi_font_mask = 0;
> @@ -2336,6 +2340,9 @@ static void console_callback(struct work_struct *ignored)
>  	if (want_console >= 0) {
>  		if (want_console != fg_console &&
>  		    vc_cons_allocated(want_console)) {
> +			if(want_console != SUSPEND_CONSOLE &&

"if (", please.

Otherwise looks ok.
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] vt: add init_hide parameter to suppress boot output
  2013-02-19  9:38 [PATCH] vt: add init_hide parameter to suppress boot output Kirill A. Shutemov
  2013-02-19 10:14 ` Pavel Machek
@ 2013-02-19 12:31 ` Jiri Slaby
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2013-02-19 12:31 UTC (permalink / raw)
  To: Kirill A. Shutemov, Greg Kroah-Hartman, Jiri Slaby
  Cc: Pavel Machek, Rafael J. Wysocki, Len Brown, linux-kernel,
	linux-pm, Andy Ross

On 02/19/2013 10:38 AM, Kirill A. Shutemov wrote:
> From: Andy Ross <andy.ross@windriver.com>
> 
> When vt.init_hide=1 is set, suppress output on newly created consoles
> until an affirmative switched to that console.  This prevents boot
> output from displaying (and clobbering splash screens, etc...) without
> disabling the console entirely.
> 
> Signed-off-by: Andy Ross <andy.ross@windriver.com>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> ---
>  drivers/tty/vt/vt.c            |    7 +++++++
>  include/linux/console_struct.h |    3 ++-
>  include/linux/vt.h             |    2 ++
>  kernel/power/console.c         |    2 --
>  4 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> index 8fd8968..3966ff5 100644
> --- a/drivers/tty/vt/vt.c
> +++ b/drivers/tty/vt/vt.c
> @@ -165,6 +165,9 @@ module_param(global_cursor_default, int, S_IRUGO | S_IWUSR);
>  static int cur_default = CUR_DEFAULT;
>  module_param(cur_default, int, S_IRUGO | S_IWUSR);
>  
> +static int init_hide;
> +module_param(init_hide, int, S_IRUGO);

So this should actually be a bool, right? Could you change that
appropriately?

thanks,
-- 
js
suse labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-19 12:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-19  9:38 [PATCH] vt: add init_hide parameter to suppress boot output Kirill A. Shutemov
2013-02-19 10:14 ` Pavel Machek
2013-02-19 12:31 ` Jiri Slaby

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.