aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2006-03-27 04:17:19 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-27 11:44:55 -0500
commit2115aea8185c8987b7688111953322742bd8795c (patch)
tree62a791c01b10cdd98d4907d2a168d51e87558c09 /drivers/video
parentc94ded6e602594c8e66fd5b1ba832d5327f5c103 (diff)
[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: Samuel Thibault <samuel.thibault@ens-lyon.org> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/console/vgacon.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 5a86978537d2..61894d5bb219 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -433,17 +433,22 @@ static void vgacon_set_cursor_size(int xpos, int from, int to)
433 cursor_size_lastto = to; 433 cursor_size_lastto = to;
434 434
435 spin_lock_irqsave(&vga_lock, flags); 435 spin_lock_irqsave(&vga_lock, flags);
436 outb_p(0x0a, vga_video_port_reg); /* Cursor start */ 436 if (vga_video_type >= VIDEO_TYPE_VGAC) {
437 curs = inb_p(vga_video_port_val); 437 outb_p(VGA_CRTC_CURSOR_START, vga_video_port_reg);
438 outb_p(0x0b, vga_video_port_reg); /* Cursor end */ 438 curs = inb_p(vga_video_port_val);
439 cure = inb_p(vga_video_port_val); 439 outb_p(VGA_CRTC_CURSOR_END, vga_video_port_reg);
440 cure = inb_p(vga_video_port_val);
441 } else {
442 curs = 0;
443 cure = 0;
444 }
440 445
441 curs = (curs & 0xc0) | from; 446 curs = (curs & 0xc0) | from;
442 cure = (cure & 0xe0) | to; 447 cure = (cure & 0xe0) | to;
443 448
444 outb_p(0x0a, vga_video_port_reg); /* Cursor start */ 449 outb_p(VGA_CRTC_CURSOR_START, vga_video_port_reg);
445 outb_p(curs, vga_video_port_val); 450 outb_p(curs, vga_video_port_val);
446 outb_p(0x0b, vga_video_port_reg); /* Cursor end */ 451 outb_p(VGA_CRTC_CURSOR_END, vga_video_port_reg);
447 outb_p(cure, vga_video_port_val); 452 outb_p(cure, vga_video_port_val);
448 spin_unlock_irqrestore(&vga_lock, flags); 453 spin_unlock_irqrestore(&vga_lock, flags);
449} 454}
@@ -455,7 +460,10 @@ static void vgacon_cursor(struct vc_data *c, int mode)
455 switch (mode) { 460 switch (mode) {
456 case CM_ERASE: 461 case CM_ERASE:
457 write_vga(14, (c->vc_pos - vga_vram_base) / 2); 462 write_vga(14, (c->vc_pos - vga_vram_base) / 2);
458 vgacon_set_cursor_size(c->vc_x, 31, 30); 463 if (vga_video_type >= VIDEO_TYPE_VGAC)
464 vgacon_set_cursor_size(c->vc_x, 31, 30);
465 else
466 vgacon_set_cursor_size(c->vc_x, 31, 31);
459 break; 467 break;
460 468
461 case CM_MOVE: 469 case CM_MOVE:
@@ -493,7 +501,10 @@ static void vgacon_cursor(struct vc_data *c, int mode)
493 10 ? 1 : 2)); 501 10 ? 1 : 2));
494 break; 502 break;
495 case CUR_NONE: 503 case CUR_NONE:
496 vgacon_set_cursor_size(c->vc_x, 31, 30); 504 if (vga_video_type >= VIDEO_TYPE_VGAC)
505 vgacon_set_cursor_size(c->vc_x, 31, 30);
506 else
507 vgacon_set_cursor_size(c->vc_x, 31, 31);
497 break; 508 break;
498 default: 509 default:
499 vgacon_set_cursor_size(c->vc_x, 1, 510 vgacon_set_cursor_size(c->vc_x, 1,