linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tonnerre Anklin <thunder@keepsake.ch>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [FBDEV] Console switch/resolution change fix
Date: Fri, 28 Nov 2003 02:36:54 +0100	[thread overview]
Message-ID: <20031128013654.GB1635@dbintra.dmz.lightweight.ods.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 4530 bytes --]

Salut,

The VT is  not resized by the framebuffer driver.   However, as we set
the framebuffer resolution  on VT switch based on the  VT size, we end
up  having  always  the same  VT  size.  This  patch  adds a  call  to
vt_resize()  to   the  state  change   manager  and  updates   the  VT
layer.  Thus, if  we  resize the  framebuffer,  the VT  is resized  as
well. This fixes the resolution changeback bug.

It also  fixes a wrong name  in the Makefile and  makes some printk()s
more informative.

This patch relies on the Framebuffer patch by James Simmons.

More on this patch can be found at
<URL:http://keepsake.keepsake.ch/~thunder/noyau/2.6.0-test11-ta1/fbcon_resolution_change.xml>

				Thunder

diff -Nur linux-2.6.0-test11-fbdev/drivers/video/console/fbcon.c linux-2.6.0-test11-ta1/drivers/video/console/fbcon.c
--- linux-2.6.0-test11-fbdev/drivers/video/console/fbcon.c	2003-11-27 23:29:57.000000000 +0100
+++ linux-2.6.0-test11-ta1/drivers/video/console/fbcon.c	2003-11-27 17:59:01.000000000 +0100
@@ -962,7 +962,7 @@
 		int s_pitch = (vc->vc_font.width + 7) >> 3;
 		int size = s_pitch * vc->vc_font.height;
 		struct fb_cursor cursor;
-		int cur_height, c, i;
+		int cur_height = 0, c, i;
 		u8 *dst;
 		
 		memset(&cursor, 0, sizeof(struct fb_cursor));
@@ -1620,7 +1620,8 @@
 	}
 	if (info)
 		info->var.yoffset = p->yscroll = 0;
-        fbcon_resize(vc, vc->vc_cols, vc->vc_rows);
+
+	fbcon_resize(vc, vc->vc_cols, vc->vc_rows);
 	switch (p->scrollmode & __SCROLL_YMASK) {
 	case __SCROLL_YWRAP:
 		scrollback_phys_max = p->vrows - vc->vc_rows;
@@ -2260,10 +2261,24 @@
 		case RESOLUTION_CHANGE:	{
 			// Switch resolution size
 			int rows, cols;
-			
-			rows = info->var.xres / vc->vc_font.height;
-			cols = info->var.yres / vc->vc_font.width;
-        		fbcon_resize(vc, cols, rows);
+
+			rows = info->var.yres / vc->vc_font.height;
+			cols = info->var.xres / vc->vc_font.width;
+			if (info->var.activate & FB_ACTIVATE_ALL) {
+				int i;
+
+				for (i = 0; i < MAX_NR_CONSOLES; i++)
+					if (vc_cons_allocated(i)) {
+						vc_resize(i, cols, rows);
+						vc_cons[i].d->vc_rows = rows;
+						vc_cons[i].d->vc_cols = cols;
+					}
+			} else {
+				vc_resize(fg_console, cols, rows);
+				vc_cons[fg_console].d->vc_rows = rows;
+				vc_cons[fg_console].d->vc_cols = cols;
+			}
+			fbcon_resize(vc, cols, rows);
 			info->state |= flag;
 			}
 			break;
diff -Nur linux-2.6.0-test11-fbdev/drivers/video/Makefile linux-2.6.0-test11-ta1/drivers/video/Makefile
--- linux-2.6.0-test11-fbdev/drivers/video/Makefile	2003-11-27 23:29:57.000000000 +0100
+++ linux-2.6.0-test11-ta1/drivers/video/Makefile	2003-11-27 17:59:01.000000000 +0100
@@ -32,7 +32,7 @@
 obj-$(CONFIG_FB_CYBER)            += cyberfb.o
 obj-$(CONFIG_FB_CYBER2000)        += cyber2000fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_SGIVW)            += sgivwfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
-obj-$(CONFIG_FB_3DFX)             += tdfxfb.o cfbimgblit.o
+obj-$(CONFIG_FB_3DFX)             += tdfxfb.o cfbimgblt.o
 obj-$(CONFIG_FB_MAC)              += macfb.o macmodes.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o 
 obj-$(CONFIG_FB_HP300)            += hpfb.o cfbfillrect.o cfbimgblt.o
 obj-$(CONFIG_FB_OF)               += offb.o cfbfillrect.o cfbimgblt.o cfbcopyarea.o
diff -Nur linux-2.6.0-test11-fbdev/drivers/video/riva/fbdev.c linux-2.6.0-test11-ta1/drivers/video/riva/fbdev.c
--- linux-2.6.0-test11-fbdev/drivers/video/riva/fbdev.c	2003-11-27 23:29:58.000000000 +0100
+++ linux-2.6.0-test11-ta1/drivers/video/riva/fbdev.c	2003-11-28 02:35:03.000000000 +0100
@@ -957,13 +957,13 @@
 	
 	if (var->xres_virtual < var->xres) {
 		printk(KERN_ERR PFX
-		       "virtual X resolution (%d) is smaller than real\n", var->xres_virtual);
+		       "virtual X resolution (%d) is smaller than real (%d)\n", var->xres_virtual, var->xres);
 		return -EINVAL;
 	}
 
 	if (var->yres_virtual < var->yres) {
 		printk(KERN_ERR PFX
-		       "virtual Y resolution (%d) is smaller than real\n", var->yres_virtual);
+		       "virtual Y resolution (%d) is smaller than real (%d)\n", var->yres_virtual, var->yres);
 		return -EINVAL;
 	}
 	return 0;
@@ -1161,7 +1161,7 @@
 
 	riva_load_video_mode(info);
 	riva_setup_accel(par);
-	
+
 	info->fix.line_length = (info->var.xres_virtual * (info->var.bits_per_pixel >> 3));
 	info->fix.visual = (info->var.bits_per_pixel == 8) ?
 				FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR;

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

                 reply	other threads:[~2003-11-28  2:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031128013654.GB1635@dbintra.dmz.lightweight.ods.org \
    --to=thunder@keepsake.ch \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).