From: Kevin O'C. <ke...@ko...> - 2009-07-04 08:23:34
|
On Tue, May 12, 2009 at 02:23:38PM +0300, Gleb Natapov wrote: > When S3 support patches were submitted we had a discussion whether > optional roms should be executed on S3 resume. We decided not to run > them then and it worked for kvm/qemu. But it turned out that in qemu vga > reset function was not called on system rest. This bug was fixed since > then and now after resume from S3 console stops working. Running vgabios > on resume fixes this. What about revising our previous decision? FYI, I added support to SeaBIOS; however, I left it disabled by default. To enable set CONFIG_S3_RESUME_VGA_INIT to 1. -Kevin --- a/src/config.h +++ b/src/config.h @@ -90,6 +90,8 @@ #define CONFIG_VGAHOOKS 0 // Support S3 resume handler. #define CONFIG_S3_RESUME 1 +// Run the vga rom during S3 resume. +#define CONFIG_S3_RESUME_VGA_INIT 0 // define it if the (emulated) hardware supports SMM mode #define CONFIG_USE_SMM 1 // Maximum number of map entries in the e820 map --- a/src/optionroms.c +++ b/src/optionroms.c @@ -438,3 +438,14 @@ vga_setup() // Write to screen. printf("Starting SeaBIOS\n\n"); } + +void +s3_resume_vga_init() +{ + if (!CONFIG_S3_RESUME_VGA_INIT) + return; + struct rom_header *rom = (void*)OPTION_ROM_START; + if (! is_valid_rom(rom)) + return; + callrom(rom, 0); +} --- a/src/resume.c +++ b/src/resume.c @@ -104,6 +104,8 @@ s3_resume() smm_init(); + s3_resume_vga_init(); + make_bios_readonly(); u32 s3_resume_vector = find_resume_vector(); --- a/src/util.h +++ b/src/util.h @@ -217,6 +217,7 @@ void handle_155f(); void call_bcv(u16 seg, u16 ip); void optionrom_setup(); void vga_setup(); +void s3_resume_vga_init(); // resume.c void init_dma(); |