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

Re: [PATCH 2/5] efi: only set a console mode if the current one is invalid


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 3 Apr 2023 13:03:07 +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=stlEyM17FXGz/0HvkYCKDBzaDmPVE+3EdmWVSIMQhbI=; b=bNG1yLlsmEZQOIGZ6sERDnD5C856fqnwm+sJ1B55y/S1uQoIk68BURMyBtHiXz7AWkBNdknl6e0znLVrV6SOKhMMt6S2WBqOYnmkIWm+K26uZc/KINhh1/Ma9Iq3jHzOkoBDueCIJTLophgDrl1z9Yv8qC4afoKw36qb6nUPPokOhiLiqZrTP2hnLMgs8Bv23UYhWCawhVxOfTiFg7A5mO89grGlfR87o4l2kSVp4i4mB9tTMaSqHOqOZeoqJ7xSiwJw9c4c6IsTggvOuw3waAjPUPxsZawTYpd5PlTU6oNXfZdrU/6t/Cb0KDwGcDqcXoNR7oRmTSNS8FZG+nxDrg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TTxWN8JN1/kZw5Cftr7clthGSLpLFjA0BKR50jnkAp4WRPxKXTbguD6xtJIvekBYNcEY1j6iiX/0JQ+R3Ccc0PFaz1MlcLyiCfITKkzFcWU+AxrgClZhz7Jp5HUnM+HaPGw+dw92JmYIKfR5I/HC6vf5KPjVqT6MN6lBwNrTQMu+sQoOlo4bLd0xeTXlP/B2nwpo85rM3dU1YLPPJ1cnnB5B7BhTRuQTpT/mIFK30dUp3PKk13XgBh7luU5thWGYeubuBIKPVxgDBh/cQVqgoiLuvU06Neiw5SrEAsz8Mx8CmXXmxoS6A6p71Xbwt4FmxdNxojIfoe073SBEXdxjwQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: marmarek@xxxxxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 03 Apr 2023 11:03:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 31.03.2023 09:37, Roger Pau Monné wrote:
> On Fri, Mar 31, 2023 at 08:51:46AM +0200, Jan Beulich wrote:
>> On 30.03.2023 18:17, Roger Pau Monné wrote:
>>> On Thu, Mar 30, 2023 at 06:07:57PM +0200, Jan Beulich wrote:
>>>> On 30.03.2023 17:44, Roger Pau Monné wrote:
>>>>> I guess I'm slightly confused by the usage of both GOP and StdOut, I
>>>>> would assume if we have a gop, and can correctly initialize it there's
>>>>> no need to fiddle with StdOut also?
>>>>
>>>> Setting the GOP mode is done last before exiting boot services; this
>>>> may be a graphics mode which doesn't support a text output protocol.
>>>
>>> Right, that's what I was missing.  I assumed that all modes available
>>> in GOP would be compatible with the ConOut mode.
>>>
>>> Would you be OK with leaving StdOut as-is when booted from multiboot2,
>>> or there's a chance of things not being properly setup?
>>
>> On modern UEFI it may be unlikely, but I think it's not impossible (see
>> below).
>>
>>> IMO it's not very friendly to change the StdOut mode if not explicitly
>>> requested, as in the multiboot2 case that gets setup by the
>>> bootloader.
>>
>> May get set up, that is. If it was set up, then yes, we probably should
>> leave it alone unless told to use another mode. I.e. no vga= or
>> vga=current should minimally result in no further mode change. Aiui we
>> can't easily honor vga=gfx-... in that case, so leaving the mode alone
>> there may also be better than trying to guess a mode. The only time
>> where I would think it would be nice to switch by default even in the
>> xen.gz case is if the boot loader handed us the screen in some text
>> mode.
> 
> How would you detect such case?
> 
> ConOut is always text-mode like because it's a
> EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface.
> 
> Would it be a matter of checking whether the current GOP mode is
> valid, and if so leave it as-is unless told otherwise by a command
> line parameter?

I think so, yes.

> I would also like to avoid the unconditional resizing of the ConOut
> interface that's done in efi_console_set_mode(), as that has the size
> effect of changing the GOP mode, so I would only call
> efi_console_set_mode() is there's no gop.

Or maybe when the set mode isn't text-output capable.

> Not sure it's meaningful to change the ConOut number of cols/rows if
> there's no GOP, maybe it's possible to have some kind of screen that's
> usable for EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL but not as a GOP?

Of course there is. As said, earlier on screens started in 80x25 mode.
Even going to 80x50 or 80x60 is already an improvement. Plus there are
systems which support wider-than-80-cols text modes.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.