From: Christian Gmeiner Date: Thu, 14 Feb 2013 09:34:34 +0000 (+0100) Subject: geodevga: move framebuffer setup X-Git-Tag: rel-1.7.3~88 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=320570821ada0c7cace04b6fa793326abc076d84;p=seabios.git geodevga: move framebuffer setup Framebuffer setup has nothing to do with dc_setup(..) so move it to geodevga_init(..). Signed-off-by: Christian Gmeiner --- diff --git a/vgasrc/geodevga.c b/vgasrc/geodevga.c index ef840a4..e96698c 100644 --- a/vgasrc/geodevga.c +++ b/vgasrc/geodevga.c @@ -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();