vga: fix bochs lfb size display
[seabios.git] / vgasrc / vgahw.h
index ca8798cb8ec1b8a991ea52c63f928f5715659349..044cd32ca281184f834e0e5922c96e05bf98b665 100644 (file)
@@ -61,4 +61,72 @@ static inline int vgahw_set_window(struct vgamode_s *vmode_g, int window
     return stdvga_set_window(vmode_g, window, val);
 }
 
+static inline int vgahw_get_linelength(struct vgamode_s *vmode_g) {
+    if (CONFIG_VGA_CIRRUS)
+        return clext_get_linelength(vmode_g);
+    if (CONFIG_VGA_BOCHS)
+        return bochsvga_get_linelength(vmode_g);
+    return stdvga_get_linelength(vmode_g);
+}
+
+static inline int vgahw_set_linelength(struct vgamode_s *vmode_g, int val) {
+    if (CONFIG_VGA_CIRRUS)
+        return clext_set_linelength(vmode_g, val);
+    if (CONFIG_VGA_BOCHS)
+        return bochsvga_set_linelength(vmode_g, val);
+    return stdvga_set_linelength(vmode_g, val);
+}
+
+static inline int vgahw_get_displaystart(struct vgamode_s *vmode_g) {
+    if (CONFIG_VGA_CIRRUS)
+        return clext_get_displaystart(vmode_g);
+    if (CONFIG_VGA_BOCHS)
+        return bochsvga_get_displaystart(vmode_g);
+    return stdvga_get_displaystart(vmode_g);
+}
+
+static inline int vgahw_set_displaystart(struct vgamode_s *vmode_g, int val) {
+    if (CONFIG_VGA_CIRRUS)
+        return clext_set_displaystart(vmode_g, val);
+    if (CONFIG_VGA_BOCHS)
+        return bochsvga_set_displaystart(vmode_g, val);
+    return stdvga_set_displaystart(vmode_g, val);
+}
+
+static inline int vgahw_get_dacformat(struct vgamode_s *vmode_g) {
+    if (CONFIG_VGA_BOCHS)
+        return bochsvga_get_dacformat(vmode_g);
+    return stdvga_get_dacformat(vmode_g);
+}
+
+static inline int vgahw_set_dacformat(struct vgamode_s *vmode_g, int val) {
+    if (CONFIG_VGA_BOCHS)
+        return bochsvga_set_dacformat(vmode_g, val);
+    return stdvga_set_dacformat(vmode_g, val);
+}
+
+static inline int vgahw_size_state(int states) {
+    if (CONFIG_VGA_CIRRUS)
+        return clext_size_state(states);
+    if (CONFIG_VGA_BOCHS)
+        return bochsvga_size_state(states);
+    return stdvga_size_state(states);
+}
+
+static inline int vgahw_save_state(u16 seg, void *data, int states) {
+    if (CONFIG_VGA_CIRRUS)
+        return clext_save_state(seg, data, states);
+    if (CONFIG_VGA_BOCHS)
+        return bochsvga_save_state(seg, data, states);
+    return stdvga_save_state(seg, data, states);
+}
+
+static inline int vgahw_restore_state(u16 seg, void *data, int states) {
+    if (CONFIG_VGA_CIRRUS)
+        return clext_restore_state(seg, data, states);
+    if (CONFIG_VGA_BOCHS)
+        return bochsvga_restore_state(seg, data, states);
+    return stdvga_restore_state(seg, data, states);
+}
+
 #endif // vgahw.h