diff options
author | Jonathan A. Kollasch <jakllsch@kollasch.net> | 2008-08-11 17:19:10 +0000 |
---|---|---|
committer | Jordan Crouse <jordan.crouse@amd.com> | 2008-08-11 17:19:10 +0000 |
commit | 42a0c80b9babaaf93ca806dd9bae4a4cc5a8936f (patch) | |
tree | f77e1037e1ea1f57f265592b6fa576b47ce7af8b /payloads/libpayload/drivers | |
parent | 12e27266c3cb9bd1499731a5c52da7ce565d7912 (diff) |
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@kollasch.net>
Acked-by: Jordan Crouse <jordan.crouse@amd.com>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3498 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/libpayload/drivers')
-rw-r--r-- | payloads/libpayload/drivers/video/vga.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/payloads/libpayload/drivers/video/vga.c b/payloads/libpayload/drivers/video/vga.c index 388c7b1ee7..540e673389 100644 --- a/payloads/libpayload/drivers/video/vga.c +++ b/payloads/libpayload/drivers/video/vga.c @@ -54,7 +54,7 @@ static void vga_get_cursor(unsigned int *x, unsigned int *y, unsigned int *en) { 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 @@ static void vga_set_cursor(unsigned int x, unsigned int y) 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_enable_cursor(int state) 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_clear_line(u8 row, u8 ch, u8 attr) static void vga_scroll_up(void) { - u16 *src = VIDEO(0,1); + u16 *src = VIDEO(1,0); u16 *dst = VIDEO(0,0); int i; |