X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fvideo%2Fcfb_console.c;h=40110668a6b41050cb33690b53aeddc5b1b4a706;hb=984df7add1fe6e5a25854eae81f51940806456bc;hp=74cc20d6532f374c87e96dd5b9c372b8973a91f6;hpb=8ef05352508f99b9e69feeca17a49671cc3d0ccf;p=u-boot diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 74cc20d653..40110668a6 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; @@ -1900,16 +1899,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);