Commit 2115aea8 authored by Samuel Thibault's avatar Samuel Thibault Committed by Linus Torvalds

[PATCH] vgacon: fix EGA cursor resize function

This corrects cursor resize on ega boards: registers are write-only, so we
shouldn't even try to read them.  And on ega, 31/30 produces a flat cursor.
Using 31/31 is better: except with 32 pixels high fonts, it shouldn't show
up.
Signed-off-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c94ded6e
...@@ -433,17 +433,22 @@ static void vgacon_set_cursor_size(int xpos, int from, int to) ...@@ -433,17 +433,22 @@ static void vgacon_set_cursor_size(int xpos, int from, int to)
cursor_size_lastto = to; cursor_size_lastto = to;
spin_lock_irqsave(&vga_lock, flags); spin_lock_irqsave(&vga_lock, flags);
outb_p(0x0a, vga_video_port_reg); /* Cursor start */ if (vga_video_type >= VIDEO_TYPE_VGAC) {
curs = inb_p(vga_video_port_val); outb_p(VGA_CRTC_CURSOR_START, vga_video_port_reg);
outb_p(0x0b, vga_video_port_reg); /* Cursor end */ curs = inb_p(vga_video_port_val);
cure = inb_p(vga_video_port_val); outb_p(VGA_CRTC_CURSOR_END, vga_video_port_reg);
cure = inb_p(vga_video_port_val);
} else {
curs = 0;
cure = 0;
}
curs = (curs & 0xc0) | from; curs = (curs & 0xc0) | from;
cure = (cure & 0xe0) | to; cure = (cure & 0xe0) | to;
outb_p(0x0a, vga_video_port_reg); /* Cursor start */ outb_p(VGA_CRTC_CURSOR_START, vga_video_port_reg);
outb_p(curs, vga_video_port_val); outb_p(curs, vga_video_port_val);
outb_p(0x0b, vga_video_port_reg); /* Cursor end */ outb_p(VGA_CRTC_CURSOR_END, vga_video_port_reg);
outb_p(cure, vga_video_port_val); outb_p(cure, vga_video_port_val);
spin_unlock_irqrestore(&vga_lock, flags); spin_unlock_irqrestore(&vga_lock, flags);
} }
...@@ -455,7 +460,10 @@ static void vgacon_cursor(struct vc_data *c, int mode) ...@@ -455,7 +460,10 @@ static void vgacon_cursor(struct vc_data *c, int mode)
switch (mode) { switch (mode) {
case CM_ERASE: case CM_ERASE:
write_vga(14, (c->vc_pos - vga_vram_base) / 2); write_vga(14, (c->vc_pos - vga_vram_base) / 2);
vgacon_set_cursor_size(c->vc_x, 31, 30); if (vga_video_type >= VIDEO_TYPE_VGAC)
vgacon_set_cursor_size(c->vc_x, 31, 30);
else
vgacon_set_cursor_size(c->vc_x, 31, 31);
break; break;
case CM_MOVE: case CM_MOVE:
...@@ -493,7 +501,10 @@ static void vgacon_cursor(struct vc_data *c, int mode) ...@@ -493,7 +501,10 @@ static void vgacon_cursor(struct vc_data *c, int mode)
10 ? 1 : 2)); 10 ? 1 : 2));
break; break;
case CUR_NONE: case CUR_NONE:
vgacon_set_cursor_size(c->vc_x, 31, 30); if (vga_video_type >= VIDEO_TYPE_VGAC)
vgacon_set_cursor_size(c->vc_x, 31, 30);
else
vgacon_set_cursor_size(c->vc_x, 31, 31);
break; break;
default: default:
vgacon_set_cursor_size(c->vc_x, 1, vgacon_set_cursor_size(c->vc_x, 1,
......
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