diff options
-rw-r--r-- | drivers/video/cfb_console.c | 30 | ||||
-rw-r--r-- | drivers/video/ipu_common.c | 6 |
2 files changed, 28 insertions, 8 deletions
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 74cc20d653..0b25897062 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -1900,16 +1900,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); diff --git a/drivers/video/ipu_common.c b/drivers/video/ipu_common.c index 96229da502..889085aa76 100644 --- a/drivers/video/ipu_common.c +++ b/drivers/video/ipu_common.c @@ -132,8 +132,12 @@ struct clk *clk_get_parent(struct clk *clk) int clk_set_rate(struct clk *clk, unsigned long rate) { - if (clk && clk->set_rate) + if (!clk) + return 0; + + if (clk->set_rate) clk->set_rate(clk, rate); + return clk->rate; } |