X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fvideo%2Fcfb_console.c;h=6db40735961e934a2f57e82c0a1dfe3f77037e9d;hb=a87a0ce7028d5371c81d77ba72c1ba43a1ca77bc;hp=c09b7e34c7173b8b4d0576ae706d890c3da2d95c;hpb=fd8cf994070df9d7576f429506514bf0bb778afd;p=oweals%2Fu-boot.git diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index c09b7e34c7..6db4073596 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -2,7 +2,7 @@ * (C) Copyright 2002 ELTEC Elektronik AG * Frank Gottschling * - * SPDX-License-Identifier: GPL-2.0+ + * SPDX-License-Identifier: GPL-2.0+ */ /* @@ -197,7 +197,6 @@ #include #include #include -#include #if defined(CONFIG_CMD_DATE) #include @@ -431,6 +430,16 @@ static const int video_font_draw_table32[16][4] = { {0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff} }; +/* + * Implement a weak default function for boards that optionally + * need to skip the cfb initialization. + */ +__weak int board_cfb_skip(void) +{ + /* As default, don't skip cfb init */ + return 0; +} + static void video_drawchars(int xx, int yy, unsigned char *s, int count) { u8 *cdat, *dest, *dest0; @@ -2017,6 +2026,8 @@ static void *video_logo(void) return video_fb_address + video_logo_height * VIDEO_LINE_LEN; } #endif + if (board_cfb_skip()) + return 0; sprintf(info, " %s", version_string); @@ -2097,6 +2108,24 @@ defined(CONFIG_SANDBOX) || defined(CONFIG_X86) return 0; } +void video_clear(void) +{ + if (!video_fb_address) + return; +#ifdef VIDEO_HW_RECTFILL + video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */ + 0, /* dest pos x */ + 0, /* dest pos y */ + VIDEO_VISIBLE_COLS, /* frame width */ + VIDEO_VISIBLE_ROWS, /* frame height */ + bgx /* fill color */ + ); +#else + memsetl(video_fb_address, + (VIDEO_VISIBLE_ROWS * VIDEO_LINE_LEN) / sizeof(int), bgx); +#endif +} + static int video_init(void) { unsigned char color8; @@ -2183,6 +2212,8 @@ static int video_init(void) } eorx = fgx ^ bgx; + video_clear(); + #ifdef CONFIG_VIDEO_LOGO /* Plot the logo and get start point of console */ debug("Video: Drawing the logo ...\n"); @@ -2226,6 +2257,9 @@ int drv_video_init(void) /* Init video chip - returns with framebuffer cleared */ skip_dev_init = (video_init() == -1); + if (board_cfb_skip()) + return 0; + #if !defined(CONFIG_VGA_AS_SINGLE_DEVICE) debug("KBD: Keyboard init ...\n"); skip_dev_init |= (VIDEO_KBD_INIT_FCT == -1); @@ -2283,21 +2317,3 @@ int video_get_screen_columns(void) { return CONSOLE_COLS; } - -void video_clear(void) -{ - if (!video_fb_address) - return; -#ifdef VIDEO_HW_RECTFILL - video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */ - 0, /* dest pos x */ - 0, /* dest pos y */ - VIDEO_VISIBLE_COLS, /* frame width */ - VIDEO_VISIBLE_ROWS, /* frame height */ - bgx /* fill color */ - ); -#else - memsetl(video_fb_address, - (VIDEO_VISIBLE_ROWS * VIDEO_LINE_LEN) / sizeof(int), bgx); -#endif -}