diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2012-01-14 14:52:01 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2012-01-14 17:19:58 -0500 |
commit | e19a68f5acf441eb0c00cbd38f74e46ad4a288f3 (patch) | |
tree | 7ce2bc1484886fd83dd43185cb9dbc08a82c217c /vgasrc/clext.c | |
parent | 643290fb1f9bca93084dd485c18397f2f7d3fdd7 (diff) | |
download | seabios-e19a68f5acf441eb0c00cbd38f74e46ad4a288f3.tar.gz |
vgabios: Make cirrus line lengths standard.
Only two modes don't match their expected line length. One looks like
a bug (it has a virtual line length of 1280 for a screen of 1600
bytes) and one looks like an optimization (2048 vs 1920). Change the
mode line lengths to exactly match the expected line lengths so that
the VBE code is correct.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'vgasrc/clext.c')
-rw-r--r-- | vgasrc/clext.c | 41 |
1 files changed, 7 insertions, 34 deletions
diff --git a/vgasrc/clext.c b/vgasrc/clext.c index 17368436..835d8096 100644 --- a/vgasrc/clext.c +++ b/vgasrc/clext.c @@ -73,8 +73,8 @@ static u16 ccrtc_640x480x24[] VAR16 = { 0x2c11, 0x5f00,0x4f01,0x4f02,0x8003,0x5204,0x1e05,0x0b06,0x3e07, 0x4009,0x000c,0x000d, - 0xea10,0xdf12,0x0013,0x4014,0xdf15,0x0b16,0xc317,0xff18, - 0x001a,0x321b,0x001d, + 0xea10,0xdf12,0xf013,0x4014,0xdf15,0x0b16,0xc317,0xff18, + 0x001a,0x221b,0x001d, 0xffff }; /* 800x600x8 */ @@ -209,7 +209,7 @@ static u16 cseq_1600x1200x8[] VAR16 = { static u16 ccrtc_1600x1200x8[] VAR16 = { 0x2911,0xc300,0x9f01,0x9f02,0x8603,0x8304,0x9405,0x2406,0xf707, 0x6009,0x000c,0x000d, - 0x0310,0xff12,0xa013,0x4014,0xff15,0x2416,0xc317,0xff18, + 0x0310,0xff12,0xc813,0x4014,0xff15,0x2416,0xc317,0xff18, 0x001a,0x221b,0x001d, 0xffff }; @@ -583,13 +583,14 @@ cirrus_get_bpp_bytes(void) static void cirrus_set_line_offset(u16 new_line_offset) { + new_line_offset /= 8; u16 crtc_addr = stdvga_get_crtc(); outb(0x13, crtc_addr); - outb(new_line_offset / 8, crtc_addr + 1); + outb(new_line_offset, crtc_addr + 1); outb(0x1b, crtc_addr); u8 v = inb(crtc_addr + 1); - outb((((new_line_offset / 8) & 0x100) >> 4) | (v & 0xef), crtc_addr + 1); + outb(((new_line_offset & 0x100) >> 4) | (v & 0xef), crtc_addr + 1); } static u16 @@ -601,35 +602,7 @@ cirrus_get_line_offset(void) outb(0x1b, crtc_addr); u8 reg1b = inb(crtc_addr + 1); - return (((reg1b << 4) & 0x100) + reg13) * 8; -} - -u16 -cirrus_get_line_offset_entry(struct cirrus_mode_s *table_g) -{ - u16 *crtc = GET_GLOBAL(table_g->crtc); - - u16 *c = crtc; - u16 reg13; - for (;;) { - reg13 = GET_GLOBAL(*c); - if ((reg13 & 0xff) == 0x13) - break; - c++; - } - reg13 >>= 8; - - c = crtc; - u16 reg1b; - for (;;) { - reg1b = GET_GLOBAL(*c); - if ((reg1b & 0xff) == 0x1b) - break; - c++; - } - reg1b >>= 8; - - return (((reg1b << 4) & 0x100) + reg13) * 8; + return (((reg1b & 0x10) << 4) + reg13) * 8; } static void |