[SeaBIOS] [PATCH 09/15] Add basic mode setting stub
Christian Gmeiner
christian.gmeiner at gmail.com
Sat Sep 1 17:13:00 CEST 2012
This commit adds a simple mode setting stub to the geode driver part.
In later commits mode setting will be completed.
Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
---
vgasrc/geodevga.c | 26 ++++++++++++++++++++++++++
vgasrc/geodevga.h | 1 +
vgasrc/vgahw.h | 2 ++
3 files changed, 29 insertions(+)
diff --git a/vgasrc/geodevga.c b/vgasrc/geodevga.c
index a1a79c9..867ad87 100644
--- a/vgasrc/geodevga.c
+++ b/vgasrc/geodevga.c
@@ -43,6 +43,12 @@ static struct geodevga_mode
{ 0x11A, { MM_DIRECT, 1280, 1024, 16, 8, 16, SEG_GRAPH } },
};
+static int is_geodevga_mode(struct vgamode_s *vmode_g)
+{
+ return (vmode_g >= &geodevga_modes[0].info
+ && vmode_g <= &geodevga_modes[ARRAY_SIZE(geodevga_modes)-1].info);
+}
+
struct vgamode_s *geodevga_find_mode(int mode)
{
struct geodevga_mode *m = geodevga_modes;
@@ -259,6 +265,26 @@ int vp_setup(void)
return 0;
}
+/****************************************************************
+ * Mode setting
+ ****************************************************************/
+
+int geodevga_set_mode(struct vgamode_s *vmode_g, int flags)
+{
+ if (! is_geodevga_mode(vmode_g))
+ return stdvga_set_mode(vmode_g, flags);
+
+ u16 width = GET_GLOBAL(vmode_g->width);
+ u16 height = GET_GLOBAL(vmode_g->height);
+ u8 depth = GET_GLOBAL(vmode_g->depth);
+
+ dprintf(1, "Setting up VESA mode %ux%ux%u\n", width, height, depth);
+
+ /* TODO stub */
+
+ return -1;
+}
+
static u8 geode_crtc_01[] VAR16 = {
0x2d, 0x27, 0x28, 0x90, 0x29, 0x8e, 0xbf, 0x1f,
0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,
diff --git a/vgasrc/geodevga.h b/vgasrc/geodevga.h
index fe149df..2651640 100644
--- a/vgasrc/geodevga.h
+++ b/vgasrc/geodevga.h
@@ -67,5 +67,6 @@
int geodevga_init();
struct vgamode_s *geodevga_find_mode(int mode);
void geodevga_list_modes(u16 seg, u16 *dest, u16 *last);
+int geodevga_set_mode(struct vgamode_s *vmode_g, int flags);
#endif
diff --git a/vgasrc/vgahw.h b/vgasrc/vgahw.h
index 1842934..c903109 100644
--- a/vgasrc/vgahw.h
+++ b/vgasrc/vgahw.h
@@ -24,6 +24,8 @@ static inline int vgahw_set_mode(struct vgamode_s *vmode_g, int flags) {
return clext_set_mode(vmode_g, flags);
if (CONFIG_VGA_BOCHS)
return bochsvga_set_mode(vmode_g, flags);
+ if (CONFIG_VGA_GEODELX)
+ return geodevga_set_mode(vmode_g, flags);
return stdvga_set_mode(vmode_g, flags);
}
--
1.7.11.rc2.5.g68f532f
More information about the SeaBIOS
mailing list