From patchwork Tue May 28 15:19:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1106372 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=fail (p=quarantine dis=none) header.from=toradex.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=toradex.com header.i=@toradex.com header.b="LqlanzmR"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45CyFM66Z8z9s3Z for ; Wed, 29 May 2019 01:19:51 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 87820C2201D; Tue, 28 May 2019 15:19:45 +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=SPF_HELO_PASS, T_DKIM_INVALID 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 604FEC21FA3; Tue, 28 May 2019 15:19:43 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A071BC21FA3; Tue, 28 May 2019 15:19:41 +0000 (UTC) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50095.outbound.protection.outlook.com [40.107.5.95]) by lists.denx.de (Postfix) with ESMTPS id 3CF38C21C50 for ; Tue, 28 May 2019 15:19:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toradex.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H2RWCEAdDJmLsRJitYcPZyJ1PvobBHVuoX0zXyiV0I8=; b=LqlanzmRr9ccFP4tFpIa3UlhlMUDQ+c/tUmPySKKaXiOemLOqOzIpkEC01y1Nj5+stzbVfWD2E8g0jH4R4QMbiKh8oixh3yssqq4Ag9Kw1s3XhJzOiF7bzRbzir1JcMZPvRb595Ev6tOhAvBIIlTN4XJAdHVmsw2vGWCFeWYq+g= Received: from HE1PR0502MB3931.eurprd05.prod.outlook.com (52.133.4.14) by HE1PR0502MB3674.eurprd05.prod.outlook.com (10.167.127.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.16; Tue, 28 May 2019 15:19:38 +0000 Received: from HE1PR0502MB3931.eurprd05.prod.outlook.com ([fe80::a08a:5b51:90db:2cad]) by HE1PR0502MB3931.eurprd05.prod.outlook.com ([fe80::a08a:5b51:90db:2cad%6]) with mapi id 15.20.1922.021; Tue, 28 May 2019 15:19:38 +0000 From: Igor Opaniuk To: "u-boot@lists.denx.de" Thread-Topic: [RESEND,RFC 1/1] splash: display splash in DM_VIDEO configurations Thread-Index: AQHVFWjDpdHcchswSU2gbD4aA8GL4A== Date: Tue, 28 May 2019 15:19:37 +0000 Message-ID: <20190528151936.26352-1-igor.opaniuk@toradex.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR09CA0056.eurprd09.prod.outlook.com (2603:10a6:802:28::24) To HE1PR0502MB3931.eurprd05.prod.outlook.com (2603:10a6:7:88::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=igor.opaniuk@toradex.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [194.105.145.90] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e2c7858a-087e-48a2-1778-08d6e37fe5de x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:HE1PR0502MB3674; x-ms-traffictypediagnostic: HE1PR0502MB3674: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:478; x-forefront-prvs: 00514A2FE6 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(396003)(39850400004)(346002)(366004)(136003)(199004)(189003)(66556008)(66946007)(64756008)(66446008)(66476007)(73956011)(305945005)(7736002)(186003)(1076003)(68736007)(486006)(26005)(52116002)(107886003)(81166006)(8676002)(8936002)(50226002)(4326008)(6916009)(81156014)(102836004)(54906003)(2501003)(6506007)(36756003)(6306002)(6512007)(99286004)(53936002)(476003)(3846002)(2351001)(2616005)(256004)(86362001)(5660300002)(44832011)(6436002)(966005)(478600001)(5640700003)(2906002)(25786009)(71200400001)(71190400001)(386003)(66066001)(316002)(6116002)(14454004)(6486002)(142933001); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0502MB3674; H:HE1PR0502MB3931.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: toradex.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: htJV639GHCq4/j5+iPFyGwNu0DiUCLkMFlu3cYENBR6H1b36uqMktO+EOLF/AKE/NWza89ueju/HVP2j9YaXvmn4w14PalppaTX2eDP3Et/ZbENNOjCsh2E+zsq04i2Lg/DTcLiU0NTno8j514JfE0oV43ilDeBXn19rZyq6vAMl+TFrElicElvrtPQJzpAUrRkhwp0vCV5/1zp4pVWaOrkNqfvvbueIyeVI3kbeS1I+Sd4P1j4N78QRgUOZ4dFNbiev8bOzhuf8zSQ3faVCZDY6vwfePAq4qiYs7KZyjfzaWH5fWejum4cU1GjR+IW/Qa6i7KwHmYf8hshiwL1+uvvqlKKrJpDz/V6FEpIucw0EcD/N1XyBTkRI8Nz/1C9i+FMXZgOLk6Wxa8PYF0r4MMog5MPuJI7uX4ZcSThy3Oo= MIME-Version: 1.0 X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: e2c7858a-087e-48a2-1778-08d6e37fe5de X-MS-Exchange-CrossTenant-originalarrivaltime: 28 May 2019 15:19:37.8761 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: igor.opaniuk@toradex.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0502MB3674 Cc: Marcel Ziswiler , Max Krummenacher , "marcel@ziswiler.com" Subject: [U-Boot] [RESEND, RFC 1/1] splash: display splash in DM_VIDEO configurations 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Currently for CONFIG_DM_VIDEO=y setting splashimage env variable doesn't have any effect. Introduce a common function for both dm-video/lcd stacks, that checks env("splashimage") and invokes bmp_display() accordingly. For additional details please check discussion [1]. [1] https://lists.denx.de/pipermail/u-boot/2019-May/371002.html Signed-off-by: Igor Opaniuk --- common/lcd.c | 10 +++------- common/splash.c | 16 ++++++++++++++-- common/stdio.c | 4 ++++ include/splash.h | 6 +++--- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/common/lcd.c b/common/lcd.c index 95526b1e17..a55f1620a1 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -222,14 +222,10 @@ void lcd_clear(void) /* Paint the logo and retrieve LCD base address */ debug("[LCD] Drawing the logo...\n"); if (do_splash) { - s = env_get("splashimage"); - if (s) { + if (splash_display() == 0) { do_splash = 0; - addr = simple_strtoul(s, NULL, 16); - if (lcd_splash(addr) == 0) { - lcd_sync(); - return; - } + lcd_sync(); + return; } } diff --git a/common/splash.c b/common/splash.c index d251b3b654..f026390393 100644 --- a/common/splash.c +++ b/common/splash.c @@ -80,11 +80,23 @@ void splash_get_pos(int *x, int *y) } #endif /* CONFIG_SPLASH_SCREEN_ALIGN */ -#if defined(CONFIG_SPLASH_SCREEN) && defined(CONFIG_LCD) -int lcd_splash(ulong addr) +/* + * Common function to show a splash image if env("splashimage") is set. + * Is used for both dm_video and lcd video stacks. For additional + * details please refer to doc/README.splashprepare. + */ +#if defined(CONFIG_SPLASH_SCREEN) +int splash_display(void) { + ulong addr; + char *s; int x = 0, y = 0, ret; + s = env_get("splashimage"); + if (!s) + return -EINVAL; + + addr = simple_strtoul(s, NULL, 16); ret = splash_screen_prepare(); if (ret) return ret; diff --git a/common/stdio.c b/common/stdio.c index ee22c1fd58..22de7aa491 100644 --- a/common/stdio.c +++ b/common/stdio.c @@ -16,6 +16,7 @@ #include #include #include +#include #if defined(CONFIG_SYS_I2C) #include @@ -366,6 +367,9 @@ int stdio_add_devices(void) if (ret) printf("%s: Video device failed (ret=%d)\n", __func__, ret); #endif /* !CONFIG_SYS_CONSOLE_IS_IN_ENV */ +#ifdef CONFIG_SPLASH_SCREEN + splash_display(); +#endif /* CONFIG_SPLASH_SCREEN */ #else # if defined(CONFIG_LCD) drv_lcd_init (); diff --git a/include/splash.h b/include/splash.h index 228aff441b..4ed8d60325 100644 --- a/include/splash.h +++ b/include/splash.h @@ -66,10 +66,10 @@ void splash_get_pos(int *x, int *y); static inline void splash_get_pos(int *x, int *y) { } #endif -#if defined(CONFIG_SPLASH_SCREEN) && defined(CONFIG_LCD) -int lcd_splash(ulong addr); +#ifdef CONFIG_SPLASH_SCREEN +int splash_display(void); #else -static inline int lcd_splash(ulong addr) +static inline int splash_display(void) { return -ENOSYS; }