]> xenbits.xensource.com Git - seabios.git/commitdiff
cbvga_setup_modes: use real mode number instead of 0x140
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 30 May 2018 20:52:04 +0000 (22:52 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 22 Jun 2018 05:44:07 +0000 (07:44 +0200)
In case the framebuffer size matches one of the cbvga video modes
just use that mode number instead of 0x140.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
vgasrc/cbvga.c

index 9ae97d5f5106d5163a4017e68ed063ec6cc3fa5f..fb68620067592fb3acff0226f1cee9288ca48ebc 100644 (file)
@@ -260,6 +260,11 @@ cbvga_setup_modes(u64 addr, u8 bpp, u32 xlines, u32 ylines, u32 linelength)
             dprintf(3, "Removing mode %x\n", GET_GLOBAL(cbmode_g->mode));
             SET_VGA(cbmode_g->mode, 0xffff);
         }
+        if ((GET_GLOBAL(cbmode_g->info.height) == ylines)
+            && (GET_GLOBAL(cbmode_g->info.width) == xlines)
+            && (GET_GLOBAL(cbmode_g->info.depth) == bpp)) {
+            SET_VGA(CBmode, GET_GLOBAL(cbmode_g->mode));
+        }
     }
 }