diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2011-12-31 19:13:45 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2011-12-31 19:21:23 -0500 |
commit | 5108c69c47e18244206593c0c7918711311d8ef3 (patch) | |
tree | 1a64a1ac0ab43a3acfe89ed8a55e2c895f25ee5b /vgasrc/bochsvga.c | |
parent | 6f775088925a9b1ed3ded58e05d7ee276366166f (diff) | |
download | seabios-5108c69c47e18244206593c0c7918711311d8ef3.tar.gz |
vgabios: Unify X_set_mode() functions.
Use the same function signature for cirrus, bochsvga, and stdvga
set_mode code.
Make both the int1000 interface and the VBE 104f02 interface use the
same set_mode function.
Where clext and bochsvga need to fallback to the standard vga mode
switching, have them call vgastd_mode_switch directly.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'vgasrc/bochsvga.c')
-rw-r--r-- | vgasrc/bochsvga.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/vgasrc/bochsvga.c b/vgasrc/bochsvga.c index 4ba6611c..c64919f7 100644 --- a/vgasrc/bochsvga.c +++ b/vgasrc/bochsvga.c @@ -1,7 +1,7 @@ #include "vgabios.h" // struct vbe_modeinfo -#include "vbe.h" -#include "bochsvga.h" -#include "util.h" +#include "vbe.h" // VBE_MODE_VESA_DEFINED +#include "bochsvga.h" // bochsvga_set_mode +#include "util.h" // dprintf #include "config.h" // CONFIG_* #include "biosvar.h" // SET_BDA #include "stdvga.h" // VGAREG_SEQU_ADDRESS @@ -259,9 +259,24 @@ bochsvga_hires_enable(int enable) dispi_write(VBE_DISPI_INDEX_ENABLE, flags); } -void -bochsvga_set_mode(u16 mode, struct vbe_modeinfo *info) +int +bochsvga_set_mode(int mode, int flags) { + if (!(mode & VBE_MODE_VESA_DEFINED)) { + dprintf(1, "set VGA mode %x\n", mode); + + bochsvga_hires_enable(0); + return stdvga_set_mode(mode, flags); + } + + struct vbe_modeinfo modeinfo, *info = &modeinfo; + int ret = bochsvga_mode_info(mode, &modeinfo); + if (ret) { + dprintf(1, "VBE mode %x not found\n", mode); + return VBE_RETURN_STATUS_FAILED; + } + bochsvga_hires_enable(1); + if (info->depth == 4) stdvga_set_mode(0x6a, 0); if (info->depth == 8) @@ -315,6 +330,16 @@ bochsvga_set_mode(u16 mode, struct vbe_modeinfo *info) } SET_BDA(vbe_mode, mode); + + if (flags & MF_LINEARFB) { + /* Linear frame buffer */ + /* XXX: ??? */ + } + if (!(mode & MF_NOCLEARMEM)) { + bochsvga_clear_scr(); + } + + return 0; } void |