linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Winischhofer <thomas@winischhofer.net>
To: Antonino Daplas <adaplas@pol.net>
Cc: James Simmons <jsimmons@infradead.org>,
	Sven Luther <luther@dpt-info.u-strasbg.fr>,
	Linux Fbdev development list
	<linux-fbdev-devel@lists.sourceforge.net>
Subject: Re: Some questions
Date: Fri, 07 Mar 2003 16:19:49 +0100	[thread overview]
Message-ID: <3E68B895.2080500@winischhofer.net> (raw)
In-Reply-To: 1047045694.1310.6.camel@localhost.localdomain

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


This works - perfectly, I must say.

However, the scrolling problem is still here, but I think I know the 
reason for this:

Imagine a console of 120x40 (using the std 8x16 font), on a screen of 
1024x768, using ypanning.

This uses only 40*16=640 pixels vertically instead of the 768 available.

The problem is the y panning, and is kind of both console's as well as 
the driver's fault:

When the y panning area reaches its end, it's supposed to copy the 
screen to the beginning of this area and pan to position 0.

However, fbcon calculates p->vrows by info->var.yres_virtual / fontheight.

This disregards the fact that the visible screen area is actually larger 
than the area console is supposed to use.

Therefore, the calculation of vrows has to take the difference between 
these two into account.

The attached patch fixes this for me but I have no idea if I cought all 
possible itches. It will no apply cleanly, because I had made changes to 
fbcon.c before making a backup copy - but it sure illustrates the problem.

Why you used info->var.yres_virtual (and not the adapted 
var.yres_virtual) in fbcon_resize() is beyond me, BTW.

Thomas

Antonino Daplas wrote:
> On Fri, 2003-03-07 at 20:08, Thomas Winischhofer wrote:
> 
>>
>>However, there is still (at least) one problem within the console layer.
>>
>>With my patch, I can now have a console of for instance 128x20 
>>characters, on a 1024x768 screen. Scrolling mostly works, but sometimes 
>>console seems to forget to pan. I can't reproduce this on purpose, but 
>>printing eg. a directory with ls works in 90% of the cases (=scrolls 
>>correctly), but prints text beyond the current amount of rows in the 
>>remaining 10% of the cases. If I press enter until the last line of the 
>>console is on the very bottom of the 1024x768 screen, then it remembers 
>>its amount of rows and pans correctly.
>>
> 
> 
> Try this patch.  The fbcon_resize test is more liberal and it now correctly
> updates p->vrows and scroll_phys_max (for panning glitches).
> 
> Tony
> 
> 
> diff -Naur linux-2.5.64-fbdev/drivers/video/console/fbcon.c linux-2.5.64/drivers/video/console/fbcon.c
> --- linux-2.5.64-fbdev/drivers/video/console/fbcon.c	2003-03-06 01:29:29.000000000 +0000
> +++ linux-2.5.64/drivers/video/console/fbcon.c	2003-03-07 13:54:04.000000000 +0000
> @@ -580,8 +580,8 @@
>  	struct fb_info *info = p->fb_info;
>  	unsigned int cw = vc->vc_font.width;
>  	unsigned int ch = vc->vc_font.height;
> -	unsigned int rw = info->var.xres % cw;
> -	unsigned int bh = info->var.yres % ch;
> +	unsigned int rw = info->var.xres - (cw * vc->vc_cols);
> +	unsigned int bh = info->var.yres - (ch * vc->vc_rows);
>  	unsigned int rs = info->var.xres - rw;
>  	unsigned int bs = info->var.yres - bh;
>  	struct fb_fillrect region;
> @@ -1815,14 +1815,14 @@
>  	   (y_diff < 0 || y_diff > fh)) {
>  		var.activate = FB_ACTIVATE_TEST;
>  		err = fb_set_var(&var, info);
> -		if (err || width != var.xres/fw ||
> -		    height != var.yres/fh)
> +		if (err || width > var.xres/fw ||
> +		    height > var.yres/fh)
>  			return -EINVAL;
>  		DPRINTK("resize now %ix%i\n", var.xres, var.yres);
>  		var.activate = FB_ACTIVATE_NOW;
>  		fb_set_var(&var, info);
> -		p->vrows = info->var.yres_virtual/fh;
>  	}
> +	p->vrows = info->var.yres_virtual/fh;
>  	return 0;
>  }
>  
> @@ -1857,6 +1857,7 @@
>  	}
>  	if (info)
>  		info->var.yoffset = p->yscroll = 0;
> +        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;
> @@ -1875,7 +1876,6 @@
>  
>  	info->currcon = unit;
>  	
> -        fbcon_resize(vc, vc->vc_cols, vc->vc_rows);
>  	update_var(unit, info);
>  	fbcon_set_palette(vc, color_table); 	
>  
> 
> 


-- 
Thomas Winischhofer
Vienna/Austria
mailto:thomas@winischhofer.net            http://www.winischhofer.net/



[-- Attachment #2: fbcon_patch --]
[-- Type: application/x-java-applet, Size: 1373 bytes --]

  reply	other threads:[~2003-03-07 15:23 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-05 12:18 Some questions Thomas Winischhofer
2003-03-05 13:26 ` Antonino Daplas
2003-03-05 14:06   ` Thomas Winischhofer
2003-03-05 15:25     ` Antonino Daplas
2003-03-05 15:37       ` Thomas Winischhofer
2003-03-05 15:44         ` Geert Uytterhoeven
2003-03-05 15:59           ` Thomas Winischhofer
2003-03-05 16:06             ` Geert Uytterhoeven
2003-03-05 16:34             ` Antonino Daplas
2003-03-05 16:06         ` Antonino Daplas
2003-03-05 16:17           ` Thomas Winischhofer
2003-03-05 16:44             ` Antonino Daplas
2003-03-05 17:01               ` Geert Uytterhoeven
2003-03-05 19:25                 ` James Simmons
2003-03-05 19:27               ` James Simmons
2003-03-05 15:40       ` Geert Uytterhoeven
2003-03-05 15:54         ` Antonino Daplas
2003-03-05 19:31         ` James Simmons
2003-03-05 15:48       ` Antonino Daplas
2003-03-05 19:43         ` James Simmons
2003-03-05 22:21           ` Thomas Winischhofer
2003-03-06  0:18             ` James Simmons
2003-03-06  9:03               ` Thomas Winischhofer
2003-03-06  1:18             ` Antonino Daplas
2003-03-06  1:18           ` Antonino Daplas
2003-03-06  8:49             ` Thomas Winischhofer
2003-03-06  9:12               ` Geert Uytterhoeven
2003-03-06  9:58                 ` Antonino Daplas
2003-03-06 10:14                   ` Geert Uytterhoeven
2003-03-06 10:30                     ` Antonino Daplas
2003-03-06  9:26               ` Antonino Daplas
2003-03-06  9:43                 ` Thomas Winischhofer
2003-03-06 10:05                   ` Antonino Daplas
2003-03-06 10:31                     ` Sven Luther
2003-03-06 10:48                       ` Antonino Daplas
2003-03-06 10:51                         ` Antonino Daplas
2003-03-06 11:40                           ` Sven Luther
2003-03-06 13:25                             ` Antonino Daplas
2003-03-06 15:25                             ` James Simmons
2003-03-06 15:27                       ` James Simmons
2003-03-07 12:08                         ` Thomas Winischhofer
2003-03-07 12:21                           ` Geert Uytterhoeven
2003-03-07 18:19                             ` James Simmons
2003-03-07 14:01                           ` Antonino Daplas
2003-03-07 15:19                             ` Thomas Winischhofer [this message]
2003-03-07 16:19                               ` Antonino Daplas
2003-03-07 17:00                                 ` Thomas Winischhofer
2003-03-07 17:42                                   ` Antonino Daplas
2003-03-07 18:31                               ` James Simmons
2003-03-07 17:49                                 ` Thomas Winischhofer
2003-03-11 16:23                                   ` James Simmons
2003-03-07 20:12                               ` Antonino Daplas
2003-03-07 20:51                                 ` Thomas Winischhofer
2003-03-08  0:58                                   ` Antonino Daplas
2003-03-08  5:40                                     ` Antonino Daplas
2003-03-08 14:11                                       ` Thomas Winischhofer
2003-03-08 14:20                                       ` Thomas Winischhofer
2003-03-08 22:03                                         ` Antonino Daplas
2003-03-09  3:47                                           ` Thomas Winischhofer
2003-03-09  6:18                                             ` Antonino Daplas
2003-03-07 18:30                             ` James Simmons
2003-03-11 16:07             ` James Simmons
2003-03-11 21:03               ` Thomas Winischhofer
2003-03-05 19:16       ` James Simmons
2003-03-05 19:30         ` Geert Uytterhoeven
2003-03-05 19:34           ` James Simmons
2003-03-05 22:13             ` Thomas Winischhofer
2003-03-05 23:53               ` James Simmons
2003-03-06  8:33             ` Geert Uytterhoeven
2003-03-06  9:00               ` Sven Luther
2003-03-06  9:03               ` Antonino Daplas
2003-03-11 16:29                 ` James Simmons
2003-03-11 20:07                   ` Antonino Daplas
2003-03-11 20:56                     ` Thomas Winischhofer
2003-03-11 21:45                       ` Antonino Daplas
2003-03-11 22:23                         ` Thomas Winischhofer
2003-03-11 22:51                           ` Antonino Daplas
2003-03-12  0:07                             ` Michel Dänzer
2003-03-12  1:02                               ` Antonino Daplas
2003-03-12  1:29                                 ` Michel Dänzer
2003-03-12  8:24                                   ` Geert Uytterhoeven
2003-03-12 15:56                                     ` Michel Dänzer
2003-03-11 22:27                         ` Thomas Winischhofer
2003-03-11 22:51                           ` Antonino Daplas
2003-03-11 23:12                             ` Thomas Winischhofer
2003-03-05 14:12   ` Geert Uytterhoeven
2003-03-05 14:18     ` Thomas Winischhofer
2003-03-05 14:16   ` Thomas Winischhofer
2003-03-05 15:25     ` Antonino Daplas
2003-03-05 14:22   ` Thomas Winischhofer
2003-03-05 19:02   ` James Simmons
2003-03-06  1:18     ` Antonino Daplas
2003-03-05 18:57 ` James Simmons

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=3E68B895.2080500@winischhofer.net \
    --to=thomas@winischhofer.net \
    --cc=adaplas@pol.net \
    --cc=jsimmons@infradead.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=luther@dpt-info.u-strasbg.fr \
    /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).