public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: valerij zaporogeci <vlrzprgts@gmail.com>,
	Hou Qiming <hqm03ster@gmail.com>,
	discuss@edk2.groups.io,
	"Marcel Apfelbaum (GMail address)" <marcel.apfelbaum@gmail.com>,
	edk2-devel-groups-io <devel@edk2.groups.io>,
	qemu devel list <qemu-devel@nongnu.org>
Subject: Re: [edk2-discuss] Load Option passing. Either bugs or my confusion.
Date: Tue, 21 Apr 2020 15:02:55 +0200	[thread overview]
Message-ID: <9aed493a-2187-cacd-5631-54fb9973509c@redhat.com> (raw)
In-Reply-To: <20200420141303.dxjqgvmzglrjtsly@sirius.home.kraxel.org>

On 04/20/20 16:13, Gerd Hoffmann wrote:
>   Hi,
>
>> So I would say that the symptom you see is a QEMU v4.1.0 regression.
>> The QemuRamfbGraphicsOutputSetMode() function in the OVMF ramfb
>> driver certainly needs the QemuFwCfgWriteBytes() call to work, for
>> changing the resolution.
>
> Oh?  QemuRamfbGraphicsOutputSetMode() can be called multiple times?
> How does that happen?

QemuRamfbGraphicsOutputSetMode() is the "SetMode" member function of the
EFI_GRAPHICS_OUTPUT_PROTOCOL instance that QemuRamfbDxe produces.

This is a standard protocol; UEFI drivers and applications are free to
locate it and to use it.

(1) When you launch OVMF, you get the splash screen in a particular
resolution. This resolution:
- is configured by OvmfPkg/PlatformDxe,
- is inherited by an OS boot loader,
- is reconfigurable with OvmfPkg/PlatformDxe, for the next boot, via the
  Setup TUI,
- defaults to 800x600 (taking effect when no particular choice is
  configured).

(2) UiApp -- the Setup TUI itself -- uses its own resolution. Under
OVMF, this resolution is fixed 640x480. When UiApp is entered,
ultimately a call is made to QemuRamfbGraphicsOutputSetMode() -- i.e., a
GOP.SetMode() member function -- for setting this 640x480 resolution.

Using the following command:

  qemu-system-x86_64 \
    -nodefaults \
    -boot menu=on,splash-time=5000 \
    -enable-kvm \
    -device ramfb \
    -drive if=pflash,readonly,format=raw,file=$PREFIX/share/qemu/edk2-x86_64-code.fd \
    -drive if=pflash,snapshot,format=raw,file=$PREFIX/share/qemu/edk2-i386-vars.fd \
    -debugcon file:ovmf.log \
    -global isa-debugcon.iobase=0x402

when you first see the progress bar, the graphical resolution (1) is
800x600. Accordingly, QEMU prints to stderr:

> ramfb_fw_cfg_write: 800x600 @ 0x6702000

Once you hit ESC to interrupt the progress bar and to enter the Setup
TUI, UiApp switches to resolution (2), 640x480. QEMU prints:

> ramfb_fw_cfg_write: 640x480 @ 0x6702000
> ramfb_fw_cfg_write: resolution locked, change rejected

And you get garbage in the Setup window.

Thanks,
Laszlo


  reply	other threads:[~2020-04-21 13:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <18709.1586743215734342129@groups.io>
     [not found] ` <11181.1586825080096843656@groups.io>
2020-04-14 14:26   ` [edk2-discuss] Load Option passing. Either bugs or my confusion Laszlo Ersek
     [not found]     ` <5211.1586899245384995995@groups.io>
2020-04-15 15:05       ` Laszlo Ersek
2020-04-16  4:38         ` Hou Qiming
2020-04-16 14:12           ` Laszlo Ersek
2020-04-17  3:22             ` Hou Qiming
2020-04-20  9:32               ` Laszlo Ersek
2020-04-20 14:19           ` Gerd Hoffmann
2020-04-20 14:13         ` Gerd Hoffmann
2020-04-21 13:02           ` Laszlo Ersek [this message]
2020-04-22  7:42             ` Hou Qiming
2020-04-22 16:05               ` Laszlo Ersek
2020-04-23  3:15                 ` Hou Qiming

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=9aed493a-2187-cacd-5631-54fb9973509c@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