]> xenbits.xensource.com Git - seabios.git/commitdiff
vgabios: Fix generating modes list for static_functionality
authorSteven Price <steven@ecrips.co.uk>
Sat, 12 Oct 2024 11:34:34 +0000 (11:34 +0000)
committerKevin O'Connor <kevin@koconnor.net>
Fri, 25 Oct 2024 15:55:25 +0000 (11:55 -0400)
Accessing the data in the vga_modes array requires using GET_GLOBAL(),
and the bits set in the bit array should correspond to the modes, not
the indexes in vga_modes.

With this change the modes calculated matches the expected value of
0xfe0ff.

Fixes: 12900b1a2431 ("vgabios: Fill in available legacy modes in video_func_static at runtime")
Signed-off-by: Steven Price <steven@ecrips.co.uk>
vgasrc/stdvgamodes.c

index b1d0ef674db463a0b7ab6715ab76783d6b4db308..d72d36b4a27ddcc89da7bc5698bb203253a48f3f 100644 (file)
@@ -419,9 +419,9 @@ stdvga_build_video_param(void)
     // 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;
+        u16 mode = GET_GLOBAL(vga_modes[i].mode);
         if (mode <= 0x13)
-            modes |= 1<<i;
+            modes |= 1<<mode;
     }
     SET_VGA(static_functionality.modes, modes);
 }