From owner-svn-src-head@freebsd.org Thu Dec 21 12:21:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2285E93202; Thu, 21 Dec 2017 12:21:36 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C145640D4; Thu, 21 Dec 2017 12:21:36 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBLCLZoC017821; Thu, 21 Dec 2017 12:21:35 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBLCLZ5p017820; Thu, 21 Dec 2017 12:21:35 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201712211221.vBLCLZ5p017820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Thu, 21 Dec 2017 12:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327058 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: mizhka X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 327058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 12:21:36 -0000 Author: mizhka Date: Thu Dec 21 12:21:35 2017 New Revision: 327058 URL: https://svnweb.freebsd.org/changeset/base/327058 Log: [boot/efi] scan all display modes rather than sequential try-fail way This patch allows to scan all display modes in boot1 as loader does. Before system tried to select optimal display mode by sequential scan of modes and if error then stop scanning. This way is not good, because if mode N is not present, mode N+1 may exist. In loader we use conout->Mode->MaxMode to identify maximum number of modes. This commit is to use same way in boot1 as in loader. Reported by: Andrey Pustovetov Reviewed by: tsoome Differential Revision: https://reviews.freebsd.org/D13541 Modified: head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Thu Dec 21 09:21:40 2017 (r327057) +++ head/stand/efi/boot1/boot1.c Thu Dec 21 12:21:35 2017 (r327058) @@ -430,10 +430,10 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) conout = ST->ConOut; conout->Reset(conout, TRUE); max_dim = best_mode = 0; - for (i = 0; ; i++) { + for (i = 0; i < conout->Mode->MaxMode; i++) { status = conout->QueryMode(conout, i, &cols, &rows); if (EFI_ERROR(status)) - break; + continue; if (cols * rows > max_dim) { max_dim = cols * rows; best_mode = i;