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 <kra...@redhat.com>
---
 vgasrc/cbvga.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/vgasrc/cbvga.c b/vgasrc/cbvga.c
index 672daa604c..2139a00904 100644
--- a/vgasrc/cbvga.c
+++ b/vgasrc/cbvga.c
@@ -263,6 +263,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));
+        }
     }
 }
 
-- 
2.9.3


_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios

Reply via email to