aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/console/fbcon.c48
-rw-r--r--drivers/video/fbmem.c6
-rw-r--r--include/linux/fb.h3
3 files changed, 55 insertions, 2 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
2596static 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
2596static int fbcon_mode_deleted(struct fb_info *info, 2641static 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);
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 4ff853fbe0be..a8eee79e117d 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -684,11 +684,13 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
684 684
685 if (!err && (flags & FBINFO_MISC_USEREVENT)) { 685 if (!err && (flags & FBINFO_MISC_USEREVENT)) {
686 struct fb_event event; 686 struct fb_event event;
687 int evnt = (var->activate & FB_ACTIVATE_ALL) ?
688 FB_EVENT_MODE_CHANGE_ALL :
689 FB_EVENT_MODE_CHANGE;
687 690
688 info->flags &= ~FBINFO_MISC_USEREVENT; 691 info->flags &= ~FBINFO_MISC_USEREVENT;
689 event.info = info; 692 event.info = info;
690 notifier_call_chain(&fb_notifier_list, 693 notifier_call_chain(&fb_notifier_list, evnt,
691 FB_EVENT_MODE_CHANGE,
692 &event); 694 &event);
693 } 695 }
694 } 696 }
diff --git a/include/linux/fb.h b/include/linux/fb.h
index bc24beeed971..70da819df0f5 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -495,6 +495,9 @@ struct fb_cursor_user {
495#define FB_EVENT_BLANK 0x08 495#define FB_EVENT_BLANK 0x08
496/* Private modelist is to be replaced */ 496/* Private modelist is to be replaced */
497#define FB_EVENT_NEW_MODELIST 0x09 497#define FB_EVENT_NEW_MODELIST 0x09
498/* The resolution of the passed in fb_info about to change and
499 all vc's should be changed */
500#define FB_EVENT_MODE_CHANGE_ALL 0x0A
498 501
499struct fb_event { 502struct fb_event {
500 struct fb_info *info; 503 struct fb_info *info;