A little off topic thing: isn't the default resolution supposed to be 1024x768? This is the Microsoft regulation which all my physical devices seem to follow: https://docs.microsoft.com/en-us/windows-hardware/test/hlk/testref/6afc8979-df62-4d86-8f6a-99f05bbdc7f3 And when the user provides an EDID one should parse it and set the default resolution to match it. But that's a less important feature. On Tue, Apr 21, 2020 at 9:03 PM Laszlo Ersek wrote: > 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 > >