X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fvideo%2Fcfb_console.c;h=636c3e8c184dac5d919a8ccf9efe1105b34cc96e;hb=f541796af929fa28a78dc3162a0ba09d4fa3ce90;hp=6c5425c195e927d4594d6f4ccc97cbb56f88bbfa;hpb=1fdafb2e3dfecdc4129a8062ad25b1adb32b0efb;p=oweals%2Fu-boot.git diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 6c5425c195..636c3e8c18 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -1,8 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2002 ELTEC Elektronik AG * Frank Gottschling - * - * SPDX-License-Identifier: GPL-2.0+ */ /* @@ -768,7 +767,7 @@ static void parse_putc(const char c) break; case '\n': /* next line */ - if (console_col || (!console_col && nl)) + if (console_col || nl) console_newline(1); nl = 1; break; @@ -1298,6 +1297,10 @@ next_run: break; } } + + if (cfb_do_flush_cache) + flush_cache(VIDEO_FB_ADRS, VIDEO_SIZE); + return 0; error: printf("Error: Too much encoded pixel data, validate your bitmap\n"); @@ -1900,16 +1903,32 @@ static void *video_logo(void) sprintf(info, " %s", version_string); #ifndef CONFIG_HIDE_LOGO_VERSION - space = (VIDEO_LINE_LEN / 2 - VIDEO_INFO_X) / VIDEO_FONT_WIDTH; + space = (VIDEO_COLS - VIDEO_INFO_X) / VIDEO_FONT_WIDTH; len = strlen(info); if (len > space) { - video_drawchars(VIDEO_INFO_X, VIDEO_INFO_Y, - (uchar *) info, space); - video_drawchars(VIDEO_INFO_X + VIDEO_FONT_WIDTH, - VIDEO_INFO_Y + VIDEO_FONT_HEIGHT, - (uchar *) info + space, len - space); - y_off = 1; + int xx = VIDEO_INFO_X, yy = VIDEO_INFO_Y; + uchar *p = (uchar *) info; + + while (len) { + if (len > space) { + video_drawchars(xx, yy, p, space); + len -= space; + + p = (uchar *)p + space; + + if (!y_off) { + xx += VIDEO_FONT_WIDTH; + space--; + } + yy += VIDEO_FONT_HEIGHT; + + y_off++; + } else { + video_drawchars(xx, yy, p, len); + len = 0; + } + } } else video_drawstring(VIDEO_INFO_X, VIDEO_INFO_Y, (uchar *) info); @@ -2081,7 +2100,8 @@ static int cfg_video_init(void) } eorx = fgx ^ bgx; - video_clear(); + if (!CONFIG_IS_ENABLED(NO_FB_CLEAR)) + video_clear(); #ifdef CONFIG_VIDEO_LOGO /* Plot the logo and get start point of console */