vgabios: Extract out common parts of struct vgamode_s.
[seabios.git] / vgasrc / vgahw.h
index 57e41c3b671c22503b356065e45a5c2fcd06d44f..55e3bc4cac9d5bf9078c28b5987e09652d6d7400 100644 (file)
@@ -7,6 +7,11 @@
 #include "clext.h" // clext_set_mode
 #include "bochsvga.h" // bochsvga_set_mode
 #include "stdvga.h" // stdvga_set_mode
+#include "geodevga.h" // geodevga_init
+
+static inline struct vgamode_s *vgahw_find_mode(int mode) {
+    return stdvga_find_mode(mode);
+}
 
 static inline int vgahw_set_mode(int mode, int flags) {
     if (CONFIG_VGA_CIRRUS)
@@ -16,4 +21,14 @@ static inline int vgahw_set_mode(int mode, int flags) {
     return stdvga_set_mode(mode, flags);
 }
 
+static inline int vgahw_init(void) {
+    if (CONFIG_VGA_CIRRUS)
+        return clext_init();
+    if (CONFIG_VGA_BOCHS)
+        return bochsvga_init();
+    if (CONFIG_VGA_GEODEGX2 || CONFIG_VGA_GEODELX)
+        return geodevga_init();
+    return stdvga_init();
+}
+
 #endif // vgahw.h