vgabios: Move BDA setting from driver code to common code.
[seabios.git] / vgasrc / vgahw.h
index fea041a2df0ed5bad1c510bb6fa1aa81cf5c6725..bb5112a691d23def31ea523f17eeb3ac9834dada 100644 (file)
@@ -9,12 +9,29 @@
 #include "stdvga.h" // stdvga_set_mode
 #include "geodevga.h" // geodevga_init
 
-static inline int vgahw_set_mode(int mode, int flags) {
+static inline struct vgamode_s *vgahw_find_mode(int mode) {
     if (CONFIG_VGA_CIRRUS)
-        return clext_set_mode(mode, flags);
+        return clext_find_mode(mode);
     if (CONFIG_VGA_BOCHS)
-        return bochsvga_set_mode(mode, flags);
-    return stdvga_set_mode(mode, flags);
+        return bochsvga_find_mode(mode);
+    return stdvga_find_mode(mode);
+}
+
+static inline int vgahw_set_mode(struct vgamode_s *vmode_g, int flags) {
+    if (CONFIG_VGA_CIRRUS)
+        return clext_set_mode(vmode_g, flags);
+    if (CONFIG_VGA_BOCHS)
+        return bochsvga_set_mode(vmode_g, flags);
+    return stdvga_set_mode(vmode_g, flags);
+}
+
+static inline void vgahw_list_modes(u16 seg, u16 *dest, u16 *last) {
+    if (CONFIG_VGA_CIRRUS)
+        clext_list_modes(seg, dest, last);
+    else if (CONFIG_VGA_BOCHS)
+        bochsvga_list_modes(seg, dest, last);
+    else
+        stdvga_list_modes(seg, dest, last);
 }
 
 static inline int vgahw_init(void) {
@@ -22,7 +39,7 @@ static inline int vgahw_init(void) {
         return clext_init();
     if (CONFIG_VGA_BOCHS)
         return bochsvga_init();
-    if (CONFIG_VGA_GEODELX)
+    if (CONFIG_VGA_GEODEGX2 || CONFIG_VGA_GEODELX)
         return geodevga_init();
     return stdvga_init();
 }