diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-08-02 07:32:49 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-08-02 07:32:49 +0200 |
commit | 1f3c43c01720ed66e7c981d3287eca7dae362ba8 (patch) | |
tree | 438c16da2cf6ab0410ed047297e03c808e312de1 /sys/src/9/pc/screen.c | |
parent | 27445c5768fc9efd11efae2ac0e793fd7f4779fc (diff) |
pc, pc64: set *bootscreen= when framebuffer changes
add bootscreenconf(VGAscr *) function, that is called whenever
the framebuffer configuration is changed by devvga. that way, we
can pass the current setting of the framebuffer to the new
kernel when using /dev/reboot.
Diffstat (limited to 'sys/src/9/pc/screen.c')
-rw-r--r-- | sys/src/9/pc/screen.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/src/9/pc/screen.c b/sys/src/9/pc/screen.c index c7317dd0a..4ff7a9485 100644 --- a/sys/src/9/pc/screen.c +++ b/sys/src/9/pc/screen.c @@ -586,7 +586,7 @@ bootmapfb(VGAscr *scr, ulong pa, ulong sz) /* * called early on boot to attach to framebuffer - * setup by bootloader or firmware. + * setup by bootloader/firmware or plan9. */ void bootscreeninit(void) @@ -665,3 +665,23 @@ bootscreeninit(void) scr->cur->enable(scr); cursoron(); } + +/* + * called from devvga when the framebuffer is setup + * to set *bootscreen= that can be passed on to a + * new kernel on reboot. + */ +void +bootscreenconf(VGAscr *scr) +{ + char conf[100], chan[30]; + + conf[0] = '\0'; + if(scr != nil && scr->paddr != 0) + snprint(conf, sizeof(conf), "%dx%dx%d %s %#p %d\n", + scr->gscreen->r.max.x, scr->gscreen->r.max.y, + scr->gscreen->depth, chantostr(chan, scr->gscreen->chan), + scr->paddr, scr->apsize); + + ksetenv("*bootscreen", conf, 1); +} |