From: Laszlo Ersek <lersek@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
Alex Williamson <alex.williamson@redhat.com>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Marc Zyngier <marc.zyngier@arm.com>
Subject: Re: [Qemu-devel] [PATCH v2 0/7] ramfb: simple boot framebuffer, no legacy vga
Date: Wed, 6 Jun 2018 14:43:52 +0200 [thread overview]
Message-ID: <149b77cf-d195-5bf1-d9b8-7e4a0e639411@redhat.com> (raw)
In-Reply-To: <20180606084900.77jv3z4il47bx5gi@sirius.home.kraxel.org>
On 06/06/18 10:49, Gerd Hoffmann wrote:
> edk2:
> QemuRamfbDxe driver, x86 wireup, incomplete arm wireup.
I'm looking at the patches very cursorily right now:
> Notes on QemuRamfbDxe:
>
> QemuRamfbDxe registers as VenHw device with a fresh generated uuid.
> The uuid should probably go to some header file, suggestions where to
> place it best?
(1) Under "OvmfPkg/Include/Guid/". The file "VirtioMmioTransport.h" is a
minimal example.
Please review commit 3765e030affb ("OvmfPkg: introduce
VIRTIO_MMIO_TRANSPORT_GUID", 2015-01-02) in its entirety though, as the
OvmfPkg.dec file should be modified as well.
> QemuRamfbDxe registers a acpi devpath node for the gop protocol. It's
> appended to the VenHw path, but looks like that isn't enough to create
> it as child node of the VenHw device (according to devtree outout).
> Suggestions how to fix that? Still this is good enough for
> consplitter to accept the device.
The UEFI Driver Writer's Guide, and the UEFI spec, treat this
extensively, but let's save ourselves some time:
(2) Please flip the MODULE_TYPE of the driver to DXE_DRIVER, from
UEFI_DRIVER. (This will also let you drop some of the other patches.)
(3) Try adding the following at the end of QemuRamfbDxe:
VOID *DevicePath;
...
gBS->OpenProtocol (
RamfbHandle,
&gEfiDevicePathProtocolGuid,
&DevicePath,
gImageHandle,
GopHandle,
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
);
See also iPXE commit d6817943d187 ("[efi] Install the HII config access
protocol on a child of the SNP handle", 2016-07-08), especially the call
to efi_child_add().
> The device path is added to the gPlatformConsole list,
Good idea.
Two notes on that:
(4) Once you add the venhw GUID as a standalone header file (see (1)),
you won't need to duplicate the constants between patches. In
"gQemuRamfbDevicePath", you'll be able to use the EFI_GUID structure
initializer macro from the header file.
(5) Does it work if you replace ACPI_ADR_DISPLAY_TYPE_VGA with
ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL? QemuVideoDxe uses the former,
but VirtioGpuDxe uses the latter. Windows has some really obscure
requirements dependent on "ACPI display type", if I remember correctly,
and "external" looked the most robust when I last checked.
> so consplitter will pick up the ramfb device even though it isn't a
> pci display device. The firmware display will show up on ramfb in
> addition to other display devices (if any). Is that approach ok?
Absolutely, that's what we want.
> If so I'll do that for armvirt too.
(6) No extra steps should be necessary for ArmVirtPkg; in the
PlatformBootManagerBeforeConsole() function
[ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c], we have
> //
> // Find all display class PCI devices (using the handles from the previous
> // step), and connect them non-recursively. This should produce a number of
> // child handles with GOPs on them.
> //
> FilterAndProcess (&gEfiPciIoProtocolGuid, IsPciDisplay, Connect);
>
> //
> // Now add the device path of all handles with GOP on them to ConOut and
> // ErrOut.
> //
> FilterAndProcess (&gEfiGraphicsOutputProtocolGuid, NULL, AddOutput);
The first call does not cover the new device, but that's fine: the new
child handle with the GOP instance on it is produced by a DXE_DRIVER in
its entry point function -- that is, not by a UEFI driver that follows
the UEFI driver model --, hence it need not be connected by platform BDS
explicitly. By the time BDS is entered in the first place, the GOP will
exist already.
Therefore, the second call will simply pick up the devpath from the new
child (GOP) handle automatically, and add it to both ConOut and ErrOut.
Does it not work for you?
Thanks
Laszlo
next prev parent reply other threads:[~2018-06-06 12:44 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-23 12:25 [Qemu-devel] [PATCH v2 0/7] ramfb: simple boot framebuffer, no legacy vga Gerd Hoffmann
2018-03-23 12:25 ` [Qemu-devel] [PATCH v2 1/7] [testing] update bios, add vgabios-ramfb Gerd Hoffmann
2018-03-23 12:25 ` [Qemu-devel] [PATCH v2 2/7] [testing] add ovmf build with ramfb support Gerd Hoffmann
2018-03-23 12:25 ` [Qemu-devel] [PATCH v2 3/7] hw/display: add ramfb, a simple boot framebuffer living in guest ram Gerd Hoffmann
2018-03-23 12:25 ` [Qemu-devel] [PATCH v2 4/7] hw/display: add ramfb-testdev Gerd Hoffmann
2018-03-23 12:25 ` [Qemu-devel] [PATCH v2 5/7] hw/display: add virtio-ramfb Gerd Hoffmann
2018-03-23 12:25 ` [Qemu-devel] [PATCH v2 6/7] hw/vfio/display: add ramfb support Gerd Hoffmann
2018-03-23 12:25 ` [Qemu-devel] [PATCH v2 7/7] [wip] hw/display: add qxl-ramfb Gerd Hoffmann
2018-03-23 13:27 ` [Qemu-devel] [PATCH v2 0/7] ramfb: simple boot framebuffer, no legacy vga Laszlo Ersek
2018-03-23 14:51 ` Gerd Hoffmann
2018-03-23 15:12 ` Laszlo Ersek
2018-03-23 17:07 ` Gerd Hoffmann
2018-03-23 18:29 ` Laszlo Ersek
2018-03-24 3:51 ` Ard Biesheuvel
2018-04-25 14:07 ` Gerd Hoffmann
2018-04-25 20:43 ` Laszlo Ersek
2018-05-31 8:43 ` Gerd Hoffmann
2018-05-31 9:11 ` Laszlo Ersek
2018-06-05 11:06 ` Gerd Hoffmann
2018-06-05 12:07 ` Laszlo Ersek
2018-06-05 13:16 ` Gerd Hoffmann
2018-06-05 13:23 ` Laszlo Ersek
2018-06-06 8:49 ` Gerd Hoffmann
2018-06-06 12:43 ` Laszlo Ersek [this message]
2018-06-06 13:21 ` Gerd Hoffmann
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-all 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=149b77cf-d195-5bf1-d9b8-7e4a0e639411@redhat.com \
--to=lersek@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=ard.biesheuvel@linaro.org \
--cc=kraxel@redhat.com \
--cc=marc.zyngier@arm.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).