vgabios: Move BDA setting from driver code to common code.

Always setup the BDA on a mode switch.  Call that BDA setup code

Also, always set vbe_mode and use that for finding the current mode
and for reporting the mode to vbe callers.

Signed-off-by: Kevin O'Connor <>
diff --git a/vgasrc/clext.h b/vgasrc/clext.h
index a14cf13..718b756 100644
--- a/vgasrc/clext.h
+++ b/vgasrc/clext.h
@@ -4,7 +4,7 @@
 #include "types.h" // u16
 struct vgamode_s *clext_find_mode(int mode);
-int clext_set_mode(int mode, int flags);
+int clext_set_mode(struct vgamode_s *vmode_g, int flags);
 void clext_list_modes(u16 seg, u16 *dest, u16 *last);
 int clext_init(void);
 struct bregs;