From patchwork Thu Nov 8 17:24:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 995062 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=st.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42rVXQ3wljz9sDC for ; Fri, 9 Nov 2018 04:24:52 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 3245BC21FF6; Thu, 8 Nov 2018 17:24:49 +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=RCVD_IN_DNSWL_BLOCKED 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 CAD7EC21F6A; Thu, 8 Nov 2018 17:24:46 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E80E3C21F6A; Thu, 8 Nov 2018 17:24:44 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id A8E49C21F02 for ; Thu, 8 Nov 2018 17:24:44 +0000 (UTC) Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wA8HO78A005423; Thu, 8 Nov 2018 18:24:43 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2nmps6guub-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 08 Nov 2018 18:24:43 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 3C4A434; Thu, 8 Nov 2018 17:24:43 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1034CA4AB; Thu, 8 Nov 2018 17:24:43 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 8 Nov 2018 18:24:42 +0100 Received: from localhost (10.201.23.85) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 8 Nov 2018 18:24:42 +0100 From: Patrick Delaunay To: Date: Thu, 8 Nov 2018 18:24:32 +0100 Message-ID: <1541697872-23945-1-git-send-email-patrick.delaunay@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.201.23.85] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-11-08_08:, , signatures=0 Cc: U-Boot STM32 Subject: [U-Boot] [PATCH] video: add command cls 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" Implement the existing command cls, for clear screen, when CONFIG_DM_VIDEO is activated. This command was defined for old LCD framework (not dm) in common/lcd.c:251 U_BOOT_CMD(cls, 1, 1, do_lcd_clear, "clear screen", ""); This command is useful to clear existing output (vidconsole) before to display splashscreen with bmp command. Signed-off-by: Patrick Delaunay --- Example of simple splashscreen in DISTRO script: boot.scr.uimg if load ${devtype} ${devnum}:${distro_bootpart} ${splashimage} splash.bmp then env set stdout "serial" env set stderr "serial" cls bmp display ${splashimage} fi drivers/video/video-uclass.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 44dfa71..5fe49a5 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -300,3 +300,17 @@ UCLASS_DRIVER(video) = { .per_device_auto_alloc_size = sizeof(struct video_priv), .per_device_platdata_auto_alloc_size = sizeof(struct video_uc_platdata), }; + +static int do_video_clear(cmd_tbl_t *cmdtp, int flag, int argc, + char *const argv[]) +{ + struct udevice *dev; + + if (uclass_first_device_err(UCLASS_VIDEO, &dev)) + return CMD_RET_FAILURE; + video_clear(dev); + + return 0; +} + +U_BOOT_CMD(cls, 1, 1, do_video_clear, "clear screen", "");