summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-05-29 20:48:45 +0300
committerToomas Soome <tsoome@me.com>2019-06-28 18:45:37 +0300
commit097aa9ce8122e2a595b37e2c87d970fec0d5fcbb (patch)
tree917fd81f059ed75e0931b805c8b3fa0ed9ae707a
parenta60ca23dc52059ace3f92bb9a63e723ac49e649b (diff)
downloadillumos-joyent-097aa9ce8122e2a595b37e2c87d970fec0d5fcbb.tar.gz
11217 gfx_private vga font setup should use set_font() to search for vga font
Reviewed by: C Fraire <cfraire@me.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/uts/i86pc/io/gfx_private/gfxp_fb.h1
-rw-r--r--usr/src/uts/i86pc/io/gfx_private/gfxp_vgatext.c21
2 files changed, 20 insertions, 2 deletions
diff --git a/usr/src/uts/i86pc/io/gfx_private/gfxp_fb.h b/usr/src/uts/i86pc/io/gfx_private/gfxp_fb.h
index dc49a628b0..6c6cc5e8bf 100644
--- a/usr/src/uts/i86pc/io/gfx_private/gfxp_fb.h
+++ b/usr/src/uts/i86pc/io/gfx_private/gfxp_fb.h
@@ -77,6 +77,7 @@ struct gfx_vga {
unsigned char blue;
} colormap[VGA8_CMAP_ENTRIES];
unsigned char attrib_palette[VGA_ATR_NUM_PLT];
+ struct font font;
};
union gfx_console {
diff --git a/usr/src/uts/i86pc/io/gfx_private/gfxp_vgatext.c b/usr/src/uts/i86pc/io/gfx_private/gfxp_vgatext.c
index ee0db4ef92..de48a9fe00 100644
--- a/usr/src/uts/i86pc/io/gfx_private/gfxp_vgatext.c
+++ b/usr/src/uts/i86pc/io/gfx_private/gfxp_vgatext.c
@@ -945,7 +945,10 @@ static void
vgatext_init(struct gfxp_fb_softc *softc)
{
union gfx_console *console = softc->console;
+ bitmap_data_t *font_data;
unsigned char atr_mode;
+ short width, height;
+ int i;
atr_mode = vga_get_atr(&console->vga.regs, VGA_ATR_MODE);
if (atr_mode & VGA_ATR_MODE_GRAPH)
@@ -961,7 +964,21 @@ vgatext_init(struct gfxp_fb_softc *softc)
vga_set_atr(&console->vga.regs, VGA_ATR_BDR_CLR,
vga_get_atr(&console->vga.regs, pc_black));
#endif
- vgatext_setfont(softc); /* need selectable font? */
+
+ width = VGA_TEXT_COLS;
+ height = VGA_TEXT_ROWS;
+ font_data = set_font(&height, &width,
+ 16 * height + BORDER_PIXELS,
+ 8 * width + BORDER_PIXELS);
+ for (i = 0; i < VFNT_MAPS; i++) {
+ console->vga.font.vf_map[i] = font_data->font->vf_map[i];
+ console->vga.font.vf_map_count[i] =
+ font_data->font->vf_map_count[i];
+ }
+ console->vga.font.vf_bytes = font_data->font->vf_bytes;
+ console->vga.font.vf_width = font_data->font->vf_width;
+ console->vga.font.vf_height = font_data->font->vf_height;
+ vgatext_setfont(softc);
}
#if defined(USE_BORDERS)
@@ -1109,7 +1126,7 @@ vgatext_setfont(struct gfxp_fb_softc *softc)
f_offset = s * 8 * 1024;
for (i = 0; i < 256; i++) {
c = vga_cp437_to_uni(i);
- from = font_lookup(font_data_8x16.font, c);
+ from = font_lookup(&console->vga.font, c);
to = (unsigned char *)console->vga.fb.addr + f_offset +
i * 0x20;
for (j = 0; j < bpc; j++)