Lines Matching defs:scr
192 struct sti_screen *scr;
195 scr = (struct sti_screen *)malloc(sizeof(*scr), M_DEVBUF,
197 if (scr == NULL) {
202 scr->scr_rom = sc->sc_rom;
203 rc = sti_screen_setup(scr, flags);
205 free(scr, M_DEVBUF, sizeof *scr);
209 sti_describe_screen(sc, scr);
211 return (scr);
409 sti_region_setup(struct sti_screen *scr)
411 struct sti_rom *rom = scr->scr_rom;
416 struct sti_cfg *cc = &scr->scr_cfg;
492 scr->fbaddr = addr;
493 scr->fblen = r->length << PGSHIFT;
523 struct sti_screen *scr = v;
524 struct sti_rom *rom = scr->scr_rom;
547 sti_screen_setup(struct sti_screen *scr, int flags)
549 struct sti_rom *rom = scr->scr_rom;
553 struct sti_cfg *cc = &scr->scr_cfg;
561 cc->ext_cfg = &scr->scr_ecfg;
565 scr->scr_ecfg.addr =
567 if (!scr->scr_ecfg.addr) {
575 scr->scr_ecfg.future.g.gvid_cmd_arg = scr;
576 scr->scr_ecfg.future.g.gvid_cmd =
580 sti_region_setup(scr);
582 if ((error = sti_init(scr, 0))) {
590 if ((error = sti_inqcfg(scr, &inq))) {
604 scr->scr_cfg.oscr_width = inq.owidth =
606 scr->scr_cfg.oscr_height = inq.oheight =
613 scr->fbheight = inq.fbheight;
614 scr->fbwidth = inq.fbwidth;
615 scr->oheight = inq.oheight;
616 scr->owidth = inq.owidth;
617 bcopy(inq.name, scr->name, sizeof(scr->name));
619 if ((error = sti_init(scr, STI_TEXTMODE | flags))) {
630 scr->scr_bpp = inq.bppu;
633 * Although scr->scr_ecfg.current_monitor is not filled by
653 if (mon->width == scr->scr_cfg.scr_width &&
654 mon->height == scr->scr_cfg.scr_height) {
667 if ((error = sti_fetchfonts(scr, &inq, dd->dd_fntaddr, fontindex))) {
679 strlcpy(scr->scr_wsd.name, "std", sizeof(scr->scr_wsd.name));
680 scr->scr_wsd.ncols = inq.width / scr->scr_curfont.width;
681 scr->scr_wsd.nrows = inq.height / scr->scr_curfont.height;
682 scr->scr_wsd.textops = &sti_emulops;
683 scr->scr_wsd.fontwidth = scr->scr_curfont.width;
684 scr->scr_wsd.fontheight = scr->scr_curfont.height;
685 scr->scr_wsd.capabilities = WSSCREEN_REVERSE;
687 scr->scr_scrlist[0] = &scr->scr_wsd;
688 scr->scr_screenlist.nscreens = 1;
689 scr->scr_screenlist.screens =
690 (const struct wsscreen_descr **)scr->scr_scrlist;
699 scr->setupfb = ngle_elk_setupfb;
700 scr->putcmap = ngle_putcmap;
702 scr->reg10_value = 0x13601000;
703 if (scr->scr_bpp > 8)
704 scr->reg12_value = NGLE_BUFF1_CMAP3;
706 scr->reg12_value = NGLE_BUFF1_CMAP0;
707 scr->cmap_finish_register = NGLE_REG_1;
711 scr->setupfb = ngle_timber_setupfb;
712 scr->putcmap = ngle_putcmap;
714 scr->reg10_value = 0x13602000;
715 scr->reg12_value = NGLE_BUFF1_CMAP0;
716 scr->cmap_finish_register = NGLE_REG_1;
720 scr->setupfb = ngle_artist_setupfb;
721 scr->putcmap = ngle_putcmap;
723 scr->reg10_value = 0x13601000;
724 scr->reg12_value = NGLE_ARTIST_CMAP0;
725 scr->cmap_finish_register = NGLE_REG_26;
729 scr->setupfb = ngle_artist_setupfb;
730 scr->putcmap = ngle_putcmap;
732 scr->reg10_value = 0x13601000;
733 if (scr->scr_bpp > 8) {
734 scr->reg12_value = NGLE_BUFF1_CMAP3;
735 scr->cmap_finish_register = NGLE_REG_1;
737 scr->reg12_value = NGLE_ARTIST_CMAP0;
738 scr->cmap_finish_register = NGLE_REG_26;
753 scr->setupfb = NULL;
754 scr->putcmap =
764 if (scr->scr_romfont != NULL) {
765 free(scr->scr_romfont, M_DEVBUF, 0);
766 scr->scr_romfont = NULL;
768 if (scr->scr_ecfg.addr != NULL) {
769 free(scr->scr_ecfg.addr, M_DEVBUF, 0);
770 scr->scr_ecfg.addr = NULL;
777 sti_describe_screen(struct sti_softc *sc, struct sti_screen *scr)
779 struct sti_font *fp = &scr->scr_curfont;
782 sc->sc_dev.dv_xname, scr->name, scr->fbwidth, scr->fbheight,
783 scr->scr_cfg.scr_width, scr->scr_cfg.scr_height, scr->scr_bpp);
820 sti_end_attach_screen(struct sti_softc *sc, struct sti_screen *scr, int console)
824 scr->scr_wsmode = WSDISPLAYIO_MODE_EMUL;
827 waa.scrdata = &scr->scr_screenlist;
829 waa.accesscookie = scr;
836 sti_pack_attr(scr, 0, 0, 0, &defattr);
837 wsdisplay_cnattach(&scr->scr_wsd, scr,
838 0, scr->scr_wsd.nrows - 1, defattr);
863 sti_fetchfonts(struct sti_screen *scr, struct sti_inqconfout *inq,
866 struct sti_rom *rom = scr->scr_rom;
869 struct sti_font *fp = &scr->scr_curfont;
924 scr->scr_romfont = malloc(size, M_DEVBUF, M_NOWAIT);
925 if (scr->scr_romfont == NULL)
929 (u_int8_t *)scr->scr_romfont, size);
942 if (fp->next == 0 && scr->scr_romfont == NULL) {
961 a.in.font_addr = scr->scr_romfont;
963 scr->scr_fontmaxcol = inq->fbheight / fp->height;
964 scr->scr_fontbase = inq->width + inq->owidth;
966 a.in.x = ((uc - fp->first) / scr->scr_fontmaxcol) *
967 fp->width + scr->scr_fontbase;
968 a.in.y = ((uc - fp->first) % scr->scr_fontmaxcol) *
972 (*scr->unpmv)(&a.flags, &a.in, &a.out, &scr->scr_cfg);
982 free(scr->scr_romfont, M_DEVBUF, 0);
983 scr->scr_romfont = NULL;
995 sti_init(struct sti_screen *scr, int mode)
997 struct sti_rom *rom = scr->scr_rom;
1021 rom->init, a.flags.flags, &a.in, &a.out, &scr->scr_cfg);
1029 (*rom->init)(&a.flags, &a.in, &a.out, &scr->scr_cfg);
1038 sti_inqcfg(struct sti_screen *scr, struct sti_inqconfout *out)
1040 struct sti_rom *rom = scr->scr_rom;
1049 (*rom->inqconf)(&a.flags, &a.in, out, &scr->scr_cfg);
1055 sti_bmove(struct sti_screen *scr, int x1, int y1, int x2, int y2, int h, int w,
1058 struct sti_rom *rom = scr->scr_rom;
1091 (*rom->blkmv)(&a.flags, &a.in, &a.out, &scr->scr_cfg);
1099 sti_setcment(struct sti_screen *scr, u_int i, u_char r, u_char g, u_char b)
1101 struct sti_rom *rom = scr->scr_rom;
1114 (*rom->scment)(&a.flags, &a.in, &a.out, &scr->scr_cfg);
1131 struct sti_screen *scr = (struct sti_screen *)v;
1143 if (scr->scr_wsmode != WSDISPLAYIO_MODE_EMUL)
1144 ret = sti_init(scr, STI_TEXTMODE);
1147 if (scr->scr_wsmode != WSDISPLAYIO_MODE_DUMBFB) {
1148 if (scr->setupfb != NULL)
1149 scr->setupfb(scr);
1152 ret = sti_init(scr, STI_FBMODE);
1164 scr->scr_wsmode = mode;
1173 wdf->height = scr->scr_cfg.scr_height;
1174 wdf->width = scr->scr_cfg.scr_width;
1175 wdf->depth = scr->scr_bpp;
1176 if (scr->scr_bpp > 8)
1177 wdf->stride = scr->scr_cfg.fb_width * 4;
1179 wdf->stride = scr->scr_cfg.fb_width;
1181 if (scr->putcmap == NULL || scr->scr_bpp > 8)
1188 if (scr->scr_bpp > 8)
1189 *(u_int *)data = scr->scr_cfg.fb_width * 4;
1191 *(u_int *)data = scr->scr_cfg.fb_width;
1195 if (scr->scr_bpp > 8)
1202 if (scr->putcmap == NULL || scr->scr_bpp > 8)
1209 if ((ret = copyout(&scr->scr_rcmap[idx], cmapp->red, count)))
1211 if ((ret = copyout(&scr->scr_gcmap[idx], cmapp->green, count)))
1213 if ((ret = copyout(&scr->scr_bcmap[idx], cmapp->blue, count)))
1218 if (scr->putcmap == NULL || scr->scr_bpp > 8)
1225 if ((ret = copyin(cmapp->red, &scr->scr_rcmap[idx], count)))
1227 if ((ret = copyin(cmapp->green, &scr->scr_gcmap[idx], count)))
1229 if ((ret = copyin(cmapp->blue, &scr->scr_bcmap[idx], count)))
1231 ret = scr->putcmap(scr, idx, count);
1248 struct sti_screen *scr = (struct sti_screen *)v;
1250 struct sti_rom *rom = scr->scr_rom;
1257 if (offset < 0 || offset >= scr->fblen)
1261 pa = bus_space_mmap(rom->memt, scr->fbaddr, offset, prot,
1264 pa = scr->fbaddr + offset;
1274 struct sti_screen *scr = (struct sti_screen *)v;
1276 if (scr->scr_nscreens > 0)
1279 *cookiep = scr;
1282 sti_pack_attr(scr, 0, 0, 0, defattr);
1283 scr->scr_nscreens++;
1290 struct sti_screen *scr = (struct sti_screen *)v;
1292 scr->scr_nscreens--;
1300 struct sti_screen *scr = (struct sti_screen *)v;
1313 struct sti_screen *scr = (struct sti_screen *)v;
1314 struct sti_font *fp = &scr->scr_curfont;
1316 sti_bmove(scr,
1351 struct sti_screen *scr = (struct sti_screen *)v;
1352 struct sti_font *fp = &scr->scr_curfont;
1383 struct sti_screen *scr = (struct sti_screen *)v;
1384 struct sti_rom *rom = scr->scr_rom;
1385 struct sti_font *fp = &scr->scr_curfont;
1388 sti_unpack_attr(scr, attr, &fg, &bg, NULL);
1390 if (scr->scr_romfont != NULL) {
1408 a.in.font_addr = scr->scr_romfont;
1411 (*rom->unpmv)(&a.flags, &a.in, &a.out, &scr->scr_cfg);
1428 a.in.srcx = ((uc - fp->first) / scr->scr_fontmaxcol) *
1429 fp->width + scr->scr_fontbase;
1430 a.in.srcy = ((uc - fp->first) % scr->scr_fontmaxcol) *
1437 (*rom->blkmv)(&a.flags, &a.in, &a.out, &scr->scr_cfg);
1446 struct sti_screen *scr = (struct sti_screen *)v;
1447 struct sti_font *fp = &scr->scr_curfont;
1449 sti_bmove(scr,
1460 struct sti_screen *scr = (struct sti_screen *)v;
1461 struct sti_font *fp = &scr->scr_curfont;
1463 sti_bmove(scr,
1474 struct sti_screen *scr = (struct sti_screen *)v;
1475 struct sti_font *fp = &scr->scr_curfont;
1477 sti_bmove(scr, 0, srcrow * fp->height, 0, dstrow * fp->height,
1478 nrows * fp->height, scr->scr_cfg.scr_width, bmf_copy);
1486 struct sti_screen *scr = (struct sti_screen *)v;
1487 struct sti_font *fp = &scr->scr_curfont;
1489 sti_bmove(scr, 0, srcrow * fp->height, 0, srcrow * fp->height,
1490 nrows * fp->height, scr->scr_cfg.scr_width, bmf_clear);
1499 struct sti_screen *scr = (struct sti_screen *)v;
1510 struct sti_screen *scr = (struct sti_screen *)v;
1525 ngle_default_putcmap(struct sti_screen *scr, u_int idx, u_int count)
1530 if ((ret = sti_setcment(scr, i, scr->scr_rcmap[i],
1531 scr->scr_gcmap[i], scr->scr_bcmap[i])))
1541 void ngle_setup_attr_planes(struct sti_screen *scr);
1542 void ngle_setup_bt458(struct sti_screen *scr);
1548 ngle_artist_setupfb(struct sti_screen *scr)
1550 struct sti_rom *rom = scr->scr_rom;
1554 ngle_setup_bt458(scr);
1557 ngle_setup_fb(memt, memh, scr->reg10_value);
1559 ngle_setup_attr_planes(scr);
1569 ngle_elk_setupfb(struct sti_screen *scr)
1571 struct sti_rom *rom = scr->scr_rom;
1575 ngle_setup_bt458(scr);
1578 ngle_setup_fb(memt, memh, scr->reg10_value);
1580 ngle_setup_attr_planes(scr);
1589 ngle_timber_setupfb(struct sti_screen *scr)
1591 struct sti_rom *rom = scr->scr_rom;
1595 ngle_setup_bt458(scr);
1604 ngle_setup_bt458(struct sti_screen *scr)
1606 struct sti_rom *rom = scr->scr_rom;
1617 ngle_setup_attr_planes(struct sti_screen *scr)
1619 struct sti_rom *rom = scr->scr_rom;
1626 bus_space_write_4(memt, memh, NGLE_REG_12, scr->reg12_value);
1631 (scr->scr_cfg.scr_width << 16) | scr->scr_cfg.scr_height);
1638 ngle_setup_fb(memt, memh, scr->reg10_value);
1642 ngle_putcmap(struct sti_screen *scr, u_int idx, u_int count)
1644 struct sti_rom *rom = scr->scr_rom;
1650 if (scr->scr_bpp > 8)
1655 r = scr->scr_rcmap + idx;
1656 g = scr->scr_gcmap + idx;
1657 b = scr->scr_bcmap + idx;
1675 bus_space_write_4(memt, memh, scr->cmap_finish_register, cmap_finish);
1676 ngle_setup_fb(memt, memh, scr->reg10_value);