Lines Matching +full:display +full:- +full:colorspace

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
37 * ALL pixel data is assumed to be 32-bit BGRA (byte order Blue, Green, Red,
43 * 32-bit to/from 32-bit is trivial case.
44 * 32-bit to/from 24-bit is also simple - we just drop the alpha channel.
45 * 32-bit to/from 16-bit is more complicated, because we nee to handle
46 * data loss from 32-bit to 16-bit. While reading/writing from/to video, we
47 * need to apply masks of 16-bit color components. This will preserve
48 * colors for terminal text. For 32-bit truecolor PMG images, we need to
49 * translate 32-bit colors to 15/16 bit colors and this means data loss.
54 * 32-bit to/from 8-bit is the most troublesome because 8-bit colors are
61 * used indexed colors for 8-bit colors (0-255) and for this mode we do
64 * - paletteentry RGB <-> index -
65 * BGRA BUFFER <----/ \ - VIDEO
67 * - RGB (16/24/32) -
70 * from when we set up 8-bit mode video. We cannot read palette data from
76 * Note: In 8-bit mode, We do store first 16 colors to palette registers
80 * loader is used. However, the palette map for 8-bit colors is using
81 * console color ordering - this does allow us to skip translation
151 * - blue and red are swapped (1 <-> 4)
152 * - yellow and cyan are swapped (3 <-> 6)
216 *depth = -1; /* auto select */
263 /* colors 232-255 are a grayscale ramp */
278 * or we will lose color information from 32-bit to 15/16 bit translation.
286 roff = ffs(gfx_state.tg_fb.fb_mask_red) - 1;
287 goff = ffs(gfx_state.tg_fb.fb_mask_green) - 1;
288 boff = ffs(gfx_state.tg_fb.fb_mask_blue) - 1;
312 * Since UEFI does only support 32-bit colors, we do not implement it for
326 diff = r - pe8[k].Red;
328 diff = g - pe8[k].Green;
330 diff = b - pe8[k].Blue;
434 roff = ffs(gfx_state.tg_fb.fb_mask_red) - 1;
435 goff = ffs(gfx_state.tg_fb.fb_mask_green) - 1;
436 boff = ffs(gfx_state.tg_fb.fb_mask_blue) - 1;
439 data = rgb_to_color_index(p->Red, p->Green, p->Blue);
441 data = (p->Red &
443 data |= (p->Green &
445 data |= (p->Blue &
525 rp = ffs(gfx_state.tg_fb.fb_mask_red) - 1;
526 gp = ffs(gfx_state.tg_fb.fb_mask_green) - 1;
527 bp = ffs(gfx_state.tg_fb.fb_mask_blue) - 1;
534 ffs(rm) - 1 == 8 && rp == 16 &&
535 ffs(gm) - 1 == 8 && gp == 8 &&
536 ffs(bm) - 1 == 8 && bp == 0;
575 p->Red = (c >> rp) & rm;
576 p->Green = (c >> gp) & gm;
577 p->Blue = (c >> bp) & bm;
578 p->Reserved = 0;
625 rp = ffs(gfx_state.tg_fb.fb_mask_red) - 1;
626 gp = ffs(gfx_state.tg_fb.fb_mask_green) - 1;
627 bp = ffs(gfx_state.tg_fb.fb_mask_blue) - 1;
634 ffs(rm) - 1 == 8 && rp == 16 &&
635 ffs(gm) - 1 == 8 && gp == 8 &&
636 ffs(bm) - 1 == 8 && bp == 0;
655 c = rgb_to_color_index(p->Red,
656 p->Green, p->Blue);
658 c = (p->Red & rm) << rp |
659 (p->Green & gm) << gp |
660 (p->Blue & bm) << bp;
735 pitch = -pitch;
738 while (Height-- > 0) {
764 Width = fbX - DestinationX;
767 Height = fbY - DestinationY;
799 tpl = BS->RaiseTPL(TPL_NOTIFY);
804 status = gop->Blt(gop, BltBuffer, EfiBltVideoFill,
810 status = gop->Blt(gop, BltBuffer,
817 status = gop->Blt(gop, BltBuffer, EfiBltBufferToVideo,
823 status = gop->Blt(gop, BltBuffer, EfiBltVideoToVideo,
848 BS->RestoreTPL(tpl);
893 width = state->tg_font.vf_width;
894 height = state->tg_font.vf_height;
897 fgc = a->ta_fgcolor;
898 bgc = a->ta_bgcolor;
899 if (a->ta_format & TF_BOLD)
901 if (a->ta_format & TF_BLINK)
907 if (a->ta_format & TF_REVERSE)
930 gfx_mem_wr4(state->tg_glyph,
931 state->tg_glyph_size, o, cc);
944 width = state->tg_font.vf_width;
945 height = state->tg_font.vf_height;
946 x = state->tg_origin.tp_col + p->tp_col * width;
947 y = state->tg_origin.tp_row + p->tp_row * height;
949 gfx_fb_cons_display(x, y, width, height, state->tg_glyph);
963 idx = p->tp_col + p->tp_row * state->tg_tp.tp_col;
964 if (idx >= state->tg_tp.tp_col * state->tg_tp.tp_row)
968 if (state->tg_cursor_visible)
969 gfx_fb_cursor_draw(state, &state->tg_cursor, false);
974 glyph = font_lookup(&state->tg_font, c, a);
978 /* display the cursor */
979 if (state->tg_cursor_visible) {
982 c = teken_get_cursor(&state->tg_teken);
997 if (state->tg_cursor_visible)
998 gfx_fb_cursor_draw(state, &state->tg_cursor, false);
1000 glyph = font_lookup(&state->tg_font, c, a);
1003 for (p.tp_row = r->tr_begin.tp_row; p.tp_row < r->tr_end.tp_row;
1005 row = &screen_buffer[p.tp_row * state->tg_tp.tp_col];
1006 for (p.tp_col = r->tr_begin.tp_col;
1007 p.tp_col < r->tr_end.tp_col; p.tp_col++) {
1014 /* display the cursor */
1015 if (state->tg_cursor_visible) {
1018 c = teken_get_cursor(&state->tg_teken);
1031 if (p.tp_col >= state->tg_tp.tp_col)
1032 p.tp_col = state->tg_tp.tp_col - 1;
1033 if (p.tp_row >= state->tg_tp.tp_row)
1034 p.tp_row = state->tg_tp.tp_row - 1;
1035 idx = p.tp_col + p.tp_row * state->tg_tp.tp_col;
1036 if (idx >= state->tg_tp.tp_col * state->tg_tp.tp_row)
1039 glyph = font_lookup(&state->tg_font, screen_buffer[idx].c,
1044 state->tg_cursor = p;
1053 if (state->tg_cursor_visible) {
1054 gfx_fb_cursor_draw(state, &state->tg_cursor, false);
1076 c = teken_get_cursor(&state->tg_teken);
1079 state->tg_cursor_visible = true;
1081 state->tg_cursor_visible = false;
1092 if (px1->c != px2->c)
1096 if ((px1->a.ta_format & TF_IMAGE) ||
1097 (px2->a.ta_format & TF_IMAGE))
1100 if (px1->a.ta_format != px2->a.ta_format)
1102 if (px1->a.ta_fgcolor != px2->a.ta_fgcolor)
1104 if (px1->a.ta_bgcolor != px2->a.ta_bgcolor)
1118 width = state->tg_font.vf_width;
1119 height = state->tg_font.vf_height;
1121 sx = s->tr_begin.tp_col * width;
1122 sy = s->tr_begin.tp_row * height;
1123 dx = d->tp_col * width;
1124 dy = d->tp_row * height;
1126 width *= (s->tr_end.tp_col - s->tr_begin.tp_col + 1);
1131 if (state->tg_shadow_fb == NULL) {
1133 sx + state->tg_origin.tp_col,
1134 sy + state->tg_origin.tp_row,
1135 dx + state->tg_origin.tp_col,
1136 dy + state->tg_origin.tp_row,
1147 pitch = state->tg_fb.fb_width;
1148 bytes = width * sizeof (*state->tg_shadow_fb);
1156 step = -step;
1159 while (height-- > 0) {
1160 uint32_t *source = &state->tg_shadow_fb[sy * pitch + sx];
1161 uint32_t *destination = &state->tg_shadow_fb[dy * pitch + dx];
1165 0, 0, dx + state->tg_origin.tp_col,
1166 dy + state->tg_origin.tp_row, width, 1, 0);
1182 soffset = s->tp_col + s->tp_row * state->tg_tp.tp_col;
1183 doffset = d->tp_col + d->tp_row * state->tg_tp.tp_col;
1196 sr.tr_end.tp_col = s->tp_col + x;
1200 sr.tr_begin.tp_col = s->tp_col + x;
1201 sr.tr_begin.tp_row = s->tp_row;
1202 sr.tr_end.tp_col = s->tp_col + x;
1203 sr.tr_end.tp_row = s->tp_row;
1204 dp.tp_col = d->tp_col + x;
1205 dp.tp_row = d->tp_row;
1220 int nrow, ncol, y; /* Has to be signed - >= 0 comparison */
1227 nrow = r->tr_end.tp_row - r->tr_begin.tp_row;
1228 ncol = r->tr_end.tp_col - r->tr_begin.tp_col;
1230 if (p->tp_row + nrow > state->tg_tp.tp_row ||
1231 p->tp_col + ncol > state->tg_tp.tp_col)
1234 soffset = r->tr_begin.tp_col + r->tr_begin.tp_row * state->tg_tp.tp_col;
1235 doffset = p->tp_col + p->tp_row * state->tg_tp.tp_col;
1238 if (state->tg_cursor_visible)
1239 gfx_fb_cursor_draw(state, &state->tg_cursor, false);
1245 s = r->tr_begin;
1248 s.tp_row = r->tr_begin.tp_row + y;
1249 d.tp_row = p->tp_row + y;
1254 for (y = nrow - 1; y >= 0; y--) {
1255 s.tp_row = r->tr_begin.tp_row + y;
1256 d.tp_row = p->tp_row + y;
1262 /* display the cursor */
1263 if (state->tg_cursor_visible) {
1266 c = teken_get_cursor(&state->tg_teken);
1275 * blend = alpha * fg + (1.0 - alpha) * bg.
1288 blend = (alpha * fg + (0xFF - alpha) * bg);
1301 * blend = alpha * fg + (1.0 - alpha) * bg.
1368 (y - gfx_state.tg_origin.tp_row) * pitch +
1369 x - gfx_state.tg_origin.tp_col);
1379 * Common data to display is glyph, use preallocated
1419 num -= res + bit;
1436 if (ap->ta_format & TF_REVERSE) {
1437 c = ap->ta_bgcolor;
1438 if (ap->ta_format & TF_BLINK)
1441 c = ap->ta_fgcolor;
1442 if (ap->ta_format & TF_BOLD)
1482 gfxfb_blt(&c, GfxFbBltVideoFill, 0, 0, x1, y1, x2 - x1,
1483 y2 - y1, 0);
1485 gfxfb_blt(&c, GfxFbBltVideoFill, 0, 0, x1, y1, x2 - x1, 1, 0);
1486 gfxfb_blt(&c, GfxFbBltVideoFill, 0, 0, x1, y2, x2 - x1, 1, 0);
1487 gfxfb_blt(&c, GfxFbBltVideoFill, 0, 0, x1, y1, 1, y2 - y1, 0);
1488 gfxfb_blt(&c, GfxFbBltVideoFill, 0, 0, x2, y1, 1, y2 - y1, 0);
1502 sx = x0 < x1? 1 : -1;
1503 sy = y0 < y1? 1 : -1;
1504 dx = x1 > x0? x1 - x0 : x0 - x1;
1505 dy = y1 > y0? y1 - y0 : y0 - y1;
1513 if ((e2 << 1) >= -dx) { /* x step */
1525 err -= dy;
1529 e2 = dx-e2;
1559 sx = x2 - x1;
1560 sy = y2 - y1;
1561 xx = x0 - x1;
1562 yy = y0 - y1;
1563 curvature = xx*sy - yy*sx;
1570 curvature = -curvature;
1574 sx = x0 < x2? 1 : -1;
1577 sy = y0 < y2? 1 : -1;
1583 xx = -xx;
1584 yy = -yy;
1585 xy = -xy;
1586 curvature = -curvature;
1588 dx = 4 * sy * curvature * (x1 - x0) + xx - xy;
1589 dy = 4 * sx * curvature * (y0 - y1) + yy - xy;
1597 return; /* last pixel -> curve finished */
1601 dx -= xy;
1607 dy -= xy;
1611 } while (dy < dx); /* gradient negates -> algorithm fails */
1634 xshift = (vf_width - width) / 2;
1635 yshift = (vf_height - width) / 2;
1639 ux1--;
1641 uy1--;
1642 ux2--;
1643 uy2--;
1661 y2 += vf_height - yshift - width;
1673 x1 += vf_width - xshift - width;
1685 gfx_fb_bezier(x1 + i, y1, x1 + i, y2 + i, x2, y2 + i, width-i);
1691 y1 += vf_height - yshift;
1695 gfx_fb_bezier(x1, y1 - i, x2 + i, y1 - i, x2 + i, y2, width-i);
1701 x2 += vf_width - xshift - width;
1705 gfx_fb_bezier(x1, y1 + i, x2 + i, y1 + i, x2 + i, y2, width-i);
1710 y1 += vf_height - yshift;
1712 x2 += vf_width - xshift - width;
1715 gfx_fb_bezier(x1, y1 - i, x2 + i, y1 - i, x2 + i, y2, width-i);
1743 if (png->color_type != PNG_TRUECOLOR_ALPHA) {
1756 if (png->width > UINT16_MAX || png->height > UINT16_MAX) {
1762 if (png->width < 1 || png->height < 1) {
1775 ux2 = ux1 + png->width;
1776 uy2 = uy1 + png->height;
1780 ux2 = ux1 + (png->width * (uy2 - uy1)) / png->height;
1783 uy2 = uy1 + (png->height * (ux2 - ux1)) / png->width;
1793 fwidth = ux2 - ux1;
1794 fheight = uy2 - uy1;
1800 if (fwidth == png->width && fheight == png->height)
1805 * No top left X co-ordinate (real coordinates start at 1),
1808 ux2 = gfx_state.tg_fb.fb_width - gfx_state.tg_origin.tp_col;
1809 ux1 = ux2 - fwidth;
1814 * No top left Y co-ordinate (real coordinates start at 1),
1817 uy2 = gfx_state.tg_fb.fb_height - gfx_state.tg_origin.tp_row;
1818 uy1 = uy2 - fheight;
1834 printf("Image %ux%u -> %ux%u @%ux%u\n",
1835 png->width, png->height, fwidth, fheight, ux1, uy1);
1864 #define GETPIXEL(xx, yy) (((yy) * png->width + (xx)) * png->bpp)
1869 * Use fixed-point arithmetic with 16-bits for each of the integer and
1872 const uint32_t wcstep = ((png->width - 1) << 16) / (fwidth - 1);
1873 const uint32_t hcstep = ((png->height - 1) << 16) / (fheight - 1);
1875 rs = 8 - (fls(gfx_state.tg_fb.fb_mask_red) -
1877 gs = 8 - (fls(gfx_state.tg_fb.fb_mask_green) -
1879 bs = 8 - (fls(gfx_state.tg_fb.fb_mask_blue) -
1885 uint32_t hc1 = 0x80 - hc2;
1893 uint32_t wc1 = 0x80 - wc2;
1903 r = png->image[i];
1904 g = png->image[i + 1];
1905 b = png->image[i + 2];
1906 a = png->image[i + 3];
1937 (png->image[p00 + i] * hc1 +
1938 png->image[p01 + i] * hc2) * wc1 +
1939 (png->image[p10 + i] * hc1 +
1940 png->image[p11 + i] * hc2) * wc2)
1952 * Rough colorspace reduction for 15/16 bit colors.
1978 fl->font_flags = FONT_AUTO;
1991 w = edid_info->display.max_horizontal_image_size;
1992 h = edid_info->display.max_vertical_image_size;
2064 /* Apply display factor 2. */
2074 if (next == NULL || next->font_data->vfbd_height < size) {
2075 font = fl->font_data;
2076 if (font->vfbd_font == NULL ||
2077 fl->font_flags == FONT_RELOAD) {
2078 if (fl->font_load != NULL &&
2079 fl->font_name != NULL)
2080 font = fl->font_load(fl->font_name);
2101 if (fl->font_flags == FONT_MANUAL) {
2102 font = fl->font_data;
2103 if (font->vfbd_font == NULL && fl->font_load != NULL &&
2104 fl->font_name != NULL) {
2105 font = fl->font_load(fl->font_name);
2107 if (font == NULL || font->vfbd_font == NULL)
2117 *rows = height / font->vfbd_height;
2118 *cols = width / font->vfbd_width;
2128 font = fl->font_data;
2129 if ((*rows * font->vfbd_height <= height &&
2130 *cols * font->vfbd_width <= width) ||
2133 font->vfbd_height == DEFAULT_FONT_DATA.vfbd_height &&
2134 font->vfbd_width == DEFAULT_FONT_DATA.vfbd_width)) {
2135 if (font->vfbd_font == NULL ||
2136 fl->font_flags == FONT_RELOAD) {
2137 if (fl->font_load != NULL &&
2138 fl->font_name != NULL) {
2139 font = fl->font_load(fl->font_name);
2144 *rows = height / font->vfbd_height;
2145 *cols = width / font->vfbd_width;
2157 if (fl != NULL && fl->font_load != NULL &&
2158 fl->font_name != NULL) {
2159 font = fl->font_load(fl->font_name);
2164 *rows = height / font->vfbd_height;
2165 *cols = width / font->vfbd_width;
2178 gfx_state.tg_functions->tf_param(&gfx_state, TP_SHOWCURSOR, 0);
2185 teken_pos_t *tp = &state->tg_tp;
2196 font_data = set_font(&tp->tp_row, &tp->tp_col, height, width);
2202 state->tg_font.vf_map[i] =
2203 font_data->vfbd_font->vf_map[i];
2204 state->tg_font.vf_map_count[i] =
2205 font_data->vfbd_font->vf_map_count[i];
2208 state->tg_font.vf_bytes = font_data->vfbd_font->vf_bytes;
2209 state->tg_font.vf_height = font_data->vfbd_font->vf_height;
2210 state->tg_font.vf_width = font_data->vfbd_font->vf_width;
2213 state->tg_font.vf_width, state->tg_font.vf_height);
2225 max = len - 1;
2235 return (src - map[0].vfm_src + map[0].vfm_dst);
2244 max = mid - 1;
2248 return (src - map[mid].vfm_src + map[mid].vfm_dst);
2265 if (a->ta_format & TF_BOLD) {
2266 dst = font_bisearch(vf->vf_map[VFNT_MAP_BOLD],
2267 vf->vf_map_count[VFNT_MAP_BOLD], c);
2271 dst = font_bisearch(vf->vf_map[VFNT_MAP_NORMAL],
2272 vf->vf_map_count[VFNT_MAP_NORMAL], c);
2275 stride = howmany(vf->vf_width, 8) * vf->vf_height;
2276 return (&vf->vf_bytes[dst * stride]);
2286 if (fp->vf_map_count[n] == 0)
2289 size = fp->vf_map_count[n] * sizeof(*mp);
2293 fp->vf_map[n] = mp;
2297 free(fp->vf_map[n]);
2298 fp->vf_map[n] = NULL;
2302 for (i = 0; i < fp->vf_map_count[n]; i++) {
2319 if (fp->vf_map_count[n] == 0)
2322 size = fp->vf_map_count[n] * sizeof(*mp);
2326 fp->vf_map[n] = mp;
2328 memcpy(mp, DEFAULT_FONT_DATA.vfbd_font->vf_map[n], size);
2353 if (strcmp(fl->font_name, path) == 0)
2359 bp = fl->font_data;
2360 if (bp->vfbd_font != NULL && fl->font_flags != FONT_RELOAD)
2363 fd = -1;
2369 if (fl->font_flags == FONT_BUILTIN) {
2373 fp->vf_width = DEFAULT_FONT_DATA.vfbd_width;
2374 fp->vf_height = DEFAULT_FONT_DATA.vfbd_height;
2376 fp->vf_bytes = malloc(DEFAULT_FONT_DATA.vfbd_uncompressed_size);
2377 if (fp->vf_bytes == NULL) {
2382 bp->vfbd_uncompressed_size =
2384 bp->vfbd_compressed_size =
2388 fp->vf_bytes,
2391 free(fp->vf_bytes);
2397 fp->vf_map_count[i] =
2398 DEFAULT_FONT_DATA.vfbd_font->vf_map_count[i];
2403 bp->vfbd_font = fp;
2426 fp->vf_map_count[i] = be32toh(fh.fh_map_count[i]);
2429 fp->vf_width = fh.fh_width;
2430 fp->vf_height = fh.fh_height;
2432 size = howmany(fp->vf_width, 8) * fp->vf_height * glyphs;
2433 bp->vfbd_uncompressed_size = size;
2434 if ((fp->vf_bytes = malloc(size)) == NULL)
2437 rv = read(fd, fp->vf_bytes, size);
2448 if (fl->font_flags == FONT_BUILTIN)
2449 fl->font_flags = FONT_AUTO;
2455 * We do need to keep fl->font_data for glyph dimensions.
2458 if (fl->font_data->vfbd_font == NULL)
2462 free(fl->font_data->vfbd_font->vf_map[i]);
2463 free(fl->font_data->vfbd_font->vf_bytes);
2464 free(fl->font_data->vfbd_font);
2465 fl->font_data->vfbd_font = NULL;
2468 bp->vfbd_font = fp;
2469 bp->vfbd_compressed_size = 0;
2472 if (fd != -1)
2478 free(fp->vf_map[i]);
2479 free(fp->vf_bytes);
2543 if (asprintf(&np->n_name, "%s/%s", dir, buf) < 0) {
2612 if (fh.fh_width == entry->font_data->vfbd_width &&
2613 fh.fh_height == entry->font_data->vfbd_height) {
2614 free(entry->font_name);
2615 entry->font_name = font_name;
2616 entry->font_flags = FONT_RELOAD;
2627 fp->font_data = calloc(sizeof(*fp->font_data), 1);
2628 if (fp->font_data == NULL) {
2633 fp->font_name = font_name;
2634 fp->font_flags = flags;
2635 fp->font_load = load_font;
2636 fp->font_data->vfbd_width = fh.fh_width;
2637 fp->font_data->vfbd_height = fh.fh_height;
2646 size = fp->font_data->vfbd_width * fp->font_data->vfbd_height;
2651 bd = entry->font_data;
2653 if (size > bd->vfbd_width * bd->vfbd_height) {
2665 size > next->font_data->vfbd_width *
2666 next->font_data->vfbd_height) {
2695 if (fl->font_data->vfbd_width == x &&
2696 fl->font_data->vfbd_height == y)
2704 fl->font_flags = FONT_MANUAL;
2711 printf(" %dx%d\n", fl->font_data->vfbd_width,
2712 fl->font_data->vfbd_height);
2741 if (insert_font(np->n_name, FONT_AUTO) == false)
2742 printf("failed to add font: %s\n", np->n_name);
2743 free(np->n_name);
2774 while ((c = getopt(argc, argv, "l")) != -1) {
2785 argc -= optind;
2789 printf("Usage: loadfont [-l] | [file.fnt]\n");
2795 printf("font %s: %dx%d%s\n", fl->font_name,
2796 fl->font_data->vfbd_width,
2797 fl->font_data->vfbd_height,
2798 fl->font_data->vfbd_font == NULL? "" : " loaded");
2825 if (fl->font_data->vfbd_font != NULL) {
2827 bd = fl->font_data;
2833 free(bd->vfbd_font->vf_map[i]);
2834 free(fl->font_data->vfbd_font);
2835 fl->font_data->vfbd_font = NULL;
2836 fl->font_data->vfbd_uncompressed_size = 0;
2837 fl->font_flags = FONT_AUTO;
2853 if ((edid->display.supported_features
2858 * Reserved value 0 is not used for display descriptor.
2860 if (edid->detailed_timings[i].pixel_clock == 0)
2864 rp->width = GET_EDID_INFO_WIDTH(edid, i);
2865 rp->height = GET_EDID_INFO_HEIGHT(edid, i);
2866 if (rp->width > 0 && rp->width <= EDID_MAX_PIXELS &&
2867 rp->height > 0 && rp->height <= EDID_MAX_LINES)
2879 if (edid->standard_timings[i] == 0x0101)
2885 rp->width = HSIZE(edid->standard_timings[i]);
2886 switch (RATIO(edid->standard_timings[i])) {
2888 rp->height = HSIZE(edid->standard_timings[i]);
2889 if (edid->header.version > 1 ||
2890 edid->header.revision > 2) {
2891 rp->height = rp->height * 10 / 16;
2895 rp->height = HSIZE(edid->standard_timings[i]) * 3 / 4;
2898 rp->height = HSIZE(edid->standard_timings[i]) * 4 / 5;
2901 rp->height = HSIZE(edid->standard_timings[i]) * 9 / 16;
2910 if (p->width * p->height < rp->width * rp->height) {
2953 if (gfx_state.tg_font.vf_width == fl->font_data->vfbd_width &&
2954 gfx_state.tg_font.vf_height == fl->font_data->vfbd_height) {
2958 if (fl->font_flags == FONT_BUILTIN)
2961 bd = fl->font_data;
2967 fd = bd->vfbd_font;
2969 fi.fi_width = fd->vf_width;
2971 fi.fi_height = fd->vf_height;
2973 fi.fi_bitmap_size = bd->vfbd_uncompressed_size;
2978 fi.fi_map_count[i] = fd->vf_map_count[i];
2980 size += fd->vf_map_count[i] * sizeof (struct vfnt_map);
2983 size += bd->vfbd_uncompressed_size;
2985 fi.fi_checksum = -checksum;
2997 if (fd->vf_map_count[i] != 0) {
2998 addr += archsw.arch_copyin(fd->vf_map[i], addr,
2999 fd->vf_map_count[i] * sizeof (struct vfnt_map));
3005 addr += archsw.arch_copyin(fd->vf_bytes, addr, fi.fi_bitmap_size);