diff options
Diffstat (limited to 'usr/src/uts')
-rw-r--r-- | usr/src/uts/common/Makefile.files | 2 | ||||
-rw-r--r-- | usr/src/uts/common/io/tem.c | 78 | ||||
-rw-r--r-- | usr/src/uts/common/io/tem_safe.c | 19 | ||||
-rw-r--r-- | usr/src/uts/common/sys/font.h | 8 | ||||
-rw-r--r-- | usr/src/uts/i86pc/boot/boot_fb.c | 40 | ||||
-rw-r--r-- | usr/src/uts/intel/tem/Makefile | 18 | ||||
-rw-r--r-- | usr/src/uts/sparc/tem/Makefile | 26 |
7 files changed, 103 insertions, 88 deletions
diff --git a/usr/src/uts/common/Makefile.files b/usr/src/uts/common/Makefile.files index 375043fa57..4887b649e1 100644 --- a/usr/src/uts/common/Makefile.files +++ b/usr/src/uts/common/Makefile.files @@ -1693,7 +1693,7 @@ TEM_OBJS += tem.o tem_safe.o # Font data for generated console fonts # i386_FONT = 8x16 -i386_FONT_SRC= ter-u16n +i386_FONT_SRC= ter-u16b sparc_FONT = 12x22 sparc_FONT_SRC= Gallant19 FONT=$($(MACH)_FONT) 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; } diff --git a/usr/src/uts/common/io/tem_safe.c b/usr/src/uts/common/io/tem_safe.c index 5008d4a4d6..8d47a00d5f 100644 --- a/usr/src/uts/common/io/tem_safe.c +++ b/usr/src/uts/common/io/tem_safe.c @@ -129,9 +129,12 @@ static void tem_safe_copy_area(struct tem_vt_state *tem, screen_pos_t e_col, screen_pos_t e_row, screen_pos_t t_col, screen_pos_t t_row, cred_t *credp, enum called_from called_from); +#if 0 +/* Currently unused */ static void tem_safe_image_display(struct tem_vt_state *, uchar_t *, int, int, screen_pos_t, screen_pos_t, cred_t *, enum called_from); +#endif static void tem_safe_bell(struct tem_vt_state *tem, enum called_from called_from); static void tem_safe_pix_clear_prom_output(struct tem_vt_state *tem, @@ -1568,6 +1571,7 @@ tem_safe_text_display(struct tem_vt_state *tem, term_char_t *string, } } +#if 0 /* * This function is used to blit a rectangular color image, * unperturbed on the underlying framebuffer, to render @@ -1600,6 +1604,7 @@ tem_safe_image_display(struct tem_vt_state *tem, uchar_t *image, mutex_exit(&tem->tvs_lock); mutex_exit(&tems.ts_lock); } +#endif /*ARGSUSED*/ void @@ -2385,12 +2390,22 @@ tem_safe_get_attr(struct tem_vt_state *tem, text_color_t *fg, static void tem_safe_get_color(text_color_t *fg, text_color_t *bg, term_char_t c) { + boolean_t bold_font; + *fg = c.tc_fg_color; *bg = c.tc_bg_color; + bold_font = tems.ts_font.vf_map_count[VFNT_MAP_BOLD] != 0; + + /* + * If we have both normal and bold font components, + * we use bold font for TEM_ATTR_BOLD. + * The bright color is traditionally used with TEM_ATTR_BOLD, + * in case there is no bold font. + */ if (c.tc_fg_color < XLATE_NCOLORS) { - if (TEM_ATTR_ISSET(c.tc_char, - TEM_ATTR_BRIGHT_FG | TEM_ATTR_BOLD)) + if (TEM_ATTR_ISSET(c.tc_char, TEM_ATTR_BRIGHT_FG) || + (TEM_ATTR_ISSET(c.tc_char, TEM_ATTR_BOLD) && !bold_font)) *fg = brt_xlate[c.tc_fg_color]; else *fg = dim_xlate[c.tc_fg_color]; diff --git a/usr/src/uts/common/sys/font.h b/usr/src/uts/common/sys/font.h index 5733686bf3..f8f154f428 100644 --- a/usr/src/uts/common/sys/font.h +++ b/usr/src/uts/common/sys/font.h @@ -84,9 +84,11 @@ typedef struct bitmap_data { } bitmap_data_t; typedef enum { - FONT_AUTO, - FONT_MANUAL, - FONT_BOOT + FONT_AUTO, /* This font is loaded by software */ + FONT_MANUAL, /* This font is loaded manually by user */ + FONT_BOOT, /* This font was passed to kernel by bootloader */ + FONT_BUILTIN, /* This font was built in at compile time */ + FONT_RELOAD /* This font is marked to be re-read from file */ } FONT_FLAGS; struct fontlist { diff --git a/usr/src/uts/i86pc/boot/boot_fb.c b/usr/src/uts/i86pc/boot/boot_fb.c index 1ac4789af7..e0e79bd14e 100644 --- a/usr/src/uts/i86pc/boot/boot_fb.c +++ b/usr/src/uts/i86pc/boot/boot_fb.c @@ -354,28 +354,44 @@ boot_get_color(uint32_t *fg, uint32_t *bg) /* ansi to solaris colors, see also boot_console.c */ if (fb_info.inverse == B_TRUE || fb_info.inverse_screen == B_TRUE) { - if (fb_info.fg_color < 16) - *bg = dim_xlate[fb_info.fg_color]; - else + if (fb_info.fg_color < XLATE_NCOLORS) { + /* + * white fg -> bright white bg + */ + if (fb_info.fg_color == pc_white) + *bg = brt_xlate[fb_info.fg_color]; + else + *bg = dim_xlate[fb_info.fg_color]; + } else { *bg = fb_info.fg_color; + } - if (fb_info.bg_color < 16) - *fg = brt_xlate[fb_info.bg_color]; - else + if (fb_info.bg_color < XLATE_NCOLORS) { + if (fb_info.bg_color == pc_white) + *fg = brt_xlate[fb_info.bg_color]; + else + *fg = dim_xlate[fb_info.bg_color]; + } else { *fg = fb_info.bg_color; + } } else { - if (fb_info.bg_color < 16) { - if (fb_info.bg_color == 7) + if (fb_info.fg_color < XLATE_NCOLORS) { + if (fb_info.fg_color == pc_white) + *fg = brt_xlate[fb_info.fg_color]; + else + *fg = dim_xlate[fb_info.fg_color]; + } else { + *fg = fb_info.fg_color; + } + + if (fb_info.bg_color < XLATE_NCOLORS) { + if (fb_info.bg_color == pc_white) *bg = brt_xlate[fb_info.bg_color]; else *bg = dim_xlate[fb_info.bg_color]; } else { *bg = fb_info.bg_color; } - if (fb_info.fg_color < 16) - *fg = dim_xlate[fb_info.fg_color]; - else - *fg = fb_info.fg_color; } } diff --git a/usr/src/uts/intel/tem/Makefile b/usr/src/uts/intel/tem/Makefile index 9eca2e7d98..1165cf3264 100644 --- a/usr/src/uts/intel/tem/Makefile +++ b/usr/src/uts/intel/tem/Makefile @@ -38,7 +38,6 @@ UTSBASE = ../.. # MODULE = tem OBJECTS = $(TEM_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(TEM_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE) # @@ -50,22 +49,11 @@ include $(UTSBASE)/intel/Makefile.intel # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LDFLAGS += -dy -Ndacf/consconfig_dacf # -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_STATIC_UNUSED - -CERRWARN += -_gcc=-Wno-unused-function -CERRWARN += $(CNOWARN_UNINIT) - -# # Default build targets. # .KEEP_STATE: @@ -78,12 +66,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sparc/tem/Makefile b/usr/src/uts/sparc/tem/Makefile index 12d9741c56..ee46e5852d 100644 --- a/usr/src/uts/sparc/tem/Makefile +++ b/usr/src/uts/sparc/tem/Makefile @@ -40,9 +40,6 @@ UTSBASE = ../.. # MODULE = tem OBJECTS = $(TEM_OBJS:%=$(OBJS_DIR)/%) $(FONT_OBJS:%=$(OBJS_DIR)/%) - -LINTS = $(TEM_OBJS:%.o=$(LINTS_DIR)/%.ln) -LINTS += $(FONT_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE) # @@ -54,24 +51,11 @@ include $(UTSBASE)/sparc/Makefile.sparc # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -CFLAGS += $(CCVERBOSE) - LDFLAGS += -dy -Ndacf/consconfig_dacf # -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_STATIC_UNUSED - -CERRWARN += -_gcc=-Wno-unused-function -CERRWARN += $(CNOWARN_UNINIT) - -# # Default build targets. # .KEEP_STATE: @@ -84,19 +68,9 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # # Include common targets. # include $(UTSBASE)/sparc/Makefile.targ - -CLOBBERFILES += \ - $(OBJS_DIR)/$(VGATEXT_FONT).o \ - $(OBJS_DIR)/$(VGATEXT_FONT).c |