diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2005-09-09 16:04:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 16:57:58 -0400 |
commit | 7726e9e10fc6e026ed2dc00e48f4a3ffc1254ad2 (patch) | |
tree | b6595002e6e9e653e395a472e3f8f5ed4b6e04f8 /drivers/video/console/fbcon.c | |
parent | cb2e87a65d6cd735eb06fa595bf90497af28c37b (diff) |
[PATCH] fbdev: Add fbset -a support
Add capability to fbdev to listen to the FB_ACTIVATE_ALL flag. If set, it
notifies fbcon that all consoles must be set to the current var.
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/console/fbcon.c')
-rw-r--r-- | drivers/video/console/fbcon.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 35c88bd7ba5e..751890a5f5f3 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -2593,6 +2593,51 @@ static void fbcon_modechanged(struct fb_info *info) | |||
2593 | } | 2593 | } |
2594 | } | 2594 | } |
2595 | 2595 | ||
2596 | static void fbcon_set_all_vcs(struct fb_info *info) | ||
2597 | { | ||
2598 | struct fbcon_ops *ops = info->fbcon_par; | ||
2599 | struct vc_data *vc; | ||
2600 | struct display *p; | ||
2601 | int i, rows, cols; | ||
2602 | |||
2603 | if (!ops || ops->currcon < 0) | ||
2604 | return; | ||
2605 | |||
2606 | for (i = 0; i < MAX_NR_CONSOLES; i++) { | ||
2607 | vc = vc_cons[i].d; | ||
2608 | if (!vc || vc->vc_mode != KD_TEXT || | ||
2609 | registered_fb[con2fb_map[i]] != info) | ||
2610 | continue; | ||
2611 | |||
2612 | p = &fb_display[vc->vc_num]; | ||
2613 | |||
2614 | info->var.xoffset = info->var.yoffset = p->yscroll = 0; | ||
2615 | var_to_display(p, &info->var, info); | ||
2616 | cols = info->var.xres / vc->vc_font.width; | ||
2617 | rows = info->var.yres / vc->vc_font.height; | ||
2618 | vc_resize(vc, cols, rows); | ||
2619 | |||
2620 | if (CON_IS_VISIBLE(vc)) { | ||
2621 | updatescrollmode(p, info, vc); | ||
2622 | scrollback_max = 0; | ||
2623 | scrollback_current = 0; | ||
2624 | update_var(vc->vc_num, info); | ||
2625 | fbcon_set_palette(vc, color_table); | ||
2626 | update_screen(vc); | ||
2627 | if (softback_buf) { | ||
2628 | int l = fbcon_softback_size / vc->vc_size_row; | ||
2629 | if (l > 5) | ||
2630 | softback_end = softback_buf + l * vc->vc_size_row; | ||
2631 | else { | ||
2632 | /* Smaller scrollback makes no sense, and 0 | ||
2633 | would screw the operation totally */ | ||
2634 | softback_top = 0; | ||
2635 | } | ||
2636 | } | ||
2637 | } | ||
2638 | } | ||
2639 | } | ||
2640 | |||
2596 | static int fbcon_mode_deleted(struct fb_info *info, | 2641 | static int fbcon_mode_deleted(struct fb_info *info, |
2597 | struct fb_videomode *mode) | 2642 | struct fb_videomode *mode) |
2598 | { | 2643 | { |
@@ -2708,6 +2753,9 @@ static int fbcon_event_notify(struct notifier_block *self, | |||
2708 | case FB_EVENT_MODE_CHANGE: | 2753 | case FB_EVENT_MODE_CHANGE: |
2709 | fbcon_modechanged(info); | 2754 | fbcon_modechanged(info); |
2710 | break; | 2755 | break; |
2756 | case FB_EVENT_MODE_CHANGE_ALL: | ||
2757 | fbcon_set_all_vcs(info); | ||
2758 | break; | ||
2711 | case FB_EVENT_MODE_DELETE: | 2759 | case FB_EVENT_MODE_DELETE: |
2712 | mode = event->data; | 2760 | mode = event->data; |
2713 | ret = fbcon_mode_deleted(info, mode); | 2761 | ret = fbcon_mode_deleted(info, mode); |