[coreboot] [patch] vga cursor positioning and correct usage of VIDEO() macro fix (again) (w/ patch)

Jonathan A. Kollasch jakllsch at kollasch.net
Mon Aug 11 17:31:02 CEST 2008


Make cursor positioning work by using both halves of the VGA cursor position register.

Have vga_scroll_up() and vga_clear_line() present row/column arguments to the VIDEO() macro in the right order.

Signed-off-by: Jonathan A. Kollasch <jakllsch at kollasch.net>
---
This had previously been change set 3186, but was lost when console video support was restructured.
-------------- next part --------------
Index: drivers/video/vga.c
===================================================================
--- drivers/video/vga.c	(revision 3493)
+++ drivers/video/vga.c	(working copy)
@@ -54,7 +54,7 @@
 {
 	unsigned int addr;
 	addr = ((unsigned int) crtc_read(0x0E)) << 8;
-	addr += crtc_read(0x0E);
+	addr += crtc_read(0x0F);
 
 	*x = addr % VIDEO_COLS;
 	*y = addr / VIDEO_COLS;
@@ -68,7 +68,7 @@
 
 	addr = x + (VIDEO_COLS * y);
 	crtc_write(addr >> 8, 0x0E);
-	crtc_write(addr, 0x0E);
+	crtc_write(addr, 0x0F);
 }
 
 static void vga_enable_cursor(int state)
@@ -87,7 +87,7 @@
 static void vga_clear_line(u8 row, u8 ch, u8 attr)
 {
 	int col;
-	u16 *ptr = VIDEO(0, row);
+	u16 *ptr = VIDEO(row, 0);
 
 	for(col = 0; col < VIDEO_COLS; col++)
 		ptr[col] = ((attr & 0xFF) << 8) | (ch & 0xFF);
@@ -95,7 +95,7 @@
 
 static void vga_scroll_up(void)
 {
-	u16 *src = VIDEO(0,1);
+	u16 *src = VIDEO(1,0);
 	u16 *dst = VIDEO(0,0);
 	int i;
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20080811/1bd0d6b1/attachment.sig>


More information about the coreboot mailing list