diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 4c668d388a493e7c982c70fb05c8f7532f4d3aa9..d5c6639c899f872c64b6c82ff294d5c9373233de 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -2026,7 +2026,6 @@ static int cfg_video_init(void) { unsigned char color8; - pGD = video_hw_init(); if (pGD == NULL) return -1; @@ -2107,6 +2106,9 @@ static int cfg_video_init(void) } eorx = fgx ^ bgx; + /* Initialize the console */ + old_col = console_col = 0; + old_row = console_row = 0; if (!CONFIG_IS_ENABLED(NO_FB_CLEAR)) video_clear(); @@ -2115,6 +2117,7 @@ static int cfg_video_init(void) video_console_address = video_fb_address; #ifndef CONFIG_VIDEO_SKIP_VERSION video_drawstring(VIDEO_FONT_WIDTH, 0, (uchar *)version_string); + old_row = console_row = 1; #endif } #endif @@ -2124,10 +2127,6 @@ static int cfg_video_init(void) video_console_address = video_logo(); #endif - /* Initialize the console */ - console_col = 0; - console_row = 0; - if (cfb_do_flush_cache) flush_cache(VIDEO_FB_ADRS, VIDEO_SIZE); @@ -2155,7 +2154,7 @@ int drv_video_init(void) return 0; /* Init video chip - returns with framebuffer cleared */ - if (cfg_video_init() == -1) + if (!drv_video_init2(video_hw_init())) return 0; if (board_cfb_skip()) @@ -2199,6 +2198,14 @@ int drv_video_init(void) return 1; } +int drv_video_init2(struct graphic_device *fb) +{ + pGD = fb; + if (cfg_video_init() == -1) + return 0; + return 1; +} + void video_position_cursor(unsigned col, unsigned row) { console_col = min(col, CONSOLE_COLS - 1); diff --git a/include/stdio_dev.h b/include/stdio_dev.h index cd0cd601bff624ebcacbe419d8795b190f45ea0c..eb41e87828d376886431740539c3b17a7b262e56 100644 --- a/include/stdio_dev.h +++ b/include/stdio_dev.h @@ -96,6 +96,8 @@ int drv_lcd_init (void); #endif #if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE) int drv_video_init (void); +struct graphic_device; +int drv_video_init2(struct graphic_device *fb); #endif #ifdef CONFIG_KEYBOARD int drv_keyboard_init (void);