mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* vt/fbcon: fix background color on line feed
@ 2008-05-10  8:17 Jan Engelhardt
  2008-05-27 19:33 ` thunder7
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Engelhardt @ 2008-05-10  8:17 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel Mailing List


commit 181afd9c4e2168f59761fd3d153b46a0c32810a3
Author: Jan Engelhardt <jengelh@medozas.de>
Date:   Sat May 10 10:16:56 2008 +0200

vt/fbcon: fix background color on line feed

Addendum to commit c9e587ab.
fbcon still was not doing the right thing (read: continued to do old
behavior). fbcon_clear() seems to clear the new line (e.g. where your
new prompt appears after doing echo -en "\e[42mfoo\n"), while
scr_memsetw clears the previous one only (where "foo" appears). So
just temporarily set the video_erase_char to the scrl_erase_char so
that fbcon_clear does the right thing.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 drivers/video/console/fbcon.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 774f803..c77c2fd 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -1854,6 +1854,8 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
 	struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
 	struct display *p = &fb_display[vc->vc_num];
 	int scroll_partial = info->flags & FBINFO_PARTIAL_PAN_OK;
+	unsigned short saved_ec;
+	int ret;
 
 	if (fbcon_is_inactive(vc, info))
 		return -EINVAL;
@@ -1866,6 +1868,11 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
 	 *           whole screen (prevents flicker).
 	 */
 
+	saved_ec = vc->vc_video_erase_char;
+	vc->vc_video_erase_char = vc->vc_scrl_erase_char;
+
+	ret = 0;
+
 	switch (dir) {
 	case SM_UP:
 		if (count > vc->vc_rows)	/* Maximum realistic size */
@@ -1884,7 +1891,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
 							(b - count)),
 				    vc->vc_scrl_erase_char,
 				    vc->vc_size_row * count);
-			return 1;
+			ret = 1;
 			break;
 
 		case SCROLL_WRAP_MOVE:
@@ -1956,7 +1963,8 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
 							(b - count)),
 				    vc->vc_scrl_erase_char,
 				    vc->vc_size_row * count);
-			return 1;
+			ret = 1;
+			break;
 		}
 		break;
 
@@ -1975,7 +1983,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
 							t),
 				    vc->vc_scrl_erase_char,
 				    vc->vc_size_row * count);
-			return 1;
+			ret = 1;
 			break;
 
 		case SCROLL_WRAP_MOVE:
@@ -2045,10 +2053,13 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
 							t),
 				    vc->vc_scrl_erase_char,
 				    vc->vc_size_row * count);
-			return 1;
+			ret = 1;
+			break;
 		}
+		break;
 	}
-	return 0;
+	vc->vc_video_erase_char = saved_ec;
+	return ret;
 }
 
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: vt/fbcon: fix background color on line feed
  2008-05-10  8:17 vt/fbcon: fix background color on line feed Jan Engelhardt
@ 2008-05-27 19:33 ` thunder7
  2008-05-28 17:08   ` Jan Engelhardt
  0 siblings, 1 reply; 4+ messages in thread
From: thunder7 @ 2008-05-27 19:33 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Andrew Morton, Linux Kernel Mailing List

Even with the patch below in 2.6.26-rc4, I can still report a bad
regression against 2.6.25-rc5-mm1, starting with 2.6.26-rc1 and still in
2.6.26-rc4.

I have a framebuffer console:


Console: colour VGA+ 80x25
console [tty0] enabled
nvidiafb: Device ID: 10de0392 
nvidiafb: CRTC0 analog not found
nvidiafb: CRTC1 analog not found
i2c-adapter i2c-0: unable to read EDID block.
i2c-adapter i2c-0: unable to read EDID block.
i2c-adapter i2c-0: unable to read EDID block.
nvidiafb: EDID found from BUS2
nvidiafb: CRTC 0 is currently programmed for DFP
nvidiafb: Using DFP on CRTC 0
nvidiafb: Panel size is 2560 x 1600
nvidiafb: Panel is TMDS
nvidiafb: MTRR set to ON
nvidiafb: Flat panel dithering disabled
Console: switching to colour frame buffer device 256x88
nvidiafb: PCI nVidia NV39 framebuffer (64MB @ 0xC0000000)

I used to force my console to black-on-white by the command 'setterm
inversescreen on'. This worked well. In 2.6.26-rc4, I get lots of black
background characters. Something as simple as typing 'ls' multiple times
until the screen scrolls gives black characters. I see them at the end
of lines, I see spaces changed in black characters, I see lots of black. 


Kind regards,
Jurriaan

> 
> commit 181afd9c4e2168f59761fd3d153b46a0c32810a3
> Author: Jan Engelhardt <jengelh@medozas.de>
> Date:   Sat May 10 10:16:56 2008 +0200
> 
> vt/fbcon: fix background color on line feed
> 
> Addendum to commit c9e587ab.
> fbcon still was not doing the right thing (read: continued to do old
> behavior). fbcon_clear() seems to clear the new line (e.g. where your
> new prompt appears after doing echo -en "\e[42mfoo\n"), while
> scr_memsetw clears the previous one only (where "foo" appears). So
> just temporarily set the video_erase_char to the scrl_erase_char so
> that fbcon_clear does the right thing.
> 
> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
> ---
>  drivers/video/console/fbcon.c |   21 ++++++++++++++++-----
>  1 files changed, 16 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
> index 774f803..c77c2fd 100644
> --- a/drivers/video/console/fbcon.c
> +++ b/drivers/video/console/fbcon.c
> @@ -1854,6 +1854,8 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
>  	struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
>  	struct display *p = &fb_display[vc->vc_num];
>  	int scroll_partial = info->flags & FBINFO_PARTIAL_PAN_OK;
> +	unsigned short saved_ec;
> +	int ret;
>  
>  	if (fbcon_is_inactive(vc, info))
>  		return -EINVAL;
> @@ -1866,6 +1868,11 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
>  	 *           whole screen (prevents flicker).
>  	 */
>  
> +	saved_ec = vc->vc_video_erase_char;
> +	vc->vc_video_erase_char = vc->vc_scrl_erase_char;
> +
> +	ret = 0;
> +
>  	switch (dir) {
>  	case SM_UP:
>  		if (count > vc->vc_rows)	/* Maximum realistic size */
> @@ -1884,7 +1891,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
>  							(b - count)),
>  				    vc->vc_scrl_erase_char,
>  				    vc->vc_size_row * count);
> -			return 1;
> +			ret = 1;
>  			break;
>  
>  		case SCROLL_WRAP_MOVE:
> @@ -1956,7 +1963,8 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
>  							(b - count)),
>  				    vc->vc_scrl_erase_char,
>  				    vc->vc_size_row * count);
> -			return 1;
> +			ret = 1;
> +			break;
>  		}
>  		break;
>  
> @@ -1975,7 +1983,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
>  							t),
>  				    vc->vc_scrl_erase_char,
>  				    vc->vc_size_row * count);
> -			return 1;
> +			ret = 1;
>  			break;
>  
>  		case SCROLL_WRAP_MOVE:
> @@ -2045,10 +2053,13 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
>  							t),
>  				    vc->vc_scrl_erase_char,
>  				    vc->vc_size_row * count);
> -			return 1;
> +			ret = 1;
> +			break;
>  		}
> +		break;
>  	}
> -	return 0;
> +	vc->vc_video_erase_char = saved_ec;
> +	return ret;
>  }
>  
-- 
When God is on the Bodhran
The atoms want to dance
	Oysterband - In your eyes
Debian (Unstable) GNU/Linux 2.6.26-rc1 2x2010 bogomips load 0.75
the Jack Vance Integral Edition: http://www.integralarchive.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: vt/fbcon: fix background color on line feed
  2008-05-27 19:33 ` thunder7
@ 2008-05-28 17:08   ` Jan Engelhardt
  2008-05-28 18:56     ` thunder7
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Engelhardt @ 2008-05-28 17:08 UTC (permalink / raw)
  To: thunder7; +Cc: Andrew Morton, Linux Kernel Mailing List, Rafael J. Wysocki

On Tuesday 2008-05-27 21:33, thunder7@xs4all.nl wrote:
>
>I used to force my console to black-on-white by the command 'setterm
>inversescreen on'. This worked well. In 2.6.26-rc4, I get lots of black
>background characters. Something as simple as typing 'ls' multiple times
>until the screen scrolls gives black characters. I see them at the end
>of lines, I see spaces changed in black characters, I see lots of black. 

commit 7f676fb7cf34dd2982d0cf79aeea7e5b06ad91eb
Author: Jan Engelhardt <jengelh@medozas.de>
Date:   Wed May 28 10:00:41 2008 +0200

    vt: fix background color on line feed, DEC invert
    
    Original report: """I used to force my console to black-on-white by
    the command `setterm -inversescreen on`. In 2.6.26-rc4, I get lots of
    black background characters."""
    
    Another addendum to commit c9e587ab.
    This was previously missed out since I was not aware of what
    vc_decscnm was for.
    
    Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 drivers/char/vt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index fa1ffbf..b8b2498 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -434,7 +434,7 @@ static void update_attr(struct vc_data *vc)
 	              vc->vc_blink, vc->vc_underline,
 	              vc->vc_reverse ^ vc->vc_decscnm, vc->vc_italic);
 	vc->vc_video_erase_char = (build_attr(vc, vc->vc_color, 1, vc->vc_blink, 0, vc->vc_decscnm, 0) << 8) | ' ';
-	vc->vc_scrl_erase_char = (build_attr(vc, vc->vc_def_color, 1, false, false, false, false) << 8) | ' ';
+	vc->vc_scrl_erase_char = (build_attr(vc, vc->vc_def_color, 1, false, false, vc->vc_decscnm, false) << 8) | ' ';
 }
 
 /* Note: inverting the screen twice should revert to the original state */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: vt/fbcon: fix background color on line feed
  2008-05-28 17:08   ` Jan Engelhardt
@ 2008-05-28 18:56     ` thunder7
  0 siblings, 0 replies; 4+ messages in thread
From: thunder7 @ 2008-05-28 18:56 UTC (permalink / raw)
  To: Jan Engelhardt
  Cc: thunder7, Andrew Morton, Linux Kernel Mailing List, Rafael J. Wysocki

From: Jan Engelhardt <jengelh@medozas.de>
Date: Wed, May 28, 2008 at 07:08:30PM +0200

> commit 7f676fb7cf34dd2982d0cf79aeea7e5b06ad91eb
> Author: Jan Engelhardt <jengelh@medozas.de>
> Date:   Wed May 28 10:00:41 2008 +0200
> 
>     vt: fix background color on line feed, DEC invert
>     
>     Original report: """I used to force my console to black-on-white by
>     the command `setterm -inversescreen on`. In 2.6.26-rc4, I get lots of
>     black background characters."""
>     
>     Another addendum to commit c9e587ab.
>     This was previously missed out since I was not aware of what
>     vc_decscnm was for.
>     
>     Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
> ---
>  drivers/char/vt.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/char/vt.c b/drivers/char/vt.c
> index fa1ffbf..b8b2498 100644
> --- a/drivers/char/vt.c
> +++ b/drivers/char/vt.c
> @@ -434,7 +434,7 @@ static void update_attr(struct vc_data *vc)
>  	              vc->vc_blink, vc->vc_underline,
>  	              vc->vc_reverse ^ vc->vc_decscnm, vc->vc_italic);
>  	vc->vc_video_erase_char = (build_attr(vc, vc->vc_color, 1, vc->vc_blink, 0, vc->vc_decscnm, 0) << 8) | ' ';
> -	vc->vc_scrl_erase_char = (build_attr(vc, vc->vc_def_color, 1, false, false, false, false) << 8) | ' ';
> +	vc->vc_scrl_erase_char = (build_attr(vc, vc->vc_def_color, 1, false, false, vc->vc_decscnm, false) << 8) | ' ';
>  }
>  
>  /* Note: inverting the screen twice should revert to the original state */
> 

Thanks, that fixes my issue with setterm -inversescreen on in
2.6.26-rc4.

Kind regards,
Jurriaan
-- 
"Light makes shadows. We all cast them. We'd be foolish to believe other-
wise. But that one--" She tilted her chin over her shoulder. "She darkens
those near her. She was a shadow before the sun ever touched her."
	Melanie Rawn - Skybowl

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-05-28 19:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-10  8:17 vt/fbcon: fix background color on line feed Jan Engelhardt
2008-05-27 19:33 ` thunder7
2008-05-28 17:08   ` Jan Engelhardt
2008-05-28 18:56     ` thunder7

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®