diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2007-07-17 04:05:32 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-17 10:23:11 -0700 |
commit | afd1db1632c3f8f95cbc2786bfa122cead79db58 (patch) | |
tree | 6708d77c3c790f32bd8d647f878a639d93b58dcc /drivers/video/console/fbcon.c | |
parent | d1baa4ffa677bf6986c460fcfd4cdaf8bfe66f0e (diff) |
fbcon: Revise primary device selection
Use set_con2fb_map() to select the primary display driver instead of using
unbind_con_driver() and bind_con_driver(). Using the former is much simpler
and safer than the current one.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/console/fbcon.c')
-rw-r--r-- | drivers/video/console/fbcon.c | 49 |
1 files changed, 13 insertions, 36 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 13b67ee8b3c0..9b66331020dd 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -3041,52 +3041,32 @@ static int fbcon_fb_unregistered(struct fb_info *info) } #ifdef CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY -static int fbcon_select_primary(struct fb_info *info) +static void fbcon_select_primary(struct fb_info *info) { - int ret = 0; - if (!map_override && primary_device == -1 && fb_is_primary_device(info)) { - int i, err; + int i; - printk(KERN_INFO "fbcon: %s is primary device\n", - info->fix.id); + printk(KERN_INFO "fbcon: %s (fb%i) is primary device\n", + info->fix.id, info->node); primary_device = info->node; - if (!con_is_bound(&fb_con)) - goto done; - - printk(KERN_INFO "fbcon: Unbinding old driver\n"); - unbind_con_driver(&fb_con, first_fb_vc, last_fb_vc, - fbcon_is_default); - info_idx = primary_device; - - for (i = first_fb_vc; i <= last_fb_vc; i++) { + for (i = first_fb_vc; i <= last_fb_vc; i++) con2fb_map_boot[i] = primary_device; - con2fb_map[i] = primary_device; - } - - printk(KERN_INFO "fbcon: Selecting new driver\n"); - err = bind_con_driver(&fb_con, first_fb_vc, last_fb_vc, - fbcon_is_default); - - if (err) { - for (i = first_fb_vc; i <= last_fb_vc; i++) - con2fb_map[i] = -1; - info_idx = -1; + if (con_is_bound(&fb_con)) { + printk(KERN_INFO "fbcon: Remapping primary device, " + "fb%i, to tty %i-%i\n", info->node, + first_fb_vc + 1, last_fb_vc + 1); + info_idx = primary_device; } - - ret = 1; } -done: - return ret; } #else -static inline int fbcon_select_primary(struct fb_info *info) +static inline void fbcon_select_primary(struct fb_info *info) { - return 0; + return; } #endif /* CONFIG_FRAMEBUFFER_DETECT_PRIMARY */ @@ -3094,9 +3074,7 @@ static int fbcon_fb_registered(struct fb_info *info) { int ret = 0, i, idx = info->node; - if (fbcon_select_primary(info)) - goto done; - + fbcon_select_primary(info); if (info_idx == -1) { for (i = first_fb_vc; i <= last_fb_vc; i++) { @@ -3115,7 +3093,6 @@ static int fbcon_fb_registered(struct fb_info *info) } } -done: return ret; } |