diff options
author | Ye.Li <B37916@freescale.com> | 2015-04-10 12:10:34 +0800 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2016-03-25 13:38:07 +0800 |
commit | a12ec4c29b4cbdf03ae68a5ecb739253f79b59fc (patch) | |
tree | d6eaba5ff794031fc6cbdb9238554d6ac50c0ff5 /drivers/video/cfb_console.c | |
parent | acfeb43685efb04423ce064c67228d15fa6d3da5 (diff) | |
download | u-boot-imx-a12ec4c29b4cbdf03ae68a5ecb739253f79b59fc.zip u-boot-imx-a12ec4c29b4cbdf03ae68a5ecb739253f79b59fc.tar.gz u-boot-imx-a12ec4c29b4cbdf03ae68a5ecb739253f79b59fc.tar.bz2 |
MLK-10542 video: Support multiple lines version string display
The caculation of left space for version string is not correct, should
use VIDEO_COLS not VIDEO_LINE_LEN / 2, otherwise we will get larger space
than actual have and cause string to overlay logo picture.
Also current version string display only supports two lines words at max.
This also causes overlay when the LCD pixel colume size is not enough.
Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit ed53487d36a886fb4557088804a4b5232b168889)
(cherry picked from commit 253936bb920c5bb8e7d26e0425d155fb2576ab77)
Diffstat (limited to 'drivers/video/cfb_console.c')
-rw-r--r-- | drivers/video/cfb_console.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index ef4984b..2b8c416 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -2,6 +2,8 @@ * (C) Copyright 2002 ELTEC Elektronik AG * Frank Gottschling <fgottschling@eltec.de> * + * Copyright (C) 2015-2016 Freescale Semiconductor, Inc. + * * SPDX-License-Identifier: GPL-2.0+ */ @@ -1978,16 +1980,30 @@ static void *video_logo(void) sprintf(info, " %s", version_string); - 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; + while (len) { + if (len > space) { + video_drawchars(xx, yy, + (uchar *) info + (y_off * space), space); + len -= space; + + if (!y_off) { + xx += VIDEO_FONT_WIDTH; + space--; + } + yy += VIDEO_FONT_HEIGHT; + + y_off++; + } else { + video_drawchars(xx, yy, + (uchar *) info + (y_off * space), len); + len = 0; + } + } } else video_drawstring(VIDEO_INFO_X, VIDEO_INFO_Y, (uchar *) info); |