Permalink
Browse files

fbcon: add parameter to toggle bind on startup

  • Loading branch information...
1 parent 9457fa0 commit ef73228a317c4046b82ccea9048072848f57ae31 @pcercuei pcercuei committed with mthuurne Jan 12, 2012
Showing with 29 additions and 5 deletions.
  1. +11 −1 Documentation/fb/fbcon.txt
  2. +2 −1 drivers/tty/vt/vt.c
  3. +15 −3 drivers/video/console/fbcon.c
  4. +1 −0 include/linux/console.h
View
12 Documentation/fb/fbcon.txt
@@ -123,7 +123,7 @@ C. Boot options
is typically located on the same video card. Thus, the consoles that
are controlled by the VGA console will be garbled.
-4. fbcon=rotate:<n>
+5. fbcon=rotate:<n>
This option changes the orientation angle of the console display. The
value 'n' accepts the following:
@@ -148,6 +148,16 @@ C. Boot options
Actually, the underlying fb driver is totally ignorant of console
rotation.
+6. fbcon=bind:<01>
+
+ This option controls whether or not the console should be bound to the
+ terminal when the kernel starts. In any case, the framebuffer console
+ can be bound / unbound at any time through sysfs.
+
+ This parameter can be useful in some cases, for instance when the
+ bootloader or the video driver display a logo that should be shown
+ during the whole boot.
+
C. Attaching, Detaching and Unloading
Before going on on how to attach, detach and unload the framebuffer console, an
View
3 drivers/tty/vt/vt.c
@@ -3473,7 +3473,7 @@ int con_debug_leave(void)
}
EXPORT_SYMBOL_GPL(con_debug_leave);
-static int do_register_con_driver(const struct consw *csw, int first, int last)
+int do_register_con_driver(const struct consw *csw, int first, int last)
{
struct module *owner = csw->owner;
struct con_driver *con_driver;
@@ -3540,6 +3540,7 @@ static int do_register_con_driver(const struct consw *csw, int first, int last)
module_put(owner);
return retval;
}
+EXPORT_SYMBOL_GPL(do_register_con_driver);
/**
View
18 drivers/video/console/fbcon.c
@@ -114,6 +114,7 @@ static int fbcon_is_default = 1;
static int fbcon_has_exited;
static int primary_device = -1;
static int fbcon_has_console_bind;
+static unsigned int bind_on_startup = 1;
#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY
static int map_override;
@@ -539,6 +540,14 @@ static int __init fb_console_setup(char *this_opt)
}
continue;
}
+
+ if (!strncmp(options, "bind:", 5)) {
+ options += 5;
+ ret = kstrtouint(options, 0, &bind_on_startup);
+ if (ret)
+ printk(KERN_WARNING "fbcon: bind: incorrect value.\n");
+ continue;
+ }
}
return 1;
}
@@ -581,15 +590,18 @@ static int do_fbcon_takeover(int show_logo)
for (i = first_fb_vc; i <= last_fb_vc; i++)
con2fb_map[i] = info_idx;
- err = do_take_over_console(&fb_con, first_fb_vc, last_fb_vc,
- fbcon_is_default);
+ if (bind_on_startup)
+ err = do_take_over_console(&fb_con, first_fb_vc, last_fb_vc,
+ fbcon_is_default);
+ else
+ err = do_register_con_driver(&fb_con, first_fb_vc, last_fb_vc);
if (err) {
for (i = first_fb_vc; i <= last_fb_vc; i++)
con2fb_map[i] = -1;
info_idx = -1;
} else {
- fbcon_has_console_bind = 1;
+ fbcon_has_console_bind = bind_on_startup;
}
return err;
View
1 include/linux/console.h
@@ -75,6 +75,7 @@ extern const struct consw newport_con; /* SGI Newport console */
extern const struct consw prom_con; /* SPARC PROM console */
int con_is_bound(const struct consw *csw);
+int do_register_con_driver(const struct consw *csw, int first, int last);
int do_unregister_con_driver(const struct consw *csw);
int do_take_over_console(const struct consw *sw, int first, int last, int deflt);
void give_up_console(const struct consw *sw);

0 comments on commit ef73228

Please sign in to comment.