public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH 1/1] efi_loader: avoid EFI_CALL() for clearing screen
Date: Sat, 15 Oct 2022 22:11:29 +0300	[thread overview]
Message-ID: <Y0sF4TPhUH4AqPzP@hera> (raw)
In-Reply-To: <20221015101547.9179-1-heinrich.schuchardt@canonical.com>

On Sat, Oct 15, 2022 at 12:15:47PM +0200, Heinrich Schuchardt wrote:
> Carve out function efi_clear_screen.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  lib/efi_loader/efi_console.c | 26 +++++++++++++++++---------
>  1 file changed, 17 insertions(+), 9 deletions(-)
> 
> diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
> index 3354b217a9..6d4784e140 100644
> --- a/lib/efi_loader/efi_console.c
> +++ b/lib/efi_loader/efi_console.c
> @@ -460,6 +460,20 @@ static efi_status_t EFIAPI efi_cout_set_attribute(
>  	return EFI_EXIT(EFI_SUCCESS);
>  }
>  
> +/**
> + * efi_cout_clear_screen() - clear screen
> + */
> +static void efi_clear_screen(void)
> +{
> +	/*
> +	 * The Linux console wants both a clear and a home command. The video
> +	 * uclass does not support <ESC>[H without coordinates, yet.
> +	 */
> +	printf(ESC "[2J" ESC "[1;1H");
> +	efi_con_mode.cursor_column = 0;
> +	efi_con_mode.cursor_row = 0;
> +}
> +
>  /**
>   * efi_cout_clear_screen() - clear screen
>   *
> @@ -475,13 +489,7 @@ static efi_status_t EFIAPI efi_cout_clear_screen(
>  {
>  	EFI_ENTRY("%p", this);
>  
> -	/*
> -	 * The Linux console wants both a clear and a home command. The video
> -	 * uclass does not support <ESC>[H without coordinates, yet.
> -	 */
> -	printf(ESC "[2J" ESC "[1;1H");
> -	efi_con_mode.cursor_column = 0;
> -	efi_con_mode.cursor_row = 0;
> +	efi_clear_screen();
>  
>  	return EFI_EXIT(EFI_SUCCESS);
>  }
> @@ -510,7 +518,7 @@ static efi_status_t EFIAPI efi_cout_set_mode(
>  		return EFI_EXIT(EFI_UNSUPPORTED);
>  
>  	efi_con_mode.mode = mode_number;
> -	EFI_CALL(efi_cout_clear_screen(this));
> +	efi_clear_screen();
>  
>  	return EFI_EXIT(EFI_SUCCESS);
>  }
> @@ -536,7 +544,7 @@ static efi_status_t EFIAPI efi_cout_reset(
>  	efi_con_mode.attribute = 0x07;
>  	printf(ESC "[0;37;40m");
>  	/* Clear screen */
> -	EFI_CALL(efi_cout_clear_screen(this));
> +	efi_clear_screen();
>  
>  	return EFI_EXIT(EFI_SUCCESS);
>  }
> -- 
> 2.37.2
> 
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


  reply	other threads:[~2022-10-15 19:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-15 10:15 [PATCH 1/1] efi_loader: avoid EFI_CALL() for clearing screen Heinrich Schuchardt
2022-10-15 19:11 ` Ilias Apalodimas [this message]
2022-11-04  7:25 ` Jan Kiszka
2022-11-04  7:41   ` Jan Kiszka

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=Y0sF4TPhUH4AqPzP@hera \
    --to=ilias.apalodimas@linaro.org \
    --cc=heinrich.schuchardt@canonical.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