Home | History | Annotate | Download | only in ic

Lines Matching defs:vc

323 egavga_getfont(struct vga_config *vc, struct vgascreen *scr, const char *name,
330 TAILQ_FOREACH(f, &vc->vc_fontlist, next) {
368 TAILQ_INSERT_TAIL(&vc->vc_fontlist, f, next);
380 egavga_unreffont(struct vga_config *vc, struct egavga_font *f)
388 TAILQ_REMOVE(&vc->vc_fontlist, f, next);
390 KASSERT(vc->vc_fonts[f->slot] == f);
391 vc->vc_fonts[f->slot] = 0;
402 vga_selectfont(struct vga_config *vc, struct vgascreen *scr, const char *name1,
408 f1 = egavga_getfont(vc, scr, name1, 1);
413 f2 = egavga_getfont(vc, scr, name2, 0);
415 egavga_unreffont(vc, f1);
432 egavga_unreffont(vc, scr->fontset1);
435 egavga_unreffont(vc, scr->fontset2);
441 vga_init_screen(struct vga_config *vc, struct vgascreen *scr,
447 scr->cfg = vc;
448 scr->pcs.hdl = (struct pcdisplay_handle *)&vc->hdl;
452 if (vc->vc_quirks & VGA_QUIRK_NOFASTSCROLL)
458 vc->active = scr;
460 cpos = vga_6845_read(&vc->hdl, cursorh) << 8;
461 cpos |= vga_6845_read(&vc->hdl, cursorl);
467 scr->pcs.dispoffset = vga_6845_read(&vc->hdl, startadrh) << 9;
468 scr->pcs.dispoffset |= vga_6845_read(&vc->hdl, startadrl) << 1;
475 if (type != vc->currenttype) {
476 vga_setscreentype(&vc->hdl, type);
477 vc->currenttype = type;
492 if (!vc->hdl.vh_mono)
513 if (vga_selectfont(vc, scr, 0, 0)) {
520 vga_setfont(vc, scr);
522 vc->nscreens++;
523 LIST_INSERT_HEAD(&vc->screens, scr, next);
527 vga_init(struct vga_config *vc, bus_space_tag_t iot, bus_space_tag_t memt)
529 struct vga_handle *vh = &vc->hdl;
555 vc->nscreens = 0;
556 LIST_INIT(&vc->screens);
557 vc->active = NULL;
558 vc->currenttype = vh->vh_mono ? &vga_25lscreen_mono : &vga_25lscreen;
559 callout_init(&vc->vc_switch_callout, 0);
570 vga_loadchars(&vc->hdl, 0, wf->firstchar, wf->numchars,
576 vc->vc_fonts[0] = &vga_builtinfont;
578 vc->vc_fonts[i] = 0;
579 TAILQ_INIT(&vc->vc_fontlist);
580 TAILQ_INSERT_HEAD(&vc->vc_fontlist, &vga_builtinfont, next);
582 vc->currentfontset1 = vc->currentfontset2 = 0;
587 vga_save_palette(vc);
596 struct vga_config *vc;
602 vc = &vga_console_vc;
605 vc = malloc(sizeof(struct vga_config), M_DEVBUF, M_WAITOK);
606 vga_init(vc, iot, memt);
610 vc->vc_nfontslots = 1;
619 vc->vc_nfontslots = 8;
643 vga_readoutchars(&vc->hdl, BUILTINFONTLOC, 0, 256,
648 vc->vc_type = type;
649 vc->vc_funcs = vf;
650 vc->vc_quirks = quirks;
652 sc->sc_vc = vc;
653 vc->softc = sc;
656 aa.scrdata = (vc->hdl.vh_mono ? &vga_screenlist_mono : &vga_screenlist);
658 aa.accesscookie = vc;
715 struct vga_config *vc;
718 vc = &vga_console_vc;
719 vh = &vc->hdl;
749 vga_get_video(struct vga_config *vc)
752 return (vga_ts_read(&vc->hdl, mode) & VGA_TS_MODE_BLANK) == 0;
756 vga_set_video(struct vga_config *vc, int state)
760 vga_ts_write(&vc->hdl, syncreset, 0x01);
762 val = vga_ts_read(&vc->hdl, mode);
763 vga_ts_write(&vc->hdl, mode, val & ~VGA_TS_MODE_BLANK);
765 val = vga_6845_read(&vc->hdl, mode);
766 vga_6845_write(&vc->hdl, mode, val | 0x80);
769 val = vga_ts_read(&vc->hdl, mode);
770 vga_ts_write(&vc->hdl, mode, val | VGA_TS_MODE_BLANK);
772 val = vga_6845_read(&vc->hdl, mode);
773 vga_6845_write(&vc->hdl, mode, val & ~0x80);
776 vga_ts_write(&vc->hdl, syncreset, 0x03);
782 struct vga_config *vc = v;
784 const struct vga_funcs *vf = vc->vc_funcs;
789 vga_restore_palette(vc);
793 *(int *)data = vc->vc_type;
801 *(int *)data = (vga_get_video(vc) ?
806 vga_set_video(vc, *(int *)data == WSDISPLAYIO_VIDEO_ON);
821 return (vga_getborder(vc, (u_int *)data));
824 return (vga_setborder(vc, *(u_int *)data));
838 if (vc->vc_funcs == NULL)
850 struct vga_config *vc = v;
851 const struct vga_funcs *vf = vc->vc_funcs;
853 if (vc->vc_funcs == NULL)
866 struct vga_config *vc = v;
869 if (vc->nscreens == 1) {
870 struct vgascreen *scr1 = vc->screens.lh_first;
882 vga_init_screen(vc, scr, type, vc->nscreens == 0, defattrp);
884 if (vc->nscreens > 1) {
901 struct vga_config *vc = vs->cfg;
904 vc->nscreens--;
906 egavga_unreffont(vc, vs->fontset1);
908 egavga_unreffont(vc, vs->fontset2);
915 if (vc->active == vs)
916 vc->active = 0;
922 vga_usefont(struct vga_config *vc, struct egavga_font *f)
930 for (slot = 0; slot < vc->vc_nfontslots; slot++) {
931 if (!vc->vc_fonts[slot])
936 TAILQ_FOREACH(of, &vc->vc_fontlist, next) {
938 KASSERT(vc->vc_fonts[of->slot] == of);
947 vga_loadchars(&vc->hdl, slot, f->wsfont->firstchar,
950 vc->vc_fonts[slot] = f;
953 TAILQ_REMOVE(&vc->vc_fontlist, f, next);
954 TAILQ_INSERT_TAIL(&vc->vc_fontlist, f, next);
958 vga_setfont(struct vga_config *vc, struct vgascreen *scr)
963 vga_usefont(vc, scr->fontset1);
965 vga_usefont(vc, scr->fontset2);
969 if (vc->currentfontset1 != fontslot1 ||
970 vc->currentfontset2 != fontslot2) {
971 vga_setfontset(&vc->hdl, fontslot1, fontslot2);
972 vc->currentfontset1 = fontslot1;
973 vc->currentfontset2 = fontslot2;
982 struct vga_config *vc = scr->cfg;
984 oldscr = vc->active; /* can be NULL! */
989 vc->wantedscreen = cookie;
990 vc->switchcb = cb;
991 vc->switchcbarg = cbarg;
993 callout_reset(&vc->vc_switch_callout, 0,
994 (void(*)(void *))vga_doswitch, vc);
998 vga_doswitch(vc);
1003 vga_doswitch(struct vga_config *vc)
1006 struct vga_handle *vh = &vc->hdl;
1009 scr = vc->wantedscreen;
1012 (*vc->switchcb)(vc->switchcbarg, EIO, 0);
1016 oldscr = vc->active; /* can be NULL! */
1021 if (oldscr->pcs.type != vc->currenttype)
1042 if (vc->currenttype != type) {
1044 vc->currenttype = type;
1047 vga_setfont(vc, scr);
1048 vga_restore_palette(vc);
1060 vc->active = scr;
1065 vc->wantedscreen = 0;
1066 if (vc->switchcb)
1067 (*vc->switchcb)(vc->switchcbarg, 0, 0);
1073 struct vga_config *vc = v;
1085 res = vga_selectfont(vc, scr, data->name, name2);
1087 vga_setfont(vc, scr);
1098 struct vga_config *vc = scr->cfg;
1104 if (vc->hdl.vh_mono) {
1459 struct vga_config *vc = v;
1461 struct vga_handle *vh = &vc->hdl;
1507 vga_getborder(struct vga_config *vc, u_int *valuep)
1509 struct vga_handle *vh = &vc->hdl;
1527 vga_setborder(struct vga_config *vc, u_int value)
1529 struct vga_handle *vh = &vc->hdl;
1555 vga_save_palette(struct vga_config *vc)
1557 struct vga_handle *vh = &vc->hdl;
1559 uint8_t *palette = vc->palette;
1566 for (i = 0; i < sizeof(vc->palette); i++)
1573 vga_restore_palette(struct vga_config *vc)
1575 struct vga_handle *vh = &vc->hdl;
1577 uint8_t *palette = vc->palette;
1584 for (i = 0; i < sizeof(vc->palette); i++)