[syslinux:firmware] efi: Fix screen clearing and cursor position

syslinux-bot for Matt Fleming matt.fleming at intel.com
Fri Jan 11 01:33:10 PST 2013


Commit-ID:  168255dc63b68714e8296bee38dec09906c9a1ec
Gitweb:     http://www.syslinux.org/commit/168255dc63b68714e8296bee38dec09906c9a1ec
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Wed, 9 Jan 2013 12:21:23 +0000
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Wed, 9 Jan 2013 12:21:23 +0000

efi: Fix screen clearing and cursor position

The logic to figure out when to clear the screen was broken, leading
to the screen sometimes containing garbage. x0,y0 are the coordinates
of the upper left part of the screen, and x1,y1 the lower right. x1,y1
will be the position of our cursor, which we can ignore, but we must
use x0,y0 to figure out when to clear the screen and not simply set
the cursor position.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 efi/main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/efi/main.c b/efi/main.c
index 2ecf9f9..9974c03 100644
--- a/efi/main.c
+++ b/efi/main.c
@@ -152,11 +152,12 @@ static void efi_erase(const struct term_state *st,
 	 * support this so we just set the cursor position unless
 	 * we're clearing the whole screen.
 	 */
-	if (!x0 && !y0 && x1 == (rows - 1) && y1 == (cols - 1)) {
+	if (!x0 && y0 == (cols - 1)) {
 		/* Really clear the screen */
 		uefi_call_wrapper(out->ClearScreen, 1, out);
-	} else
-		uefi_call_wrapper(out->SetCursorPosition, 3, out, y0, x0);
+	} else {
+		uefi_call_wrapper(out->SetCursorPosition, 3, out, y1, x1);
+	}
 }
 
 static void efi_set_mode(uint16_t mode)


More information about the Syslinux-commits mailing list