<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: "Antonino A. Daplas" &lt;adaplas@gmail.com&gt;

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 &lt;adaplas@pol.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 drivers/video/console/fbcon.c |   48 ++++++++++++++++++++++++++++++++++++++++++
 drivers/video/fbmem.c         |    6 +++--
 include/linux/fb.h            |    3 ++
 3 files changed, 55 insertions(+), 2 deletions(-)

diff -puN drivers/video/console/fbcon.c~fbdev-add-fbset-a-support drivers/video/console/fbcon.c
--- devel/drivers/video/console/fbcon.c~fbdev-add-fbset-a-support	2005-08-21 23:49:48.000000000 -0700
+++ devel-akpm/drivers/video/console/fbcon.c	2005-08-21 23:49:48.000000000 -0700
@@ -2593,6 +2593,51 @@ static void fbcon_modechanged(struct fb_
 	}
 }
 
+static void fbcon_set_all_vcs(struct fb_info *info)
+{
+	struct fbcon_ops *ops = info-&gt;fbcon_par;
+	struct vc_data *vc;
+	struct display *p;
+	int i, rows, cols;
+
+	if (!ops || ops-&gt;currcon &lt; 0)
+		return;
+
+	for (i = 0; i &lt; MAX_NR_CONSOLES; i++) {
+		vc = vc_cons[i].d;
+		if (!vc || vc-&gt;vc_mode != KD_TEXT ||
+		    registered_fb[con2fb_map[i]] != info)
+			continue;
+
+		p = &amp;fb_display[vc-&gt;vc_num];
+
+		info-&gt;var.xoffset = info-&gt;var.yoffset = p-&gt;yscroll = 0;
+		var_to_display(p, &amp;info-&gt;var, info);
+		cols = info-&gt;var.xres / vc-&gt;vc_font.width;
+		rows = info-&gt;var.yres / vc-&gt;vc_font.height;
+		vc_resize(vc, cols, rows);
+
+		if (CON_IS_VISIBLE(vc)) {
+			updatescrollmode(p, info, vc);
+			scrollback_max = 0;
+			scrollback_current = 0;
+			update_var(vc-&gt;vc_num, info);
+			fbcon_set_palette(vc, color_table);
+			update_screen(vc);
+			if (softback_buf) {
+				int l = fbcon_softback_size / vc-&gt;vc_size_row;
+				if (l &gt; 5)
+					softback_end = softback_buf + l * vc-&gt;vc_size_row;
+				else {
+					/* Smaller scrollback makes no sense, and 0
+					   would screw the operation totally */
+					softback_top = 0;
+				}
+			}
+		}
+	}
+}
+
 static int fbcon_mode_deleted(struct fb_info *info,
 			      struct fb_videomode *mode)
 {
@@ -2708,6 +2753,9 @@ static int fbcon_event_notify(struct not
 	case FB_EVENT_MODE_CHANGE:
 		fbcon_modechanged(info);
 		break;
+	case FB_EVENT_MODE_CHANGE_ALL:
+		fbcon_set_all_vcs(info);
+		break;
 	case FB_EVENT_MODE_DELETE:
 		mode = event-&gt;data;
 		ret = fbcon_mode_deleted(info, mode);
diff -puN drivers/video/fbmem.c~fbdev-add-fbset-a-support drivers/video/fbmem.c
--- devel/drivers/video/fbmem.c~fbdev-add-fbset-a-support	2005-08-21 23:49:48.000000000 -0700
+++ devel-akpm/drivers/video/fbmem.c	2005-08-21 23:49:48.000000000 -0700
@@ -684,11 +684,13 @@ fb_set_var(struct fb_info *info, struct 
 
 			if (!err &amp;&amp; (flags &amp; FBINFO_MISC_USEREVENT)) {
 				struct fb_event event;
+				int evnt = (var-&gt;activate &amp; FB_ACTIVATE_ALL) ?
+					FB_EVENT_MODE_CHANGE_ALL :
+					FB_EVENT_MODE_CHANGE;
 
 				info-&gt;flags &amp;= ~FBINFO_MISC_USEREVENT;
 				event.info = info;
-				notifier_call_chain(&amp;fb_notifier_list,
-						    FB_EVENT_MODE_CHANGE,
+				notifier_call_chain(&amp;fb_notifier_list, evnt,
 						    &amp;event);
 			}
 		}
diff -puN include/linux/fb.h~fbdev-add-fbset-a-support include/linux/fb.h
--- devel/include/linux/fb.h~fbdev-add-fbset-a-support	2005-08-21 23:49:48.000000000 -0700
+++ devel-akpm/include/linux/fb.h	2005-08-21 23:49:48.000000000 -0700
@@ -495,6 +495,9 @@ struct fb_cursor_user {
 #define FB_EVENT_BLANK                  0x08
 /*      Private modelist is to be replaced */
 #define FB_EVENT_NEW_MODELIST           0x09
+/*	The resolution of the passed in fb_info about to change and
+        all vc's should be changed         */
+#define FB_EVENT_MODE_CHANGE_ALL	0x0A
 
 struct fb_event {
 	struct fb_info *info;
_
</pre></body></html>