Home | History | Annotate | Download | only in ic

Lines Matching refs:scr

194 	struct sti_screen *scr;
197 scr = (struct sti_screen *)malloc(sizeof(*scr), M_DEVBUF,
199 scr->scr_rom = sc->sc_rom;
200 rc = sti_screen_setup(scr, flags);
202 free(scr, M_DEVBUF);
206 sti_describe_screen(sc, scr);
208 return scr;
399 sti_region_setup(struct sti_screen *scr)
401 struct sti_rom *rom = scr->scr_rom;
406 struct sti_cfg *cc = &scr->scr_cfg;
478 scr->fbaddr = addr;
479 scr->fblen = r->length << STI_PGSHIFT;
498 sti_screen_setup(struct sti_screen *scr, int flags)
500 struct sti_rom *rom = scr->scr_rom;
504 struct sti_cfg *cc = &scr->scr_cfg;
514 KASSERT(scr != NULL);
516 cc->ext_cfg = &scr->scr_ecfg;
520 scr->scr_ecfg.addr =
524 sti_region_setup(scr);
526 if ((error = sti_init(scr, 0))) {
534 if ((error = sti_inqcfg(scr, &cfg))) {
549 scr->scr_cfg.oscr_width = cfg.owidth =
551 scr->scr_cfg.oscr_height = cfg.oheight =
558 scr->fbheight = cfg.fbheight;
559 scr->fbwidth = cfg.fbwidth;
560 scr->oheight = cfg.oheight;
561 scr->owidth = cfg.owidth;
562 memcpy(scr->name, cfg.name, sizeof(scr->name));
566 sti_init(scr, STI_FBMODE);
570 if ((error = sti_init(scr, STI_TEXTMODE | flags))) {
582 scr->scr_bpp = cfg.bppu;
585 * Although scr->scr_ecfg.current_monitor is not filled by
605 if (mon->width == scr->scr_cfg.scr_width &&
606 mon->height == scr->scr_cfg.scr_height) {
617 if ((error = sti_fetchfonts(scr, &cfg, dd->dd_fntaddr, fontindex))) {
629 scr->scr_wsd.name = "std";
630 scr->scr_wsd.ncols = cfg.width / scr->scr_curfont.width;
631 scr->scr_wsd.nrows = cfg.height / scr->scr_curfont.height;
632 scr->scr_wsd.textops = &sti_emulops;
633 scr->scr_wsd.fontwidth = scr->scr_curfont.width;
634 scr->scr_wsd.fontheight = scr->scr_curfont.height;
635 scr->scr_wsd.capabilities = WSSCREEN_REVERSE;
637 scr->scr_scrlist[0] = &scr->scr_wsd;
638 scr->scr_screenlist.nscreens = 1;
639 scr->scr_screenlist.screens = scr->scr_scrlist;
648 scr->setupfb = ngle_elk_setupfb;
649 scr->putcmap = ngle_putcmap;
651 scr->reg10_value = 0x13601000;
652 if (scr->scr_bpp > 8)
653 scr->reg12_value = NGLE_BUFF1_CMAP3;
655 scr->reg12_value = NGLE_BUFF1_CMAP0;
656 scr->cmap_finish_register = NGLE_REG_1;
660 scr->setupfb = ngle_timber_setupfb;
661 scr->putcmap = ngle_putcmap;
663 scr->reg10_value = 0x13602000;
664 scr->reg12_value = NGLE_BUFF1_CMAP0;
665 scr->cmap_finish_register = NGLE_REG_1;
669 scr->setupfb = ngle_artist_setupfb;
670 scr->putcmap = ngle_putcmap;
672 scr->reg10_value = 0x13601000;
673 scr->reg12_value = NGLE_ARTIST_CMAP0;
674 scr->cmap_finish_register = NGLE_REG_26;
678 scr->setupfb = ngle_artist_setupfb;
679 scr->putcmap = ngle_putcmap;
681 scr->reg10_value = 0x13601000;
682 if (scr->scr_bpp > 8) {
683 scr->reg12_value = NGLE_BUFF1_CMAP3;
684 scr->cmap_finish_register = NGLE_REG_1;
686 scr->reg12_value = NGLE_ARTIST_CMAP0;
687 scr->cmap_finish_register = NGLE_REG_26;
692 scr->setupfb = ngle_elk_setupfb;
693 scr->putcmap = ngle_hcrx_putcmap;
695 if (scr->scr_bpp > 8) {
696 scr->reg12_value = NGLE_BUFF1_CMAP3;
697 scr->reg10_value = 0xBBA0A000;
699 scr->reg12_value = NGLE_BUFF1_CMAP0;
700 scr->reg10_value = 0x13602000;
702 scr->cmap_finish_register = NGLE_REG_38;
707 scr->setupfb = summit_setupfb;
708 scr->putcmap = summit_putcmap;
709 scr->scr_bpp = 8; /* for now */
727 scr->setupfb = NULL;
728 scr->putcmap =
738 if (scr->scr_ecfg.addr != NULL) {
739 free(scr->scr_ecfg.addr, M_DEVBUF);
740 scr->scr_ecfg.addr = NULL;
747 sti_describe_screen(struct sti_softc *sc, struct sti_screen *scr)
749 struct sti_font *fp = &scr->scr_curfont;
752 device_xname(sc->sc_dev), scr->name, scr->fbwidth, scr->fbheight,
753 scr->scr_cfg.scr_width, scr->scr_cfg.scr_height, scr->scr_bpp);
782 struct sti_screen *scr = sc->sc_scr;
784 if (scr == NULL)
789 scr->scr_wsmode = WSDISPLAYIO_MODE_EMUL;
792 waa.scrdata = &scr->scr_screenlist;
794 waa.accesscookie = scr;
800 sti_alloc_attr(scr, 0, 0, 0, &defattr);
801 wsdisplay_cnattach(&scr->scr_wsd, scr,
802 0, scr->scr_wsd.nrows - 1, defattr);
832 sti_fetchfonts(struct sti_screen *scr, struct sti_inqconfout *cfg,
835 struct sti_rom *rom = scr->scr_rom;
838 struct sti_font *fp = &scr->scr_curfont;
877 scr->scr_rom->rom_softc == NULL ? __func__ :
878 device_xname(scr->scr_rom->rom_softc->sc_dev), fp->width,
888 scr->scr_romfont = malloc(size, M_DEVBUF, M_WAITOK);
891 (uint32_t *)scr->scr_romfont, size / 4);
903 if (fp->next == 0 && scr->scr_romfont == NULL) {
922 a.in.font_addr = scr->scr_romfont;
924 scr->scr_fontmaxcol = cfg->fbheight / fp->height;
925 scr->scr_fontbase = cfg->width + cfg->owidth;
927 a.in.x = ((uc - fp->first) / scr->scr_fontmaxcol) *
928 fp->width + scr->scr_fontbase;
929 a.in.y = ((uc - fp->first) % scr->scr_fontmaxcol) *
933 (*scr->unpmv)(&a.flags, &a.in, &a.out, &scr->scr_cfg);
941 free(scr->scr_romfont, M_DEVBUF);
942 scr->scr_romfont = NULL;
954 sti_init(struct sti_screen *scr, int mode)
956 struct sti_rom *rom = scr->scr_rom;
996 &a.in, &a.out, &scr->scr_cfg));
998 (*rom->init)(&a.flags, &a.in, &a.out, &scr->scr_cfg);
1006 sti_inqcfg(struct sti_screen *scr, struct sti_inqconfout *out)
1008 struct sti_rom *rom = scr->scr_rom;
1017 (*rom->inqconf)(&a.flags, &a.in, out, &scr->scr_cfg);
1023 sti_bmove(struct sti_screen *scr, int x1, int y1, int x2, int y2, int h, int w,
1026 struct sti_rom *rom = scr->scr_rom;
1059 (*rom->blkmv)(&a.flags, &a.in, &a.out, &scr->scr_cfg);
1069 sti_setcment(struct sti_screen *scr, u_int i, u_char r, u_char g, u_char b)
1071 struct sti_rom *rom = scr->scr_rom;
1084 (*rom->scment)(&a.flags, &a.in, &a.out, &scr->scr_cfg);
1095 struct sti_screen *scr = (struct sti_screen *)v;
1096 struct sti_rom *rom = scr->scr_rom;
1109 *(u_int *)data = scr->scr_wsmode;
1116 if (scr->scr_wsmode != WSDISPLAYIO_MODE_EMUL)
1117 ret = sti_init(scr, STI_TEXTMODE);
1120 if (scr->scr_wsmode != WSDISPLAYIO_MODE_DUMBFB) {
1121 ret = sti_init(scr, 0);
1122 if (scr->setupfb != NULL)
1123 scr->setupfb(scr);
1126 ret = sti_init(scr, STI_FBMODE);
1138 scr->scr_wsmode = mode;
1147 wdf->height = scr->scr_cfg.scr_height;
1148 wdf->width = scr->scr_cfg.scr_width;
1149 wdf->depth = scr->scr_bpp;
1150 if (scr->putcmap == NULL || scr->scr_bpp > 8)
1157 if (scr->scr_bpp > 8)
1158 *(u_int *)data = scr->scr_cfg.fb_width * 4;
1160 *(u_int *)data = scr->scr_cfg.fb_width;
1164 if (scr->putcmap == NULL || scr->scr_bpp > 8)
1171 if ((ret = copyout(&scr->scr_rcmap[idx], cmapp->red, count)))
1173 if ((ret = copyout(&scr->scr_gcmap[idx], cmapp->green, count)))
1175 if ((ret = copyout(&scr->scr_bcmap[idx], cmapp->blue, count)))
1180 if (scr->putcmap == NULL || scr->scr_bpp > 8)
1182 if (scr->scr_wsmode == WSDISPLAYIO_MODE_EMUL) {
1197 if ((ret = copyin(cmapp->red, &scr->scr_rcmap[idx], count)))
1199 if ((ret = copyin(cmapp->green, &scr->scr_gcmap[idx], count)))
1201 if ((ret = copyin(cmapp->blue, &scr->scr_bcmap[idx], count)))
1203 ret = scr->putcmap(scr
1223 struct sti_screen *scr = (struct sti_screen *)v;
1224 struct sti_rom *rom = scr->scr_rom;
1230 if (offset < 0 || offset >= scr->fblen)
1233 if (scr->scr_wsmode != WSDISPLAYIO_MODE_DUMBFB)
1236 pa = bus_space_mmap(rom->memt, scr->fbaddr, offset, prot,
1240 pa = scr->fbaddr + offset;
1249 struct sti_screen *scr = (struct sti_screen *)v;
1251 if (scr->scr_nscreens > 0)
1254 *cookiep = scr;
1257 sti_alloc_attr(scr, 0, 0, 0, defattr);
1258 scr->scr_nscreens++;
1265 struct sti_screen *scr = (struct sti_screen *)v;
1267 scr->scr_nscreens--;
1275 struct sti_screen *scr = (struct sti_screen *)v;
1285 struct sti_screen *scr = (struct sti_screen *)v;
1297 struct sti_screen *scr = (struct sti_screen *)v;
1298 struct sti_font *fp = &scr->scr_curfont;
1300 sti_bmove(scr,
1333 struct sti_screen *scr = (struct sti_screen *)v;
1334 struct sti_font *fp = &scr->scr_curfont;
1365 struct sti_screen *scr = (struct sti_screen *)v;
1366 struct sti_rom *rom = scr->scr_rom;
1367 struct sti_font *fp = &scr->scr_curfont;
1373 if (scr->scr_romfont != NULL) {
1390 a.in.font_addr = scr->scr_romfont;
1393 (*rom->unpmv)(&a.flags, &a.in, &a.out, &scr->scr_cfg);
1410 a.in.srcx = ((uc - fp->first) / scr->scr_fontmaxcol) *
1411 fp->width + scr->scr_fontbase;
1412 a.in.srcy = ((uc - fp->first) % scr->scr_fontmaxcol) *
1419 (*rom->blkmv)(&a.flags, &a.in, &a.out, &scr->scr_cfg);
1426 struct sti_screen *scr = (struct sti_screen *)v;
1427 struct sti_font *fp = &scr->scr_curfont;
1429 sti_bmove(scr,
1438 struct sti_screen *scr = (struct sti_screen *)v;
1439 struct sti_font *fp = &scr->scr_curfont;
1441 sti_bmove(scr,
1450 struct sti_screen *scr = (struct sti_screen *)v;
1451 struct sti_font *fp = &scr->scr_curfont;
1453 sti_bmove(scr, 0, srcrow * fp->height, 0, dstrow * fp->height,
1454 nrows * fp->height, scr->scr_cfg.scr_width, bmf_copy);
1460 struct sti_screen *scr = (struct sti_screen *)v;
1461 struct sti_font *fp = &scr->scr_curfont;
1463 sti_bmove(scr, 0, srcrow * fp->height, 0, srcrow * fp->height,
1464 nrows * fp->height, scr->scr_cfg.scr_width, bmf_clear);
1471 struct sti_screen *scr = (struct sti_screen *)v;
1493 sti_cnattach(struct sti_rom *rom, struct sti_screen *scr, bus_space_tag_t memt,
1517 scr->scr_rom = rom;
1518 if (sti_screen_setup(scr, STI_CLEARSCR) != 0)
1521 sti_alloc_attr(scr, 0, 0, 0, &defattr);
1522 wsdisplay_cnattach(&scr->scr_wsd, scr, 0, 0, defattr);
1528 ngle_default_putcmap(struct sti_screen *scr, u_int idx, u_int count)
1533 if ((ret = sti_setcment(scr, i, scr->scr_rcmap[i],
1534 scr->scr_gcmap[i], scr->scr_bcmap[i])))
1544 void ngle_setup_attr_planes(struct sti_screen *scr);
1545 void ngle_setup_bt458(struct sti_screen *scr);
1551 ngle_artist_setupfb(struct sti_screen *scr)
1553 struct sti_rom *rom = scr->scr_rom;
1557 ngle_setup_bt458(scr);
1560 ngle_setup_fb(memt, memh, scr->reg10_value);
1562 ngle_setup_attr_planes(scr);
1572 ngle_elk_setupfb(struct sti_screen *scr)
1574 struct sti_rom *rom = scr->scr_rom;
1578 ngle_setup_bt458(scr);
1581 ngle_setup_fb(memt, memh, scr->reg10_value);
1583 ngle_setup_attr_planes(scr);
1592 ngle_timber_setupfb(struct sti_screen *scr)
1594 struct sti_rom *rom = scr->scr_rom;
1598 ngle_setup_bt458(scr);
1607 summit_wait(struct sti_screen *scr)
1609 struct sti_rom *rom = scr->scr_rom;
1618 summit_setupfb(struct sti_screen *scr)
1620 struct sti_rom *rom = scr->scr_rom;
1624 summit_wait(scr);
1648 ngle_setup_bt458(struct sti_screen *scr)
1650 struct sti_rom *rom = scr->scr_rom;
1661 ngle_setup_attr_planes(struct sti_screen *scr)
1663 struct sti_rom *rom = scr->scr_rom;
1670 bus_space_write_stream_4(memt, memh, NGLE_REG_12, scr->reg12_value);
1675 (scr->scr_cfg.scr_width << 16) | scr->scr_cfg.scr_height);
1682 ngle_setup_fb(memt, memh, scr->reg10_value);
1686 ngle_putcmap(struct sti_screen *scr, u_int idx, u_int count)
1688 struct sti_rom *rom = scr->scr_rom;
1694 if (scr->scr_bpp > 8)
1699 r = scr->scr_rcmap + idx;
1700 g = scr->scr_gcmap + idx;
1701 b = scr->scr_bcmap + idx;
1721 bus_space_write_stream_4(memt, memh, scr->cmap_finish_register,
1723 ngle_setup_fb(memt, memh, scr->reg10_value);
1730 ngle_hcrx_putcmap(struct sti_screen *scr, u_int idx, u_int count)
1732 struct sti_rom *rom = scr->scr_rom;
1738 if (scr->scr_bpp > 8)
1743 r = scr->scr_rcmap + idx;
1744 g = scr->scr_gcmap + idx;
1745 b = scr->scr_bcmap + idx;
1766 ngle_setup_fb(memt, memh, scr->reg10_value);
1773 summit_putcmap(struct sti_screen *scr, u_int idx, u_int count)
1775 struct sti_rom *rom = scr->scr_rom;
1780 r = scr->scr_rcmap + idx;
1781 g = scr->scr_gcmap + idx;
1782 b = scr->scr_bcmap + idx;