[coreboot] [PATCH] [libpayload] VGA driver cursor placement and scrolling fixes

Jonathan A. Kollasch jakllsch at kollasch.net
Sat Mar 22 14:31:08 CET 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>

---
-------------- next part --------------
Index: drivers/vga.c
===================================================================
--- drivers/vga.c	(revision 3185)
+++ drivers/vga.c	(working copy)
@@ -64,7 +64,7 @@
 	unsigned int addr;
 
 	addr = ((unsigned int)crtc_read(0x0E)) << 8;
-	addr += crtc_read(0x0E);
+	addr += crtc_read(0x0F);
 
 	cursorx = addr % WIDTH;
 	cursory = addr / WIDTH;
@@ -93,7 +93,7 @@
 
 	addr = cursorx + (WIDTH * cursory);
 	crtc_write(addr >> 8, 0x0E);
-	crtc_write(addr, 0x0E);
+	crtc_write(addr, 0x0F);
 }
 
 void vga_cursor_enable(int state)
@@ -115,7 +115,7 @@
 void vga_clear_line(uint8_t row, uint8_t ch, uint8_t attr)
 {
 	int col;
-	uint16_t *ptr = VIDEO(0, row);
+	uint16_t *ptr = VIDEO(row, 0);
 
 	for (col = 0; col < WIDTH; col++)
 		ptr[col] = ((attr & 0xFF) << 8) | (ch & 0xFF);
@@ -123,7 +123,7 @@
 
 static void vga_scroll_up(void)
 {
-	uint16_t *src = VIDEO(0, 1);
+	uint16_t *src = VIDEO(1, 0);
 	uint16_t *dst = VIDEO(0, 0);
 	int i;
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20080322/a1063843/attachment.sig>


More information about the coreboot mailing list