Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8218
b: refs/heads/master
c: 3b41dc1
h: refs/heads/master
v: v3
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Sep 9, 2005
1 parent 15e3553 commit 1342a32
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2cc38ed13f1b0f9d80a2d0acc2916af94922f27e
refs/heads/master: 3b41dc1a3c7839a765ffa560a5ae07aa5d253cc8
37 changes: 31 additions & 6 deletions trunk/drivers/char/vt.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
unsigned long old_origin, new_origin, new_scr_end, rlth, rrem, err = 0;
unsigned int old_cols, old_rows, old_row_size, old_screen_size;
unsigned int new_cols, new_rows, new_row_size, new_screen_size;
unsigned int end;
unsigned short *newscreen;

WARN_CONSOLE_UNLOCKED();
Expand Down Expand Up @@ -794,20 +795,44 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
old_origin = vc->vc_origin;
new_origin = (long) newscreen;
new_scr_end = new_origin + new_screen_size;
if (new_rows < old_rows)
old_origin += (old_rows - new_rows) * old_row_size;

if (vc->vc_y > new_rows) {
if (old_rows - vc->vc_y < new_rows) {
/*
* Cursor near the bottom, copy contents from the
* bottom of buffer
*/
old_origin += (old_rows - new_rows) * old_row_size;
end = vc->vc_scr_end;
} else {
/*
* Cursor is in no man's land, copy 1/2 screenful
* from the top and bottom of cursor position
*/
old_origin += (vc->vc_y - new_rows/2) * old_row_size;
end = old_origin + new_screen_size;
}
} else
/*
* Cursor near the top, copy contents from the top of buffer
*/
end = (old_rows > new_rows) ? old_origin + new_screen_size :
vc->vc_scr_end;

update_attr(vc);

while (old_origin < vc->vc_scr_end) {
scr_memcpyw((unsigned short *) new_origin, (unsigned short *) old_origin, rlth);
while (old_origin < end) {
scr_memcpyw((unsigned short *) new_origin,
(unsigned short *) old_origin, rlth);
if (rrem)
scr_memsetw((void *)(new_origin + rlth), vc->vc_video_erase_char, rrem);
scr_memsetw((void *)(new_origin + rlth),
vc->vc_video_erase_char, rrem);
old_origin += old_row_size;
new_origin += new_row_size;
}
if (new_scr_end > new_origin)
scr_memsetw((void *)new_origin, vc->vc_video_erase_char, new_scr_end - new_origin);
scr_memsetw((void *)new_origin, vc->vc_video_erase_char,
new_scr_end - new_origin);
if (vc->vc_kmalloced)
kfree(vc->vc_screenbuf);
vc->vc_screenbuf = newscreen;
Expand Down

0 comments on commit 1342a32

Please sign in to comment.