public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Patrick Delaunay <patrick.delaunay@st.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] video: add command cls
Date: Thu, 8 Nov 2018 18:24:32 +0100	[thread overview]
Message-ID: <1541697872-23945-1-git-send-email-patrick.delaunay@st.com> (raw)

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 <patrick.delaunay@st.com>
---
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", "");
-- 
2.7.4

             reply	other threads:[~2018-11-08 17:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-08 17:24 Patrick Delaunay [this message]
2018-11-17 13:50 ` [U-Boot] [PATCH] video: add command cls Anatolij Gustschin
2018-11-17 14:36   ` Anatolij Gustschin
2018-11-19 17:50     ` Patrick DELAUNAY

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1541697872-23945-1-git-send-email-patrick.delaunay@st.com \
    --to=patrick.delaunay@st.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox