Bug 11258

Summary: fbcon cursor disappered after switch to 512 consolefont
Product: Drivers Reporter: Peter Hanzel (hanzelpeter)
Component: Console/FramebuffersAssignee: James Simmons (jsimmons)
Status: CLOSED CODE_FIX    
Severity: normal CC: bunk
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.26.1 Subsystem:
Regression: Yes Bisected commit-id:

Description Peter Hanzel 2008-08-06 08:27:54 UTC
Latest working kernel version: 2.6.25.8
Earliest failing kernel version: 2.6.26
Distribution: LFS 6.3
Hardware Environment: VMWare 5.5
Software Environment: LFS, framebuffer console
Problem Description: When I use setfont to change font to 512 chars font, than blinking cursor disappers.

Steps to reproduce: 
1) setfont LatArCyrHeb-16.psfu.gz
2) press enter (sometimes twice or more)
3) blinking cursor disappers
4) start typing (no cursor)
5) press "backspace" => cursor is back
Comment 1 Peter Hanzel 2008-08-06 08:30:33 UTC
sometimes "showconsolefont" leads to no cursor
Comment 2 Anonymous Emailer 2008-08-06 09:12:14 UTC
Reply-To: akpm@linux-foundation.org


(switched to email.  Please respond via emailed reply-to-all, not via the
bugzilla web interface).

On Wed,  6 Aug 2008 08:27:54 -0700 (PDT) bugme-daemon@bugzilla.kernel.org wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=11258
> 
>            Summary: fbcon cursor disappered after switch to 512 consolefont
>            Product: Drivers
>            Version: 2.5
>      KernelVersion: 2.6.26.1
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: Console/Framebuffers
>         AssignedTo: jsimmons@infradead.org
>         ReportedBy: hanzelpeter@gmail.com
> 
> 
> Latest working kernel version: 2.6.25.8
> Earliest failing kernel version: 2.6.26
> Distribution: LFS 6.3
> Hardware Environment: VMWare 5.5
> Software Environment: LFS, framebuffer console
> Problem Description: When I use setfont to change font to 512 chars font,
> than
> blinking cursor disappers.
> 
> Steps to reproduce: 
> 1) setfont LatArCyrHeb-16.psfu.gz
> 2) press enter (sometimes twice or more)
> 3) blinking cursor disappers
> 4) start typing (no cursor)
> 5) press "backspace" => cursor is back
> 

A regression.
Comment 3 Peter Hanzel 2008-08-08 04:53:34 UTC
I bisected http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.26.y.git
And found this:

7fe3915a492503a9199af475a433b50258303806 is first bad commit
commit 7fe3915a492503a9199af475a433b50258303806
Author: Jan Engelhardt <jengelh@medozas.de>
Date:   Mon May 12 14:02:38 2008 -0700

    vt/fbcon: update scrl_erase_char after 256/512-glyph font switch

    Addendum to commit c9e587abfdec2c2aaa55fab83bcb4972e2f84f9b ("vt: fix
    background color on line feed").

    vc->vc_scrl_erase_char was not updated when fbcon switches between
    256- and 512-glyph fonts.

    Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
    Acked-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

:040000 040000 64781b2d980fdd05f04ab5e044349175677009e8 f1cb8948ba72075f2f83a2c812187758ecf46641 M drivers 

So this commit fixes bug with vt: fix background color on line feed
but makes cursor disappear as discribed.
Comment 4 Peter Hanzel 2008-08-08 06:36:32 UTC
Hello. 

Look like this fixes the bug:

diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 3385993..85822b4 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -2518,7 +2518,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
 			c = vc->vc_video_erase_char;
 			vc->vc_video_erase_char =
 			    ((c & 0xfe00) >> 1) | (c & 0xff);
-			c = vc->vc_def_color;
+			c = (vc->vc_def_color << 8) | ' ';
 			vc->vc_scrl_erase_char =
 			    ((c & 0xFE00) >> 1) | (c & 0xFF);
 			vc->vc_attr >>= 1;
@@ -2551,7 +2551,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
 			if (vc->vc_can_do_color) {
 				vc->vc_video_erase_char =
 				    ((c & 0xff00) << 1) | (c & 0xff);
-				c = vc->vc_def_color;
+				c = (vc->vc_def_color << 8) | ' ';
 				vc->vc_scrl_erase_char =
 				    ((c & 0xFF00) << 1) | (c & 0xFF);
 				vc->vc_attr <<= 1; 
Comment 5 Anonymous Emailer 2008-08-10 09:33:23 UTC
Reply-To: krzysztof.h1@poczta.fm

On Wed, 6 Aug 2008 09:12:04 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> 
> (switched to email.  Please respond via emailed reply-to-all, not via the
> bugzilla web interface).
> 
> On Wed,  6 Aug 2008 08:27:54 -0700 (PDT) bugme-daemon@bugzilla.kernel.org
> wrote:
> 
> > http://bugzilla.kernel.org/show_bug.cgi?id=11258
> > 
> >            Summary: fbcon cursor disappered after switch to 512 consolefont

> 
> A regression.
> 


The patch for the issue is below. It is very similar to
Peter Hanzel's patch already posted to the bugzilla
but it honors vc_scrl_erase_char for scrolling.

Regards,
Krzysztof
----

From: Krzysztof Helt <krzysztof.h1@wp.pl>

Adjust  and honor the vc_scrl_erase_char for
256 and 512 character fonts.

It fixes the issue with disappearing cursor during scrolling
(kernel bug #11258). The issue was reported and tracked
by Peter Hanzel.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>

diff -urp linux-ref/drivers/video/console/fbcon.c linux-2.6.27/drivers/video/console/fbcon.c
--- linux-ref/drivers/video/console/fbcon.c	2008-08-09 19:00:06.000000000 +0200
+++ linux-2.6.27/drivers/video/console/fbcon.c	2008-08-09 19:04:44.000000000 +0200
@@ -2515,7 +2515,7 @@ static int fbcon_do_set_font(struct vc_d
 			c = vc->vc_video_erase_char;
 			vc->vc_video_erase_char =
 			    ((c & 0xfe00) >> 1) | (c & 0xff);
-			c = vc->vc_def_color;
+			c = vc->vc_scrl_erase_char;
 			vc->vc_scrl_erase_char =
 			    ((c & 0xFE00) >> 1) | (c & 0xFF);
 			vc->vc_attr >>= 1;
@@ -2548,7 +2548,7 @@ static int fbcon_do_set_font(struct vc_d
 			if (vc->vc_can_do_color) {
 				vc->vc_video_erase_char =
 				    ((c & 0xff00) << 1) | (c & 0xff);
-				c = vc->vc_def_color;
+				c = vc->vc_scrl_erase_char;
 				vc->vc_scrl_erase_char =
 				    ((c & 0xFF00) << 1) | (c & 0xFF);
 				vc->vc_attr <<= 1;


----------------------------------------------------------------------
Tylko dla detektywow! Konkurs na Smaker.pl
Kliknij >>> http://link.interia.pl/f1eb1
Comment 6 Andrew Morton 2008-08-10 12:45:54 UTC
Added to -mm, as fbcon-prevent-cursor-disappearance-after-switching-to-512-character-font.patch
Comment 7 Adrian Bunk 2008-08-13 01:51:18 UTC
fized by commit afa9b649aa699297258dbb67aaae651c9ad4245f