aboutsummaryrefslogtreecommitdiffstats
path: root/vgasrc/clext.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2012-02-02 22:52:17 -0500
committerKevin O'Connor <kevin@koconnor.net>2012-02-02 22:52:17 -0500
commitcfd7ef9d8b38d9706671a4e88d40dcc4ac922b6a (patch)
treebd3a12909491fbbe04a59827b4a24986ef42623e /vgasrc/clext.c
parentb88869564b2637d05dda14f6cededceebfbb0f66 (diff)
downloadseabios-cfd7ef9d8b38d9706671a4e88d40dcc4ac922b6a.tar.gz
vgabios: Handle VGA option rom being re-run.
Check for the case where the option rom is executed a second time - in that case re-init the hardware, but do not set any variables. This should make the rom better behaving when run from S3 resume. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'vgasrc/clext.c')
-rw-r--r--vgasrc/clext.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/vgasrc/clext.c b/vgasrc/clext.c
index 26b34e0d..0470d80a 100644
--- a/vgasrc/clext.c
+++ b/vgasrc/clext.c
@@ -590,6 +590,17 @@ clext_init(void)
return -1;
dprintf(1, "cirrus init 2\n");
+ // memory setup
+ stdvga_sequ_write(0x0a, stdvga_sequ_read(0x0f) & 0x18);
+ // set vga mode
+ stdvga_sequ_write(0x07, 0x00);
+ // reset bitblt
+ stdvga_grdc_write(0x31, 0x04);
+ stdvga_grdc_write(0x31, 0x00);
+
+ if (GET_GLOBAL(HaveRunInit))
+ return 0;
+
u32 lfb_addr = 0;
int bdf = GET_GLOBAL(VgaBDF);
if (CONFIG_VGA_PCI && bdf >= 0)
@@ -600,13 +611,5 @@ clext_init(void)
SET_VGA(VBE_total_memory, totalmem * 64 * 1024);
SET_VGA(VBE_win_granularity, 16);
- // memory setup
- stdvga_sequ_write(0x0a, stdvga_sequ_read(0x0f) & 0x18);
- // set vga mode
- stdvga_sequ_write(0x07, 0x00);
- // reset bitblt
- stdvga_grdc_write(0x31, 0x04);
- stdvga_grdc_write(0x31, 0x00);
-
return 0;
}