diff options
Diffstat (limited to 'usr/src/uts/common/io/tem.c')
-rw-r--r-- | usr/src/uts/common/io/tem.c | 78 |
1 files changed, 52 insertions, 26 deletions
diff --git a/usr/src/uts/common/io/tem.c b/usr/src/uts/common/io/tem.c index 573e10cd66..525aa5f585 100644 --- a/usr/src/uts/common/io/tem.c +++ b/usr/src/uts/common/io/tem.c @@ -524,10 +524,41 @@ tems_check_videomode(struct vis_devinit *tp) } static void -tems_setup_terminal(struct vis_devinit *tp, size_t height, size_t width) +tems_setup_font(screen_size_t height, screen_size_t width) { bitmap_data_t *font_data; int i; + + /* + * set_font() will select an appropriate sized font for + * the number of rows and columns selected. If we don't + * have a font that will fit, then it will use the + * default builtin font and adjust the rows and columns + * to fit on the screen. + */ + font_data = set_font(&tems.ts_c_dimension.height, + &tems.ts_c_dimension.width, height, width); + + /* + * To use loaded font, we assign the loaded font data to tems.ts_font. + * In case of next load, the previously loaded data is freed + * when loading the new font. + */ + for (i = 0; i < VFNT_MAPS; i++) { + tems.ts_font.vf_map[i] = + font_data->font->vf_map[i]; + tems.ts_font.vf_map_count[i] = + font_data->font->vf_map_count[i]; + } + + tems.ts_font.vf_bytes = font_data->font->vf_bytes; + tems.ts_font.vf_width = font_data->font->vf_width; + tems.ts_font.vf_height = font_data->font->vf_height; +} + +static void +tems_setup_terminal(struct vis_devinit *tp, size_t height, size_t width) +{ int old_blank_buf_size = tems.ts_c_dimension.width * sizeof (*tems.ts_blank_line); @@ -546,6 +577,9 @@ tems_setup_terminal(struct vis_devinit *tp, size_t height, size_t width) tems.ts_c_dimension.height = tp->height; tems.ts_callbacks = &tem_safe_text_callbacks; + tems_setup_font(16 * tp->height + BORDER_PIXELS, + 8 * tp->width + BORDER_PIXELS); + break; case VIS_PIXEL: @@ -559,33 +593,11 @@ tems_setup_terminal(struct vis_devinit *tp, size_t height, size_t width) } tems.ts_c_dimension.height = (screen_size_t)height; tems.ts_c_dimension.width = (screen_size_t)width; - tems.ts_p_dimension.height = tp->height; tems.ts_p_dimension.width = tp->width; - tems.ts_callbacks = &tem_safe_pix_callbacks; - /* - * set_font() will select a appropriate sized font for - * the number of rows and columns selected. If we don't - * have a font that will fit, then it will use the - * default builtin font. set_font() will adjust the rows - * and columns to fit on the screen. - */ - font_data = set_font(&tems.ts_c_dimension.height, - &tems.ts_c_dimension.width, - tems.ts_p_dimension.height, - tems.ts_p_dimension.width); - - for (i = 0; i < VFNT_MAPS; i++) { - tems.ts_font.vf_map[i] = - font_data->font->vf_map[i]; - tems.ts_font.vf_map_count[i] = - font_data->font->vf_map_count[i]; - } - tems.ts_font.vf_bytes = font_data->font->vf_bytes; - tems.ts_font.vf_width = font_data->font->vf_width; - tems.ts_font.vf_height = font_data->font->vf_height; + tems_setup_font(tp->height, tp->width); tems.ts_p_offset.y = (tems.ts_p_dimension.height - (tems.ts_c_dimension.height * tems.ts_font.vf_height)) / 2; @@ -594,9 +606,7 @@ tems_setup_terminal(struct vis_devinit *tp, size_t height, size_t width) tems.ts_pix_data_size = tems.ts_font.vf_width * tems.ts_font.vf_height; - tems.ts_pix_data_size *= 4; - tems.ts_pdepth = tp->depth; break; @@ -963,6 +973,7 @@ tems_get_initial_color(tem_color_t *pcolor) if (inverse_screen) flags |= TEM_ATTR_SCREEN_REVERSE; +#ifdef _HAVE_TEM_FIRMWARE if (flags != 0) { /* * If either reverse flag is set, the screen is in @@ -980,6 +991,21 @@ tems_get_initial_color(tem_color_t *pcolor) if (pcolor->bg_color == ANSI_COLOR_WHITE) flags |= TEM_ATTR_BRIGHT_BG; } +#else + if (flags != 0) { + if (pcolor->fg_color == ANSI_COLOR_WHITE) + flags |= TEM_ATTR_BRIGHT_BG; + + if (pcolor->fg_color == ANSI_COLOR_BLACK) + flags &= ~TEM_ATTR_BRIGHT_BG; + } else { + /* + * In case of black on white we want bright white for BG. + */ + if (pcolor->bg_color == ANSI_COLOR_WHITE) + flags |= TEM_ATTR_BRIGHT_BG; + } +#endif pcolor->a_flags = flags; } |