public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] video: add command cls
@ 2018-11-08 17:24 Patrick Delaunay
  2018-11-17 13:50 ` Anatolij Gustschin
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick Delaunay @ 2018-11-08 17:24 UTC (permalink / raw)
  To: 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 <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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] video: add command cls
  2018-11-08 17:24 [U-Boot] [PATCH] video: add command cls Patrick Delaunay
@ 2018-11-17 13:50 ` Anatolij Gustschin
  2018-11-17 14:36   ` Anatolij Gustschin
  0 siblings, 1 reply; 4+ messages in thread
From: Anatolij Gustschin @ 2018-11-17 13:50 UTC (permalink / raw)
  To: u-boot

Hi Patrick,

On Thu, 8 Nov 2018 18:24:32 +0100
Patrick Delaunay patrick.delaunay at st.com wrote:

> 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.

Thanks for the patch! But I think we should remove this existing
lcd specific cls and add a common command under cmd/cls.c. I'll
submit a path for this.

--
Anatolij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] video: add command cls
  2018-11-17 13:50 ` Anatolij Gustschin
@ 2018-11-17 14:36   ` Anatolij Gustschin
  2018-11-19 17:50     ` Patrick DELAUNAY
  0 siblings, 1 reply; 4+ messages in thread
From: Anatolij Gustschin @ 2018-11-17 14:36 UTC (permalink / raw)
  To: u-boot

Hi Patrick,

On Sat, 17 Nov 2018 14:50:26 +0100
Anatolij Gustschin agust at denx.de wrote:
...
> Thanks for the patch! But I think we should remove this existing
> lcd specific cls and add a common command under cmd/cls.c. I'll
> submit a path for this.

Please test using this patch [1].

[1] http://patchwork.ozlabs.org/patch/999320/

--
Anatolij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] video: add command cls
  2018-11-17 14:36   ` Anatolij Gustschin
@ 2018-11-19 17:50     ` Patrick DELAUNAY
  0 siblings, 0 replies; 4+ messages in thread
From: Patrick DELAUNAY @ 2018-11-19 17:50 UTC (permalink / raw)
  To: u-boot

Hi Anatolij,

> From: Anatolij Gustschin <agust@denx.de> 
> Sent: samedi 17 novembre 2018 15:37
> 
Hi Patrick,
> 
> On Sat, 17 Nov 2018 14:50:26 +0100
> Anatolij Gustschin agust at denx.de wrote:
> ...
>> Thanks for the patch! But I think we should remove this existing lcd 
>> specific cls and add a common command under cmd/cls.c. I'll submit a 
>> path for this.
>>
>> Please test using this patch [1].
>> 
>> [1] http://patchwork.ozlabs.org/patch/999320/

I agree, that adding a new command file in cmd directory is cleaner.
I hesitate to do the same when I prepare my patch.

This patchset is superseded by (1), tested on my side for DM_VIDEO configuration (stm32mp157 board).

> --
>Anatolij

Regards
Patrick

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-19 17:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-08 17:24 [U-Boot] [PATCH] video: add command cls Patrick Delaunay
2018-11-17 13:50 ` Anatolij Gustschin
2018-11-17 14:36   ` Anatolij Gustschin
2018-11-19 17:50     ` Patrick DELAUNAY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox