[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 3/3] multiboot2: do not set StdOut mode unconditionally
- To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 5 Apr 2023 12:36:55 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tuyqy/r8c07AnJqD3GHmViiudIVOTpE8t2D0DhGIOh4=; b=iPRtFEsJ/uwPPijUhRg9/SdbqBfJwLjReIhYm1w9gZBjH7qUOmY2RC+evVR8bKpyBTPXqFzkA2l+/KvsoOdfTgJkcNN4dr2jwUVC2EDITK0UHkZCvHHjGne0bVJyCt7sxORTL/ltslG1P8OYzEMPrd7+6+ITZ+bFvEbfjFGEe1GxdAEWHlwA5hdAlmEh8ZlcCOcNuKV8avxtEt2EiR5Canw4vYWVkdJQGWScm8A3zDujIpUZVewk6td5lq7zN1LoenWDqvfn2F75BRHeKo/Xsla2NpKlvnHusJ3UkpsXiz5IP1gfZDFJWksJb8pCHOvZmM38xESyCfFLPMovJDhf7w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FGXqNsWaiCWBsLGXCHtB9NVu7xQfSwFyFtWPTySNrymtykz1/+WdsRug7SxjuBRlF3TsT9TDBEEEPkwL//RBILfvDt3E2lPF7anKERPEYrIHn5HZdKPJVk6sHRqx2/AqQY+m6wopXEpRrPPeykSQz6b1jQgwLfVVc9VhGJTwGvMiBLvi6IkkxR/gxFSuLUhMFori1qBC62z/nZIRdrLyarZR8e9NJn6Y+Id/kJcnY6ylFn9/4kvfSAfrKhwp52RpYmaBHd/qg4fP74qNhNxnjdAMWWynpuHUU+e/PY+zh4C7+QzZys+x3CvLo9w3NY/wtq5O8xs+cQaTkgSv3JlBjQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Wed, 05 Apr 2023 10:37:21 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 31.03.2023 11:59, Roger Pau Monne wrote:
> @@ -887,6 +881,15 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle,
> EFI_SYSTEM_TABLE *SystemTable
>
> efi_arch_edid(gop_handle);
> }
> + else
> + {
> + /* If no GOP, init ConOut (StdOut) to the max supported size. */
> + efi_console_set_mode();
> +
> + if ( StdOut->QueryMode(StdOut, StdOut->Mode->Mode,
> + &cols, &rows) == EFI_SUCCESS )
> + efi_arch_console_init(cols, rows);
> + }
Instead of making this an "else", wouldn't you better check that a
valid gop_mode was found? efi_find_gop_mode() can return ~0 after all.
Furthermore, what if the active mode doesn't support text output? (I
consider the spec unclear in regard to whether this is possible, but
maybe I simply didn't find the right place stating it.)
Finally I think efi_arch_console_init() wants calling nevertheless.
So altogether maybe
if ( gop_mode == ~0 ||
StdOut->QueryMode(StdOut, StdOut->Mode->Mode,
&cols, &rows) != EFI_SUCCESS )
/* If no usable GOP mode, init ConOut (StdOut) to the max supported
size. */
efi_console_set_mode();
if ( StdOut->QueryMode(StdOut, StdOut->Mode->Mode,
&cols, &rows) == EFI_SUCCESS )
efi_arch_console_init(cols, rows);
?
Jan
|