Lines Matching +full:mode +full:- +full:xxx
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
55 /* 3.0-RELEASE used the following structure */
60 /* flag bits are the same as the -CURRENT
83 /* 3.1-RELEASE used the following structure */
108 /* 3.0-RELEASE and 3.1-RELEASE used the following structure */
112 /* flag bits are the same as the -CURRENT
135 sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, int xsize, int ysize, in sc_set_text_mode() argument
147 if (vidd_get_info(scp->sc->adp, mode, &info)) in sc_set_text_mode()
164 if ((scp->sc->fonts_loaded & FONT_8) == 0) in sc_set_text_mode()
166 font = scp->sc->font_8; in sc_set_text_mode()
169 if ((scp->sc->fonts_loaded & FONT_14) == 0) in sc_set_text_mode()
171 font = scp->sc->font_14; in sc_set_text_mode()
174 if ((scp->sc->fonts_loaded & FONT_16) == 0) in sc_set_text_mode()
176 font = scp->sc->font_16; in sc_set_text_mode()
194 if (sc_render_match(scp, scp->sc->adp->va_name, 0) == NULL) { in sc_set_text_mode()
201 if (scp->history != NULL) in sc_set_text_mode()
203 prev_ysize = scp->ysize; in sc_set_text_mode()
207 * muck around with scp. XXX in sc_set_text_mode()
209 scp->status |= UNKNOWN_MODE | MOUSE_HIDDEN; in sc_set_text_mode()
210 scp->status &= ~(GRAPHICS_MODE | PIXEL_MODE | MOUSE_VISIBLE); in sc_set_text_mode()
211 scp->mode = mode; in sc_set_text_mode()
212 scp->xsize = xsize; in sc_set_text_mode()
213 scp->ysize = ysize; in sc_set_text_mode()
214 scp->xoff = 0; in sc_set_text_mode()
215 scp->yoff = 0; in sc_set_text_mode()
216 scp->xpixel = scp->xsize*8; in sc_set_text_mode()
217 scp->ypixel = scp->ysize*fontsize; in sc_set_text_mode()
218 scp->font = font; in sc_set_text_mode()
219 scp->font_size = fontsize; in sc_set_text_mode()
220 scp->font_width = fontwidth; in sc_set_text_mode()
233 if (scp == scp->sc->cur_scp) in sc_set_text_mode()
235 scp->status &= ~UNKNOWN_MODE; in sc_set_text_mode()
239 wsz.ws_col = scp->xsize; in sc_set_text_mode()
240 wsz.ws_row = scp->ysize; in sc_set_text_mode()
246 sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode) in sc_set_graphics_mode() argument
256 if (vidd_get_info(scp->sc->adp, mode, &info)) in sc_set_graphics_mode()
266 if (sc_render_match(scp, scp->sc->adp->va_name, GRAPHICS_MODE) == NULL) { in sc_set_graphics_mode()
272 scp->status |= (UNKNOWN_MODE | GRAPHICS_MODE | MOUSE_HIDDEN); in sc_set_graphics_mode()
273 scp->status &= ~(PIXEL_MODE | MOUSE_VISIBLE); in sc_set_graphics_mode()
274 scp->mode = mode; in sc_set_graphics_mode()
279 scp->xoff = 0; in sc_set_graphics_mode()
280 scp->yoff = 0; in sc_set_graphics_mode()
281 scp->xpixel = info.vi_width; in sc_set_graphics_mode()
282 scp->ypixel = info.vi_height; in sc_set_graphics_mode()
283 scp->font = NULL; in sc_set_graphics_mode()
284 scp->font_size = 0; in sc_set_graphics_mode()
287 sc_mouse_move(scp, scp->xpixel / 2, scp->ypixel / 2); in sc_set_graphics_mode()
292 if (scp == scp->sc->cur_scp) in sc_set_graphics_mode()
295 scp->status &= ~UNKNOWN_MODE; in sc_set_graphics_mode()
299 wsz.ws_col = scp->xsize; in sc_set_graphics_mode()
300 wsz.ws_row = scp->ysize; in sc_set_graphics_mode()
322 if (vidd_get_info(scp->sc->adp, scp->mode, &info)) in sc_set_pixel_mode()
337 if ((scp->sc->fonts_loaded & FONT_8) == 0) in sc_set_pixel_mode()
339 font = scp->sc->font_8; in sc_set_pixel_mode()
342 if ((scp->sc->fonts_loaded & FONT_14) == 0) in sc_set_pixel_mode()
344 font = scp->sc->font_14; in sc_set_pixel_mode()
347 if ((scp->sc->fonts_loaded & FONT_16) == 0) in sc_set_pixel_mode()
349 font = scp->sc->font_16; in sc_set_pixel_mode()
373 if (sc_render_match(scp, scp->sc->adp->va_name, PIXEL_MODE) == NULL) { in sc_set_pixel_mode()
379 if (scp->tsw) in sc_set_pixel_mode()
380 (*scp->tsw->te_term)(scp, scp->ts); in sc_set_pixel_mode()
381 scp->tsw = NULL; in sc_set_pixel_mode()
382 scp->ts = NULL; in sc_set_pixel_mode()
387 if (scp->history != NULL) in sc_set_pixel_mode()
389 prev_ysize = scp->ysize; in sc_set_pixel_mode()
391 scp->status |= (UNKNOWN_MODE | PIXEL_MODE | MOUSE_HIDDEN); in sc_set_pixel_mode()
392 scp->status &= ~(GRAPHICS_MODE | MOUSE_VISIBLE); in sc_set_pixel_mode()
393 scp->xsize = xsize; in sc_set_pixel_mode()
394 scp->ysize = ysize; in sc_set_pixel_mode()
395 scp->xoff = (scp->xpixel/8 - xsize)/2; in sc_set_pixel_mode()
396 scp->yoff = (scp->ypixel/fontsize - ysize)/2; in sc_set_pixel_mode()
397 scp->font = font; in sc_set_pixel_mode()
398 scp->font_size = fontsize; in sc_set_pixel_mode()
399 scp->font_width = fontwidth; in sc_set_pixel_mode()
412 if (scp == scp->sc->cur_scp) { in sc_set_pixel_mode()
413 sc_set_border(scp, scp->border); in sc_set_pixel_mode()
417 scp->status &= ~UNKNOWN_MODE; in sc_set_pixel_mode()
421 wsz.ws_col = scp->xsize; in sc_set_pixel_mode()
422 wsz.ws_row = scp->ysize; in sc_set_pixel_mode()
434 if ((info->vi_flags & V_INFO_GRAPHICS) == 0) in sc_support_pixel_mode()
440 * - 4 bpp planar modes whose memory size does not exceed 64K in sc_support_pixel_mode()
441 * - 15, 16, 24 and 32 bpp linear modes in sc_support_pixel_mode()
443 switch (info->vi_mem_model) { in sc_support_pixel_mode()
445 if (info->vi_planes != 4) in sc_support_pixel_mode()
449 * the entire screen. XXX in sc_support_pixel_mode()
451 if (info->vi_width * info->vi_height / 8 > info->vi_window_size) in sc_support_pixel_mode()
455 if ((info->vi_flags & V_INFO_LINEAR) == 0 && in sc_support_pixel_mode()
456 info->vi_depth != 15 && info->vi_depth != 16 && in sc_support_pixel_mode()
457 info->vi_depth != 24 && info->vi_depth != 32) in sc_support_pixel_mode()
461 if ((info->vi_flags & V_INFO_LINEAR) == 0 && in sc_support_pixel_mode()
462 info->vi_depth != 8) in sc_support_pixel_mode()
491 adp = scp->sc->adp; in sc_vid_ioctl()
505 if (((old_video_adapter_t *)data)->va_index >= 0) { in sc_vid_ioctl()
506 adp = vid_get_adapter(((old_video_adapter_t *)data)->va_index); in sc_vid_ioctl()
510 ((old_video_adapter_t *)data)->va_index = adp->va_index; in sc_vid_ioctl()
511 ((old_video_adapter_t *)data)->va_type = adp->va_type; in sc_vid_ioctl()
512 ((old_video_adapter_t *)data)->va_flags = adp->va_flags; in sc_vid_ioctl()
513 ((old_video_adapter_t *)data)->va_crtc_addr = adp->va_crtc_addr; in sc_vid_ioctl()
514 ((old_video_adapter_t *)data)->va_window = adp->va_window; in sc_vid_ioctl()
515 ((old_video_adapter_t *)data)->va_window_size = adp->va_window_size; in sc_vid_ioctl()
516 ((old_video_adapter_t *)data)->va_window_gran = adp->va_window_gran; in sc_vid_ioctl()
517 ((old_video_adapter_t *)data)->va_buffer = adp->va_buffer; in sc_vid_ioctl()
518 ((old_video_adapter_t *)data)->va_buffer_size = adp->va_buffer_size; in sc_vid_ioctl()
519 ((old_video_adapter_t *)data)->va_mode = adp->va_mode; in sc_vid_ioctl()
520 ((old_video_adapter_t *)data)->va_initial_mode = adp->va_initial_mode; in sc_vid_ioctl()
521 ((old_video_adapter_t *)data)->va_initial_bios_mode in sc_vid_ioctl()
522 = adp->va_initial_bios_mode; in sc_vid_ioctl()
526 adp_info.va_index = ((old_video_adapter_info_t *)data)->va_index; in sc_vid_ioctl()
539 if (((video_adapter_info_t *)data)->va_index >= 0) { in sc_vid_ioctl()
540 adp = vid_get_adapter(((video_adapter_info_t *)data)->va_index); in sc_vid_ioctl()
546 case CONS_GET: /* get current video mode */ in sc_vid_ioctl()
548 *(int *)data = scp->mode; in sc_vid_ioctl()
552 case FBIO_SETMODE: /* set video mode */ in sc_vid_ioctl()
553 if (!(adp->va_flags & V_ADP_MODECHANGE)) in sc_vid_ioctl()
565 case OLD_CONS_MODEINFO: /* get mode information (old infterface) */ in sc_vid_ioctl()
566 info.vi_mode = ((old_video_info_t *)data)->vi_mode; in sc_vid_ioctl()
572 case CONS_MODEINFO: /* get mode information */ in sc_vid_ioctl()
576 case OLD_CONS_FINDMODE: /* find a matching video mode (old interface) */ in sc_vid_ioctl()
584 case CONS_FINDMODE: /* find a matching video mode */ in sc_vid_ioctl()
597 if (scp != scp->sc->cur_scp) in sc_vid_ioctl()
598 return ENODEV; /* XXX */ in sc_vid_ioctl()
602 if (scp != scp->sc->cur_scp) in sc_vid_ioctl()
603 return ENODEV; /* XXX */ in sc_vid_ioctl()
610 if (scp != scp->sc->cur_scp) in sc_vid_ioctl()
611 return ENODEV; /* XXX */ in sc_vid_ioctl()
619 if (scp != scp->sc->cur_scp) in sc_vid_ioctl()
620 return ENODEV; /* XXX */ in sc_vid_ioctl()
624 if (scp != scp->sc->cur_scp) in sc_vid_ioctl()
625 return ENODEV; /* XXX */ in sc_vid_ioctl()
652 if (!(adp->va_flags & V_ADP_MODECHANGE)) in sc_vid_ioctl()
662 if (!(adp->va_flags & V_ADP_MODECHANGE)) in sc_vid_ioctl()
674 case KDSETMODE: /* set current mode of this (virtual) console */ in sc_vid_ioctl()
676 case KD_TEXT: /* switch to TEXT (known) mode */ in sc_vid_ioctl()
678 * If scp->mode is of graphics modes, we don't know which in sc_vid_ioctl()
679 * text mode to switch back to... in sc_vid_ioctl()
681 if (scp->status & GRAPHICS_MODE) in sc_vid_ioctl()
686 if (ISFONTAVAIL(adp->va_flags) in sc_vid_ioctl()
687 && !(scp->status & (GRAPHICS_MODE | PIXEL_MODE))) in sc_vid_ioctl()
690 * Don't load fonts for now... XXX in sc_vid_ioctl()
692 if (scp->sc->fonts_loaded & FONT_8) in sc_vid_ioctl()
693 sc_load_font(scp, 0, 8, 8, scp->sc->font_8, 0, 256); in sc_vid_ioctl()
694 if (scp->sc->fonts_loaded & FONT_14) in sc_vid_ioctl()
695 sc_load_font(scp, 0, 14, 8, scp->sc->font_14, 0, 256); in sc_vid_ioctl()
696 if (scp->sc->fonts_loaded & FONT_16) in sc_vid_ioctl()
697 sc_load_font(scp, 0, 16, 8, scp->sc->font_16, 0, 256); in sc_vid_ioctl()
704 if (adp->va_info.vi_mem_model == V_INFO_MM_DIRECT) in sc_vid_ioctl()
705 vidd_load_palette(adp, scp->sc->palette2); in sc_vid_ioctl()
708 vidd_load_palette(adp, scp->sc->palette); in sc_vid_ioctl()
712 vidd_set_hw_cursor(adp, -1, -1); in sc_vid_ioctl()
716 case KD_TEXT1: /* switch to TEXT (known) mode */ in sc_vid_ioctl()
718 * If scp->mode is of graphics modes, we don't know which in sc_vid_ioctl()
719 * text/pixel mode to switch back to... in sc_vid_ioctl()
721 if (scp->status & GRAPHICS_MODE) in sc_vid_ioctl()
728 scp->status |= UNKNOWN_MODE | MOUSE_HIDDEN; in sc_vid_ioctl()
731 if (scp == scp->sc->cur_scp) in sc_vid_ioctl()
734 scp->status &= ~UNKNOWN_MODE; in sc_vid_ioctl()
739 if (!(scp->status & (GRAPHICS_MODE | PIXEL_MODE))) in sc_vid_ioctl()
741 if (scp->status & GRAPHICS_MODE) in sc_vid_ioctl()
742 return sc_set_pixel_mode(scp, tp, scp->xsize, scp->ysize, in sc_vid_ioctl()
743 scp->font_size, scp->font_width); in sc_vid_ioctl()
749 scp->status |= (UNKNOWN_MODE | PIXEL_MODE | MOUSE_HIDDEN); in sc_vid_ioctl()
751 if (scp == scp->sc->cur_scp) { in sc_vid_ioctl()
754 if (adp->va_info.vi_mem_model == V_INFO_MM_DIRECT) in sc_vid_ioctl()
755 vidd_load_palette(adp, scp->sc->palette2); in sc_vid_ioctl()
757 vidd_load_palette(adp, scp->sc->palette); in sc_vid_ioctl()
761 scp->status &= ~UNKNOWN_MODE; in sc_vid_ioctl()
765 case KD_GRAPHICS: /* switch to GRAPHICS (unknown) mode */ in sc_vid_ioctl()
771 scp->status |= UNKNOWN_MODE | MOUSE_HIDDEN; in sc_vid_ioctl()
781 case KDRASTER: /* set pixel (raster) display mode */ in sc_vid_ioctl()
788 case KDGETMODE: /* get current mode of this (virtual) console */ in sc_vid_ioctl()
804 scp->border = *(int *)data; in sc_vid_ioctl()
805 if (scp == scp->sc->cur_scp) in sc_vid_ioctl()
806 sc_set_border(scp, scp->border); in sc_vid_ioctl()
829 return EBUSY; /* XXX */ in sc_render_remove()
833 *sc_render_match(scr_stat *scp, char *name, int mode) in sc_render_match() argument
840 if ((strcmp(p->name, name) == 0) in sc_render_match()
841 && (mode == p->mode)) { in sc_render_match()
842 scp->status &= in sc_render_match()
844 return p->rndrsw; in sc_render_match()
850 if ((strcmp(p->name, name) == 0) in sc_render_match()
851 && (mode == p->mode)) { in sc_render_match()
852 scp->status &= in sc_render_match()
854 return p->rndrsw; in sc_render_match()