Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f74a289b authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Tomi Valkeinen
Browse files

framebuffer: fix border color



The framebuffer code uses the current background color to fill the border
when switching consoles, however, this results in inconsistent behavior.
For example:
- start Midnigh Commander
- the border is black
- switch to another console and switch back
- the border is cyan
- type something into the command line in mc
- the border is cyan
- switch to another console and switch back
- the border is black
- press F9 to go to menu
- the border is black
- switch to another console and switch back
- the border is dark blue

When switching to a console with Midnight Commander, the border is random
color that was left selected by the slang subsystem.

This patch fixes this inconsistency by always using black as the
background color when switching consoles.

Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent c8b8888f
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -205,7 +205,6 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info,
static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
			      int bottom_only)
			      int bottom_only)
{
{
	int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
	unsigned int cw = vc->vc_font.width;
	unsigned int cw = vc->vc_font.width;
	unsigned int ch = vc->vc_font.height;
	unsigned int ch = vc->vc_font.height;
	unsigned int rw = info->var.xres - (vc->vc_cols*cw);
	unsigned int rw = info->var.xres - (vc->vc_cols*cw);
@@ -214,7 +213,7 @@ static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
	unsigned int bs = info->var.yres - bh;
	unsigned int bs = info->var.yres - bh;
	struct fb_fillrect region;
	struct fb_fillrect region;


	region.color = attr_bgcol_ec(bgshift, vc, info);
	region.color = 0;
	region.rop = ROP_COPY;
	region.rop = ROP_COPY;


	if (rw && !bottom_only) {
	if (rw && !bottom_only) {
+1 −2
Original line number Original line Diff line number Diff line
@@ -197,9 +197,8 @@ static void ccw_clear_margins(struct vc_data *vc, struct fb_info *info,
	unsigned int bh = info->var.xres - (vc->vc_rows*ch);
	unsigned int bh = info->var.xres - (vc->vc_rows*ch);
	unsigned int bs = vc->vc_rows*ch;
	unsigned int bs = vc->vc_rows*ch;
	struct fb_fillrect region;
	struct fb_fillrect region;
	int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;


	region.color = attr_bgcol_ec(bgshift,vc,info);
	region.color = 0;
	region.rop = ROP_COPY;
	region.rop = ROP_COPY;


	if (rw && !bottom_only) {
	if (rw && !bottom_only) {
+1 −2
Original line number Original line Diff line number Diff line
@@ -180,9 +180,8 @@ static void cw_clear_margins(struct vc_data *vc, struct fb_info *info,
	unsigned int bh = info->var.xres - (vc->vc_rows*ch);
	unsigned int bh = info->var.xres - (vc->vc_rows*ch);
	unsigned int rs = info->var.yres - rw;
	unsigned int rs = info->var.yres - rw;
	struct fb_fillrect region;
	struct fb_fillrect region;
	int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;


	region.color = attr_bgcol_ec(bgshift,vc,info);
	region.color = 0;
	region.rop = ROP_COPY;
	region.rop = ROP_COPY;


	if (rw && !bottom_only) {
	if (rw && !bottom_only) {
+1 −2
Original line number Original line Diff line number Diff line
@@ -227,9 +227,8 @@ static void ud_clear_margins(struct vc_data *vc, struct fb_info *info,
	unsigned int rw = info->var.xres - (vc->vc_cols*cw);
	unsigned int rw = info->var.xres - (vc->vc_cols*cw);
	unsigned int bh = info->var.yres - (vc->vc_rows*ch);
	unsigned int bh = info->var.yres - (vc->vc_rows*ch);
	struct fb_fillrect region;
	struct fb_fillrect region;
	int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;


	region.color = attr_bgcol_ec(bgshift,vc,info);
	region.color = 0;
	region.rop = ROP_COPY;
	region.rop = ROP_COPY;


	if (rw && !bottom_only) {
	if (rw && !bottom_only) {