Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/stand/efiboot Don't maximize the text columns ...



details:   https://anonhg.NetBSD.org/src/rev/06fb7077bb82
branches:  trunk
changeset: 822529:06fb7077bb82
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Fri Mar 24 01:25:36 2017 +0000

description:
Don't maximize the text columns and rows. only use 100x31 or 80x25.

diffstat:

 sys/arch/i386/stand/efiboot/eficons.c |  17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diffs (43 lines):

diff -r c726f91c2e3d -r 06fb7077bb82 sys/arch/i386/stand/efiboot/eficons.c
--- a/sys/arch/i386/stand/efiboot/eficons.c     Fri Mar 24 01:14:26 2017 +0000
+++ b/sys/arch/i386/stand/efiboot/eficons.c     Fri Mar 24 01:25:36 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eficons.c,v 1.2 2017/03/24 01:00:47 nonaka Exp $       */
+/*     $NetBSD: eficons.c,v 1.3 2017/03/24 01:25:36 nonaka Exp $       */
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka <nonaka%netbsd.org@localhost>
@@ -499,24 +499,27 @@
 eficons_init_video(void)
 {
        EFI_STATUS status;
-       UINTN cols, rows, dim = 0;
-       INT32 i, best = -1;
+       UINTN cols, rows;
+       INT32 i, best, mode80x25, mode100x31;
 
        /*
         * Setup text mode
         */
        uefi_call_wrapper(ST->ConOut->Reset, 2, ST->ConOut, TRUE);
 
+       mode80x25 = mode100x31 = -1;
        for (i = 0; i < ST->ConOut->Mode->MaxMode; i++) {
                status = uefi_call_wrapper(ST->ConOut->QueryMode, 4,
                    ST->ConOut, i, &cols, &rows);
                if (EFI_ERROR(status))
                        continue;
-               if (dim < cols * rows) {
-                       dim = cols * rows;
-                       best = i;
-               }
+
+               if (mode80x25 < 0 && cols == 80 && rows == 25)
+                       mode80x25 = i;
+               else if (mode100x31 < 0 && cols == 100 && rows == 31)
+                       mode100x31 = i;
        }
+       best = mode100x31 >= 0 ? mode100x31 : mode80x25 >= 0 ? mode80x25 : -1;
        if (best >= 0)
                uefi_call_wrapper(ST->ConOut->SetMode, 2, ST->ConOut, best);
        uefi_call_wrapper(ST->ConOut->EnableCursor, 2, ST->ConOut, TRUE);



Home | Main Index | Thread Index | Old Index