Is the QemuVideoDXE GOP gone after S3


Joel
 

I was wondering if anyone knew if the Graphical Output Protocol that creates the framebuffer for the guests is no longer instantiated after OVMF comes back from S3 resume. If I uninstall my guest PV driver for display, I no longer get screen updates after the guest has gone to sleep. It will fall back to the GOP framebuffer correctly before S3. Is there a large amount of work that needs to be done to get this type of thing working? I'm unsure if we just need to add the tables to the LockBox for the GOP during EndOfDxe events or something. Any help would be great.

-Joel


Joel
 

Closing the loop on this issue, and leaving what I found for if anyone else runs into a similar issue:

I determined that I on a sleep event, qemu would reset all the pci devices, thus the vga-pci device would be reset. When this occurs, the VBE info would be lost (screen width/height, mode, enabled, etc). These things occur during the Initialization of the QemuVideoDxe service, but will not occur again as there is only a linear frame buffer that is created and maintained after DXE. I found the VBEShim.asm doesn't seem to be able to be called from 64 bit windows 10, probably because accessing 16 bit real mode in a 64 bit system is protected and needs emulation. I tried built in Windows x86BiosCall to try to write to the int10h interrupt with the correct ax/bx registers set, but it would not reset from within windows. I therefore determined to do the reset using similar VBEShim.asm code for KnownMode2 with some glue into the 16 bit real mode return vector during wake from sleep to reinitialize the qemu vga-pci device. This allows Windows to write to the frame buffer, and the vga pci device in qemu is in the correct mode for receiving that data. I added the code to the MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/S3Asm.nasm file in under global ASM_PFX(AsmTransferControl). I am unsure whether up steam would want such a patch, as it is only really helpful to those not using qxl, and using the standard vga device in qemu.