mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
TTY core fixes for 7.0-rc7
Here are 2 small tty vt fixes for 7.0-rc7 to resolve some reported issues with the resize ability of the alt screen buffer. Both of these have been in linux-next all week with no reported issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCadIatA8cZ3JlZ0Brcm9h aC5jb20ACgkQMUfUDdst+ylqVQCfecM0mxjbI8EmKsfL6FtpAstcW1IAn2XwT7S0 ITAhHAylAuh3HHpXqRfi =eulV -----END PGP SIGNATURE----- Merge tag 'tty-7.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty fixes from Greg KH: "Here are two small tty vt fixes for 7.0-rc7 to resolve some reported issues with the resize ability of the alt screen buffer. Both of these have been in linux-next all week with no reported issues" * tag 'tty-7.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: vt: resize saved unicode buffer on alt screen exit after resize vt: discard stale unicode buffer on alt screen exit after resize
This commit is contained in:
commit
7a60c79bd0
|
|
@ -1909,6 +1909,24 @@ static void leave_alt_screen(struct vc_data *vc)
|
|||
dest = ((u16 *)vc->vc_origin) + r * vc->vc_cols;
|
||||
memcpy(dest, src, 2 * cols);
|
||||
}
|
||||
/*
|
||||
* If the console was resized while in the alternate screen,
|
||||
* resize the saved unicode buffer to the current dimensions.
|
||||
* On allocation failure new_uniscr is NULL, causing the old
|
||||
* buffer to be freed and vc_uni_lines to be lazily rebuilt
|
||||
* via vc_uniscr_check() when next needed.
|
||||
*/
|
||||
if (vc->vc_saved_uni_lines &&
|
||||
(vc->vc_saved_rows != vc->vc_rows ||
|
||||
vc->vc_saved_cols != vc->vc_cols)) {
|
||||
u32 **new_uniscr = vc_uniscr_alloc(vc->vc_cols, vc->vc_rows);
|
||||
|
||||
if (new_uniscr)
|
||||
vc_uniscr_copy_area(new_uniscr, vc->vc_cols, vc->vc_rows,
|
||||
vc->vc_saved_uni_lines, cols, 0, rows);
|
||||
vc_uniscr_free(vc->vc_saved_uni_lines);
|
||||
vc->vc_saved_uni_lines = new_uniscr;
|
||||
}
|
||||
vc_uniscr_set(vc, vc->vc_saved_uni_lines);
|
||||
vc->vc_saved_uni_lines = NULL;
|
||||
restore_cur(vc);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user