]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fbcon: Use correct erase colour for clearing in fbcon
authorZsolt Kajtar <soci@c64.rulez.org>
Sun, 2 Feb 2025 20:33:46 +0000 (21:33 +0100)
committerHelge Deller <deller@gmx.de>
Wed, 26 Mar 2025 21:39:19 +0000 (22:39 +0100)
commit892c788d73fe4a94337ed092cb998c49fa8ecaf4
tree70c3e70c9dfa2c738df9d8ae50591004ff750234
parent76d3ca89981354e1f85a3e0ad9ac4217d351cc72
fbcon: Use correct erase colour for clearing in fbcon

The erase colour calculation for fbcon clearing should use get_color instead
of attr_col_ec, like everything else. The latter is similar but is not correct.
For example it's missing the depth dependent remapping and doesn't care about
blanking.

The problem can be reproduced by setting up the background colour to grey
(vt.color=0x70) and having an fbcon console set to 2bpp (4 shades of gray).
Now the background attribute should be 1 (dark gray) on the console.

If the screen is scrolled when pressing enter in a shell prompt at the bottom
line then the new line is cleared using colour 7 instead of 1. That's not
something fillrect likes (at 2bbp it expect 0-3) so the result is interesting.

This patch switches to get_color with vc_video_erase_char to determine the
erase colour from attr_col_ec. That makes the latter function redundant as
no other users were left.

Use correct erase colour for clearing in fbcon

Signed-off-by: Zsolt Kajtar <soci@c64.rulez.org>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/core/bitblit.c
drivers/video/fbdev/core/fbcon.c
drivers/video/fbdev/core/fbcon.h
drivers/video/fbdev/core/fbcon_ccw.c
drivers/video/fbdev/core/fbcon_cw.c
drivers/video/fbdev/core/fbcon_ud.c
drivers/video/fbdev/core/tileblit.c