Skip to content

Commit

Permalink
efi console add max rows and cols
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Lapkin <[email protected]>
  • Loading branch information
Artem Lapkin committed Aug 3, 2021
1 parent c873d26 commit 8b2d79a
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 332b5e87456089dc75471c16190157e81871bd97 Mon Sep 17 00:00:00 2001
From: Artem Lapkin <[email protected]>
Date: Tue, 3 Aug 2021 11:59:42 +0800
Subject: [PATCH 1/2] EFI: console: add max rows and cols parameter

Signed-off-by: Artem Lapkin <[email protected]>
---
lib/efi_loader/Kconfig | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
index 6c4e93f1..d46b3f7d 100644
--- a/lib/efi_loader/Kconfig
+++ b/lib/efi_loader/Kconfig
@@ -377,4 +377,12 @@ config EFI_CONSOLE_UTF_BLOCK
bool "console unicode chars replace by . if vidconsole is active"
default n

+config EFI_CONSOLE_MAX_ROWS
+ int "setup console max rows"
+ default 0
+
+config EFI_CONSOLE_MAX_COLS
+ int "setup console max cols"
+ default 0
+
endif
--
2.25.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From 4fc97de728db5d2bb633a8161542a1fd364d6ada Mon Sep 17 00:00:00 2001
From: Artem Lapkin <[email protected]>
Date: Tue, 3 Aug 2021 12:00:46 +0800
Subject: [PATCH 2/2] EFI: console: setup max rows and cols

Signed-off-by: Artem Lapkin <[email protected]>
---
lib/efi_loader/efi_console.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index 526d8afe..7f916ce6 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -357,6 +357,11 @@ static void query_console_size(void)
} else if (query_console_serial(&rows, &cols))
return;

+ if (CONFIG_EFI_CONSOLE_MAX_ROWS > 0 )
+ rows=min(rows, CONFIG_EFI_CONSOLE_MAX_ROWS);
+ if (CONFIG_EFI_CONSOLE_MAX_COLS > 0 )
+ cols=min(cols, CONFIG_EFI_CONSOLE_MAX_COLS);
+
/* Test if we can have Mode 1 */
if (cols >= 80 && rows >= 50) {
efi_cout_modes[1].present = 1;
--
2.25.1

0 comments on commit 8b2d79a

Please sign in to comment.