提交 d850a2fa 编写于 作者: J Jan Engelhardt 提交者: Linus Torvalds

vt/fbcon: fix background color on line feed

Another addendum to commit c9e587ab
("vt: fix background color on line feed").

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: NJan Engelhardt <jengelh@medozas.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 7fe3915a
...@@ -1853,6 +1853,8 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, ...@@ -1853,6 +1853,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 fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
struct display *p = &fb_display[vc->vc_num]; struct display *p = &fb_display[vc->vc_num];
int scroll_partial = info->flags & FBINFO_PARTIAL_PAN_OK; int scroll_partial = info->flags & FBINFO_PARTIAL_PAN_OK;
unsigned short saved_ec;
int ret;
if (fbcon_is_inactive(vc, info)) if (fbcon_is_inactive(vc, info))
return -EINVAL; return -EINVAL;
...@@ -1865,6 +1867,11 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, ...@@ -1865,6 +1867,11 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
* whole screen (prevents flicker). * 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) { switch (dir) {
case SM_UP: case SM_UP:
if (count > vc->vc_rows) /* Maximum realistic size */ if (count > vc->vc_rows) /* Maximum realistic size */
...@@ -1883,7 +1890,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, ...@@ -1883,7 +1890,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
(b - count)), (b - count)),
vc->vc_scrl_erase_char, vc->vc_scrl_erase_char,
vc->vc_size_row * count); vc->vc_size_row * count);
return 1; ret = 1;
break; break;
case SCROLL_WRAP_MOVE: case SCROLL_WRAP_MOVE:
...@@ -1955,7 +1962,8 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, ...@@ -1955,7 +1962,8 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
(b - count)), (b - count)),
vc->vc_scrl_erase_char, vc->vc_scrl_erase_char,
vc->vc_size_row * count); vc->vc_size_row * count);
return 1; ret = 1;
break;
} }
break; break;
...@@ -1974,7 +1982,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, ...@@ -1974,7 +1982,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
t), t),
vc->vc_scrl_erase_char, vc->vc_scrl_erase_char,
vc->vc_size_row * count); vc->vc_size_row * count);
return 1; ret = 1;
break; break;
case SCROLL_WRAP_MOVE: case SCROLL_WRAP_MOVE:
...@@ -2044,10 +2052,13 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, ...@@ -2044,10 +2052,13 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
t), t),
vc->vc_scrl_erase_char, vc->vc_scrl_erase_char,
vc->vc_size_row * count); vc->vc_size_row * count);
return 1; ret = 1;
break;
} }
break;
} }
return 0; vc->vc_video_erase_char = saved_ec;
return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册