From 9565908ba0e39dba28c032cbd6b9ba0f61322c78 Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Mon, 5 Sep 2016 01:19:57 +0200
Subject: [PATCH 1/7] kernel/vga: Change indentation to tabs and other style
 fixes.

---
 sys/dev/video/fb/vga.c | 2457 ++++++++++++++++++++--------------------
 1 file changed, 1235 insertions(+), 1222 deletions(-)

diff --git a/sys/dev/video/fb/vga.c b/sys/dev/video/fb/vga.c
index b5d8b31951..53f5ab8999 100644
--- a/sys/dev/video/fb/vga.c
+++ b/sys/dev/video/fb/vga.c
@@ -161,21 +161,21 @@ vga_mmap(cdev_t dev, vga_softc_t *sc, vm_offset_t offset, int prot)
 
 /* video adapter state buffer */
 struct adp_state {
-    int			sig;
+	int		sig;
 #define V_STATE_SIG	0x736f6962
-    u_char		regs[V_MODE_PARAM_SIZE];
+	u_char		regs[V_MODE_PARAM_SIZE];
 };
 typedef struct adp_state adp_state_t;
 
-/* 
+/*
  * NOTE: `va_window' should have a virtual address, but is initialized
  * with a physical address in the following table, as verify_adapter()
  * will perform address conversion at run-time.
  */
 static video_adapter_t biosadapter = {
-    0, KD_VGA, VGA_DRIVER_NAME, 0, 0, V_ADP_COLOR, IO_VGA, 32,
-    EGA_BUF_BASE, EGA_BUF_SIZE, CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 
-    0, 0, 0, M_VGA_C80x25, M_C80x25, M_VGA_C80x25
+	0, KD_VGA, VGA_DRIVER_NAME, 0, 0, V_ADP_COLOR, IO_VGA, 32,
+	EGA_BUF_BASE, EGA_BUF_SIZE, CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE,
+	0, 0, 0, M_VGA_C80x25, M_C80x25, M_VGA_C80x25
 };
 
 /* video driver declarations */
@@ -216,7 +216,7 @@ static video_switch_t vgavidsw = {
 	vga_probe,
 	vga_init,
 	vga_get_info,
-	vga_query_mode,	
+	vga_query_mode,
 	vga_set_mode,
 	vga_save_font,
 	vga_load_font,
@@ -248,117 +248,117 @@ VIDEO_DRIVER(vga, vgavidsw, vga_configure);
 #define NA		(-2)
 
 static video_info_t bios_vmode[] = {
-    /* CGA */
-    { M_B40x25,     V_INFO_COLOR, 40, 25, 8,  8, 2, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_C40x25,     V_INFO_COLOR, 40, 25, 8,  8, 4, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_B80x25,     V_INFO_COLOR, 80, 25, 8,  8, 2, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_C80x25,     V_INFO_COLOR, 80, 25, 8,  8, 4, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    /* EGA */
-    { M_ENH_B40x25, V_INFO_COLOR, 40, 25, 8, 14, 2, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_ENH_C40x25, V_INFO_COLOR, 40, 25, 8, 14, 4, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_ENH_B80x25, V_INFO_COLOR, 80, 25, 8, 14, 2, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_ENH_C80x25, V_INFO_COLOR, 80, 25, 8, 14, 4, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    /* VGA */
-    { M_VGA_C40x25, V_INFO_COLOR, 40, 25, 8, 16, 4, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_VGA_M80x25, 0,            80, 25, 8, 16, 2, 1,
-      MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_VGA_C80x25, V_INFO_COLOR, 80, 25, 8, 16, 4, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    /* MDA */
-    { M_EGAMONO80x25, 0,          80, 25, 8, 14, 2, 1,
-      MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    /* EGA */
-    { M_ENH_B80x43, 0,            80, 43, 8,  8, 2, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_ENH_C80x43, V_INFO_COLOR, 80, 43, 8,  8, 4, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    /* VGA */
-    { M_VGA_M80x30, 0,            80, 30, 8, 16, 2, 1,
-      MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_VGA_C80x30, V_INFO_COLOR, 80, 30, 8, 16, 4, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_VGA_M80x50, 0,            80, 50, 8,  8, 2, 1,
-      MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_VGA_C80x50, V_INFO_COLOR, 80, 50, 8,  8, 4, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_VGA_M80x60, 0,            80, 60, 8,  8, 2, 1,
-      MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_VGA_C80x60, V_INFO_COLOR, 80, 60, 8,  8, 4, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	/* CGA */
+	{ M_B40x25,     V_INFO_COLOR, 40, 25, 8,  8, 2, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_C40x25,     V_INFO_COLOR, 40, 25, 8,  8, 4, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_B80x25,     V_INFO_COLOR, 80, 25, 8,  8, 2, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_C80x25,     V_INFO_COLOR, 80, 25, 8,  8, 4, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	/* EGA */
+	{ M_ENH_B40x25, V_INFO_COLOR, 40, 25, 8, 14, 2, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_ENH_C40x25, V_INFO_COLOR, 40, 25, 8, 14, 4, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_ENH_B80x25, V_INFO_COLOR, 80, 25, 8, 14, 2, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_ENH_C80x25, V_INFO_COLOR, 80, 25, 8, 14, 4, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	/* VGA */
+	{ M_VGA_C40x25, V_INFO_COLOR, 40, 25, 8, 16, 4, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_M80x25, 0,            80, 25, 8, 16, 2, 1,
+	  MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_C80x25, V_INFO_COLOR, 80, 25, 8, 16, 4, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	/* MDA */
+	{ M_EGAMONO80x25, 0,          80, 25, 8, 14, 2, 1,
+	  MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	/* EGA */
+	{ M_ENH_B80x43, 0,            80, 43, 8,  8, 2, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_ENH_C80x43, V_INFO_COLOR, 80, 43, 8,  8, 4, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	/* VGA */
+	{ M_VGA_M80x30, 0,            80, 30, 8, 16, 2, 1,
+	  MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_C80x30, V_INFO_COLOR, 80, 30, 8, 16, 4, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_M80x50, 0,            80, 50, 8,  8, 2, 1,
+	  MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_C80x50, V_INFO_COLOR, 80, 50, 8,  8, 4, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_M80x60, 0,            80, 60, 8,  8, 2, 1,
+	  MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_C80x60, V_INFO_COLOR, 80, 60, 8,  8, 4, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
 
 #ifndef VGA_NO_MODE_CHANGE
 
 #ifdef VGA_WIDTH90
-    { M_VGA_M90x25, 0,            90, 25, 8, 16, 2, 1,
-      MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_VGA_C90x25, V_INFO_COLOR, 90, 25, 8, 16, 4, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_VGA_M90x30, 0,            90, 30, 8, 16, 2, 1,
-      MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_VGA_C90x30, V_INFO_COLOR, 90, 30, 8, 16, 4, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_VGA_M90x43, 0,            90, 43, 8,  8, 2, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_VGA_C90x43, V_INFO_COLOR, 90, 43, 8,  8, 4, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_VGA_M90x50, 0,            90, 50, 8,  8, 2, 1,
-      MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_VGA_C90x50, V_INFO_COLOR, 90, 50, 8,  8, 4, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_VGA_M90x60, 0,            90, 60, 8,  8, 2, 1,
-      MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
-    { M_VGA_C90x60, V_INFO_COLOR, 90, 60, 8,  8, 4, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_M90x25, 0,            90, 25, 8, 16, 2, 1,
+	  MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_C90x25, V_INFO_COLOR, 90, 25, 8, 16, 4, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_M90x30, 0,            90, 30, 8, 16, 2, 1,
+	  MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_C90x30, V_INFO_COLOR, 90, 30, 8, 16, 4, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_M90x43, 0,            90, 43, 8,  8, 2, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_C90x43, V_INFO_COLOR, 90, 43, 8,  8, 4, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_M90x50, 0,            90, 50, 8,  8, 2, 1,
+	  MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_C90x50, V_INFO_COLOR, 90, 50, 8,  8, 4, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_M90x60, 0,            90, 60, 8,  8, 2, 1,
+	  MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
+	{ M_VGA_C90x60, V_INFO_COLOR, 90, 60, 8,  8, 4, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT },
 #endif /* VGA_WIDTH90 */
 
-    /* CGA */
-    { M_BG320,      V_INFO_COLOR | V_INFO_GRAPHICS, 320, 200, 8,  8, 2, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_CGA },
-    { M_CG320,      V_INFO_COLOR | V_INFO_GRAPHICS, 320, 200, 8,  8, 2, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_CGA },
-    { M_BG640,      V_INFO_COLOR | V_INFO_GRAPHICS, 640, 200, 8,  8, 1, 1,
-      CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_CGA },
-    /* EGA */
-    { M_CG320_D,    V_INFO_COLOR | V_INFO_GRAPHICS, 320, 200, 8,  8, 4, 4,
-      GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0,
-      V_INFO_MM_PLANAR },
-    { M_CG640_E,    V_INFO_COLOR | V_INFO_GRAPHICS, 640, 200, 8,  8, 4, 4,
-      GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 ,
-      V_INFO_MM_PLANAR },
-    { M_EGAMONOAPA, V_INFO_GRAPHICS,                640, 350, 8, 14, 4, 4,
-      GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, 64*1024, 0, 0 ,
-      V_INFO_MM_PLANAR },
-    { M_ENHMONOAPA2,V_INFO_GRAPHICS,                640, 350, 8, 14, 4, 4,
-      GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 ,
-      V_INFO_MM_PLANAR },
-    { M_CG640x350,  V_INFO_COLOR | V_INFO_GRAPHICS, 640, 350, 8, 14, 2, 2,
-      GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 ,
-      V_INFO_MM_PLANAR },
-    { M_ENH_CG640,  V_INFO_COLOR | V_INFO_GRAPHICS, 640, 350, 8, 14, 4, 4,
-      GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 ,
-      V_INFO_MM_PLANAR },
-    /* VGA */
-    { M_BG640x480,  V_INFO_COLOR | V_INFO_GRAPHICS, 640, 480, 8, 16, 4, 4,
-      GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 ,
-      V_INFO_MM_PLANAR },
-    { M_CG640x480,  V_INFO_COLOR | V_INFO_GRAPHICS, 640, 480, 8, 16, 4, 4,
-      GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 ,
-      V_INFO_MM_PLANAR },
-    { M_VGA_CG320,  V_INFO_COLOR | V_INFO_GRAPHICS, 320, 200, 8,  8, 8, 1,
-      GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0,
-      V_INFO_MM_PACKED, 1 },
-    { M_VGA_MODEX,  V_INFO_COLOR | V_INFO_GRAPHICS, 320, 240, 8,  8, 8, 4,
-      GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0,
-      V_INFO_MM_VGAX, 1 },
+	/* CGA */
+	{ M_BG320,      V_INFO_COLOR | V_INFO_GRAPHICS, 320, 200, 8,  8, 2, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_CGA },
+	{ M_CG320,      V_INFO_COLOR | V_INFO_GRAPHICS, 320, 200, 8,  8, 2, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_CGA },
+	{ M_BG640,      V_INFO_COLOR | V_INFO_GRAPHICS, 640, 200, 8,  8, 1, 1,
+	  CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_CGA },
+	/* EGA */
+	{ M_CG320_D,    V_INFO_COLOR | V_INFO_GRAPHICS, 320, 200, 8,  8, 4, 4,
+	  GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0,
+	  V_INFO_MM_PLANAR },
+	{ M_CG640_E,    V_INFO_COLOR | V_INFO_GRAPHICS, 640, 200, 8,  8, 4, 4,
+	  GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 ,
+	  V_INFO_MM_PLANAR },
+	{ M_EGAMONOAPA, V_INFO_GRAPHICS,                640, 350, 8, 14, 4, 4,
+	  GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, 64*1024, 0, 0 ,
+	  V_INFO_MM_PLANAR },
+	{ M_ENHMONOAPA2,V_INFO_GRAPHICS,                640, 350, 8, 14, 4, 4,
+	  GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 ,
+	  V_INFO_MM_PLANAR },
+	{ M_CG640x350,  V_INFO_COLOR | V_INFO_GRAPHICS, 640, 350, 8, 14, 2, 2,
+	  GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 ,
+	  V_INFO_MM_PLANAR },
+	{ M_ENH_CG640,  V_INFO_COLOR | V_INFO_GRAPHICS, 640, 350, 8, 14, 4, 4,
+	  GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 ,
+	  V_INFO_MM_PLANAR },
+	/* VGA */
+	{ M_BG640x480,  V_INFO_COLOR | V_INFO_GRAPHICS, 640, 480, 8, 16, 4, 4,
+	  GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 ,
+	  V_INFO_MM_PLANAR },
+	{ M_CG640x480,  V_INFO_COLOR | V_INFO_GRAPHICS, 640, 480, 8, 16, 4, 4,
+	  GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0 ,
+	  V_INFO_MM_PLANAR },
+	{ M_VGA_CG320,  V_INFO_COLOR | V_INFO_GRAPHICS, 320, 200, 8,  8, 8, 1,
+	  GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0,
+	  V_INFO_MM_PACKED, 1 },
+	{ M_VGA_MODEX,  V_INFO_COLOR | V_INFO_GRAPHICS, 320, 240, 8,  8, 8, 4,
+	  GRAPHICS_BUF_BASE, GRAPHICS_BUF_SIZE, GRAPHICS_BUF_SIZE, 0, 0,
+	  V_INFO_MM_VGAX, 1 },
 #endif /* VGA_NO_MODE_CHANGE */
 
     { EOT },
@@ -407,11 +407,11 @@ static void packed_fill(video_adapter_t *, int);
 static void direct_fill(video_adapter_t *, int);
 #endif /* !VGA_NO_MODE_CHANGE */
 
-#define	ISMAPPED(pa, width)				\
-	(((pa) <= (u_long)0x1000 - (width)) 		\
+#define	ISMAPPED(pa, width)					\
+	(((pa) <= (u_long)0x1000 - (width)) 			\
 	 || ((pa) >= ISA_HOLE_START && (pa) <= 0x100000 - (width)))
 
-#define	prologue(adp, flag, err)			\
+#define	prologue(adp, flag, err)				\
 	if (!vga_init_done || !((adp)->va_flags & (flag)))	\
 	    return (err)
 
@@ -419,20 +419,21 @@ static void direct_fill(video_adapter_t *, int);
 static int
 vga_configure(int flags)
 {
-    /* No VGA when booted via UEFI */
-    if (probe_efi_fb(0) == 0)
-        return 0;	/* XXX nobody uses this return value */
-
-    /* XXX Also abort if VGA isn't present according to ACPI FADT BootFlags */
-
-    probe_adapters();
-    if (probe_done(&biosadapter)) {
-	biosadapter.va_flags |= V_ADP_INITIALIZED;
-	if (!config_done(&biosadapter) && !(vid_register(&biosadapter) < 0))
-	    biosadapter.va_flags |= V_ADP_REGISTERED;
-    }
+	/* No VGA when booted via UEFI */
+	if (probe_efi_fb(0) == 0)
+		return 0;	/* XXX nobody uses this return value */
+
+	/* XXX Also abort if VGA isn't present according to ACPI FADT BootFlags */
+
+	probe_adapters();
+	if (probe_done(&biosadapter)) {
+		biosadapter.va_flags |= V_ADP_INITIALIZED;
+		if (!config_done(&biosadapter) &&
+		    !(vid_register(&biosadapter) < 0))
+			biosadapter.va_flags |= V_ADP_REGISTERED;
+	}
 
-    return 1;
+	return 1;
 }
 
 /* local subroutines */
@@ -442,17 +443,17 @@ vga_configure(int flags)
 static void
 map_mode_table(u_char *map[], u_char *table)
 {
-    int i, valid;
-
-    for(i = 0; i < V_MODE_MAP_SIZE; ++i) {
-	map[i] = table + i*V_MODE_PARAM_SIZE;
-	valid = 0;
-	if ((map[i][0] == 40 && map[i][1] == 24) ||
-	    (map[i][0] == 80 && (map[i][1] == 24 || map[i][1] == 29)))
-	    valid++;
-	if (!valid)
-	    map[i] = NULL;
-    }
+	int i, valid;
+
+	for(i = 0; i < V_MODE_MAP_SIZE; ++i) {
+		map[i] = table + i*V_MODE_PARAM_SIZE;
+		valid = 0;
+		if ((map[i][0] == 40 && map[i][1] == 24) ||
+		    (map[i][0] == 80 && (map[i][1] == 24 || map[i][1] == 29)))
+			valid++;
+		if (!valid)
+			map[i] = NULL;
+	}
 }
 #endif /* !VGA_NO_MODE_CHANGE */
 
@@ -461,64 +462,64 @@ map_mode_table(u_char *map[], u_char *table)
 static int
 map_mode_num(int mode)
 {
-    static struct {
-        int from;
-        int to;
-    } mode_map[] = {
-        { M_ENH_B80x43, M_ENH_B80x25 },
-        { M_ENH_C80x43, M_ENH_C80x25 },
-        { M_VGA_M80x30, M_VGA_M80x25 },
-        { M_VGA_C80x30, M_VGA_C80x25 },
-        { M_VGA_M80x50, M_VGA_M80x25 },
-        { M_VGA_C80x50, M_VGA_C80x25 },
-        { M_VGA_M80x60, M_VGA_M80x25 },
-        { M_VGA_C80x60, M_VGA_C80x25 },
+	static struct {
+		int from;
+		int to;
+	} mode_map[] = {
+		{ M_ENH_B80x43, M_ENH_B80x25 },
+		{ M_ENH_C80x43, M_ENH_C80x25 },
+		{ M_VGA_M80x30, M_VGA_M80x25 },
+		{ M_VGA_C80x30, M_VGA_C80x25 },
+		{ M_VGA_M80x50, M_VGA_M80x25 },
+		{ M_VGA_C80x50, M_VGA_C80x25 },
+		{ M_VGA_M80x60, M_VGA_M80x25 },
+		{ M_VGA_C80x60, M_VGA_C80x25 },
 #ifdef VGA_WIDTH90
-        { M_VGA_M90x25, M_VGA_M80x25 },
-        { M_VGA_C90x25, M_VGA_C80x25 },
-        { M_VGA_M90x30, M_VGA_M80x25 },
-        { M_VGA_C90x30, M_VGA_C80x25 },
-        { M_VGA_M90x43, M_ENH_B80x25 },
-        { M_VGA_C90x43, M_ENH_C80x25 },
-        { M_VGA_M90x50, M_VGA_M80x25 },
-        { M_VGA_C90x50, M_VGA_C80x25 },
-        { M_VGA_M90x60, M_VGA_M80x25 },
-        { M_VGA_C90x60, M_VGA_C80x25 },
+		{ M_VGA_M90x25, M_VGA_M80x25 },
+		{ M_VGA_C90x25, M_VGA_C80x25 },
+		{ M_VGA_M90x30, M_VGA_M80x25 },
+		{ M_VGA_C90x30, M_VGA_C80x25 },
+		{ M_VGA_M90x43, M_ENH_B80x25 },
+		{ M_VGA_C90x43, M_ENH_C80x25 },
+		{ M_VGA_M90x50, M_VGA_M80x25 },
+		{ M_VGA_C90x50, M_VGA_C80x25 },
+		{ M_VGA_M90x60, M_VGA_M80x25 },
+		{ M_VGA_C90x60, M_VGA_C80x25 },
 #endif
-        { M_VGA_MODEX,  M_VGA_CG320 },
-    };
-    int i;
-
-    for (i = 0; i < NELEM(mode_map); ++i) {
-        if (mode_map[i].from == mode)
-            return mode_map[i].to;
-    }
-    return mode;
+		{ M_VGA_MODEX,  M_VGA_CG320 },
+	};
+	int i;
+
+	for (i = 0; i < NELEM(mode_map); ++i) {
+		if (mode_map[i].from == mode)
+			return mode_map[i].to;
+	}
+	return mode;
 }
 
 /* turn the BIOS video number into our video mode number */
 static int
 map_bios_mode_num(int bios_mode)
 {
-    static int vga_modes[20] = {
-	M_VGA_C40x25, M_VGA_C40x25,	/* 0, 1 */
-	M_VGA_C80x25, M_VGA_C80x25,	/* 2, 3 */
-	M_BG320, M_CG320,
-	M_BG640,
-	M_VGA_M80x25,			/* 7 */
-	8, 9, 10, 11, 12,
-	M_CG320_D,
-	M_CG640_E,
-	M_ENHMONOAPA2,
-	M_ENH_CG640,
-	M_BG640x480, M_CG640x480, 
-	M_VGA_CG320,
-    };
-
-    if (bios_mode < NELEM(vga_modes))
-	return vga_modes[bios_mode];
-
-    return M_VGA_C80x25;
+	static int vga_modes[20] = {
+		M_VGA_C40x25, M_VGA_C40x25,	/* 0, 1 */
+		M_VGA_C80x25, M_VGA_C80x25,	/* 2, 3 */
+		M_BG320, M_CG320,
+		M_BG640,
+		M_VGA_M80x25,			/* 7 */
+		8, 9, 10, 11, 12,
+		M_CG320_D,
+		M_CG640_E,
+		M_ENHMONOAPA2,
+		M_ENH_CG640,
+		M_BG640x480, M_CG640x480,
+		M_VGA_CG320,
+	};
+
+	if (bios_mode < NELEM(vga_modes))
+		return vga_modes[bios_mode];
+
+	return M_VGA_C80x25;
 }
 #endif /* !VGA_NO_MODE_CHANGE */
 
@@ -527,281 +528,282 @@ static u_char *
 get_mode_param(int mode)
 {
 #ifndef VGA_NO_MODE_CHANGE
-    if (mode >= V_MODE_MAP_SIZE)
-	mode = map_mode_num(mode);
+	if (mode >= V_MODE_MAP_SIZE)
+		mode = map_mode_num(mode);
 #endif
-    if ((mode >= 0) && (mode < V_MODE_MAP_SIZE))
-	return mode_map[mode];
-    else
-	return NULL;
+	if ((mode >= 0) && (mode < V_MODE_MAP_SIZE))
+		return mode_map[mode];
+	else
+		return NULL;
 }
 
 static int
 verify_adapter(video_adapter_t *adp)
 {
-    vm_offset_t buf;
-    u_int16_t v;
+	vm_offset_t buf;
+	u_int16_t v;
 #ifndef VGA_NO_MODE_CHANGE
-    u_int32_t p;
+	u_int32_t p;
 #endif
 
-    buf = BIOS_PADDRTOVADDR(adp->va_window);
-    v = readw(buf);
-    writew(buf, 0xA55A);
-    if (readw(buf) != 0xA55A)
-	return ENXIO;
-    writew(buf, v);
+	buf = BIOS_PADDRTOVADDR(adp->va_window);
+	v = readw(buf);
+	writew(buf, 0xA55A);
+	if (readw(buf) != 0xA55A)
+		return ENXIO;
+	writew(buf, v);
 
-    outb(CRTC, 7);
-    if (inb(CRTC) != 7)
-	return ENXIO;
+	outb(CRTC, 7);
+	if (inb(CRTC) != 7)
+		return ENXIO;
 
-    adp->va_flags |= V_ADP_STATELOAD | V_ADP_STATESAVE | V_ADP_PALETTE |
-	V_ADP_BORDER;
+	adp->va_flags |= V_ADP_STATELOAD | V_ADP_STATESAVE | V_ADP_PALETTE |
+	    V_ADP_BORDER;
 
 #ifndef VGA_NO_MODE_CHANGE
-    /* get the BIOS video mode pointer */
-    p = *(u_int32_t *)BIOS_PADDRTOVADDR(0x4a8);
-    p = BIOS_SADDRTOLADDR(p);
-    if (ISMAPPED(p, sizeof(u_int32_t))) {
-	p = *(u_int32_t *)BIOS_PADDRTOVADDR(p);
+	/* get the BIOS video mode pointer */
+	p = *(u_int32_t *)BIOS_PADDRTOVADDR(0x4a8);
 	p = BIOS_SADDRTOLADDR(p);
-	if (ISMAPPED(p, V_MODE_PARAM_SIZE))
-	    video_mode_ptr = (u_char *)BIOS_PADDRTOVADDR(p);
-    }
+	if (ISMAPPED(p, sizeof(u_int32_t))) {
+		p = *(u_int32_t *)BIOS_PADDRTOVADDR(p);
+		p = BIOS_SADDRTOLADDR(p);
+		if (ISMAPPED(p, V_MODE_PARAM_SIZE))
+			video_mode_ptr = (u_char *)BIOS_PADDRTOVADDR(p);
+	}
 #endif
 
-    return 0;
+	return 0;
 }
 
 static void
 update_adapter_info(video_adapter_t *adp, video_info_t *info)
 {
-    adp->va_flags |= V_ADP_COLOR;
-    adp->va_window = BIOS_PADDRTOVADDR(info->vi_window);
-    adp->va_window_size = info->vi_window_size;
-    adp->va_window_gran = info->vi_window_gran;
-    adp->va_window_orig = 0;
-    /* XXX */
-    adp->va_buffer = info->vi_buffer;
-    adp->va_buffer_size = info->vi_buffer_size;
-    if (info->vi_mem_model == V_INFO_MM_VGAX) {
-	adp->va_line_width = info->vi_width/2;
-    } else if (info->vi_flags & V_INFO_GRAPHICS) {
-	switch (info->vi_depth/info->vi_planes) {
-	case 1:
-	    adp->va_line_width = info->vi_width/8;
-	    break;
-	case 2:
-	    adp->va_line_width = info->vi_width/4;
-	    break;
-	case 4:
-	    adp->va_line_width = info->vi_width/2;
-	    break;
-	case 8:
-	default: /* shouldn't happen */
-	    adp->va_line_width = info->vi_width;
-	    break;
+	adp->va_flags |= V_ADP_COLOR;
+	adp->va_window = BIOS_PADDRTOVADDR(info->vi_window);
+	adp->va_window_size = info->vi_window_size;
+	adp->va_window_gran = info->vi_window_gran;
+	adp->va_window_orig = 0;
+	/* XXX */
+	adp->va_buffer = info->vi_buffer;
+	adp->va_buffer_size = info->vi_buffer_size;
+	if (info->vi_mem_model == V_INFO_MM_VGAX) {
+		adp->va_line_width = info->vi_width/2;
+	} else if (info->vi_flags & V_INFO_GRAPHICS) {
+		switch (info->vi_depth/info->vi_planes) {
+		case 1:
+			adp->va_line_width = info->vi_width/8;
+			break;
+		case 2:
+			adp->va_line_width = info->vi_width/4;
+			break;
+		case 4:
+			adp->va_line_width = info->vi_width/2;
+			break;
+		case 8:
+		default: /* shouldn't happen */
+			adp->va_line_width = info->vi_width;
+			break;
+		}
+	} else {
+		adp->va_line_width = info->vi_width;
 	}
-    } else {
-	adp->va_line_width = info->vi_width;
-    }
-    adp->va_disp_start.x = 0;
-    adp->va_disp_start.y = 0;
-    bcopy(info, &adp->va_info, sizeof(adp->va_info));
+	adp->va_disp_start.x = 0;
+	adp->va_disp_start.y = 0;
+	bcopy(info, &adp->va_info, sizeof(adp->va_info));
 }
 
 /* probe video adapters and return the number of detected adapters */
 static int
 probe_adapters(void)
 {
-    video_adapter_t *adp;
-    video_info_t info;
+	video_adapter_t *adp;
+	video_info_t info;
 #ifndef VGA_NO_MODE_CHANGE
-    u_char *mp;
+	u_char *mp;
 #endif
-    int i;
+	int i;
 
-    /* do this test only once */
-    if (vga_init_done)
-	return 1;
-    vga_init_done = TRUE;
+	/* do this test only once */
+	if (vga_init_done)
+		return 1;
+	vga_init_done = TRUE;
 
-    if (verify_adapter(&biosadapter) != 0)
-	return 0;
+	if (verify_adapter(&biosadapter) != 0)
+		return 0;
 
-    biosadapter.va_flags |= V_ADP_PROBED;
+	biosadapter.va_flags |= V_ADP_PROBED;
 #ifndef VGA_NO_MODE_CHANGE
-    biosadapter.va_initial_bios_mode = readb(BIOS_PADDRTOVADDR(0x449));
-    biosadapter.va_mode = biosadapter.va_initial_mode =
-	map_bios_mode_num(biosadapter.va_initial_bios_mode);
+	biosadapter.va_initial_bios_mode = readb(BIOS_PADDRTOVADDR(0x449));
+	biosadapter.va_mode = biosadapter.va_initial_mode =
+	    map_bios_mode_num(biosadapter.va_initial_bios_mode);
 #endif
 
-    /*
-     * Ensure a zero start address. The registers are w/o for old
-     * hardware so it's too hard to relocate the active screen
-     * memory.
-     * This must be done before vga_save_state() for VGA.
-     */
-    outb(CRTC, 12);
-    outb(CRTC + 1, 0);
-    outb(CRTC, 13);
-    outb(CRTC + 1, 0);
-
-    /* the video mode parameter table in VGA BIOS */
-    /* NOTE: there can be only one VGA recognized by the video BIOS.
-     */
-    adp = &biosadapter;
-    bzero(mode_map, sizeof(mode_map));
-    vga_save_state(adp, &adpstate, sizeof(adpstate));
-    for(i = 0; i < 16; i++)
-	adp->va_palette_regs[i] = adpstate.regs[35 + i];
+	/*
+	 * Ensure a zero start address. The registers are w/o for old
+	 * hardware so it's too hard to relocate the active screen
+	 * memory.
+	 * This must be done before vga_save_state() for VGA.
+	 */
+	outb(CRTC, 12);
+	outb(CRTC + 1, 0);
+	outb(CRTC, 13);
+	outb(CRTC + 1, 0);
+
+	/*
+	 * the video mode parameter table in VGA BIOS
+	 * NOTE: there can be only one VGA recognized by the video BIOS.
+	 */
+	adp = &biosadapter;
+	bzero(mode_map, sizeof(mode_map));
+	vga_save_state(adp, &adpstate, sizeof(adpstate));
+	for(i = 0; i < 16; i++)
+		adp->va_palette_regs[i] = adpstate.regs[35 + i];
 #ifdef VGA_NO_MODE_CHANGE
-    mode_map[adp->va_initial_mode] = adpstate.regs;
-    rows_offset = 1;
-#else /* !VGA_NO_MODE_CHANGE */
-    if (video_mode_ptr == NULL) {
 	mode_map[adp->va_initial_mode] = adpstate.regs;
 	rows_offset = 1;
-    } else {
-	/* discard modes that we are not familiar with */
-	map_mode_table(mode_map, video_mode_ptr);
-	mp = get_mode_param(adp->va_initial_mode);
+#else /* !VGA_NO_MODE_CHANGE */
+	if (video_mode_ptr == NULL) {
+		mode_map[adp->va_initial_mode] = adpstate.regs;
+		rows_offset = 1;
+	} else {
+		/* discard modes that we are not familiar with */
+		map_mode_table(mode_map, video_mode_ptr);
+		mp = get_mode_param(adp->va_initial_mode);
 #ifndef VGA_KEEP_POWERON_MODE
-	if (mp != NULL) {
-	    bcopy(mp, adpstate2.regs, sizeof(adpstate2.regs));
-	    rows_offset = adpstate.regs[1] + 1 - mp[1];
-	} else
+		if (mp != NULL) {
+			bcopy(mp, adpstate2.regs, sizeof(adpstate2.regs));
+			rows_offset = adpstate.regs[1] + 1 - mp[1];
+		} else
 #endif
-	{
-	    mode_map[adp->va_initial_mode] = adpstate.regs;
-	    rows_offset = 1;
+		{
+			mode_map[adp->va_initial_mode] = adpstate.regs;
+			rows_offset = 1;
+		}
 	}
-    }
 #endif /* VGA_NO_MODE_CHANGE */
 
 #ifndef VGA_NO_MODE_CHANGE
-    adp->va_flags |= V_ADP_MODECHANGE;
+	adp->va_flags |= V_ADP_MODECHANGE;
 #endif
 #ifndef VGA_NO_FONT_LOADING
-    adp->va_flags |= V_ADP_FONT;
+	adp->va_flags |= V_ADP_FONT;
 #endif
 
-    /* XXX remove conflicting modes */
-    for (i = 0; i < M_VGA_CG320; i++) {
-	if (vga_get_info(&biosadapter, i, &info))
-	    continue;
-	if ((info.vi_flags & V_INFO_COLOR) != V_ADP_COLOR)
-	    mode_map[i] = NULL;
-    }
-
-    /* buffer address */
-    vga_get_info(&biosadapter, biosadapter.va_initial_mode, &info);
-    info.vi_flags &= ~V_INFO_LINEAR; /* XXX */
-    update_adapter_info(&biosadapter, &info);
-
-    /*
-     * XXX: we should verify the following values for the primary adapter...
-     * crtc I/O port address: *(u_int16_t *)BIOS_PADDRTOVADDR(0x463);
-     * color/mono display: (*(u_int8_t *)BIOS_PADDRTOVADDR(0x487) & 0x02) 
-     *                     ? 0 : V_ADP_COLOR;
-     * columns: *(u_int8_t *)BIOS_PADDRTOVADDR(0x44a);
-     * rows: *(u_int8_t *)BIOS_PADDRTOVADDR(0x484);
-     * font size: *(u_int8_t *)BIOS_PADDRTOVADDR(0x485);
-     * buffer size: *(u_int16_t *)BIOS_PADDRTOVADDR(0x44c);
-     */
-
-    return 1;
+	/* XXX remove conflicting modes */
+	for (i = 0; i < M_VGA_CG320; i++) {
+		if (vga_get_info(&biosadapter, i, &info))
+			continue;
+		if ((info.vi_flags & V_INFO_COLOR) != V_ADP_COLOR)
+			mode_map[i] = NULL;
+	}
+
+	/* buffer address */
+	vga_get_info(&biosadapter, biosadapter.va_initial_mode, &info);
+	info.vi_flags &= ~V_INFO_LINEAR; /* XXX */
+	update_adapter_info(&biosadapter, &info);
+
+	/*
+	 * XXX: we should verify the following values for the primary adapter
+	 * crtc I/O port address: *(u_int16_t *)BIOS_PADDRTOVADDR(0x463);
+	 * color/mono display: (*(u_int8_t *)BIOS_PADDRTOVADDR(0x487) & 0x02)
+	 *                     ? 0 : V_ADP_COLOR;
+	 * columns: *(u_int8_t *)BIOS_PADDRTOVADDR(0x44a);
+	 * rows: *(u_int8_t *)BIOS_PADDRTOVADDR(0x484);
+	 * font size: *(u_int8_t *)BIOS_PADDRTOVADDR(0x485);
+	 * buffer size: *(u_int16_t *)BIOS_PADDRTOVADDR(0x44c);
+	 */
+
+	return 1;
 }
 
 /* set the scan line length in pixel */
 static int
 set_line_length(video_adapter_t *adp, int pixel)
 {
-    u_char *mp;
-    int ppw;	/* pixels per word */
-    int bpl;	/* bytes per line */
-    int count;
-
-    mp = get_mode_param(adp->va_mode);
-    if (mp == NULL)
-	return EINVAL;
-
-    switch (adp->va_info.vi_mem_model) {
-    case V_INFO_MM_PLANAR:
-	ppw = 16/(adp->va_info.vi_depth/adp->va_info.vi_planes);
-	count = (pixel + ppw - 1)/ppw/2;
-	bpl = ((pixel + ppw - 1)/ppw/2)*4;
-	break;
-    case V_INFO_MM_PACKED:
-	count = (pixel + 7)/8;
-	bpl = ((pixel + 7)/8)*8;
-	break;
-    case V_INFO_MM_TEXT:
-	count = (pixel + 7)/8;			/* columns */
-	bpl = (pixel + 7)/8;			/* columns */
-	break;
-    default:
-	return ENODEV;
-    }
+	u_char *mp;
+	int ppw;	/* pixels per word */
+	int bpl;	/* bytes per line */
+	int count;
+
+	mp = get_mode_param(adp->va_mode);
+	if (mp == NULL)
+		return EINVAL;
+
+	switch (adp->va_info.vi_mem_model) {
+	case V_INFO_MM_PLANAR:
+		ppw = 16/(adp->va_info.vi_depth/adp->va_info.vi_planes);
+		count = (pixel + ppw - 1)/ppw/2;
+		bpl = ((pixel + ppw - 1)/ppw/2)*4;
+		break;
+	case V_INFO_MM_PACKED:
+		count = (pixel + 7)/8;
+		bpl = ((pixel + 7)/8)*8;
+		break;
+	case V_INFO_MM_TEXT:
+		count = (pixel + 7)/8;		/* columns */
+		bpl = (pixel + 7)/8;		/* columns */
+		break;
+	default:
+		return ENODEV;
+	}
 
-    if (mp[10 + 0x17] & 0x40)			/* CRTC mode control reg */
-	count *= 2;				/* byte mode */
-    outb(CRTC, 0x13);
-    outb(CRTC + 1, count);
-    adp->va_line_width = bpl;
+	if (mp[10 + 0x17] & 0x40)		/* CRTC mode control reg */
+		count *= 2;			/* byte mode */
+	outb(CRTC, 0x13);
+	outb(CRTC + 1, count);
+	adp->va_line_width = bpl;
 
-    return 0;
+	return 0;
 }
 
 static int
 set_display_start(video_adapter_t *adp, int x, int y)
 {
-    int off;	/* byte offset (graphics mode)/word offset (text mode) */
-    int poff;	/* pixel offset */
-    int roff;	/* row offset */
-    int ppb;	/* pixels per byte */
-
-    if (adp->va_info.vi_flags & V_INFO_GRAPHICS) {
-	ppb = 8/(adp->va_info.vi_depth/adp->va_info.vi_planes);
-	off = y*adp->va_line_width + x/ppb;
-	roff = 0;
-	poff = x%ppb;
-    } else {
-	outb(TSIDX, 1);
-	if (inb(TSREG) & 1)
-	    ppb = 9;
-	else
-	    ppb = 8;
-	off = y/adp->va_info.vi_cheight*adp->va_line_width + x/ppb;
-	roff = y%adp->va_info.vi_cheight;
-	/* FIXME: is this correct? XXX */
-	if (ppb == 8)
-	    poff = x%ppb;
-	else
-	    poff = (x + 8)%ppb;
-    }
-
-    /* start address */
-    outb(CRTC, 0xc);		/* high */
-    outb(CRTC + 1, off >> 8);
-    outb(CRTC, 0xd);		/* low */
-    outb(CRTC + 1, off & 0xff);
-
-    /* horizontal pel pan */
-    inb(CRTC + 6);
-    outb(ATC, 0x13 | 0x20);
-    outb(ATC, poff);
-    inb(CRTC + 6);
-    outb(ATC, 0x20);
-
-    /* preset row scan */
-    outb(CRTC, 8);
-    outb(CRTC + 1, roff);
-
-    adp->va_disp_start.x = x;
-    adp->va_disp_start.y = y;
-    return 0;
+	int off;	/* byte offset (graphics mode)/word offset (text mode) */
+	int poff;	/* pixel offset */
+	int roff;	/* row offset */
+	int ppb;	/* pixels per byte */
+
+	if (adp->va_info.vi_flags & V_INFO_GRAPHICS) {
+		ppb = 8/(adp->va_info.vi_depth/adp->va_info.vi_planes);
+		off = y*adp->va_line_width + x/ppb;
+		roff = 0;
+		poff = x%ppb;
+	} else {
+		outb(TSIDX, 1);
+		if (inb(TSREG) & 1)
+			ppb = 9;
+		else
+			ppb = 8;
+		off = y/adp->va_info.vi_cheight*adp->va_line_width + x/ppb;
+		roff = y%adp->va_info.vi_cheight;
+		/* FIXME: is this correct? XXX */
+		if (ppb == 8)
+			poff = x%ppb;
+		else
+			poff = (x + 8)%ppb;
+	}
+
+	/* start address */
+	outb(CRTC, 0xc);		/* high */
+	outb(CRTC + 1, off >> 8);
+	outb(CRTC, 0xd);		/* low */
+	outb(CRTC + 1, off & 0xff);
+
+	/* horizontal pel pan */
+	inb(CRTC + 6);
+	outb(ATC, 0x13 | 0x20);
+	outb(ATC, poff);
+	inb(CRTC + 6);
+	outb(ATC, 0x20);
+
+	/* preset row scan */
+	outb(CRTC, 8);
+	outb(CRTC + 1, roff);
+
+	adp->va_disp_start.x = x;
+	adp->va_disp_start.y = y;
+	return 0;
 }
 
 #ifndef VGA_NO_MODE_CHANGE
@@ -809,20 +811,20 @@ set_display_start(video_adapter_t *adp, int x, int y)
 static void
 fill(int val, void *d, size_t size)
 {
-    u_char *p = d;
+	u_char *p = d;
 
-    while (size-- > 0)
-	*p++ = val;
+	while (size-- > 0)
+		*p++ = val;
 }
 #endif /* __x86_64__ */
 
 static void
 filll_io(int val, vm_offset_t d, size_t size)
 {
-    while (size-- > 0) {
-	writel(d, val);
-	d += sizeof(u_int32_t);
-    }
+	while (size-- > 0) {
+		writel(d, val);
+		d += sizeof(u_int32_t);
+	}
 }
 #endif /* !VGA_NO_MODE_CHANGE */
 
@@ -831,45 +833,45 @@ filll_io(int val, vm_offset_t d, size_t size)
 static int
 vga_error(void)
 {
-    return ENODEV;
+	return ENODEV;
 }
 
 static int
 vga_probe(int unit, video_adapter_t **adpp, void *arg, int flags)
 {
-    /* No VGA when booted via UEFI */
-    if (probe_efi_fb(0) == 0)
-        return (ENXIO);
+	/* No VGA when booted via UEFI */
+	if (probe_efi_fb(0) == 0)
+		return (ENXIO);
 
-    /* XXX Also abort if VGA isn't present according to ACPI FADT BootFlags */
+	/* XXX Also abort if VGA isn't present according to ACPI FADT BootFlags */
 
-    probe_adapters();
-    if (unit != 0)
-	return ENXIO;
+	probe_adapters();
+	if (unit != 0)
+		return ENXIO;
 
-    *adpp = &biosadapter;
+	*adpp = &biosadapter;
 
-    return 0;
+	return 0;
 }
 
 static int
 vga_init(int unit, video_adapter_t *adp, int flags)
 {
-    if ((unit != 0) || (adp == NULL) || !probe_done(adp))
-	return ENXIO;
+	if ((unit != 0) || (adp == NULL) || !probe_done(adp))
+		return ENXIO;
 
-    if (!init_done(adp)) {
-	/* nothing to do really... */
-	adp->va_flags |= V_ADP_INITIALIZED;
-    }
+	if (!init_done(adp)) {
+		/* nothing to do really... */
+		adp->va_flags |= V_ADP_INITIALIZED;
+	}
 
-    if (!config_done(adp)) {
-	if (vid_register(adp) < 0)
-		return ENXIO;
-	adp->va_flags |= V_ADP_REGISTERED;
-    }
+	if (!config_done(adp)) {
+		if (vid_register(adp) < 0)
+			return ENXIO;
+		adp->va_flags |= V_ADP_REGISTERED;
+	}
 
-    return 0;
+	return 0;
 }
 
 /*
@@ -879,42 +881,43 @@ vga_init(int unit, video_adapter_t *adp, int flags)
 static int
 vga_get_info(video_adapter_t *adp, int mode, video_info_t *info)
 {
-    int i;
+	int i;
 
-    if (!vga_init_done)
-	return ENXIO;
+	if (!vga_init_done)
+		return ENXIO;
 
 #ifndef VGA_NO_MODE_CHANGE
-    if (adp->va_flags & V_ADP_MODECHANGE) {
-	/*
-	 * If the parameter table entry for this mode is not found, 
-	 * the mode is not supported...
-	 */
-	if (get_mode_param(mode) == NULL)
-	    return EINVAL;
-    } else
+	if (adp->va_flags & V_ADP_MODECHANGE) {
+		/*
+		 * If the parameter table entry for this mode is not found,
+		 * the mode is not supported...
+		 */
+		if (get_mode_param(mode) == NULL)
+			return EINVAL;
+	} else
 #endif /* VGA_NO_MODE_CHANGE */
-    {
-	/* 
-	 * Even if we don't support video mode switching on this adapter,
-	 * the information on the initial (thus current) video mode 
-	 * should be made available.
-	 */
-	if (mode != adp->va_initial_mode)
-	    return EINVAL;
-    }
-
-    for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
-	if (bios_vmode[i].vi_mode == NA)
-	    continue;
-	if (mode == bios_vmode[i].vi_mode) {
-	    *info = bios_vmode[i];
-	    /* XXX */
-	    info->vi_buffer_size = info->vi_window_size*info->vi_planes;
-	    return 0;
+	{
+		/*
+		 * Even if we don't support video mode switching on this
+		 * adapter, the information on the initial (thus current)
+		 * video mode should be made available.
+		 */
+		if (mode != adp->va_initial_mode)
+			return EINVAL;
+	}
+
+	for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
+		if (bios_vmode[i].vi_mode == NA)
+			continue;
+		if (mode == bios_vmode[i].vi_mode) {
+			*info = bios_vmode[i];
+			/* XXX */
+			info->vi_buffer_size =
+			    info->vi_window_size*info->vi_planes;
+			return 0;
+		}
 	}
-    }
-    return EINVAL;
+	return EINVAL;
 }
 
 /*
@@ -926,44 +929,44 @@ vga_get_info(video_adapter_t *adp, int mode, video_info_t *info)
 static int
 vga_query_mode(video_adapter_t *adp, video_info_t *info)
 {
-    int i;
-
-    if (!vga_init_done)
-	return ENXIO;
-
-    for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
-	if (bios_vmode[i].vi_mode == NA)
-	    continue;
-
-	if ((info->vi_width != 0)
-	    && (info->vi_width != bios_vmode[i].vi_width))
-		continue;
-	if ((info->vi_height != 0)
-	    && (info->vi_height != bios_vmode[i].vi_height))
-		continue;
-	if ((info->vi_cwidth != 0)
-	    && (info->vi_cwidth != bios_vmode[i].vi_cwidth))
-		continue;
-	if ((info->vi_cheight != 0)
-	    && (info->vi_cheight != bios_vmode[i].vi_cheight))
-		continue;
-	if ((info->vi_depth != 0)
-	    && (info->vi_depth != bios_vmode[i].vi_depth))
-		continue;
-	if ((info->vi_planes != 0)
-	    && (info->vi_planes != bios_vmode[i].vi_planes))
-		continue;
-	/* XXX: should check pixel format, memory model */
-	if ((info->vi_flags != 0)
-	    && (info->vi_flags != bios_vmode[i].vi_flags))
-		continue;
-
-	/* verify if this mode is supported on this adapter */
-	if (vga_get_info(adp, bios_vmode[i].vi_mode, info))
-		continue;
-	return 0;
-    }
-    return ENODEV;
+	int i;
+
+	if (!vga_init_done)
+		return ENXIO;
+
+	for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
+		if (bios_vmode[i].vi_mode == NA)
+			continue;
+
+		if ((info->vi_width != 0) &&
+		    (info->vi_width != bios_vmode[i].vi_width))
+			continue;
+		if ((info->vi_height != 0) &&
+		    (info->vi_height != bios_vmode[i].vi_height))
+			continue;
+		if ((info->vi_cwidth != 0) &&
+		    (info->vi_cwidth != bios_vmode[i].vi_cwidth))
+			continue;
+		if ((info->vi_cheight != 0) &&
+		    (info->vi_cheight != bios_vmode[i].vi_cheight))
+			continue;
+		if ((info->vi_depth != 0) &&
+		    (info->vi_depth != bios_vmode[i].vi_depth))
+			continue;
+		if ((info->vi_planes != 0) &&
+		    (info->vi_planes != bios_vmode[i].vi_planes))
+			continue;
+		/* XXX: should check pixel format, memory model */
+		if ((info->vi_flags != 0) &&
+		    (info->vi_flags != bios_vmode[i].vi_flags))
+			continue;
+
+		/* verify if this mode is supported on this adapter */
+		if (vga_get_info(adp, bios_vmode[i].vi_mode, info))
+			continue;
+		return 0;
+	}
+	return ENODEV;
 }
 
 /*
@@ -976,19 +979,19 @@ vga_query_mode(video_adapter_t *adp, video_info_t *info)
 static void
 set_width90(adp_state_t *params)
 {
-    /* 
-     * Based on code submitted by Kelly Yancey (kbyanc@freedomnet.com)
-     * and alexv@sui.gda.itesm.mx.
-     */
-    params->regs[5] |= 1;		/* toggle 8 pixel wide fonts */
-    params->regs[10+0x0] = 0x6b;
-    params->regs[10+0x1] = 0x59;
-    params->regs[10+0x2] = 0x5a;
-    params->regs[10+0x3] = 0x8e;
-    params->regs[10+0x4] = 0x5e;
-    params->regs[10+0x5] = 0x8a;
-    params->regs[10+0x13] = 45;
-    params->regs[35+0x13] = 0;
+	/*
+	 * Based on code submitted by Kelly Yancey (kbyanc@freedomnet.com)
+	 * and alexv@sui.gda.itesm.mx.
+	 */
+	params->regs[5] |= 1;		/* toggle 8 pixel wide fonts */
+	params->regs[10+0x0] = 0x6b;
+	params->regs[10+0x1] = 0x59;
+	params->regs[10+0x2] = 0x5a;
+	params->regs[10+0x3] = 0x8e;
+	params->regs[10+0x4] = 0x5e;
+	params->regs[10+0x5] = 0x8a;
+	params->regs[10+0x13] = 45;
+	params->regs[35+0x13] = 0;
 }
 #endif /* VGA_WIDTH90 */
 #endif /* !VGA_NO_MODE_CHANGE */
@@ -997,136 +1000,136 @@ static int
 vga_set_mode(video_adapter_t *adp, int mode)
 {
 #ifndef VGA_NO_MODE_CHANGE
-    video_info_t info;
-    adp_state_t params;
+	video_info_t info;
+	adp_state_t params;
 
-    prologue(adp, V_ADP_MODECHANGE, ENODEV);
+	prologue(adp, V_ADP_MODECHANGE, ENODEV);
 
-    if (vga_get_info(adp, mode, &info))
-	return EINVAL;
+	if (vga_get_info(adp, mode, &info))
+		return EINVAL;
 
-    lwkt_gettoken(&vga_token);
+	lwkt_gettoken(&vga_token);
 
 #if VGA_DEBUG > 1
-    kprintf("vga_set_mode(): setting mode %d\n", mode);
+	kprintf("vga_set_mode(): setting mode %d\n", mode);
 #endif
 
-    params.sig = V_STATE_SIG;
-    bcopy(get_mode_param(mode), params.regs, sizeof(params.regs));
+	params.sig = V_STATE_SIG;
+	bcopy(get_mode_param(mode), params.regs, sizeof(params.regs));
 
-    switch (mode) {
+	switch (mode) {
 #ifdef VGA_WIDTH90
-    case M_VGA_C90x60: case M_VGA_M90x60:
-	set_width90(&params);
-	/* FALLTHROUGH */
+	case M_VGA_C90x60: case M_VGA_M90x60:
+		set_width90(&params);
+		/* FALLTHROUGH */
 #endif
-    case M_VGA_C80x60: case M_VGA_M80x60:
-	params.regs[2]  = 0x08;
-	params.regs[19] = 0x47;
-	goto special_480l;
+	case M_VGA_C80x60: case M_VGA_M80x60:
+		params.regs[2]  = 0x08;
+		params.regs[19] = 0x47;
+		goto special_480l;
 
 #ifdef VGA_WIDTH90
-    case M_VGA_C90x30: case M_VGA_M90x30:
-	set_width90(&params);
-	/* FALLTHROUGH */
+	case M_VGA_C90x30: case M_VGA_M90x30:
+		set_width90(&params);
+		/* FALLTHROUGH */
 #endif
-    case M_VGA_C80x30: case M_VGA_M80x30:
-	params.regs[19] = 0x4f;
+	case M_VGA_C80x30: case M_VGA_M80x30:
+		params.regs[19] = 0x4f;
 special_480l:
-	params.regs[9] |= 0xc0;
-	params.regs[16] = 0x08;
-	params.regs[17] = 0x3e;
-	params.regs[26] = 0xea;
-	params.regs[28] = 0xdf;
-	params.regs[31] = 0xe7;
-	params.regs[32] = 0x04;
-	goto setup_mode;
+		params.regs[9] |= 0xc0;
+		params.regs[16] = 0x08;
+		params.regs[17] = 0x3e;
+		params.regs[26] = 0xea;
+		params.regs[28] = 0xdf;
+		params.regs[31] = 0xe7;
+		params.regs[32] = 0x04;
+		goto setup_mode;
 
 #ifdef VGA_WIDTH90
-    case M_VGA_C90x43: case M_VGA_M90x43:
-	set_width90(&params);
-	/* FALLTHROUGH */
+	case M_VGA_C90x43: case M_VGA_M90x43:
+		set_width90(&params);
+		/* FALLTHROUGH */
 #endif
-    case M_ENH_C80x43: case M_ENH_B80x43:
-	params.regs[28] = 87;
-	goto special_80x50;
+	case M_ENH_C80x43: case M_ENH_B80x43:
+		params.regs[28] = 87;
+		goto special_80x50;
 
 #ifdef VGA_WIDTH90
-    case M_VGA_C90x50: case M_VGA_M90x50:
-	set_width90(&params);
-	/* FALLTHROUGH */
+	case M_VGA_C90x50: case M_VGA_M90x50:
+		set_width90(&params);
+		/* FALLTHROUGH */
 #endif
-    case M_VGA_C80x50: case M_VGA_M80x50:
+	case M_VGA_C80x50: case M_VGA_M80x50:
 special_80x50:
-	params.regs[2] = 8;
-	params.regs[19] = 7;
-	goto setup_mode;
+		params.regs[2] = 8;
+		params.regs[19] = 7;
+		goto setup_mode;
 
 #ifdef VGA_WIDTH90
-    case M_VGA_C90x25: case M_VGA_M90x25:
-	set_width90(&params);
-	/* FALLTHROUGH */
+	case M_VGA_C90x25: case M_VGA_M90x25:
+		set_width90(&params);
+		/* FALLTHROUGH */
 #endif
-    case M_VGA_C40x25: case M_VGA_C80x25:
-    case M_VGA_M80x25:
-    case M_B40x25:     case M_C40x25:
-    case M_B80x25:     case M_C80x25:
-    case M_ENH_B40x25: case M_ENH_C40x25:
-    case M_ENH_B80x25: case M_ENH_C80x25:
-    case M_EGAMONO80x25:
+	case M_VGA_C40x25: case M_VGA_C80x25:
+	case M_VGA_M80x25:
+	case M_B40x25:     case M_C40x25:
+	case M_B80x25:     case M_C80x25:
+	case M_ENH_B40x25: case M_ENH_C40x25:
+	case M_ENH_B80x25: case M_ENH_C80x25:
+	case M_EGAMONO80x25:
 
 setup_mode:
-	vga_load_state(adp, &params);
-	break;
-
-    case M_VGA_MODEX:
-	/* "unchain" the VGA mode */
-	params.regs[5-1+0x04] &= 0xf7;
-	params.regs[5-1+0x04] |= 0x04;
-	/* turn off doubleword mode */
-	params.regs[10+0x14] &= 0xbf;
-	/* turn off word addressing */
-	params.regs[10+0x17] |= 0x40;
-	/* set logical screen width */
-	params.regs[10+0x13] = 80;
-	/* set 240 lines */
-	params.regs[10+0x11] = 0x2c;
-	params.regs[10+0x06] = 0x0d;
-	params.regs[10+0x07] = 0x3e;
-	params.regs[10+0x10] = 0xea;
-	params.regs[10+0x11] = 0xac;
-	params.regs[10+0x12] = 0xdf;
-	params.regs[10+0x15] = 0xe7;
-	params.regs[10+0x16] = 0x06;
-	/* set vertical sync polarity to reflect aspect ratio */
-	params.regs[9] = 0xe3;
-	goto setup_grmode;
-
-    case M_BG320:     case M_CG320:     case M_BG640:
-    case M_CG320_D:   case M_CG640_E:
-    case M_CG640x350: case M_ENH_CG640:
-    case M_BG640x480: case M_CG640x480: case M_VGA_CG320:
+		vga_load_state(adp, &params);
+		break;
+
+	case M_VGA_MODEX:
+		/* "unchain" the VGA mode */
+		params.regs[5-1+0x04] &= 0xf7;
+		params.regs[5-1+0x04] |= 0x04;
+		/* turn off doubleword mode */
+		params.regs[10+0x14] &= 0xbf;
+		/* turn off word addressing */
+		params.regs[10+0x17] |= 0x40;
+		/* set logical screen width */
+		params.regs[10+0x13] = 80;
+		/* set 240 lines */
+		params.regs[10+0x11] = 0x2c;
+		params.regs[10+0x06] = 0x0d;
+		params.regs[10+0x07] = 0x3e;
+		params.regs[10+0x10] = 0xea;
+		params.regs[10+0x11] = 0xac;
+		params.regs[10+0x12] = 0xdf;
+		params.regs[10+0x15] = 0xe7;
+		params.regs[10+0x16] = 0x06;
+		/* set vertical sync polarity to reflect aspect ratio */
+		params.regs[9] = 0xe3;
+		goto setup_grmode;
+
+	case M_BG320:     case M_CG320:     case M_BG640:
+	case M_CG320_D:   case M_CG640_E:
+	case M_CG640x350: case M_ENH_CG640:
+	case M_BG640x480: case M_CG640x480: case M_VGA_CG320:
 
 setup_grmode:
-	vga_load_state(adp, &params);
-	break;
+		vga_load_state(adp, &params);
+		break;
 
-    default:
-        lwkt_reltoken(&vga_token);
-	return EINVAL;
-    }
+	default:
+		lwkt_reltoken(&vga_token);
+		return EINVAL;
+	}
 
-    adp->va_mode = mode;
-    info.vi_flags &= ~V_INFO_LINEAR; /* XXX */
-    update_adapter_info(adp, &info);
+	adp->va_mode = mode;
+	info.vi_flags &= ~V_INFO_LINEAR; /* XXX */
+	update_adapter_info(adp, &info);
 
-    /* move hardware cursor out of the way */
-    (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1);
+	/* move hardware cursor out of the way */
+	(*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1);
 
-    lwkt_reltoken(&vga_token);
-    return 0;
+	lwkt_reltoken(&vga_token);
+	return 0;
 #else /* VGA_NO_MODE_CHANGE */
-    return ENODEV;
+	return ENODEV;
 #endif /* VGA_NO_MODE_CHANGE */
 }
 
@@ -1135,48 +1138,48 @@ vga_set_mode(video_adapter_t *adp, int mode)
 static void
 set_font_mode(video_adapter_t *adp, u_char *buf)
 {
-    crit_enter();
-
-    /* save register values */
-    outb(TSIDX, 0x02); buf[0] = inb(TSREG);
-    outb(TSIDX, 0x04); buf[1] = inb(TSREG);
-    outb(GDCIDX, 0x04); buf[2] = inb(GDCREG);
-    outb(GDCIDX, 0x05); buf[3] = inb(GDCREG);
-    outb(GDCIDX, 0x06); buf[4] = inb(GDCREG);
-    inb(CRTC + 6);
-    outb(ATC, 0x10); buf[5] = inb(ATC + 1);
-
-    /* setup vga for loading fonts */
-    inb(CRTC + 6);				/* reset flip-flop */
-    outb(ATC, 0x10); outb(ATC, buf[5] & ~0x01);
-    inb(CRTC + 6);				/* reset flip-flop */
-    outb(ATC, 0x20);				/* enable palette */
-    outw(TSIDX, 0x0402);
-    outw(TSIDX, 0x0704);
-    outw(GDCIDX, 0x0204);
-    outw(GDCIDX, 0x0005);
-    outw(GDCIDX, 0x0406);               /* addr = a0000, 64kb */
-
-    crit_exit();
+	crit_enter();
+
+	/* save register values */
+	outb(TSIDX, 0x02); buf[0] = inb(TSREG);
+	outb(TSIDX, 0x04); buf[1] = inb(TSREG);
+	outb(GDCIDX, 0x04); buf[2] = inb(GDCREG);
+	outb(GDCIDX, 0x05); buf[3] = inb(GDCREG);
+	outb(GDCIDX, 0x06); buf[4] = inb(GDCREG);
+	inb(CRTC + 6);
+	outb(ATC, 0x10); buf[5] = inb(ATC + 1);
+
+	/* setup vga for loading fonts */
+	inb(CRTC + 6);				/* reset flip-flop */
+	outb(ATC, 0x10); outb(ATC, buf[5] & ~0x01);
+	inb(CRTC + 6);				/* reset flip-flop */
+	outb(ATC, 0x20);			/* enable palette */
+	outw(TSIDX, 0x0402);
+	outw(TSIDX, 0x0704);
+	outw(GDCIDX, 0x0204);
+	outw(GDCIDX, 0x0005);
+	outw(GDCIDX, 0x0406);			/* addr = a0000, 64kb */
+
+	crit_exit();
 }
 
 static void
 set_normal_mode(video_adapter_t *adp, u_char *buf)
 {
-    crit_enter();
-
-    /* setup vga for normal operation mode again */
-    inb(CRTC + 6);				/* reset flip-flop */
-    outb(ATC, 0x10); outb(ATC, buf[5]);
-    inb(CRTC + 6);				/* reset flip-flop */
-    outb(ATC, 0x20);				/* enable palette */
-    outw(TSIDX, 0x0002 | (buf[0] << 8));
-    outw(TSIDX, 0x0004 | (buf[1] << 8));
-    outw(GDCIDX, 0x0004 | (buf[2] << 8));
-    outw(GDCIDX, 0x0005 | (buf[3] << 8));
-    outw(GDCIDX, 0x0006 | (((buf[4] & 0x03) | 0x0c)<<8));
-
-    crit_exit();
+	crit_enter();
+
+	/* setup vga for normal operation mode again */
+	inb(CRTC + 6);				/* reset flip-flop */
+	outb(ATC, 0x10); outb(ATC, buf[5]);
+	inb(CRTC + 6);				/* reset flip-flop */
+	outb(ATC, 0x20);			/* enable palette */
+	outw(TSIDX, 0x0002 | (buf[0] << 8));
+	outw(TSIDX, 0x0004 | (buf[1] << 8));
+	outw(GDCIDX, 0x0004 | (buf[2] << 8));
+	outw(GDCIDX, 0x0005 | (buf[3] << 8));
+	outw(GDCIDX, 0x0006 | (((buf[4] & 0x03) | 0x0c)<<8));
+
+	crit_exit();
 }
 
 #endif /* VGA_NO_FONT_LOADING */
@@ -1187,48 +1190,50 @@ set_normal_mode(video_adapter_t *adp, u_char *buf)
  */
 static int
 vga_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
-	      int ch, int count)
+    int ch, int count)
 {
 #ifndef VGA_NO_FONT_LOADING
-    u_char buf[PARAM_BUFSIZE];
-    vm_offset_t segment;
-    int c;
-
-    prologue(adp, V_ADP_FONT, ENODEV);
-
-    if (fontsize < 14) {
-	/* FONT_8 */
-	fontsize = 8;
-    } else if (fontsize >= 32) {
-	fontsize = 32;
-    } else if (fontsize >= 16) {
-	/* FONT_16 */
-	fontsize = 16;
-    } else {
-	/* FONT_14 */
-	fontsize = 14;
-    }
-
-    if (page < 0 || page >= 8)
-	return EINVAL;
-    segment = FONT_BUF + 0x4000*page;
-    if (page > 3)
-	segment -= 0xe000;
-
-    set_font_mode(adp, buf);
-    if (fontsize == 32) {
-	bcopy_fromio((uintptr_t)segment + ch*32, data, fontsize*count);
-    } else {
-	for (c = ch; count > 0; ++c, --count) {
-	    bcopy_fromio((uintptr_t)segment + c*32, data, fontsize);
-	    data += fontsize;
+	u_char buf[PARAM_BUFSIZE];
+	vm_offset_t segment;
+	int c;
+
+	prologue(adp, V_ADP_FONT, ENODEV);
+
+	if (fontsize < 14) {
+		/* FONT_8 */
+		fontsize = 8;
+	} else if (fontsize >= 32) {
+		fontsize = 32;
+	} else if (fontsize >= 16) {
+		/* FONT_16 */
+		fontsize = 16;
+	} else {
+		/* FONT_14 */
+		fontsize = 14;
 	}
-    }
-    set_normal_mode(adp, buf);
 
-    return 0;
+	if (page < 0 || page >= 8)
+		return EINVAL;
+	segment = FONT_BUF + 0x4000*page;
+	if (page > 3)
+		segment -= 0xe000;
+
+	set_font_mode(adp, buf);
+	if (fontsize == 32) {
+		bcopy_fromio((uintptr_t)segment + ch*32, data,
+		    fontsize*count);
+	} else {
+		for (c = ch; count > 0; ++c, --count) {
+			bcopy_fromio((uintptr_t)segment + c*32, data,
+			    fontsize);
+			data += fontsize;
+		}
+	}
+	set_normal_mode(adp, buf);
+
+	return 0;
 #else /* VGA_NO_FONT_LOADING */
-    return ENODEV;
+	return ENODEV;
 #endif /* VGA_NO_FONT_LOADING */
 }
 
@@ -1240,48 +1245,48 @@ vga_save_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
  */
 static int
 vga_load_font(video_adapter_t *adp, int page, int fontsize, u_char *data,
-	      int ch, int count)
+    int ch, int count)
 {
 #ifndef VGA_NO_FONT_LOADING
-    u_char buf[PARAM_BUFSIZE];
-    vm_offset_t segment;
-    int c;
-
-    prologue(adp, V_ADP_FONT, ENODEV);
-
-    if (fontsize < 14) {
-	/* FONT_8 */
-	fontsize = 8;
-    } else if (fontsize >= 32) {
-	fontsize = 32;
-    } else if (fontsize >= 16) {
-	/* FONT_16 */
-	fontsize = 16;
-    } else {
-	/* FONT_14 */
-	fontsize = 14;
-    }
-
-    if (page < 0 || page >= 8)
-	return EINVAL;
-    segment = FONT_BUF + 0x4000*page;
-    if (page > 3)
-	segment -= 0xe000;
-
-    set_font_mode(adp, buf);
-    if (fontsize == 32) {
-	bcopy_toio(data, (uintptr_t)segment + ch*32, fontsize*count);
-    } else {
-	for (c = ch; count > 0; ++c, --count) {
-	    bcopy_toio(data, (uintptr_t)segment + c*32, fontsize);
-	    data += fontsize;
+	u_char buf[PARAM_BUFSIZE];
+	vm_offset_t segment;
+	int c;
+
+	prologue(adp, V_ADP_FONT, ENODEV);
+
+	if (fontsize < 14) {
+		/* FONT_8 */
+		fontsize = 8;
+	} else if (fontsize >= 32) {
+		fontsize = 32;
+	} else if (fontsize >= 16) {
+		/* FONT_16 */
+		fontsize = 16;
+	} else {
+		/* FONT_14 */
+		fontsize = 14;
+	}
+
+	if (page < 0 || page >= 8)
+		return EINVAL;
+	segment = FONT_BUF + 0x4000*page;
+	if (page > 3)
+		segment -= 0xe000;
+
+	set_font_mode(adp, buf);
+	if (fontsize == 32) {
+		bcopy_toio(data, (uintptr_t)segment + ch*32, fontsize*count);
+	} else {
+		for (c = ch; count > 0; ++c, --count) {
+			bcopy_toio(data, (uintptr_t)segment + c*32, fontsize);
+			data += fontsize;
+		}
 	}
-    }
-    set_normal_mode(adp, buf);
+	set_normal_mode(adp, buf);
 
-    return 0;
+	return 0;
 #else /* VGA_NO_FONT_LOADING */
-    return ENODEV;
+	return ENODEV;
 #endif /* VGA_NO_FONT_LOADING */
 }
 
@@ -1295,19 +1300,21 @@ static int
 vga_show_font(video_adapter_t *adp, int page)
 {
 #ifndef VGA_NO_FONT_LOADING
-    static u_char cg[] = { 0x00, 0x05, 0x0a, 0x0f, 0x30, 0x35, 0x3a, 0x3f };
+	static u_char cg[] = { 0x00, 0x05, 0x0a, 0x0f,
+			       0x30, 0x35, 0x3a, 0x3f
+	};
 
-    prologue(adp, V_ADP_FONT, ENODEV);
-    if (page < 0 || page >= 8)
-	return EINVAL;
+	prologue(adp, V_ADP_FONT, ENODEV);
+	if (page < 0 || page >= 8)
+		return EINVAL;
 
-    crit_enter();
-    outb(TSIDX, 0x03); outb(TSREG, cg[page]);
-    crit_exit();
+	crit_enter();
+	outb(TSIDX, 0x03); outb(TSREG, cg[page]);
+	crit_exit();
 
-    return 0;
+	return 0;
 #else /* VGA_NO_FONT_LOADING */
-    return ENODEV;
+	return ENODEV;
 #endif /* VGA_NO_FONT_LOADING */
 }
 
@@ -1320,37 +1327,37 @@ vga_show_font(video_adapter_t *adp, int page)
 static int
 vga_save_palette(video_adapter_t *adp, u_char *palette)
 {
-    int i;
-
-    prologue(adp, V_ADP_PALETTE, ENODEV);
-
-    /* 
-     * We store 8 bit values in the palette buffer, while the standard
-     * VGA has 6 bit DAC .
-     */
-    outb(PALRADR, 0x00);
-    for (i = 0; i < 256*3; ++i)
-	palette[i] = inb(PALDATA) << 2; 
-    inb(CRTC + 6);		/* reset flip/flop */
-    return 0;
+	int i;
+
+	prologue(adp, V_ADP_PALETTE, ENODEV);
+
+	/*
+	 * We store 8 bit values in the palette buffer, while the standard
+	 * VGA has 6 bit DAC .
+	 */
+	outb(PALRADR, 0x00);
+	for (i = 0; i < 256*3; ++i)
+		palette[i] = inb(PALDATA) << 2;
+	inb(CRTC + 6);		/* reset flip/flop */
+	return 0;
 }
 
 static int
 vga_save_palette2(video_adapter_t *adp, int base, int count,
-		  u_char *r, u_char *g, u_char *b)
+    u_char *r, u_char *g, u_char *b)
 {
-    int i;
-
-    prologue(adp, V_ADP_PALETTE, ENODEV);
-
-    outb(PALRADR, base);
-    for (i = 0; i < count; ++i) {
-	r[i] = inb(PALDATA) << 2; 
-	g[i] = inb(PALDATA) << 2; 
-	b[i] = inb(PALDATA) << 2; 
-    }
-    inb(CRTC + 6);		/* reset flip/flop */
-    return 0;
+	int i;
+
+	prologue(adp, V_ADP_PALETTE, ENODEV);
+
+	outb(PALRADR, base);
+	for (i = 0; i < count; ++i) {
+		r[i] = inb(PALDATA) << 2;
+		g[i] = inb(PALDATA) << 2;
+		b[i] = inb(PALDATA) << 2;
+	}
+	inb(CRTC + 6);		/* reset flip/flop */
+	return 0;
 }
 
 /*
@@ -1362,37 +1369,37 @@ vga_save_palette2(video_adapter_t *adp, int base, int count,
 static int
 vga_load_palette(video_adapter_t *adp, const u_char *palette)
 {
-    int i;
+	int i;
 
-    prologue(adp, V_ADP_PALETTE, ENODEV);
+	prologue(adp, V_ADP_PALETTE, ENODEV);
 
-    outb(PIXMASK, 0xff);		/* no pixelmask */
-    outb(PALWADR, 0x00);
-    for (i = 0; i < 256*3; ++i)
-	outb(PALDATA, palette[i] >> 2);
-    inb(CRTC + 6);			/* reset flip/flop */
-    outb(ATC, 0x20);			/* enable palette */
-    return 0;
+	outb(PIXMASK, 0xff);		/* no pixelmask */
+	outb(PALWADR, 0x00);
+	for (i = 0; i < 256*3; ++i)
+		outb(PALDATA, palette[i] >> 2);
+	inb(CRTC + 6);			/* reset flip/flop */
+	outb(ATC, 0x20);		/* enable palette */
+	return 0;
 }
 
 static int
 vga_load_palette2(video_adapter_t *adp, int base, int count,
-		  u_char *r, u_char *g, u_char *b)
+    u_char *r, u_char *g, u_char *b)
 {
-    int i;
-
-    prologue(adp, V_ADP_PALETTE, ENODEV);
-
-    outb(PIXMASK, 0xff);		/* no pixelmask */
-    outb(PALWADR, base);
-    for (i = 0; i < count; ++i) {
-	outb(PALDATA, r[i] >> 2);
-	outb(PALDATA, g[i] >> 2);
-	outb(PALDATA, b[i] >> 2);
-    }
-    inb(CRTC + 6);			/* reset flip/flop */
-    outb(ATC, 0x20);			/* enable palette */
-    return 0;
+	int i;
+
+	prologue(adp, V_ADP_PALETTE, ENODEV);
+
+	outb(PIXMASK, 0xff);		/* no pixelmask */
+	outb(PALWADR, base);
+	for (i = 0; i < count; ++i) {
+		outb(PALDATA, r[i] >> 2);
+		outb(PALDATA, g[i] >> 2);
+		outb(PALDATA, b[i] >> 2);
+	}
+	inb(CRTC + 6);			/* reset flip/flop */
+	outb(ATC, 0x20);		/* enable palette */
+	return 0;
 }
 
 /*
@@ -1402,12 +1409,12 @@ vga_load_palette2(video_adapter_t *adp, int base, int count,
 static int
 vga_set_border(video_adapter_t *adp, int color)
 {
-    prologue(adp, V_ADP_BORDER, ENODEV);
+	prologue(adp, V_ADP_BORDER, ENODEV);
 
-    inb(CRTC + 6);	/* reset flip-flop */
-    outb(ATC, 0x31); outb(ATC, color & 0xff); 
+	inb(CRTC + 6);	/* reset flip-flop */
+	outb(ATC, 0x31); outb(ATC, color & 0xff);
 
-    return 0;
+	return 0;
 }
 
 /*
@@ -1419,75 +1426,76 @@ vga_set_border(video_adapter_t *adp, int color)
 static int
 vga_save_state(video_adapter_t *adp, void *p, size_t size)
 {
-    video_info_t info;
-    u_char *buf;
-    int i, j;
-
-    if (size == 0) {
-	/* return the required buffer size */
-	prologue(adp, V_ADP_STATESAVE, 0);
-	return sizeof(adp_state_t);
-    } else {
-	prologue(adp, V_ADP_STATESAVE, ENODEV);
-	if (size < sizeof(adp_state_t))
-	    return EINVAL;
-    }
-    ((adp_state_t *)p)->sig = V_STATE_SIG;
-    buf = ((adp_state_t *)p)->regs;
-    bzero(buf, V_MODE_PARAM_SIZE);
-
-    crit_enter();
-
-    outb(TSIDX, 0x00); outb(TSREG, 0x01);	/* stop sequencer */
-    for (i = 0, j = 5; i < 4; i++) {           
-	outb(TSIDX, i + 1);
-	buf[j++]  =  inb(TSREG);
-    }
-    buf[9]  =  inb(MISC + 10);			/* dot-clock */
-    outb(TSIDX, 0x00); outb(TSREG, 0x03);	/* start sequencer */
-
-    for (i = 0, j = 10; i < 25; i++) {		/* crtc */
-	outb(CRTC, i);
-	buf[j++]  =  inb(CRTC + 1);
-    }
-    for (i = 0, j = 35; i < 20; i++) {		/* attribute ctrl */
-        inb(CRTC + 6);				/* reset flip-flop */
-	outb(ATC, i);
-	buf[j++]  =  inb(ATC + 1);
-    }
-    for (i = 0, j = 55; i < 9; i++) {		/* graph data ctrl */
-	outb(GDCIDX, i);
-	buf[j++]  =  inb(GDCREG);
-    }
-    inb(CRTC + 6);				/* reset flip-flop */
-    outb(ATC, 0x20);				/* enable palette */
-
-    crit_exit();
-
-#if 1
-    if (vga_get_info(adp, adp->va_mode, &info) == 0) {
-	if (info.vi_flags & V_INFO_GRAPHICS) {
-	    buf[0] = info.vi_width/info.vi_cwidth; /* COLS */
-	    buf[1] = info.vi_height/info.vi_cheight - 1; /* ROWS */
+	video_info_t info;
+	u_char *buf;
+	int crtc_addr;
+	int i, j;
+
+	if (size == 0) {
+		/* return the required buffer size */
+		prologue(adp, V_ADP_STATESAVE, 0);
+		return sizeof(adp_state_t);
 	} else {
-	    buf[0] = info.vi_width;		/* COLS */
-	    buf[1] = info.vi_height - 1;	/* ROWS */
+		prologue(adp, V_ADP_STATESAVE, ENODEV);
+		if (size < sizeof(adp_state_t))
+			return EINVAL;
 	}
-	buf[2] = info.vi_cheight;		/* POINTS */
-    } else {
-	/* XXX: shouldn't be happening... */
-	kprintf("vga%d: %s: failed to obtain mode info. (vga_save_state())\n",
-	       adp->va_unit, adp->va_name);
-    }
-#else
-    buf[0] = readb(BIOS_PADDRTOVADDR(0x44a));	/* COLS */
-    buf[1] = readb(BIOS_PADDRTOVADDR(0x484));	/* ROWS */
-    buf[2] = readb(BIOS_PADDRTOVADDR(0x485));	/* POINTS */
-    buf[3] = readb(BIOS_PADDRTOVADDR(0x44c));
-    buf[4] = readb(BIOS_PADDRTOVADDR(0x44d));
+	((adp_state_t *)p)->sig = V_STATE_SIG;
+	buf = ((adp_state_t *)p)->regs;
+	bzero(buf, V_MODE_PARAM_SIZE);
+	crtc_addr = CRTC;
+
+	crit_enter();
+
+	outb(TSIDX, 0x00); outb(TSREG, 0x01);	/* stop sequencer */
+	for (i = 0, j = 5; i < 4; i++) {
+		outb(TSIDX, i + 1);
+		buf[j++]  =  inb(TSREG);
+	}
+	buf[9]  =  inb(MISC + 10);		/* dot-clock */
+	outb(TSIDX, 0x00); outb(TSREG, 0x03);	/* start sequencer */
+
+	for (i = 0, j = 10; i < 25; i++) {	/* crtc */
+		outb(crtc_addr, i);
+		buf[j++]  =  inb(crtc_addr + 1);
+	}
+	for (i = 0, j = 35; i < 20; i++) {	/* attribute ctrl */
+		inb(crtc_addr + 6);		/* reset flip-flop */
+		outb(ATC, i);
+		buf[j++]  =  inb(ATC + 1);
+	}
+	for (i = 0, j = 55; i < 9; i++) {	/* graph data ctrl */
+		outb(GDCIDX, i);
+		buf[j++]  =  inb(GDCREG);
+	}
+	inb(crtc_addr + 6);			/* reset flip-flop */
+	outb(ATC, 0x20);			/* enable palette */
+
+	crit_exit();
+
+	if (vga_get_info(adp, adp->va_mode, &info) == 0) {
+		if (info.vi_flags & V_INFO_GRAPHICS) {
+			buf[0] = info.vi_width/info.vi_cwidth; /* COLS */
+			buf[1] = info.vi_height/info.vi_cheight - 1; /* ROWS */
+		} else {
+			buf[0] = info.vi_width;		/* COLS */
+			buf[1] = info.vi_height - 1;	/* ROWS */
+		}
+		buf[2] = info.vi_cheight;		/* POINTS */
+	} else {
+		/* XXX: shouldn't be happening... */
+		kprintf("vga%d: %s: failed to obtain mode info. (%s())\n",
+		    adp->va_unit, adp->va_name, __func__);
+	}
+#if 0
+	buf[0] = readb(BIOS_PADDRTOVADDR(0x44a));	/* COLS */
+	buf[1] = readb(BIOS_PADDRTOVADDR(0x484));	/* ROWS */
+	buf[2] = readb(BIOS_PADDRTOVADDR(0x485));	/* POINTS */
+	buf[3] = readb(BIOS_PADDRTOVADDR(0x44c));
+	buf[4] = readb(BIOS_PADDRTOVADDR(0x44d));
 #endif
 
-    return 0;
+	return 0;
 }
 
 /*
@@ -1499,62 +1507,64 @@ vga_save_state(video_adapter_t *adp, void *p, size_t size)
 static int
 vga_load_state(video_adapter_t *adp, void *p)
 {
-    u_char *buf;
-    int i;
+	u_char *buf;
+	int crtc_addr;
+	int i;
 
-    prologue(adp, V_ADP_STATELOAD, ENODEV);
-    if (((adp_state_t *)p)->sig != V_STATE_SIG)
-	return EINVAL;
+	prologue(adp, V_ADP_STATELOAD, ENODEV);
+	if (((adp_state_t *)p)->sig != V_STATE_SIG)
+		return EINVAL;
 
-    buf = ((adp_state_t *)p)->regs;
+	buf = ((adp_state_t *)p)->regs;
+	crtc_addr = CRTC;
 
 #if VGA_DEBUG > 1
-    hexdump(buf, V_MODE_PARAM_SIZE, NULL, HD_OMIT_CHARS | HD_OMIT_COUNT);
+	hexdump(buf, V_MODE_PARAM_SIZE, NULL, HD_OMIT_CHARS | HD_OMIT_COUNT);
 #endif
 
-    crit_enter();
-
-    outb(TSIDX, 0x00); outb(TSREG, 0x01);	/* stop sequencer */
-    for (i = 0; i < 4; ++i) {			/* program sequencer */
-	outb(TSIDX, i + 1);
-	outb(TSREG, buf[i + 5]);
-    }
-    outb(MISC, buf[9]);				/* set dot-clock */
-    outb(TSIDX, 0x00); outb(TSREG, 0x03);	/* start sequencer */
-    outb(CRTC, 0x11);
-    outb(CRTC + 1, inb(CRTC + 1) & 0x7F);
-    for (i = 0; i < 25; ++i) {			/* program crtc */
-	outb(CRTC, i);
-	outb(CRTC + 1, buf[i + 10]);
-    }
-    inb(CRTC + 6);				/* reset flip-flop */
-    for (i = 0; i < 20; ++i) {			/* program attribute ctrl */
-	outb(ATC, i);
-	outb(ATC, buf[i + 35]);
-    }
-    for (i = 0; i < 9; ++i) {			/* program graph data ctrl */
-	outb(GDCIDX, i);
-	outb(GDCREG, buf[i + 55]);
-    }
-    inb(CRTC + 6);				/* reset flip-flop */
-    outb(ATC, 0x20);				/* enable palette */
+	crit_enter();
+
+	outb(TSIDX, 0x00); outb(TSREG, 0x01);	/* stop sequencer */
+	for (i = 0; i < 4; ++i) {		/* program sequencer */
+		outb(TSIDX, i + 1);
+		outb(TSREG, buf[i + 5]);
+	}
+	outb(MISC, buf[9]);			/* set dot-clock */
+	outb(TSIDX, 0x00); outb(TSREG, 0x03);	/* start sequencer */
+	outb(crtc_addr, 0x11);
+	outb(crtc_addr + 1, inb(crtc_addr + 1) & 0x7F);
+	for (i = 0; i < 25; ++i) {		/* program crtc */
+		outb(crtc_addr, i);
+		outb(crtc_addr + 1, buf[i + 10]);
+	}
+	inb(crtc_addr+6);			/* reset flip-flop */
+	for (i = 0; i < 20; ++i) {		/* program attribute ctrl */
+		outb(ATC, i);
+		outb(ATC, buf[i + 35]);
+	}
+	for (i = 0; i < 9; ++i) {		/* program graph data ctrl */
+		outb(GDCIDX, i);
+		outb(GDCREG, buf[i + 55]);
+	}
+	inb(crtc_addr + 6);			/* reset flip-flop */
+	outb(ATC, 0x20);			/* enable palette */
 
 #if 0 /* XXX a temporary workaround for kernel panic */
 #ifndef VGA_NO_MODE_CHANGE
-    if (adp->va_unit == V_ADP_PRIMARY) {
-	writeb(BIOS_PADDRTOVADDR(0x44a), buf[0]);	/* COLS */
-	writeb(BIOS_PADDRTOVADDR(0x484), buf[1] + rows_offset - 1); /* ROWS */
-	writeb(BIOS_PADDRTOVADDR(0x485), buf[2]);	/* POINTS */
+	if (adp->va_unit == V_ADP_PRIMARY) {
+		writeb(BIOS_PADDRTOVADDR(0x44a), buf[0]);	/* COLS */
+		writeb(BIOS_PADDRTOVADDR(0x484), buf[1] + rows_offset - 1); /* ROWS */
+		writeb(BIOS_PADDRTOVADDR(0x485), buf[2]);	/* POINTS */
 #if 0
-	writeb(BIOS_PADDRTOVADDR(0x44c), buf[3]);
-	writeb(BIOS_PADDRTOVADDR(0x44d), buf[4]);
+		writeb(BIOS_PADDRTOVADDR(0x44c), buf[3]);
+		writeb(BIOS_PADDRTOVADDR(0x44d), buf[4]);
 #endif
-    }
+	}
 #endif /* !VGA_NO_MODE_CHANGE */
 #endif /* XXX */
 
-    crit_exit();
-    return 0;
+	crit_exit();
+	return 0;
 }
 
 /*
@@ -1564,11 +1574,11 @@ vga_load_state(video_adapter_t *adp, void *p)
 static int
 vga_set_origin(video_adapter_t *adp, off_t offset)
 {
-    /* 
-     * The standard video modes do not require window mapping; 
-     * always return error.
-     */
-    return ENODEV;
+	/*
+	 * The standard video modes do not require window mapping;
+	 * always return error.
+	 */
+	return ENODEV;
 }
 
 /*
@@ -1578,56 +1588,56 @@ vga_set_origin(video_adapter_t *adp, off_t offset)
 static int
 vga_read_hw_cursor(video_adapter_t *adp, int *col, int *row)
 {
-    u_int16_t off;
+	u_int16_t off;
 
-    if (!vga_init_done)
-	return ENXIO;
+	if (!vga_init_done)
+		return ENXIO;
 
-    if (adp->va_info.vi_flags & V_INFO_GRAPHICS)
-	return ENODEV;
+	if (adp->va_info.vi_flags & V_INFO_GRAPHICS)
+		return ENODEV;
 
-    crit_enter();
-    outb(CRTC, 14);
-    off = inb(CRTC + 1);
-    outb(CRTC, 15);
-    off = (off << 8) | inb(CRTC + 1);
-    crit_exit();
+	crit_enter();
+	outb(CRTC, 14);
+	off = inb(CRTC + 1);
+	outb(CRTC, 15);
+	off = (off << 8) | inb(CRTC + 1);
+	crit_exit();
 
-    *row = off / adp->va_info.vi_width;
-    *col = off % adp->va_info.vi_width;
+	*row = off / adp->va_info.vi_width;
+	*col = off % adp->va_info.vi_width;
 
-    return 0;
+	return 0;
 }
 
 /*
  * set_hw_cursor():
- * Move the hardware text cursor.  If col and row are both -1, 
+ * Move the hardware text cursor.  If col and row are both -1,
  * the cursor won't be shown.
  */
 static int
 vga_set_hw_cursor(video_adapter_t *adp, int col, int row)
 {
-    u_int16_t off;
+	u_int16_t off;
 
-    if (!vga_init_done)
-	return ENXIO;
+	if (!vga_init_done)
+		return ENXIO;
 
-    if ((col == -1) && (row == -1)) {
-	off = -1;
-    } else {
-	if (adp->va_info.vi_flags & V_INFO_GRAPHICS)
-	    return ENODEV;
-	off = row*adp->va_info.vi_width + col;
-    }
-
-    crit_enter();
-    outb(CRTC, 14);
-    outb(CRTC + 1, off >> 8);
-    outb(CRTC, 15);
-    outb(CRTC + 1, off & 0x00ff);
-    crit_exit();
-
-    return 0;
+	if ((col == -1) && (row == -1)) {
+		off = -1;
+	} else {
+		if (adp->va_info.vi_flags & V_INFO_GRAPHICS)
+			return ENODEV;
+		off = row*adp->va_info.vi_width + col;
+	}
+
+	crit_enter();
+	outb(CRTC, 14);
+	outb(CRTC + 1, off >> 8);
+	outb(CRTC, 15);
+	outb(CRTC + 1, off & 0x00ff);
+	crit_exit();
+
+	return 0;
 }
 
 /*
@@ -1637,27 +1647,27 @@ vga_set_hw_cursor(video_adapter_t *adp, int col, int row)
  */
 static int
 vga_set_hw_cursor_shape(video_adapter_t *adp, int base, int height,
-			int celsize, int blink)
+    int celsize, int blink)
 {
-    if (!vga_init_done)
-	return ENXIO;
-
-    crit_enter();
-    if (height <= 0) {
-	/* make the cursor invisible */
-	outb(CRTC, 10);
-	outb(CRTC + 1, 32);
-	outb(CRTC, 11);
-	outb(CRTC + 1, 0);
-    } else {
-	outb(CRTC, 10);
-	outb(CRTC + 1, celsize - base - height);
-	outb(CRTC, 11);
-	outb(CRTC + 1, celsize - base - 1);
-    }
-    crit_exit();
-
-    return 0;
+	if (!vga_init_done)
+		return ENXIO;
+
+	crit_enter();
+	if (height <= 0) {
+		/* make the cursor invisible */
+		outb(CRTC, 10);
+		outb(CRTC + 1, 32);
+		outb(CRTC, 11);
+		outb(CRTC + 1, 0);
+	} else {
+		outb(CRTC, 10);
+		outb(CRTC + 1, celsize - base - height);
+		outb(CRTC, 11);
+		outb(CRTC + 1, celsize - base - 1);
+	}
+	crit_exit();
+
+	return 0;
 }
 
 /*
@@ -1667,39 +1677,39 @@ vga_set_hw_cursor_shape(video_adapter_t *adp, int base, int height,
 static int
 vga_blank_display(video_adapter_t *adp, int mode)
 {
-    u_char val;
-
-    crit_enter();
-    switch (mode) {
-    case V_DISPLAY_SUSPEND:
-    case V_DISPLAY_STAND_BY:
-	outb(TSIDX, 0x01);
-	val = inb(TSREG);
-	outb(TSIDX, 0x01);
-	outb(TSREG, val | 0x20);
-	outb(CRTC, 0x17);
-	val = inb(CRTC + 1);
-	outb(CRTC + 1, val & ~0x80);
-	break;
-    case V_DISPLAY_BLANK:
-	outb(TSIDX, 0x01);
-	val = inb(TSREG);
-	outb(TSIDX, 0x01);
-	outb(TSREG, val | 0x20);
-	break;
-    case V_DISPLAY_ON:
-	outb(TSIDX, 0x01);
-	val = inb(TSREG);
-	outb(TSIDX, 0x01);
-	outb(TSREG, val & 0xDF);
-	outb(CRTC, 0x17);
-	val = inb(CRTC + 1);
-	outb(CRTC + 1, val | 0x80);
-	break;
-    }
-    crit_exit();
-
-    return 0;
+	u_char val;
+
+	crit_enter();
+	switch (mode) {
+	case V_DISPLAY_SUSPEND:
+	case V_DISPLAY_STAND_BY:
+		outb(TSIDX, 0x01);
+		val = inb(TSREG);
+		outb(TSIDX, 0x01);
+		outb(TSREG, val | 0x20);
+		outb(CRTC, 0x17);
+		val = inb(CRTC + 1);
+		outb(CRTC + 1, val & ~0x80);
+		break;
+	case V_DISPLAY_BLANK:
+		outb(TSIDX, 0x01);
+		val = inb(TSREG);
+		outb(TSIDX, 0x01);
+		outb(TSREG, val | 0x20);
+		break;
+	case V_DISPLAY_ON:
+		outb(TSIDX, 0x01);
+		val = inb(TSREG);
+		outb(TSIDX, 0x01);
+		outb(TSREG, val & 0xDF);
+		outb(CRTC, 0x17);
+		val = inb(CRTC + 1);
+		outb(CRTC + 1, val | 0x80);
+		break;
+	}
+	crit_exit();
+
+	return 0;
 }
 
 /*
@@ -1709,20 +1719,20 @@ vga_blank_display(video_adapter_t *adp, int mode)
 static int
 vga_mmap_buf(video_adapter_t *adp, vm_offset_t offset, int prot)
 {
-    if (adp->va_info.vi_flags & V_INFO_LINEAR)
-	return -1;
+	if (adp->va_info.vi_flags & V_INFO_LINEAR)
+		return -1;
 
 #if VGA_DEBUG > 0
-    kprintf("vga_mmap_buf(): window:0x%x, offset:%p\n",
-	   adp->va_info.vi_window, (void *)offset);
+	kprintf("vga_mmap_buf(): window:0x%x, offset:%p\n",
+	    adp->va_info.vi_window, (void *)offset);
 #endif
 
-    /* XXX: is this correct? */
-    if (offset > adp->va_window_size - PAGE_SIZE)
-	return -1;
+	/* XXX: is this correct? */
+	if (offset > adp->va_window_size - PAGE_SIZE)
+		return -1;
 
 #if defined(__x86_64__)
-    return x86_64_btop(adp->va_info.vi_window + offset);
+	return x86_64_btop(adp->va_info.vi_window + offset);
 #else
 #error "vga_mmap_buf needs to return something"
 #endif
@@ -1733,239 +1743,240 @@ vga_mmap_buf(video_adapter_t *adp, vm_offset_t offset, int prot)
 static void
 planar_fill(video_adapter_t *adp, int val)
 {
-    int length;
-    int at;			/* position in the frame buffer */
-    int l;
-
-    lwkt_gettoken(&vga_token);
-    outw(GDCIDX, 0x0005);		/* read mode 0, write mode 0 */
-    outw(GDCIDX, 0x0003);		/* data rotate/function select */
-    outw(GDCIDX, 0x0f01);		/* set/reset enable */
-    outw(GDCIDX, 0xff08);		/* bit mask */
-    outw(GDCIDX, (val << 8) | 0x00);	/* set/reset */
-    at = 0;
-    length = adp->va_line_width*adp->va_info.vi_height;
-    while (length > 0) {
-	l = imin(length, adp->va_window_size);
-	(*vidsw[adp->va_index]->set_win_org)(adp, at);
-	bzero_io(adp->va_window, l);
-	length -= l;
-	at += l;
-    }
-    outw(GDCIDX, 0x0000);		/* set/reset */
-    outw(GDCIDX, 0x0001);		/* set/reset enable */
-    lwkt_reltoken(&vga_token);
+	int length;
+	int at;			/* position in the frame buffer */
+	int l;
+
+	lwkt_gettoken(&vga_token);
+	outw(GDCIDX, 0x0005);		/* read mode 0, write mode 0 */
+	outw(GDCIDX, 0x0003);		/* data rotate/function select */
+	outw(GDCIDX, 0x0f01);		/* set/reset enable */
+	outw(GDCIDX, 0xff08);		/* bit mask */
+	outw(GDCIDX, (val << 8) | 0x00); /* set/reset */
+	at = 0;
+	length = adp->va_line_width*adp->va_info.vi_height;
+	while (length > 0) {
+		l = imin(length, adp->va_window_size);
+		(*vidsw[adp->va_index]->set_win_org)(adp, at);
+		bzero_io(adp->va_window, l);
+		length -= l;
+		at += l;
+	}
+	outw(GDCIDX, 0x0000);		/* set/reset */
+	outw(GDCIDX, 0x0001);		/* set/reset enable */
+	lwkt_reltoken(&vga_token);
 }
 
 static void
 packed_fill(video_adapter_t *adp, int val)
 {
-    int length;
-    int at;			/* position in the frame buffer */
-    int l;
-
-    lwkt_gettoken(&vga_token);
-    at = 0;
-    length = adp->va_line_width*adp->va_info.vi_height;
-    while (length > 0) {
-	l = imin(length, adp->va_window_size);
-	(*vidsw[adp->va_index]->set_win_org)(adp, at);
-	fill_io(val, adp->va_window, l);
-	length -= l;
-	at += l;
-    }
-    lwkt_reltoken(&vga_token);
+	int length;
+	int at;			/* position in the frame buffer */
+	int l;
+
+	lwkt_gettoken(&vga_token);
+	at = 0;
+	length = adp->va_line_width*adp->va_info.vi_height;
+	while (length > 0) {
+		l = imin(length, adp->va_window_size);
+		(*vidsw[adp->va_index]->set_win_org)(adp, at);
+		fill_io(val, adp->va_window, l);
+		length -= l;
+		at += l;
+	}
+	lwkt_reltoken(&vga_token);
 }
 
 static void
 direct_fill(video_adapter_t *adp, int val)
 {
-    int length;
-    int at;			/* position in the frame buffer */
-    int l;
-
-    lwkt_gettoken(&vga_token);
-    at = 0;
-    length = adp->va_line_width*adp->va_info.vi_height;
-    while (length > 0) {
-	l = imin(length, adp->va_window_size);
-	(*vidsw[adp->va_index]->set_win_org)(adp, at);
-	switch (adp->va_info.vi_pixel_size) {
-	case sizeof(u_int16_t):
-	    fillw_io(val, adp->va_window, l/sizeof(u_int16_t));
-	    break;
-	case 3:
-	    /* FIXME */
-	    break;
-	case sizeof(u_int32_t):
-	    filll_io(val, adp->va_window, l/sizeof(u_int32_t));
-	    break;
+	int length;
+	int at;			/* position in the frame buffer */
+	int l;
+
+	lwkt_gettoken(&vga_token);
+	at = 0;
+	length = adp->va_line_width*adp->va_info.vi_height;
+	while (length > 0) {
+		l = imin(length, adp->va_window_size);
+		(*vidsw[adp->va_index]->set_win_org)(adp, at);
+		switch (adp->va_info.vi_pixel_size) {
+		case sizeof(u_int16_t):
+			fillw_io(val, adp->va_window, l/sizeof(u_int16_t));
+			break;
+		case 3:
+			/* FIXME */
+			break;
+		case sizeof(u_int32_t):
+			filll_io(val, adp->va_window, l/sizeof(u_int32_t));
+			break;
+		}
+		length -= l;
+		at += l;
 	}
-	length -= l;
-	at += l;
-    }
-    lwkt_reltoken(&vga_token);
+	lwkt_reltoken(&vga_token);
 }
 
 static int
 vga_clear(video_adapter_t *adp)
 {
-    switch (adp->va_info.vi_mem_model) {
-    case V_INFO_MM_TEXT:
-	/* do nothing? XXX */
-	break;
-    case V_INFO_MM_PLANAR:
-	planar_fill(adp, 0);
-	break;
-    case V_INFO_MM_PACKED:
-	packed_fill(adp, 0);
-	break;
-    case V_INFO_MM_DIRECT:
-	direct_fill(adp, 0);
-	break;
-    }
-    return 0;
+	switch (adp->va_info.vi_mem_model) {
+	case V_INFO_MM_TEXT:
+		/* do nothing? XXX */
+		break;
+	case V_INFO_MM_PLANAR:
+		planar_fill(adp, 0);
+		break;
+	case V_INFO_MM_PACKED:
+		packed_fill(adp, 0);
+		break;
+	case V_INFO_MM_DIRECT:
+		direct_fill(adp, 0);
+		break;
+	}
+	return 0;
 }
 
 static int
 vga_fill_rect(video_adapter_t *adp, int val, int x, int y, int cx, int cy)
 {
-    return ENODEV;
+	return ENODEV;
 }
 
 static int
 vga_bitblt(video_adapter_t *adp,...)
 {
-    /* FIXME */
-    return ENODEV;
+	/* FIXME */
+	return ENODEV;
 }
 
 #endif /* !VGA_NO_MODE_CHANGE */
 
 static int
 get_palette(video_adapter_t *adp, int base, int count,
-	    u_char *red, u_char *green, u_char *blue, u_char *trans)
+    u_char *red, u_char *green, u_char *blue, u_char *trans)
 {
-    u_char *r;
-    u_char *g;
-    u_char *b;
-
-    if (count < 0 || base < 0 || count > 256 || base > 256 ||
-	base + count > 256)
-	return EINVAL;
-
-    r = kmalloc(count*3, M_DEVBUF, M_WAITOK);
-    g = r + count;
-    b = g + count;
-    if (vga_save_palette2(adp, base, count, r, g, b)) {
+	u_char *r;
+	u_char *g;
+	u_char *b;
+
+	if (count < 0 || base < 0 || count > 256 || base > 256 ||
+	    base + count > 256)
+		return EINVAL;
+
+	r = kmalloc(count*3, M_DEVBUF, M_WAITOK);
+	g = r + count;
+	b = g + count;
+	if (vga_save_palette2(adp, base, count, r, g, b)) {
+		kfree(r, M_DEVBUF);
+		return ENODEV;
+	}
+	copyout(r, red, count);
+	copyout(g, green, count);
+	copyout(b, blue, count);
+	if (trans != NULL) {
+		bzero(r, count);
+		copyout(r, trans, count);
+	}
 	kfree(r, M_DEVBUF);
-	return ENODEV;
-    }
-    copyout(r, red, count);
-    copyout(g, green, count);
-    copyout(b, blue, count);
-    if (trans != NULL) {
-	bzero(r, count);
-	copyout(r, trans, count);
-    }
-    kfree(r, M_DEVBUF);
-
-    return 0;
+
+	return 0;
 }
 
 static int
 set_palette(video_adapter_t *adp, int base, int count,
-	    u_char *red, u_char *green, u_char *blue, u_char *trans)
+    u_char *red, u_char *green, u_char *blue, u_char *trans)
 {
-    u_char *r;
-    u_char *g;
-    u_char *b;
-    int err;
-
-    if (count < 0 || base < 0 || count > 256 || base > 256 ||
-	base + count > 256)
-	return EINVAL;
+	u_char *r;
+	u_char *g;
+	u_char *b;
+	int err;
+
+	if (count < 0 || base < 0 || count > 256 || base > 256 ||
+	    base + count > 256)
+		return EINVAL;
+
+	r = kmalloc(count*3, M_DEVBUF, M_WAITOK);
+	g = r + count;
+	b = g + count;
+	err = copyin(red, r, count);
+	if (!err)
+		err = copyin(green, g, count);
+	if (!err)
+		err = copyin(blue, b, count);
+	if (!err)
+		err = vga_load_palette2(adp, base, count, r, g, b);
+	kfree(r, M_DEVBUF);
 
-    r = kmalloc(count*3, M_DEVBUF, M_WAITOK);
-    g = r + count;
-    b = g + count;
-    err = copyin(red, r, count);
-    if (!err)
-	err = copyin(green, g, count);
-    if (!err)
-	err = copyin(blue, b, count);
-    if (!err)
-	err = vga_load_palette2(adp, base, count, r, g, b);
-    kfree(r, M_DEVBUF);
-
-    return (err ? ENODEV : 0);
+	return (err ? ENODEV : 0);
 }
 
 static int
 vga_dev_ioctl(video_adapter_t *adp, u_long cmd, caddr_t arg)
 {
-    switch (cmd) {
-    case FBIO_GETWINORG:	/* get frame buffer window origin */
-	*(u_int *)arg = 0;
-	return 0;
+	switch (cmd) {
+	case FBIO_GETWINORG:	/* get frame buffer window origin */
+		*(u_int *)arg = 0;
+		return 0;
 
-    case FBIO_SETWINORG:	/* set frame buffer window origin */
-	return ENODEV;
+	case FBIO_SETWINORG:	/* set frame buffer window origin */
+		return ENODEV;
 
-    case FBIO_SETDISPSTART:	/* set display start address */
-	return (set_display_start(adp, 
-				  ((video_display_start_t *)arg)->x,
-			  	  ((video_display_start_t *)arg)->y)
-		? ENODEV : 0);
-
-    case FBIO_SETLINEWIDTH:	/* set scan line length in pixel */
-	return (set_line_length(adp, *(u_int *)arg) ? ENODEV : 0);
-
-    case FBIO_GETPALETTE:	/* get color palette */
-	return get_palette(adp, ((video_color_palette_t *)arg)->index,
-			   ((video_color_palette_t *)arg)->count,
-			   ((video_color_palette_t *)arg)->red,
-			   ((video_color_palette_t *)arg)->green,
-			   ((video_color_palette_t *)arg)->blue,
-			   ((video_color_palette_t *)arg)->transparent);
-
-    case FBIO_SETPALETTE:	/* set color palette */
-	return set_palette(adp, ((video_color_palette_t *)arg)->index,
-			   ((video_color_palette_t *)arg)->count,
-			   ((video_color_palette_t *)arg)->red,
-			   ((video_color_palette_t *)arg)->green,
-			   ((video_color_palette_t *)arg)->blue,
-			   ((video_color_palette_t *)arg)->transparent);
-
-    case FBIOGTYPE:		/* get frame buffer type info. */
-	((struct fbtype *)arg)->fb_type = fb_type(adp->va_type);
-	((struct fbtype *)arg)->fb_height = adp->va_info.vi_height;
-	((struct fbtype *)arg)->fb_width = adp->va_info.vi_width;
-	((struct fbtype *)arg)->fb_depth = adp->va_info.vi_depth;
-	if ((adp->va_info.vi_depth <= 1) || (adp->va_info.vi_depth > 8))
-	    ((struct fbtype *)arg)->fb_cmsize = 0;
-	else
-	    ((struct fbtype *)arg)->fb_cmsize = 1 << adp->va_info.vi_depth;
-	((struct fbtype *)arg)->fb_size = adp->va_buffer_size;
-	return 0;
+	case FBIO_SETDISPSTART:	/* set display start address */
+		return (set_display_start(adp,
+			((video_display_start_t *)arg)->x,
+			((video_display_start_t *)arg)->y)
+		    ? ENODEV : 0);
+
+	case FBIO_SETLINEWIDTH:	/* set scan line length in pixel */
+		return (set_line_length(adp, *(u_int *)arg) ? ENODEV : 0);
+
+	case FBIO_GETPALETTE:	/* get color palette */
+		return get_palette(adp, ((video_color_palette_t *)arg)->index,
+		    ((video_color_palette_t *)arg)->count,
+		    ((video_color_palette_t *)arg)->red,
+		    ((video_color_palette_t *)arg)->green,
+		    ((video_color_palette_t *)arg)->blue,
+		    ((video_color_palette_t *)arg)->transparent);
+
+	case FBIO_SETPALETTE:	/* set color palette */
+		return set_palette(adp, ((video_color_palette_t *)arg)->index,
+		    ((video_color_palette_t *)arg)->count,
+		    ((video_color_palette_t *)arg)->red,
+		    ((video_color_palette_t *)arg)->green,
+		    ((video_color_palette_t *)arg)->blue,
+		    ((video_color_palette_t *)arg)->transparent);
+
+	case FBIOGTYPE:		/* get frame buffer type info. */
+		((struct fbtype *)arg)->fb_type = fb_type(adp->va_type);
+		((struct fbtype *)arg)->fb_height = adp->va_info.vi_height;
+		((struct fbtype *)arg)->fb_width = adp->va_info.vi_width;
+		((struct fbtype *)arg)->fb_depth = adp->va_info.vi_depth;
+		if ((adp->va_info.vi_depth <= 1) ||
+		    (adp->va_info.vi_depth > 8))
+			((struct fbtype *)arg)->fb_cmsize = 0;
+		else
+			((struct fbtype *)arg)->fb_cmsize = 1 << adp->va_info.vi_depth;
+		((struct fbtype *)arg)->fb_size = adp->va_buffer_size;
+		return 0;
 
-    case FBIOGETCMAP:		/* get color palette */
-	return get_palette(adp, ((struct fbcmap *)arg)->index,
-			   ((struct fbcmap *)arg)->count,
-			   ((struct fbcmap *)arg)->red,
-			   ((struct fbcmap *)arg)->green,
-			   ((struct fbcmap *)arg)->blue, NULL);
-
-    case FBIOPUTCMAP:		/* set color palette */
-	return set_palette(adp, ((struct fbcmap *)arg)->index,
-			   ((struct fbcmap *)arg)->count,
-			   ((struct fbcmap *)arg)->red,
-			   ((struct fbcmap *)arg)->green,
-			   ((struct fbcmap *)arg)->blue, NULL);
-
-    default:
-	return fb_commonioctl(adp, cmd, arg);
-    }
+	case FBIOGETCMAP:	/* get color palette */
+		return get_palette(adp, ((struct fbcmap *)arg)->index,
+		    ((struct fbcmap *)arg)->count,
+		    ((struct fbcmap *)arg)->red,
+		    ((struct fbcmap *)arg)->green,
+		    ((struct fbcmap *)arg)->blue, NULL);
+
+	case FBIOPUTCMAP:	/* set color palette */
+		return set_palette(adp, ((struct fbcmap *)arg)->index,
+		    ((struct fbcmap *)arg)->count,
+		    ((struct fbcmap *)arg)->red,
+		    ((struct fbcmap *)arg)->green,
+		    ((struct fbcmap *)arg)->blue, NULL);
+
+	default:
+		return fb_commonioctl(adp, cmd, arg);
+	}
 }
 
 /*
@@ -1976,69 +1987,71 @@ vga_dev_ioctl(video_adapter_t *adp, u_long cmd, caddr_t arg)
 static int
 vga_diag(video_adapter_t *adp, int level)
 {
-    u_char *mp;
+	u_char *mp;
 #if FB_DEBUG > 1
-    video_info_t info;
-    int i;
+	video_info_t info;
+	int i;
 #endif
 
-    if (!vga_init_done)
-	return ENXIO;
+	if (!vga_init_done)
+		return ENXIO;
 
 #if FB_DEBUG > 1
 #ifndef VGA_NO_MODE_CHANGE
-    kprintf("vga: DCC code:0x%02x\n",
-	readb(BIOS_PADDRTOVADDR(0x488)));
-    kprintf("vga: CRTC:0x%x, video option:0x%02x, ",
-	readw(BIOS_PADDRTOVADDR(0x463)),
-	readb(BIOS_PADDRTOVADDR(0x487)));
-    kprintf("rows:%d, cols:%d, font height:%d\n",
-	readb(BIOS_PADDRTOVADDR(0x44a)),
-	readb(BIOS_PADDRTOVADDR(0x484)) + 1,
-	readb(BIOS_PADDRTOVADDR(0x485)));
-    kprintf("vga: param table:%p\n", video_mode_ptr);
-    kprintf("vga: rows_offset:%d\n", rows_offset);
+	kprintf("vga: DCC code:0x%02x\n",
+	    readb(BIOS_PADDRTOVADDR(0x488)));
+	kprintf("vga: CRTC:0x%x, video option:0x%02x, ",
+	    readw(BIOS_PADDRTOVADDR(0x463)),
+	    readb(BIOS_PADDRTOVADDR(0x487)));
+	kprintf("rows:%d, cols:%d, font height:%d\n",
+	    readb(BIOS_PADDRTOVADDR(0x44a)),
+	    readb(BIOS_PADDRTOVADDR(0x484)) + 1,
+	    readb(BIOS_PADDRTOVADDR(0x485)));
+	kprintf("vga: param table:%p\n", video_mode_ptr);
+	kprintf("vga: rows_offset:%d\n", rows_offset);
 #endif
 #endif /* FB_DEBUG > 1 */
 
-    fb_dump_adp_info(VGA_DRIVER_NAME, adp, level);
+	fb_dump_adp_info(VGA_DRIVER_NAME, adp, level);
 
 #if FB_DEBUG > 1
-    if (adp->va_flags & V_ADP_MODECHANGE) {
-	for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
-	    if (bios_vmode[i].vi_mode == NA)
-		continue;
-	    if (get_mode_param(bios_vmode[i].vi_mode) == NULL)
-		continue;
-	    fb_dump_mode_info(VGA_DRIVER_NAME, adp, &bios_vmode[i], level);
+	if (adp->va_flags & V_ADP_MODECHANGE) {
+		for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
+			if (bios_vmode[i].vi_mode == NA)
+				continue;
+			if (get_mode_param(bios_vmode[i].vi_mode) == NULL)
+				continue;
+			fb_dump_mode_info(VGA_DRIVER_NAME, adp,
+			    &bios_vmode[i], level);
+		}
+	} else {
+		vga_get_info(adp, adp->va_initial_mode, &info);	/* shouldn't fail */
+		fb_dump_mode_info(VGA_DRIVER_NAME, adp, &info, level);
 	}
-    } else {
-	vga_get_info(adp, adp->va_initial_mode, &info);	/* shouldn't fail */
-	fb_dump_mode_info(VGA_DRIVER_NAME, adp, &info, level);
-    }
 #endif /* FB_DEBUG > 1 */
 
 #ifndef VGA_NO_MODE_CHANGE
-    if (video_mode_ptr == NULL)
-	kprintf("vga%d: %s: WARNING: video mode switching is not "
-	       "fully supported on this adapter\n",
-	       adp->va_unit, adp->va_name);
+	if (video_mode_ptr == NULL)
+		kprintf("vga%d: %s: WARNING: video mode switching is not "
+		    "fully supported on this adapter\n",
+		    adp->va_unit, adp->va_name);
 #endif
-    if (level <= 0)
-	return 0;
+	if (level <= 0)
+		return 0;
 
-    kprintf("VGA parameters upon power-up\n");
-    hexdump(adpstate.regs, sizeof(adpstate.regs), NULL,
-	HD_OMIT_CHARS | HD_OMIT_COUNT);
+	kprintf("VGA parameters upon power-up\n");
+	hexdump(adpstate.regs, sizeof(adpstate.regs), NULL,
+	    HD_OMIT_CHARS | HD_OMIT_COUNT);
 
-    mp = get_mode_param(adp->va_initial_mode);
-    if (mp == NULL)	/* this shouldn't be happening */
-	return 0;
-    kprintf("VGA parameters in BIOS for mode %d\n", adp->va_initial_mode);
-    hexdump(adpstate2.regs, sizeof(adpstate2.regs), NULL,
-	HD_OMIT_CHARS | HD_OMIT_COUNT);
-    kprintf("VGA parameters to be used for mode %d\n", adp->va_initial_mode);
-    hexdump(mp, V_MODE_PARAM_SIZE, NULL, HD_OMIT_CHARS | HD_OMIT_COUNT);
+	mp = get_mode_param(adp->va_initial_mode);
+	if (mp == NULL)	/* this shouldn't be happening */
+		return 0;
+	kprintf("VGA parameters in BIOS for mode %d\n", adp->va_initial_mode);
+	hexdump(adpstate2.regs, sizeof(adpstate2.regs), NULL,
+	    HD_OMIT_CHARS | HD_OMIT_COUNT);
+	kprintf("VGA parameters to be used for mode %d\n",
+	    adp->va_initial_mode);
+	hexdump(mp, V_MODE_PARAM_SIZE, NULL, HD_OMIT_CHARS | HD_OMIT_COUNT);
 
-    return 0;
+	return 0;
 }
-- 
2.23.0

