]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: pxe_utils: sysboot: replace cls command by video_clear in PXE parser
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Tue, 22 Mar 2022 16:08:43 +0000 (17:08 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 11 Apr 2022 15:39:19 +0000 (11:39 -0400)
Since the commit bfaa51dd4adf ("cmd: add serial console support
for the cls command") the cls command is not enough to clear the
video display when ANSI console is activated.

This patch clears the video device with the video_clear() API
before to display the bitmap used for the PXE background.

This patch avoids to display the LOGO, activated by default with
commit 7a8555d87136 ("video: Show the U-Boot logo by default").

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
boot/pxe_utils.c

index 0c24becae3939421ace5ff064e76442c9703e9b6..b08aee9896bc27a18831371b6150fe85fee14de4 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <dm.h>
 #include <env.h>
 #include <image.h>
 #include <log.h>
@@ -14,6 +15,7 @@
 #include <lcd.h>
 #include <net.h>
 #include <fdt_support.h>
+#include <video.h>
 #include <linux/libfdt.h>
 #include <linux/string.h>
 #include <linux/ctype.h>
@@ -21,7 +23,6 @@
 #include <linux/list.h>
 
 #ifdef CONFIG_DM_RNG
-#include <dm.h>
 #include <rng.h>
 #endif
 
@@ -1516,8 +1517,13 @@ void handle_pxe_menu(struct pxe_context *ctx, struct pxe_menu *cfg)
                /* display BMP if available */
                if (cfg->bmp) {
                        if (get_relfile(ctx, cfg->bmp, image_load_addr, NULL)) {
-                               if (CONFIG_IS_ENABLED(CMD_CLS))
-                                       run_command("cls", 0);
+#if defined(CONFIG_DM_VIDEO)
+                               struct udevice *dev;
+
+                               err = uclass_first_device_err(UCLASS_VIDEO, &dev);
+                               if (!err)
+                                       video_clear(dev);
+#endif
                                bmp_display(image_load_addr,
                                            BMP_ALIGN_CENTER, BMP_ALIGN_CENTER);
                        } else {