In oder to support VESA we need to provide mode table and some functions to work with modes. mode_setting will be added later.
Signed-off-by: Christian Gmeiner christian.gmeiner@gmail.com --- vgasrc/geodevga.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ vgasrc/geodevga.h | 2 ++ 2 files changed, 51 insertions(+)
diff --git a/vgasrc/geodevga.c b/vgasrc/geodevga.c index 636d55b..a1a79c9 100644 --- a/vgasrc/geodevga.c +++ b/vgasrc/geodevga.c @@ -17,6 +17,55 @@
/**************************************************************** + * Mode tables + ****************************************************************/ + +static struct geodevga_mode +{ + u16 mode; + struct vgamode_s info; +} geodevga_modes[] VAR16 = { + /* VESA modes */ + { 0x101, { MM_PACKED, 640, 480, 8, 8, 16, SEG_GRAPH } }, + { 0x103, { MM_PACKED, 800, 600, 8, 8, 16, SEG_GRAPH } }, + { 0x105, { MM_PACKED, 1024, 768, 8, 8, 16, SEG_GRAPH } }, + { 0x107, { MM_PACKED, 1280, 1024, 8, 8, 16, SEG_GRAPH } }, + { 0x110, { MM_DIRECT, 640, 480, 15, 8, 16, SEG_GRAPH } }, + { 0x111, { MM_DIRECT, 640, 480, 16, 8, 16, SEG_GRAPH } }, + { 0x112, { MM_DIRECT, 640, 480, 24, 8, 16, SEG_GRAPH } }, + { 0x113, { MM_DIRECT, 800, 600, 15, 8, 16, SEG_GRAPH } }, + { 0x114, { MM_DIRECT, 800, 600, 16, 8, 16, SEG_GRAPH } }, + { 0x115, { MM_DIRECT, 800, 600, 24, 8, 16, SEG_GRAPH } }, + { 0x116, { MM_DIRECT, 1024, 768, 15, 8, 16, SEG_GRAPH } }, + { 0x117, { MM_DIRECT, 1024, 768, 16, 8, 16, SEG_GRAPH } }, + { 0x118, { MM_DIRECT, 1024, 768, 24, 8, 16, SEG_GRAPH } }, + { 0x119, { MM_DIRECT, 1280, 1024, 15, 8, 16, SEG_GRAPH } }, + { 0x11A, { MM_DIRECT, 1280, 1024, 16, 8, 16, SEG_GRAPH } }, +}; + +struct vgamode_s *geodevga_find_mode(int mode) +{ + struct geodevga_mode *m = geodevga_modes; + for (; m < &geodevga_modes[ARRAY_SIZE(geodevga_modes)]; m++) + if (GET_GLOBAL(m->mode) == mode) + return &m->info; + return stdvga_find_mode(mode); +} + +void geodevga_list_modes(u16 seg, u16 *dest, u16 *last) +{ + struct geodevga_mode *m = geodevga_modes; + for (; m < &geodevga_modes[ARRAY_SIZE(geodevga_modes)] && dest<last; m++) { + u16 mode = GET_GLOBAL(m->mode); + if (mode == 0xffff) + continue; + SET_FARVAR(seg, *dest, mode); + dest++; + } + stdvga_list_modes(seg, dest, last); +} + +/**************************************************************** * MSR and High Mem access through VSA Virtual Register ****************************************************************/
diff --git a/vgasrc/geodevga.h b/vgasrc/geodevga.h index 14e33d6..fe149df 100644 --- a/vgasrc/geodevga.h +++ b/vgasrc/geodevga.h @@ -65,5 +65,7 @@ #define DC_CFG_MSK 0xf000a6
int geodevga_init(); +struct vgamode_s *geodevga_find_mode(int mode); +void geodevga_list_modes(u16 seg, u16 *dest, u16 *last);
#endif