video: add command cls
PATCH 1/1 video: add command cls
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.
---
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(+)
drivers/video/video-uclass.c +14 -0
@@ -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" ,"" );
Signature · 1 line
2.7.4
PATCH 1/1 video: add command cls
Hi Patrick,
Quoted 9 lines · On Thu, 8 Nov 2018 18:24:32 +0100 Patrick Delaunay patrick.delaunay at st.com…
Implement the existing command cls, for clear screen, when
CONFIG_DM_VIDEOis 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
PATCH 1/1 video: add command cls
Hi Patrick,
On Sat, 17 Nov 2018 14:50:26 +0100
Anatolij Gustschin agust at denx.de wrote:
...
Quoted 3 lines
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
PATCH 1/1 video: add command cls
Hi Anatolij,
Quoted 3 lines
From: Anatolij Gustschin <[email protected]>
Sent: samedi 17 novembre 2018 15:37
Hi Patrick,
Quoted 11 lines
On Sat, 17 Nov 2018 14:50:26 +0100
Anatolij Gustschin agust at denx.de wrote:
...Quoted 7 lines
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].
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).
Quoted 2 lines
--
Anatolij
Regards
Patrick