public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	"Ni, Ray" <ray.ni@intel.com>, Andrew Fish <afish@apple.com>
Subject: Re: [RFC PATCH] ArmPkg/PlatformBmLib: defer GOP console discovery after Driver#### dispatch
Date: Wed, 15 Jan 2020 15:52:02 +0100	[thread overview]
Message-ID: <c4d2beef-7e4a-aec9-65b2-aa3f5b746ab4@redhat.com> (raw)
In-Reply-To: <CAKv+Gu-9mge0UXh6-OdJ_iw1Yf1F57ayDy_6q03SRU9nzzVzWA@mail.gmail.com>

On 01/15/20 14:02, Ard Biesheuvel wrote:
> On Wed, 15 Jan 2020 at 13:50, Laszlo Ersek <lersek@redhat.com> wrote:

>> (3) So how about the following approach:
>>
>> (3a) factor the following sequence:
>>
>>   FilterAndProcess (&gEfiPciIoProtocolGuid, IsPciDisplay, Connect);
>>   FilterAndProcess (&gEfiGraphicsOutputProtocolGuid, NULL, AddOutput);
>>
>> out to a helper function,
>>
>> (3b) call the extracted sequence in *both* its current place, *and* at
>> the top of PlatformBootManagerAfterConsole() (instead of
>> EfiBootManagerConnectVideoController())?
>>
>> ?
>>
>> I expect this should give you *some* consoles in BeforeConsole() (on
>> such PCI and non-PCI graphics controllers whose drivers are in the
>> platform firmware), just to be safe; and *all* the rest would be picked
>> up in AfterConsole().
>>
> 
> I wonder whether there is a point to doing it twice, regardless of
> whether we are talking about PCI or non-PCI. I experimented with just
> moving those calls to AfterConsole(), and I get basically the same
> behavior as with this patch.

Looking at BdsEntry() [MdeModulePkg/Universal/BdsDxe/BdsEntry.c],
admittedly quite little happens between the calls to
PlatformBootManagerBeforeConsole() and PlatformBootManagerAfterConsole().

What if a UEFI driver, loaded from a Driver#### option, prints a message
to the UEFI console, in its entry point function? Do we want such
messages to appear on platform framebuffers?

... Hmmm, I felt that the Driver Writer's Guide spoke some words on
this, and indeed. In 3.15.3 "Connecting consoles", the Note at the end
includes the following sentence:

    UEFI Drivers should never directly access console devices except for
    the few UEFI driver related services that explicitly allow user
    interaction. In most cases, UEFI drivers use HII infrastructure to
    present information to users.

I don't know what those "few UEFI driver related services" are supposed
to be "that explicitly allow user interaction". So with the (somewhat
incomplete) information I seem to have, I must agree that simply moving
those two function calls should be safe enough.

Thanks
Laszlo


  reply	other threads:[~2020-01-15 14:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 10:22 [RFC PATCH] ArmPkg/PlatformBmLib: defer GOP console discovery after Driver#### dispatch Ard Biesheuvel
2020-01-15 12:50 ` Laszlo Ersek
2020-01-15 13:02   ` Ard Biesheuvel
2020-01-15 14:52     ` Laszlo Ersek [this message]
2020-01-15 14:58       ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c4d2beef-7e4a-aec9-65b2-aa3f5b746ab4@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox