Commit 17220af0 authored by Egmont Koblinger's avatar Egmont Koblinger Committed by Linus Torvalds

[PATCH] Shift+PgUp if nr of scrolled lines is < 4

Using the vga console driver, if the number of the lines scrolled out is
less than four, then Shift+PageUp doesn't work.

The bug is closely related to the 'margin' feature of scrolling, which
means that if less than four lines should remain unvisible in the direction
we are scrolling to, then we scroll a little bit more just to see those few
lines.  Kind of two small magnets at the borders of the buffer.

This bug was also reported with maybe a less clear description by Stepan
Koltsov (cc'ed just for fun) back in 2001 and he got no answer.  I found it
at http://seclists.org/lists/linux-kernel/2001/Nov/0080.html

His patch simply disables margin support and hence everythings becomes
okay, but you lose a nice feature.

Here's a patch that retains margin support and fixes the bug.  Works for
me, tested for a week.  No guarantee.  As I don't fully understand the code
(see also my previous mail) I'm not 100% sure that I'm doing the right
thing, so I'd prefer if someone would take a closer look at it.

At least 2.4 and 2.6 are affected, maybe older ones too.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3ca54916
...@@ -963,6 +963,8 @@ static int vgacon_scrolldelta(struct vc_data *c, int lines) ...@@ -963,6 +963,8 @@ static int vgacon_scrolldelta(struct vc_data *c, int lines)
p = (c->vc_visible_origin - vga_vram_base - ul + we) % we + p = (c->vc_visible_origin - vga_vram_base - ul + we) % we +
lines * c->vc_size_row; lines * c->vc_size_row;
st = (c->vc_origin - vga_vram_base - ul + we) % we; st = (c->vc_origin - vga_vram_base - ul + we) % we;
if (st < 2 * margin)
margin = 0;
if (p < margin) if (p < margin)
p = 0; p = 0;
if (p > st - margin) if (p > st - margin)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment