From patchwork Tue May 28 15:15:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1106371 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="W4gy9aLL"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45Cy822NvJz9s1c for ; Wed, 29 May 2019 01:15:14 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id EB9B1C21FB8; Tue, 28 May 2019 15:15:12 +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 6CE1CC21E6C; Tue, 28 May 2019 15:15:11 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 59D9AC21E6C; Tue, 28 May 2019 15:15:09 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150091.outbound.protection.outlook.com [40.107.15.91]) by lists.denx.de (Postfix) with ESMTPS id D6A36C21C29 for ; Tue, 28 May 2019 15:15:08 +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=dEEuXmPmf5w3kPZ5cxiO2RGVTFRMLZX6SN1qzx5oc2k=; b=W4gy9aLLorOm+QA7GRPA90PnAauJv04Ic4CYb92RUWQGpTimUFQfJ+pKUVKWRhK7iBE7RQUX9t3VfY9KF0q4EFkDkF1m4uoftdbwAqlcWCo/4nxQscpNaOTuJFNIlKId2lL6s3Cvjq8Z0V8s7w7aMNK1UyEcG4wPV5Nyq7u0lS0= Received: from HE1PR0502MB3931.eurprd05.prod.outlook.com (52.133.4.14) by HE1PR0502MB3689.eurprd05.prod.outlook.com (10.167.127.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1943.16; Tue, 28 May 2019 15:15:06 +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:15:06 +0000 From: Igor Opaniuk To: "u-boot@lists.denx.de" Thread-Topic: [RFC 1/1] splash: display splash in DM_VIDEO configurations Thread-Index: AQHVFWghaYK7ViklwEmjQv9mPuhm8A== Date: Tue, 28 May 2019 15:15:06 +0000 Message-ID: <20190528151503.25864-1-igor.opaniuk@toradex.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1P195CA0029.EURP195.PROD.OUTLOOK.COM (2603:10a6:802:5a::18) 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: 43ce84f0-64e6-4c10-e0f2-08d6e37f43d7 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:HE1PR0502MB3689; x-ms-traffictypediagnostic: HE1PR0502MB3689: 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)(366004)(346002)(376002)(39850400004)(136003)(396003)(189003)(199004)(256004)(5640700003)(6436002)(478600001)(1076003)(99286004)(8936002)(14454004)(81156014)(66066001)(8676002)(54906003)(44832011)(6512007)(6306002)(81166006)(73956011)(36756003)(66946007)(966005)(71200400001)(71190400001)(5660300002)(66476007)(66556008)(64756008)(66446008)(6486002)(26005)(6916009)(4326008)(386003)(6506007)(25786009)(2906002)(53936002)(6116002)(3846002)(476003)(2616005)(107886003)(2351001)(7736002)(186003)(305945005)(486006)(102836004)(316002)(86362001)(52116002)(50226002)(68736007)(2501003); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0502MB3689; H:HE1PR0502MB3931.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: MBk+B0d7uDZGHamORTXtxSxSjyBCUB2aLt4PMb7iAmLTvVzBa4NA19Pc1DgcQZgqLP/w1GSrMJsUR0Q/sa45zJieroVh3oqJH0pohXoXdJYji67PTI93J7Cn1N9nJJx8YGFbxjGrTw2YrPsDFvrlQJIOFGGaV/7DtE4cIimrn+zh4dwiOxkeZRtN8eftLh/AQ6RpJrt2MjMqWe8MES+/DvGyknwuQf3RFvaKhoSkUnLuilMoNsVHWepouInR8rlwqLXO+KiseszvKREG+biVES4JAZ0tq4Gt5Ouelz7JWsEXadZrT/MeFS9MsZ7GfQ5GHKY28SjffRpKtV9jiqXYwUz2gDUlW1sv9yEKR9Qy7AseIopfczDDyEkvQC9e7wwKOmurPN75J+N5rurhr/r0BIfXoerzNV69Ivyf1cYXOLM= MIME-Version: 1.0 X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43ce84f0-64e6-4c10-e0f2-08d6e37f43d7 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 May 2019 15:15:06.1774 (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: HE1PR0502MB3689 Cc: Marcel Ziswiler , Max Krummenacher , "marcel@ziswiler.com" Subject: [U-Boot] [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..1c5d8adb47 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_show() == 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; }