diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-08-16 02:06:44 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-08-16 02:06:44 +0000 |
commit | 67c3cf02fb2bdb3b177cce1884526cb404a874f2 (patch) | |
tree | 9269128e4fbedeb894f61d744dd38f6f1b6f0712 /sys/arch/sparc | |
parent | f975a20e6f5a76679e8fa8c6071898ffc0c0c543 (diff) |
Scale back rows and columns if the font would not otherwise fit on the
display. Otherwise, we would panic in wsdisplay_cnattach(). miod@ OK
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r-- | sys/arch/sparc/dev/fb.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/arch/sparc/dev/fb.c b/sys/arch/sparc/dev/fb.c index c0dd87eb0b5..a358eef0834 100644 --- a/sys/arch/sparc/dev/fb.c +++ b/sys/arch/sparc/dev/fb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fb.c,v 1.19 2002/08/12 10:44:04 miod Exp $ */ +/* $OpenBSD: fb.c,v 1.20 2002/08/16 02:06:43 millert Exp $ */ /* $NetBSD: fb.c,v 1.23 1997/07/07 23:30:22 pk Exp $ */ /* @@ -371,6 +371,15 @@ fbwscons_console_init(sf, wsc, row, setcolor, burner) sf->sf_ro.ri_crow = row; /* + * Scale back rows and columns if the font would not otherwise + * fit on this display. Without this we would panic later. + */ + if (sf->sf_ro.ri_crow >= wsc->nrows) + sf->sf_ro.ri_crow = wsc->nrows - 1; + if (sf->sf_ro.ri_ccol >= wsc->ncols) + sf->sf_ro.ri_ccol = wsc->ncols - 1; + + /* * Select appropriate color settings to mimic a * black on white Sun console. */ |