Home | History | Annotate | Download | only in ic

Lines Matching refs:scr

334 	const struct wsscreen_descr *scr;
345 scr = wsdisplay_screentype_pick(vga_console_vc.hdl.vh_mono ?
347 if (!scr)
350 else if (scr->nrows > 30)
354 scr = wsdisplay_screentype_pick(vga_console_vc.hdl.vh_mono ?
356 if (scr != vga_console_vc.currenttype)
357 vga_console_vc.currenttype = scr;
359 scr = vga_console_vc.currenttype;
361 vga_raster_init_screen(&vga_console_vc, &vga_console_screen, scr, 1,
367 wsdisplay_cnattach(scr, &vga_console_screen,
438 vga_raster_init_screen(struct vga_config *vc, struct vgascreen *scr,
445 scr->cfg = vc;
446 scr->hdl = &vc->hdl;
447 scr->type = type;
448 scr->mindispoffset = 0;
449 scr->maxdispoffset = scr->dispoffset +
453 LIST_INIT(&scr->fontset);
454 vga_raster_setup_font(vc, scr);
466 scr->dispoffset = vga_6845_read(vh, startadrh) << 9;
467 scr->dispoffset |= vga_6845_read(vh, startadrl) << 1;
470 if (scr->dispoffset < scr->mindispoffset ||
471 scr->dispoffset > scr->maxdispoffset)
472 scr->dispoffset = scr->mindispoffset;
474 scr->mem = boot_scrmem;
475 scr->active = 1;
479 scr->mem[i].ch = bus_space_read_1(vh->vh_memt,
481 scr->mem[i].attr = bus_space_read_1(vh->vh_memt,
483 scr->mem[i].enc = scr->encoding;
493 vga_restore_screen(scr, type, scr->mem);
496 scr->dispoffset = scr->mindispoffset;
497 scr->mem = NULL;
498 scr->active = 0;
501 scr->cursorrow = cpos / type->ncols;
502 scr->cursorcol = cpos % type->ncols;
503 vga_raster_cursor_init(scr, existing);
510 res = vga_raster_allocattr(scr, WSCOL_WHITE, WSCOL_BLUE,
514 res = vga_raster_allocattr(scr, 0, 0, 0, attrp);
518 LIST_INSERT_HEAD(&vc->screens, scr, next);
705 struct vgascreen *scr;
711 scr = malloc(sizeof(struct vgascreen), M_DEVBUF, M_WAITOK);
712 vga_raster_init_screen(vc, scr, type, vc->nscreens == 0, defattrp);
715 scr->active = 1;
716 vc->active = scr;
719 scr->mem = malloc(sizeof(struct vga_scrmem) *
721 vga_raster_eraserows(scr, 0, type->nrows, *defattrp);
724 *cookiep = scr;
725 *curxp = scr->cursorcol;
726 *curyp = scr->cursorrow;
752 struct vgascreen *scr = cookie, *oldscr;
753 struct vga_config *vc = scr->cfg;
756 if (scr == oldscr) {
776 struct vgascreen *scr, *oldscr;
780 scr = vc->wantedscreen;
781 if (!scr) {
786 type = scr->type;
796 if (scr == oldscr) {
800 if (scr->active)
812 scr->dispoffset = scr->mindispoffset;
814 if (!oldscr || (scr->dispoffset != oldscr->dispoffset)) {
815 vga_6845_write(vh, startadrh, scr->dispoffset >> 8);
816 vga_6845_write(vh, startadrl, scr->dispoffset);
823 scr->active = 1;
824 vga_restore_screen(scr, type, scr->mem);
826 vc->active = scr;
828 vga_raster_cursor(scr, scr->cursoron, scr->cursorrow, scr->cursorcol);
846 vga_raster_setup_font(struct vga_config *vc, struct vgascreen *scr)
853 if (wsfont_matches(vf->font, 0, 0, scr->type->fontheight, 0,
855 scr->encoding = vf->font->encoding;
856 LIST_INSERT_HEAD(&scr->fontset, vf, next);
861 cookie = wsfont_find(NULL, 0, scr->type->fontheight, 0,
871 scr->encoding = vf->font->encoding;
872 LIST_INSERT_HEAD(&scr->fontset, vf, next);
1039 vga_raster_cursor_init(struct vgascreen *scr, int existing)
1045 * This is the first screen. At this point, scr->active is
1048 off = (scr->cursorrow * scr->type->ncols + scr->cursorcol) +
1049 scr->dispoffset / 8;
1051 scr->cursortmp = scr->mem[off];
1052 vga_raster_putchar(scr, scr->cursorrow, scr->cursorcol,
1053 scr->cursortmp.ch, scr->cursortmp.attr ^ 0x77);
1055 scr->cursortmp.ch = 0;
1056 scr->cursortmp.attr = 0;
1057 scr->cursortmp.second = 0;
1058 scr->cursortmp.enc = scr->encoding;
1061 scr->cursoron = 1;
1067 struct vgascreen *scr = id;
1071 if (scr->cursoron) {
1072 off = scr->cursorrow * scr->type->ncols + scr->cursorcol;
1073 if (scr->active) {
1074 tmp = scr->encoding;
1075 scr->encoding = scr->cursortmp.enc;
1076 if (scr->cursortmp.second)
1077 vga_raster_putchar(id, scr->cursorrow,
1078 scr->cursorcol - 1, scr->cursortmp.ch,
1079 scr->cursortmp.attr);
1081 vga_raster_putchar(id, scr->cursorrow,
1082 scr->cursorcol, scr->cursortmp.ch,
1083 scr->cursortmp.attr);
1084 scr->encoding = tmp;
1088 scr->cursorrow = row;
1089 scr->cursorcol = col;
1091 if ((scr->cursoron = on) == 0)
1094 off = scr->cursorrow * scr->type->ncols + scr->cursorcol;
1095 scr->cursortmp = scr->mem[off];
1096 if (scr->active) {
1097 tmp = scr->encoding;
1098 scr->encoding = scr->cursortmp.enc;
1099 if (scr->cursortmp.second)
1100 vga_raster_putchar(id, scr->cursorrow,
1101 scr->cursorcol - 1, scr->cursortmp.ch,
1102 scr->cursortmp.attr ^ 0x77);
1104 vga_raster_putchar(id, scr->cursorrow,
1105 scr->cursorcol, scr->cursortmp.ch,
1106 scr->cursortmp.attr ^ 0x77);
1107 scr->encoding = tmp;
1114 struct vgascreen *scr = id;
1116 if (scr->encoding == WSDISPLAY_FONTENC_IBM)
1127 struct vgascreen *scr = id;
1132 off = row * scr->type->ncols + col;
1134 if (__predict_false(off >= (scr->type->ncols * scr->type->nrows)))
1137 LIST_FOREACH(fs, &scr->fontset, next) {
1138 if ((scr->encoding == fs->font->encoding) &&
1141 (scr->type->fontheight == fs->font->fontheight)) {
1142 if (scr->active) {
1144 _vga_raster_putchar(scr, row, col, tmp_ch,
1148 scr->mem[off].ch = c;
1149 scr->mem[off].attr = attr;
1150 scr->mem[off].second = 0;
1151 scr->mem[off].enc = fs->font->encoding;
1154 scr->mem[off + 1].ch = c;
1155 scr->mem[off + 1].attr = attr;
1156 scr->mem[off + 1].second = 1;
1157 scr->mem[off + 1].enc = fs->font->encoding;
1167 if (scr->active)
1172 _vga_raster_putchar(scr, row, col, ' ', attr,
1174 scr->mem[off].ch = c;
1175 scr->mem[off].attr = attr;
1176 scr->mem[off].second = 0;
1177 scr->mem[off].enc = scr->encoding;
1184 struct vgascreen *scr = id;
1185 struct vga_handle *vh = scr->hdl;
1190 int fheight = scr->type->fontheight;
1194 rasoff = scr->dispoffset + row * scr->type->ncols * fheight + col;
1210 rasoff += scr->type->ncols;
1223 rasoff2 += scr->type->ncols;
1231 rasoff += scr->type->ncols;
1252 rasoff2 += scr->type->ncols;
1260 struct vgascreen *scr = id;
1261 struct vga_handle *vh = scr->hdl;
1267 int fheight = scr->type->fontheight;
1269 srcoff = row * scr->type->ncols + srccol;
1270 dstoff = row * scr->type->ncols + dstcol;
1271 rassrcoff = scr->dispoffset + row * scr->type->ncols * fheight + srccol;
1272 rasdstoff = scr->dispoffset + row * scr->type->ncols * fheight + dstcol;
1274 memcpy(&scr->mem[dstoff], &scr->mem[srcoff],
1278 if (scr->active) {
1281 rassrcoff + i * scr->type->ncols, memh,
1282 rasdstoff + i * scr->type->ncols, ncols);
1290 struct vgascreen *scr = id;
1293 if (scr->active == 0)
1303 struct vgascreen *scr = id;
1304 struct vga_handle *vh = scr->hdl;
1312 ncols = scr->type->ncols;
1313 fheight = scr->type->fontheight;
1320 if (scr->active) {
1322 if (dstrow == 0 && (srcrow + nrows == scr->type->nrows)) {
1323 int cursoron = scr->cursoron;
1327 vga_raster_cursor(scr, 0,
1328 scr->cursorrow, scr->cursorcol);
1331 if ((scr->dispoffset + srcrow * ncols * fheight)
1332 <= scr->maxdispoffset)
1333 scr->dispoffset += srcrow * ncols * fheight;
1336 scr->dispoffset + rassrcoff,
1337 memh, scr->mindispoffset,
1339 scr->dispoffset = scr->mindispoffset;
1341 vga_6845_write(vh, startadrh, scr->dispoffset >> 8);
1342 vga_6845_write(vh, startadrl, scr->dispoffset);
1346 vga_raster_cursor(scr, 1, scr->cursorrow,
1347 scr->cursorcol);
1350 scr->dispoffset + rassrcoff, memh,
1351 scr->dispoffset + rasdstoff,
1354 memcpy(&scr->mem[dstoff], &scr->mem[srcoff],
1361 struct vgascreen *scr = id;
1362 struct vga_handle *vh = scr->hdl;
1369 off = startrow * scr->type->ncols;
1370 count = nrows * scr->type->ncols;
1371 rasoff = off * scr->type->fontheight;
1372 rascount = count * scr->type->fontheight;
1374 if (scr->active) {
1379 if (scr->type->ncols % 4 == 0) {
1385 scr->dispoffset + i, fill);
1390 scr->dispoffset + i, fill);
1394 scr->mem[off + i].ch = ' ';
1395 scr->mem[off + i].attr = fillattr;
1396 scr->mem[off + i].second = 0;
1397 scr->mem[off + i].enc = scr->encoding;
1404 struct vgascreen *scr = id;
1405 struct vga_config *vc = scr->cfg;
1438 vga_restore_screen(struct vgascreen *scr,
1443 tmp = scr->encoding;
1448 scr->encoding = mem[off].enc;
1449 vga_raster_putchar(scr, i, j, mem[off].ch,
1454 scr->encoding = tmp;
1472 struct vgascreen *scr = id;
1473 const struct wsscreen_descr *type = scr->type;
1477 if (scr->mem[off].attr == oldattr)
1478 scr->mem[off].attr = newattr;
1482 if (scr->active)
1483 vga_restore_screen(scr, type, scr->mem);