]> xenbits.xensource.com Git - seabios.git/commitdiff
geodevga: move framebuffer setup
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Thu, 14 Feb 2013 09:34:34 +0000 (10:34 +0100)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 16 Feb 2013 03:52:18 +0000 (22:52 -0500)
Framebuffer setup has nothing to do with dc_setup(..) so
move it to  geodevga_init(..).

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
vgasrc/geodevga.c

index ef840a43836f5dade059ea6e8947c7ce2510d5b4..e96698c9aa2a749f2bf6589f2ddc41b80e67d0d1 100644 (file)
@@ -218,22 +218,10 @@ static void dc_setup(void)
     geode_dc_write(DC_CB_ST_OFFSET, 0x0);
     geode_dc_write(DC_CURS_ST_OFFSET, 0x0);
 
-    /* read fb-bar from pci, then point dc to the fb base */
-    u32 fb = GET_GLOBAL(GeodeFB);
-    if (geode_dc_read(DC_GLIU0_MEM_OFFSET) != fb)
-        geode_dc_write(DC_GLIU0_MEM_OFFSET, fb);
-
     geode_dc_mask(DC_DISPLAY_CFG, ~DC_CFG_MSK, DC_DISPLAY_CFG_GDEN|DC_DISPLAY_CFG_TRUP);
     geode_dc_write(DC_GENERAL_CFG, DC_DISPLAY_CFG_VGAE);
 
     geode_dc_write(DC_UNLOCK, DC_LOCK_LOCK);
-
-    u32 fb_size = framebuffer_size(); // in byte
-    dprintf(1, "%d KB of video memory at 0x%08x\n", fb_size / 1024, fb);
-
-    /* update VBE variables */
-    SET_VGA(VBE_framebuffer, fb);
-    SET_VGA(VBE_total_memory, fb_size / 1024 / 64); // number of 64K blocks
 }
 
 /* Setup the vp (video processor) portion of the geodelx
@@ -408,6 +396,23 @@ int geodevga_setup(void)
     dprintf(1, "dc addr: 0x%08x\n", GET_GLOBAL(GeodeDC));
     dprintf(1, "vp addr: 0x%08x\n", GET_GLOBAL(GeodeVP));
 
+    /* setup framebuffer */
+    geode_dc_write(DC_UNLOCK, DC_LOCK_UNLOCK);
+
+    /* read fb-bar from pci, then point dc to the fb base */
+    u32 fb = GET_GLOBAL(GeodeFB);
+    if (geode_dc_read(DC_GLIU0_MEM_OFFSET) != fb)
+        geode_dc_write(DC_GLIU0_MEM_OFFSET, fb);
+
+    geode_dc_write(DC_UNLOCK, DC_LOCK_LOCK);
+
+    u32 fb_size = framebuffer_size(); // in byte
+    dprintf(1, "%d KB of video memory at 0x%08x\n", fb_size / 1024, fb);
+
+    /* update VBE variables */
+    SET_VGA(VBE_framebuffer, fb);
+    SET_VGA(VBE_total_memory, fb_size / 1024 / 64); // number of 64K blocks
+
     vp_setup();
     dc_setup();