From patchwork Fri Sep 20 15:43:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 1165305 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46ZdLJ1HKNz9s00 for ; Sat, 21 Sep 2019 01:44:08 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id C166AC21DF9; Fri, 20 Sep 2019 15:44:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id B5A0CC21C51; Fri, 20 Sep 2019 15:43:58 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E3A8BC21C51; Fri, 20 Sep 2019 15:43:57 +0000 (UTC) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by lists.denx.de (Postfix) with ESMTPS id 95BF8C21BE5 for ; Fri, 20 Sep 2019 15:43:57 +0000 (UTC) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 46ZdL52gtwz1s1VX; Fri, 20 Sep 2019 17:43:57 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 46ZdL52HP0z1qqkJ; Fri, 20 Sep 2019 17:43:57 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id pzvWLDjRP1qY; Fri, 20 Sep 2019 17:43:56 +0200 (CEST) X-Auth-Info: mxKcWeoO7Oj/yR12da7Q/6TWkwlfkAJXhuKb4R4jVm4= Received: from crub.agik.hopto.org (p54833695.dip0.t-ipconnect.de [84.131.54.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 20 Sep 2019 17:43:56 +0200 (CEST) From: Anatolij Gustschin To: u-boot@lists.denx.de Date: Fri, 20 Sep 2019 17:43:55 +0200 Message-Id: <20190920154355.26215-1-agust@denx.de> X-Mailer: git-send-email 2.17.1 Cc: Fabio Estevam Subject: [U-Boot] [PATCH] splash: fix splash banner output X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Old splash code in cfb_console driver displayed U-Boot version string by default. Restore this behaviour for DM_VIDEO enabled configurations. Signed-off-by: Anatolij Gustschin --- common/splash.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/common/splash.c b/common/splash.c index 1a5db69a7e..10089fe33a 100644 --- a/common/splash.c +++ b/common/splash.c @@ -112,6 +112,35 @@ void splash_get_pos(int *x, int *y) } #endif /* CONFIG_SPLASH_SCREEN_ALIGN */ +#ifndef CONFIG_HIDE_LOGO_VERSION + +#include +#include +#include +#include + +void splash_display_banner(void) +{ + struct udevice *dev; + char buf[DISPLAY_OPTIONS_BANNER_LENGTH]; + int col, raw, ret; + + ret = uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &dev); + if (ret) + return; + + col = BMP_LOGO_WIDTH / VIDEO_FONT_WIDTH + 1; + raw = BMP_LOGO_HEIGHT / VIDEO_FONT_HEIGHT + 1; + + display_options_get_banner(false, buf, sizeof(buf)); + vidconsole_position_cursor(dev, col, 1); + vidconsole_put_string(dev, buf); + vidconsole_position_cursor(dev, 0, raw); +} +#else +static inline void splash_display_banner(void) { } +#endif + /* * Common function to show a splash image if env("splashimage") is set. * Is used for both dm_video and lcd video stacks. For additional @@ -135,6 +164,14 @@ int splash_display(void) splash_get_pos(&x, &y); - return bmp_display(addr, x, y); + ret = bmp_display(addr, x, y); + + /* Skip banner output on video console if the logo is not at 0,0 */ + if (x || y) + goto end; + + splash_display_banner(); +end: + return ret; } #endif