diff options
author | delphij <delphij@FreeBSD.org> | 2009-09-11 02:07:24 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2009-09-11 02:07:24 +0000 |
commit | 115c0d027c275a438e6a64297b2380f71c326821 (patch) | |
tree | 3a59f57d6ab18584579943a2d00b9806f359f71d /sys/dev/syscons | |
parent | f7f200d12d205da289929f0b9118c36acb30e16b (diff) | |
download | FreeBSD-src-115c0d027c275a438e6a64297b2380f71c326821.zip FreeBSD-src-115c0d027c275a438e6a64297b2380f71c326821.tar.gz |
Extend the usage of sc(4)'s hint variable 'flag'. Bit 0x80 now means
"set vesa mode" and higher 16bits of the flag would be the desired mode.
One can now set, for instance, hint.sc.0.flags=0x01680180, which means
that the system should set VESA mode 0x168 upon boot.
Submitted by: paradox <ddkprog yahoo com>, swell k at gmail.com with
some minor changes.
Diffstat (limited to 'sys/dev/syscons')
-rw-r--r-- | sys/dev/syscons/syscons.c | 21 | ||||
-rw-r--r-- | sys/dev/syscons/syscons.h | 2 |
2 files changed, 15 insertions, 8 deletions
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 653ff08..4fcbf41 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -352,6 +352,7 @@ sc_attach_unit(int unit, int flags) #endif int vc; struct cdev *dev; + u_int16_t vmode; flags &= ~SC_KERNEL_CONSOLE; @@ -372,16 +373,20 @@ sc_attach_unit(int unit, int flags) if (sc_console == NULL) /* sc_console_unit < 0 */ sc_console = scp; + vmode = (flags >> 16) & 0x1fff; + if (vmode < M_VESA_BASE || vmode > M_VESA_MODE_MAX) + vmode = M_VESA_FULL_800; + #ifdef SC_PIXEL_MODE - if ((sc->config & SC_VESA800X600) - && (vidd_get_info(sc->adp, M_VESA_800x600, &info) == 0)) { + if ((sc->config & SC_VESAMODE) + && (vidd_get_info(sc->adp, vmode, &info) == 0)) { #ifdef DEV_SPLASH if (sc->flags & SC_SPLASH_SCRN) splash_term(sc->adp); #endif - sc_set_graphics_mode(scp, NULL, M_VESA_800x600); - sc_set_pixel_mode(scp, NULL, COL, ROW, 16, 8); - sc->initial_mode = M_VESA_800x600; + sc_set_graphics_mode(scp, NULL, vmode); + sc_set_pixel_mode(scp, NULL, 0, 0, 16, 8); + sc->initial_mode = vmode; #ifdef DEV_SPLASH /* put up the splash again! */ if (sc->flags & SC_SPLASH_SCRN) @@ -517,7 +522,7 @@ sctty_open(struct tty *tp) if (scp == NULL) { scp = SC_STAT(tp) = alloc_scp(sc, SC_VTY(tp)); if (ISGRAPHSC(scp)) - sc_set_pixel_mode(scp, NULL, COL, ROW, 16, 8); + sc_set_pixel_mode(scp, NULL, 0, 0, 16, 8); } if (!tp->t_winsize.ws_col && !tp->t_winsize.ws_row) { tp->t_winsize.ws_col = scp->xsize; @@ -2995,6 +3000,8 @@ init_scp(sc_softc_t *sc, int vty, scr_stat *scp) scp->ysize = info.vi_height; scp->xpixel = scp->xsize*info.vi_cwidth; scp->ypixel = scp->ysize*info.vi_cheight; + } + scp->font_size = info.vi_cheight; scp->font_width = info.vi_cwidth; if (info.vi_cheight < 14) { @@ -3016,7 +3023,7 @@ init_scp(sc_softc_t *sc, int vty, scr_stat *scp) scp->font = NULL; #endif } - } + sc_vtb_init(&scp->vtb, VTB_MEMORY, 0, 0, NULL, FALSE); #ifndef __sparc64__ sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, 0, 0, NULL, FALSE); diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h index c0ed6c1..202769f 100644 --- a/sys/dev/syscons/syscons.h +++ b/sys/dev/syscons/syscons.h @@ -191,7 +191,7 @@ struct tty; typedef struct sc_softc { int unit; /* unit # */ int config; /* configuration flags */ -#define SC_VESA800X600 (1 << 7) +#define SC_VESAMODE (1 << 7) #define SC_AUTODETECT_KBD (1 << 8) #define SC_KERNEL_CONSOLE (1 << 9) |