[PATCH] cmd: pxe_utils: sysboot: replace cls command by video_clear in PXE parser
Patrick DELAUNAY
patrick.delaunay at foss.st.com
Tue Mar 22 15:59:58 CET 2022
Hi,
On 3/22/22 15:10, Patrick Delaunay wrote:
> 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 at foss.st.com>
> ---
>
> boot/pxe_utils.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c
> index 0c24becae3..115d33b845 100644
> --- a/boot/pxe_utils.c
> +++ b/boot/pxe_utils.c
> @@ -14,6 +14,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>
> @@ -1511,13 +1512,17 @@ void handle_pxe_menu(struct pxe_context *ctx, struct pxe_menu *cfg)
> void *choice;
> struct menu *m;
> int err;
> + struct udevice *dev;
>
> if (IS_ENABLED(CONFIG_CMD_BMP)) {
> /* 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 (IS_ENABLED(CONFIG_DM_VIDEO)) {
> + err = uclass_first_device_err(UCLASS_VIDEO, &dev);
> + if (!err)
> + video_clear(dev);
> + }
> bmp_display(image_load_addr,
> BMP_ALIGN_CENTER, BMP_ALIGN_CENTER);
> } else {
need V2, this patch have compilation issues for some defconfig
- unknown uclass_first_device_err => "dm.h" is only included when
CONFIG_DM_RNG is activated
- video_clear(dev) => too many argument when CONFIG_DM_VIDEO is not
activated
Regards
Patrick
More information about the U-Boot
mailing list