Lines Matching +full:flip +full:- +full:vertical
1 /*-
65 bus_space_read_1(sc->vga_fb_tag, sc->vga_fb_handle, ofs)
67 bus_space_write_1(sc->vga_fb_tag, sc->vga_fb_handle, ofs, val)
69 bus_space_write_2(sc->vga_fb_tag, sc->vga_fb_handle, ofs, val)
71 bus_space_read_1(sc->vga_reg_tag, sc->vga_reg_handle, reg)
73 bus_space_write_1(sc->vga_reg_tag, sc->vga_reg_handle, reg, val)
86 * We use an off-screen addresses to:
129 struct vga_softc *sc = vd->vd_softc;
131 if (sc->vga_wmode == wmode)
136 sc->vga_wmode = wmode;
140 /* Re-enable all planes. */
151 struct vga_softc *sc = vd->vd_softc;
155 if (sc->vga_curfg == color)
160 sc->vga_curfg = color;
166 struct vga_softc *sc = vd->vd_softc;
170 if (sc->vga_curbg == color)
177 * Write 8 pixels using the background color to an off-screen
188 sc->vga_curbg = color;
194 sc->vga_curfg = 0xff;
304 max = nitems(cp437table) - 1;
313 max = mid - 1;
318 return (c - cp437table[mid].unicode_base +
328 struct vga_softc *sc = vd->vd_softc;
340 struct vga_softc *sc = vd->vd_softc;
356 sc->vga_curbg = 0xff;
366 if (vd->vd_flags & VDF_TEXTMODE)
379 if (vd->vd_flags & VDF_TEXTMODE)
408 >> (8 - x_count))
409 << (8 - x_count - dst_x);
412 if (n == (src_x + x_count - 1) / 8) {
416 *pattern >>= (dst_x - src_x % 8);
418 *pattern <<= (src_x % 8 - dst_x);
423 src[n] << (8 - dst_x - src_x % 8) |
424 src[n + 1] >> (dst_x - src_x % 8);
427 src[n] << (src_x % 8 - dst_x) |
428 src[n + 1] >> (8 - src_x % 8 - dst_x);
475 /* Set the bits in the 2-colors array. */
484 * Set the same bits in the n-colors array. This one
523 sc = vd->vd_softc;
539 sc = vd->vd_softc;
566 * | | +-> 0b0011 (Y)
567 * | +-----> 0b0000 (B)
568 * +--------> 0b0111 (G)
578 if (!((mask >> (7 - j)) & 0x1))
585 plane) & 0x1) << (7 - j);
617 uint8_t pattern_2colors[vw->vw_font->vf_height];
618 uint8_t pattern_ncolors[vw->vw_font->vf_height * 16];
623 vb = &vw->vw_buf;
624 vf = vw->vw_font;
641 if (i < vw->vw_draw_area.tr_begin.tp_col) {
647 i = vw->vw_draw_area.tr_begin.tp_col;
651 i < vw->vw_draw_area.tr_end.tp_col) {
659 col = (i - vw->vw_draw_area.tr_begin.tp_col) / vf->vf_width;
660 row = (y - vw->vw_draw_area.tr_begin.tp_row) / vf->vf_height;
679 * the current position -
683 * - the last pixel of the character, or
684 * - the pixel of the character matching the end of
691 src_x = i -
692 (col * vf->vf_width + vw->vw_draw_area.tr_begin.tp_col);
694 (col + 1) * vf->vf_width +
695 vw->vw_draw_area.tr_begin.tp_col,
697 vw->vw_draw_area.tr_end.tp_col);
698 x_count -= col * vf->vf_width +
699 vw->vw_draw_area.tr_begin.tp_col;
700 x_count -= src_x;
704 src, NULL, vf->vf_width,
706 0, 0, vf->vf_height, fg, bg, 0);
726 drawn_area.tr_end.tp_row = y + vf->vf_height;
727 if (vd->vd_mshown && vt_is_cursor_in_area(vd, &drawn_area)) {
732 cursor = vd->vd_mcursor;
733 mx = vd->vd_mx_drawn + vw->vw_draw_area.tr_begin.tp_col;
734 my = vd->vd_my_drawn + vw->vw_draw_area.tr_begin.tp_row;
737 src_x = x > mx ? x - mx : 0;
738 dst_x = mx > x ? mx - x : 0;
740 cursor->width - src_x,
741 x + VT_VGA_PIXELS_BLOCK - mx),
742 vw->vw_draw_area.tr_end.tp_col - mx),
746 * The cursor isn't aligned on the Y-axis with
747 * characters, so we need to compute the vertical
750 src_y = y > my ? y - my : 0;
751 dst_y = my > y ? my - y : 0;
753 min(cursor->height - src_y, y + vf->vf_height - my),
754 vf->vf_height);
758 cursor->map, cursor->mask, cursor->width,
760 vd->vd_mcursor_fg, vd->vd_mcursor_bg, 1);
762 if ((used_colors_list[vd->vd_mcursor_fg] & 0x1) != 0x1)
764 if ((used_colors_list[vd->vd_mcursor_bg] & 0x2) != 0x2)
775 x, y, vf->vf_height);
778 x, y, vf->vf_height);
789 vf = vw->vw_font;
792 * Compute the top-left pixel position aligned with the video
795 * This is calculated from the top-left column of te dirty area:
797 * 1. Compute the top-left pixel of the character:
811 * For the Y-axis, we need to compute the character's y
815 col = area->tr_begin.tp_col;
816 row = area->tr_begin.tp_row;
817 x1 = (int)((col * vf->vf_width + vw->vw_draw_area.tr_begin.tp_col)
820 y1 = row * vf->vf_height + vw->vw_draw_area.tr_begin.tp_row;
830 col = area->tr_end.tp_col;
831 row = area->tr_end.tp_row;
832 x2 = (int)howmany(col * vf->vf_width + vw->vw_draw_area.tr_begin.tp_col,
835 y2 = row * vf->vf_height + vw->vw_draw_area.tr_begin.tp_row;
838 x2 = min(x2, vw->vw_draw_area.tr_end.tp_col);
839 y2 = min(y2, vw->vw_draw_area.tr_end.tp_row);
847 * Therefore, on the X-axis, characters my be drawn partially if
848 * they are not aligned on 8-pixels boundary.
856 for (y = y1; y < y2; y += vf->vf_height) {
875 sc = vd->vd_softc;
876 vb = &vw->vw_buf;
878 for (row = area->tr_begin.tp_row; row < area->tr_end.tp_row; ++row) {
879 for (col = area->tr_begin.tp_col;
880 col < area->tr_end.tp_col;
894 if (vd->vd_drawn && (vd->vd_drawn[z] == c) &&
895 vd->vd_drawnfg && (vd->vd_drawnfg[z] == fg) &&
896 vd->vd_drawnbg && (vd->vd_drawnbg[z] == bg))
914 if (vd->vd_drawn)
915 vd->vd_drawn[z] = c;
916 if (vd->vd_drawnfg)
917 vd->vd_drawnfg[z] = fg;
918 if (vd->vd_drawnbg)
919 vd->vd_drawnbg[z] = bg;
929 if (!(vd->vd_flags & VDF_TEXTMODE)) {
942 for (row = area->tr_begin.tp_row; row < area->tr_end.tp_row; ++row) {
943 for (col = area->tr_begin.tp_col;
944 col < area->tr_end.tp_col;
950 if (vd->vd_drawn)
951 vd->vd_drawn[z] = 0;
952 if (vd->vd_drawnfg)
953 vd->vd_drawnfg[z] = 0;
954 if (vd->vd_drawnbg)
955 vd->vd_drawnbg[z] = 0;
969 /* Align coordinates with the 8-pxels grid. */
975 x2 = min(x2, vd->vd_width - 1);
976 y2 = min(y2, vd->vd_height - 1);
980 dst_x = x - x1;
981 x_count = VT_VGA_PIXELS_BLOCK - dst_x;
990 j - y1, 0, 1, fg, bg, 0);
998 x_count = min(width - src_x, VT_VGA_PIXELS_BLOCK);
1016 struct vga_softc *sc = vd->vd_softc;
1034 REG_WRITE1(sc, VGA_CRTC_DATA, 0x4f); /* 640 - 8 */
1055 REG_WRITE1(sc, VGA_CRTC_DATA, 0xdf); /* 480 - 1*/
1097 struct vga_softc *sc = vd->vd_softc;
1105 /* Unprotect CRTC registers 0-7. */
1111 * Wait for the vertical retrace.
1113 * the side-effect of clearing the internal flip-flip of the attribute
1125 } while (x != (VGA_GEN_IS1_VR | VGA_GEN_IS1_DE) && --timeout != 0);
1225 * enabled, so a single-paged loop should clear all
1233 /* Re-enable the sequencer. */
1236 /* Re-enable the sync signals. */
1245 sc->vga_wmode = 3;
1260 sc->vga_curfg = sc->vga_curbg = 0xff;
1300 if (vd->vd_softc == NULL)
1301 vd->vd_softc = (void *)&vga_conssoftc;
1302 sc = vd->vd_softc;
1304 if (vd->vd_flags & VDF_DOWNGRADE && vd->vd_video_dev != NULL)
1305 vga_pci_repost(vd->vd_video_dev);
1308 sc->vga_fb_tag = X86_BUS_SPACE_MEM;
1309 sc->vga_reg_tag = X86_BUS_SPACE_IO;
1314 bus_space_map(sc->vga_reg_tag, VGA_REG_BASE, VGA_REG_SIZE, 0,
1315 &sc->vga_reg_handle);
1321 * in text mode, especially when we're on Hyper-V.
1326 vd->vd_flags |= VDF_TEXTMODE;
1327 vd->vd_width = 80;
1328 vd->vd_height = 25;
1329 bus_space_map(sc->vga_fb_tag, VGA_TXT_BASE, VGA_TXT_SIZE, 0,
1330 &sc->vga_fb_handle);
1332 vd->vd_width = VT_VGA_WIDTH;
1333 vd->vd_height = VT_VGA_HEIGHT;
1334 bus_space_map(sc->vga_fb_tag, VGA_MEM_BASE, VGA_MEM_SIZE, 0,
1335 &sc->vga_fb_handle);
1339 sc->vga_enabled = true;
1349 vga_initialize(vd, (vd->vd_flags & VDF_TEXTMODE));
1351 vd->vd_flags |= VDF_INVALID;
1362 if (BUS_ADD_CHILD(parent, 0, driver->name, 0) == NULL)
1383 &res_id, VGA_MEM_BASE, VGA_MEM_BASE + VGA_MEM_SIZE - 1,
1390 /*-------------------- Private Device Attachment Data -----------------------*/