]> xenbits.xensource.com Git - seabios.git/commitdiff
vgabios: Fill in available legacy modes in video_func_static at runtime
authorKevin O'Connor <kevin@koconnor.net>
Thu, 23 Oct 2014 20:37:08 +0000 (16:37 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 27 Oct 2014 15:03:12 +0000 (11:03 -0400)
Instead of hard coding the list of modes, fill them in from the list
of supported modes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgasrc/stdvgamodes.c
vgasrc/vgabios.c
vgasrc/vgabios.h

index 53b7463a028380ab03a1b14d618f3eb3e2ea6229..c553514fad6e313d9052c0403d557d277a9ab5fe 100644 (file)
@@ -397,6 +397,15 @@ stdvga_build_video_param(void)
                    , get_global_seg(), GET_GLOBAL(stdmode_g->grdc_regs)
                    , ARRAY_SIZE(vparam_g->grdc_regs));
     }
+
+    // Fill available legacy modes in video_func_static table
+    u32 modes = 0;
+    for (i = 0; i < ARRAY_SIZE(vga_modes); i++) {
+        u16 mode = vga_modes[i].mode;
+        if (mode <= 0x13)
+            modes |= 1<<i;
+    }
+    SET_VGA(static_functionality.modes, modes);
 }
 
 void
index 9b94f4d6041f739b5f2dd6f9dfa9e6d809687ed7..858f415afa10c316af4e4f52e6a6b13367e5e6e8 100644 (file)
@@ -1076,8 +1076,8 @@ handle_101a(struct bregs *regs)
 }
 
 
-static struct video_func_static static_functionality VAR16 = {
-    .modes          = 0x0fe0ff,
+struct video_func_static static_functionality VAR16 = {
+    .modes          = 0x00,   // Filled in by stdvga_build_video_param()
     .scanlines      = 0x07,   // 200, 350, 400 scan lines
     .cblocks        = 0x02,   // mamimum number of visible charsets in text mode
     .active_cblocks = 0x08,   // total number of charset blocks in text mode
index 397225aaf8a90a7e32a0e52f4f4411cf12678909..d06ebb4cfb1f24c21a58e3c8747b8090004eaad1 100644 (file)
@@ -107,6 +107,7 @@ u16 calc_page_size(u8 memmodel, u16 width, u16 height);
 int bda_save_restore(int cmd, u16 seg, void *data);
 struct vgamode_s *get_current_mode(void);
 int vga_set_mode(int mode, int flags);
+extern struct video_func_static static_functionality;
 
 // vgafb.c
 void init_gfx_op(struct gfx_op *op, struct vgamode_s *vmode_g);