2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
7 * This code is derived from software contributed to The DragonFly Project
8 * by Sascha Wildner <saw@online.de>
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer as
15 * the first lines of this file unmodified.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #include <sys/cdefs.h>
33 __FBSDID("$FreeBSD$");
35 #include "opt_syscons.h"
37 #include <sys/param.h>
38 #include <sys/systm.h>
40 #include <sys/signalvar.h>
42 #include <sys/kernel.h>
44 #include <sys/consio.h>
45 #include <sys/filedesc.h>
48 #include <sys/mutex.h>
51 #include <dev/fb/fbreg.h>
52 #include <dev/syscons/syscons.h>
54 SET_DECLARE(scrndr_set, const sc_renderer_t);
56 /* for compatibility with previous versions */
57 /* 3.0-RELEASE used the following structure */
58 typedef struct old_video_adapter {
62 /* flag bits are the same as the -CURRENT
63 #define V_ADP_COLOR (1<<0)
64 #define V_ADP_MODECHANGE (1<<1)
65 #define V_ADP_STATESAVE (1<<2)
66 #define V_ADP_STATELOAD (1<<3)
67 #define V_ADP_FONT (1<<4)
68 #define V_ADP_PALETTE (1<<5)
69 #define V_ADP_BORDER (1<<6)
70 #define V_ADP_VESA (1<<7)
73 u_int va_window; /* virtual address */
74 size_t va_window_size;
75 size_t va_window_gran;
76 u_int va_buffer; /* virtual address */
77 size_t va_buffer_size;
79 int va_initial_bios_mode;
81 } old_video_adapter_t;
83 #define OLD_CONS_ADPINFO _IOWR('c', 101, old_video_adapter_t)
85 /* 3.1-RELEASE used the following structure */
86 typedef struct old_video_adapter_info {
97 u_int va_window; /* virtual address */
98 size_t va_window_size;
99 size_t va_window_gran;
101 size_t va_buffer_size;
103 int va_initial_bios_mode;
106 } old_video_adapter_info_t;
108 #define OLD_CONS_ADPINFO2 _IOWR('c', 101, old_video_adapter_info_t)
110 /* 3.0-RELEASE and 3.1-RELEASE used the following structure */
111 typedef struct old_video_info {
114 /* flag bits are the same as the -CURRENT
115 #define V_INFO_COLOR (1<<0)
116 #define V_INFO_GRAPHICS (1<<1)
117 #define V_INFO_LINEAR (1<<2)
118 #define V_INFO_VESA (1<<3)
126 u_int vi_window; /* physical address */
127 size_t vi_window_size;
128 size_t vi_window_gran;
129 u_int vi_buffer; /* physical address */
130 size_t vi_buffer_size;
133 #define OLD_CONS_MODEINFO _IOWR('c', 102, old_video_info_t)
134 #define OLD_CONS_FINDMODE _IOWR('c', 103, old_video_info_t)
137 sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, int xsize, int ysize,
138 int fontsize, int fontwidth)
147 if (vidd_get_info(scp->sc->adp, mode, &info))
150 /* adjust argument values */
152 fontwidth = info.vi_cwidth;
154 fontsize = info.vi_cheight;
157 else if (fontsize >= 16)
161 #ifndef SC_NO_FONT_LOADING
164 if ((scp->sc->fonts_loaded & FONT_8) == 0)
166 font = scp->sc->font_8;
169 if ((scp->sc->fonts_loaded & FONT_14) == 0)
171 font = scp->sc->font_14;
174 if ((scp->sc->fonts_loaded & FONT_16) == 0)
176 font = scp->sc->font_16;
182 if ((xsize <= 0) || (xsize > info.vi_width))
183 xsize = info.vi_width;
184 if ((ysize <= 0) || (ysize > info.vi_height))
185 ysize = info.vi_height;
187 /* stop screen saver, etc */
189 if ((error = sc_clean_up(scp))) {
194 if (sc_render_match(scp, scp->sc->adp->va_name, 0) == NULL) {
200 #ifndef SC_NO_HISTORY
201 if (scp->history != NULL)
204 prev_ysize = scp->ysize;
206 * This is a kludge to fend off scrn_update() while we
207 * muck around with scp. XXX
209 scp->status |= UNKNOWN_MODE | MOUSE_HIDDEN;
210 scp->status &= ~(GRAPHICS_MODE | PIXEL_MODE | MOUSE_VISIBLE);
216 scp->xpixel = scp->xsize*8;
217 scp->ypixel = scp->ysize*fontsize;
219 scp->font_size = fontsize;
220 scp->font_width = fontwidth;
222 /* allocate buffers */
223 sc_alloc_scr_buffer(scp, TRUE, TRUE);
224 sc_init_emulator(scp, NULL);
225 #ifndef SC_NO_CUTPASTE
226 sc_alloc_cut_buffer(scp, FALSE);
228 #ifndef SC_NO_HISTORY
229 sc_alloc_history_buffer(scp, 0, prev_ysize, FALSE);
233 if (scp == scp->sc->cur_scp)
235 scp->status &= ~UNKNOWN_MODE;
239 wsz.ws_col = scp->xsize;
240 wsz.ws_row = scp->ysize;
241 tty_set_winsize(tp, &wsz);
246 sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode)
248 #ifdef SC_NO_MODE_CHANGE
256 if (vidd_get_info(scp->sc->adp, mode, &info))
259 /* stop screen saver, etc */
261 if ((error = sc_clean_up(scp))) {
266 if (sc_render_match(scp, scp->sc->adp->va_name, GRAPHICS_MODE) == NULL) {
272 scp->status |= (UNKNOWN_MODE | GRAPHICS_MODE | MOUSE_HIDDEN);
273 scp->status &= ~(PIXEL_MODE | MOUSE_VISIBLE);
276 * Don't change xsize and ysize; preserve the previous vty
277 * and history buffers.
281 scp->xpixel = info.vi_width;
282 scp->ypixel = info.vi_height;
285 #ifndef SC_NO_SYSMOUSE
286 /* move the mouse cursor at the center of the screen */
287 sc_mouse_move(scp, scp->xpixel / 2, scp->ypixel / 2);
289 sc_init_emulator(scp, NULL);
292 if (scp == scp->sc->cur_scp)
294 /* clear_graphics();*/
295 scp->status &= ~UNKNOWN_MODE;
299 wsz.ws_col = scp->xsize;
300 wsz.ws_row = scp->ysize;
301 tty_set_winsize(tp, &wsz);
303 #endif /* SC_NO_MODE_CHANGE */
307 sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize,
308 int fontsize, int fontwidth)
310 #ifndef SC_PIXEL_MODE
320 if (vidd_get_info(scp->sc->adp, scp->mode, &info))
321 return ENODEV; /* this shouldn't happen */
323 /* adjust argument values */
325 fontsize = info.vi_cheight;
328 else if (fontsize >= 16)
332 #ifndef SC_NO_FONT_LOADING
335 if ((scp->sc->fonts_loaded & FONT_8) == 0)
337 font = scp->sc->font_8;
340 if ((scp->sc->fonts_loaded & FONT_14) == 0)
342 font = scp->sc->font_14;
345 if ((scp->sc->fonts_loaded & FONT_16) == 0)
347 font = scp->sc->font_16;
354 xsize = info.vi_width/8;
356 ysize = info.vi_height/fontsize;
358 if ((info.vi_width < xsize*8) || (info.vi_height < ysize*fontsize))
361 if (!sc_support_pixel_mode(&info))
364 /* stop screen saver, etc */
366 if ((error = sc_clean_up(scp))) {
371 if (sc_render_match(scp, scp->sc->adp->va_name, PIXEL_MODE) == NULL) {
378 (*scp->tsw->te_term)(scp, scp->ts);
384 #ifndef SC_NO_HISTORY
385 if (scp->history != NULL)
388 prev_ysize = scp->ysize;
389 scp->status |= (UNKNOWN_MODE | PIXEL_MODE | MOUSE_HIDDEN);
390 scp->status &= ~(GRAPHICS_MODE | MOUSE_VISIBLE);
393 scp->xoff = (scp->xpixel/8 - xsize)/2;
394 scp->yoff = (scp->ypixel/fontsize - ysize)/2;
396 scp->font_size = fontsize;
397 scp->font_width = fontwidth;
399 /* allocate buffers */
400 sc_alloc_scr_buffer(scp, TRUE, TRUE);
401 sc_init_emulator(scp, NULL);
402 #ifndef SC_NO_CUTPASTE
403 sc_alloc_cut_buffer(scp, FALSE);
405 #ifndef SC_NO_HISTORY
406 sc_alloc_history_buffer(scp, 0, prev_ysize, FALSE);
410 if (scp == scp->sc->cur_scp) {
411 sc_set_border(scp, scp->border);
412 sc_set_cursor_image(scp);
415 scp->status &= ~UNKNOWN_MODE;
419 wsz.ws_col = scp->xsize;
420 wsz.ws_row = scp->ysize;
421 tty_set_winsize(tp, &wsz);
423 #endif /* SC_PIXEL_MODE */
427 sc_support_pixel_mode(void *arg)
430 video_info_t *info = arg;
432 if ((info->vi_flags & V_INFO_GRAPHICS) == 0)
436 * We currently support the following graphic modes:
438 * - 4 bpp planar modes whose memory size does not exceed 64K
439 * - 15, 16, 24 and 32 bpp linear modes
441 switch (info->vi_mem_model) {
442 case V_INFO_MM_PLANAR:
443 if (info->vi_planes != 4)
446 * A memory size >64K requires bank switching to access
447 * the entire screen. XXX
449 if (info->vi_width * info->vi_height / 8 > info->vi_window_size)
452 case V_INFO_MM_DIRECT:
453 if ((info->vi_flags & V_INFO_LINEAR) == 0 &&
454 info->vi_depth != 15 && info->vi_depth != 16 &&
455 info->vi_depth != 24 && info->vi_depth != 32)
458 case V_INFO_MM_PACKED:
459 if ((info->vi_flags & V_INFO_LINEAR) == 0 &&
468 #define fb_ioctl(a, c, d) \
469 (((a) == NULL) ? ENODEV : \
470 vidd_ioctl((a), (c), (caddr_t)(d)))
473 sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td)
476 video_adapter_t *adp;
478 video_adapter_info_t adp_info;
481 #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
482 defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
487 if (scp == NULL) /* tp == SC_MOUSE */
490 if (adp == NULL) /* shouldn't happen??? */
495 case CONS_CURRENTADP: /* get current adapter index */
497 return fb_ioctl(adp, FBIO_ADAPTER, data);
499 case CONS_CURRENT: /* get current adapter type */
501 return fb_ioctl(adp, FBIO_ADPTYPE, data);
503 case OLD_CONS_ADPINFO: /* adapter information (old interface) */
504 if (((old_video_adapter_t *)data)->va_index >= 0) {
505 adp = vid_get_adapter(((old_video_adapter_t *)data)->va_index);
509 ((old_video_adapter_t *)data)->va_index = adp->va_index;
510 ((old_video_adapter_t *)data)->va_type = adp->va_type;
511 ((old_video_adapter_t *)data)->va_flags = adp->va_flags;
512 ((old_video_adapter_t *)data)->va_crtc_addr = adp->va_crtc_addr;
513 ((old_video_adapter_t *)data)->va_window = adp->va_window;
514 ((old_video_adapter_t *)data)->va_window_size = adp->va_window_size;
515 ((old_video_adapter_t *)data)->va_window_gran = adp->va_window_gran;
516 ((old_video_adapter_t *)data)->va_buffer = adp->va_buffer;
517 ((old_video_adapter_t *)data)->va_buffer_size = adp->va_buffer_size;
518 ((old_video_adapter_t *)data)->va_mode = adp->va_mode;
519 ((old_video_adapter_t *)data)->va_initial_mode = adp->va_initial_mode;
520 ((old_video_adapter_t *)data)->va_initial_bios_mode
521 = adp->va_initial_bios_mode;
524 case OLD_CONS_ADPINFO2: /* adapter information (yet another old I/F) */
525 adp_info.va_index = ((old_video_adapter_info_t *)data)->va_index;
526 if (adp_info.va_index >= 0) {
527 adp = vid_get_adapter(adp_info.va_index);
531 error = fb_ioctl(adp, FBIO_ADPINFO, &adp_info);
533 bcopy(&adp_info, data, sizeof(old_video_adapter_info_t));
536 case CONS_ADPINFO: /* adapter information */
538 if (((video_adapter_info_t *)data)->va_index >= 0) {
539 adp = vid_get_adapter(((video_adapter_info_t *)data)->va_index);
543 return fb_ioctl(adp, FBIO_ADPINFO, data);
545 case CONS_GET: /* get current video mode */
547 *(int *)data = scp->mode;
550 #ifndef SC_NO_MODE_CHANGE
551 case FBIO_SETMODE: /* set video mode */
552 if (!(adp->va_flags & V_ADP_MODECHANGE))
554 info.vi_mode = *(int *)data;
555 error = fb_ioctl(adp, FBIO_MODEINFO, &info);
558 if (info.vi_flags & V_INFO_GRAPHICS)
559 return sc_set_graphics_mode(scp, tp, *(int *)data);
561 return sc_set_text_mode(scp, tp, *(int *)data, 0, 0, 0, 0);
562 #endif /* SC_NO_MODE_CHANGE */
564 case OLD_CONS_MODEINFO: /* get mode information (old infterface) */
565 info.vi_mode = ((old_video_info_t *)data)->vi_mode;
566 error = fb_ioctl(adp, FBIO_MODEINFO, &info);
568 bcopy(&info, (old_video_info_t *)data, sizeof(old_video_info_t));
571 case CONS_MODEINFO: /* get mode information */
573 return fb_ioctl(adp, FBIO_MODEINFO, data);
575 case OLD_CONS_FINDMODE: /* find a matching video mode (old interface) */
576 bzero(&info, sizeof(info));
577 bcopy((old_video_info_t *)data, &info, sizeof(old_video_info_t));
578 error = fb_ioctl(adp, FBIO_FINDMODE, &info);
580 bcopy(&info, (old_video_info_t *)data, sizeof(old_video_info_t));
583 case CONS_FINDMODE: /* find a matching video mode */
585 return fb_ioctl(adp, FBIO_FINDMODE, data);
587 #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
588 defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
590 ival = IOCPARM_IVAL(data);
591 data = (caddr_t)&ival;
594 case CONS_SETWINORG: /* set frame buffer window origin */
596 if (scp != scp->sc->cur_scp)
597 return ENODEV; /* XXX */
598 return fb_ioctl(adp, FBIO_SETWINORG, data);
600 case FBIO_GETWINORG: /* get frame buffer window origin */
601 if (scp != scp->sc->cur_scp)
602 return ENODEV; /* XXX */
603 return fb_ioctl(adp, FBIO_GETWINORG, data);
605 case FBIO_GETDISPSTART:
606 case FBIO_SETDISPSTART:
607 case FBIO_GETLINEWIDTH:
608 case FBIO_SETLINEWIDTH:
609 if (scp != scp->sc->cur_scp)
610 return ENODEV; /* XXX */
611 return fb_ioctl(adp, cmd, data);
613 case FBIO_GETPALETTE:
614 case FBIO_SETPALETTE:
626 if (scp != scp->sc->cur_scp)
627 return ENODEV; /* XXX */
628 return fb_ioctl(adp, cmd, data);
631 if (scp != scp->sc->cur_scp)
632 return ENODEV; /* XXX */
633 return fb_ioctl(adp, cmd, data);
635 #ifndef SC_NO_MODE_CHANGE
636 /* generic text modes */
637 case SW_TEXT_80x25: case SW_TEXT_80x30:
638 case SW_TEXT_80x43: case SW_TEXT_80x50:
644 case SW_VGA_C80x25: case SW_VGA_M80x25:
645 case SW_VGA_C80x30: case SW_VGA_M80x30:
646 case SW_VGA_C80x50: case SW_VGA_M80x50:
647 case SW_VGA_C80x60: case SW_VGA_M80x60:
648 case SW_VGA_C90x25: case SW_VGA_M90x25:
649 case SW_VGA_C90x30: case SW_VGA_M90x30:
650 case SW_VGA_C90x43: case SW_VGA_M90x43:
651 case SW_VGA_C90x50: case SW_VGA_M90x50:
652 case SW_VGA_C90x60: case SW_VGA_M90x60:
653 case SW_B40x25: case SW_C40x25:
654 case SW_B80x25: case SW_C80x25:
655 case SW_ENH_B40x25: case SW_ENH_C40x25:
656 case SW_ENH_B80x25: case SW_ENH_C80x25:
657 case SW_ENH_B80x43: case SW_ENH_C80x43:
658 case SW_EGAMONO80x25:
659 if (!(adp->va_flags & V_ADP_MODECHANGE))
661 return sc_set_text_mode(scp, tp, cmd & 0xff, 0, 0, 0, 0);
664 case SW_BG320: case SW_BG640:
665 case SW_CG320: case SW_CG320_D: case SW_CG640_E:
666 case SW_CG640x350: case SW_ENH_CG640:
667 case SW_BG640x480: case SW_CG640x480: case SW_VGA_CG320:
669 if (!(adp->va_flags & V_ADP_MODECHANGE))
671 return sc_set_graphics_mode(scp, tp, cmd & 0xff);
672 #endif /* SC_NO_MODE_CHANGE */
674 #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
675 defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
677 ival = IOCPARM_IVAL(data);
678 data = (caddr_t)&ival;
681 case KDSETMODE: /* set current mode of this (virtual) console */
682 switch (*(int *)data) {
683 case KD_TEXT: /* switch to TEXT (known) mode */
685 * If scp->mode is of graphics modes, we don't know which
686 * text mode to switch back to...
688 if (scp->status & GRAPHICS_MODE)
690 /* restore fonts & palette ! */
692 #ifndef SC_NO_FONT_LOADING
693 if (ISFONTAVAIL(adp->va_flags)
694 && !(scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
697 * Don't load fonts for now... XXX
699 if (scp->sc->fonts_loaded & FONT_8)
700 sc_load_font(scp, 0, 8, 8, scp->sc->font_8, 0, 256);
701 if (scp->sc->fonts_loaded & FONT_14)
702 sc_load_font(scp, 0, 14, 8, scp->sc->font_14, 0, 256);
703 if (scp->sc->fonts_loaded & FONT_16)
704 sc_load_font(scp, 0, 16, 8, scp->sc->font_16, 0, 256);
706 #endif /* SC_NO_FONT_LOADING */
709 #ifndef SC_NO_PALETTE_LOADING
711 if (adp->va_info.vi_mem_model == V_INFO_MM_DIRECT)
712 vidd_load_palette(adp, scp->sc->palette2);
715 vidd_load_palette(adp, scp->sc->palette);
718 /* move hardware cursor out of the way */
719 vidd_set_hw_cursor(adp, -1, -1);
723 case KD_TEXT1: /* switch to TEXT (known) mode */
725 * If scp->mode is of graphics modes, we don't know which
726 * text/pixel mode to switch back to...
728 if (scp->status & GRAPHICS_MODE)
731 if ((error = sc_clean_up(scp))) {
735 scp->status |= UNKNOWN_MODE | MOUSE_HIDDEN;
737 /* no restore fonts & palette */
738 if (scp == scp->sc->cur_scp)
740 sc_clear_screen(scp);
741 scp->status &= ~UNKNOWN_MODE;
745 case KD_PIXEL: /* pixel (raster) display */
746 if (!(scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
748 if (scp->status & GRAPHICS_MODE)
749 return sc_set_pixel_mode(scp, tp, scp->xsize, scp->ysize,
750 scp->font_size, scp->font_width);
752 if ((error = sc_clean_up(scp))) {
756 scp->status |= (UNKNOWN_MODE | PIXEL_MODE | MOUSE_HIDDEN);
758 if (scp == scp->sc->cur_scp) {
760 #ifndef SC_NO_PALETTE_LOADING
761 if (adp->va_info.vi_mem_model == V_INFO_MM_DIRECT)
762 vidd_load_palette(adp, scp->sc->palette2);
764 vidd_load_palette(adp, scp->sc->palette);
767 sc_clear_screen(scp);
768 scp->status &= ~UNKNOWN_MODE;
770 #endif /* SC_PIXEL_MODE */
772 case KD_GRAPHICS: /* switch to GRAPHICS (unknown) mode */
774 if ((error = sc_clean_up(scp))) {
778 scp->status |= UNKNOWN_MODE | MOUSE_HIDDEN;
788 case KDRASTER: /* set pixel (raster) display mode */
789 if (ISUNKNOWNSC(scp) || ISTEXTSC(scp))
791 return sc_set_pixel_mode(scp, tp, ((int *)data)[0], ((int *)data)[1],
792 ((int *)data)[2], 8);
793 #endif /* SC_PIXEL_MODE */
795 case KDGETMODE: /* get current mode of this (virtual) console */
797 * From the user program's point of view, KD_PIXEL is the same
800 *data = ISGRAPHSC(scp) ? KD_GRAPHICS : KD_TEXT;
803 #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
804 defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
806 ival = IOCPARM_IVAL(data);
807 data = (caddr_t)&ival;
810 case KDSBORDER: /* set border color of this (virtual) console */
811 scp->border = *(int *)data;
812 if (scp == scp->sc->cur_scp)
813 sc_set_border(scp, scp->border);
820 static LIST_HEAD(, sc_renderer) sc_rndr_list =
821 LIST_HEAD_INITIALIZER(sc_rndr_list);
824 sc_render_add(sc_renderer_t *rndr)
826 LIST_INSERT_HEAD(&sc_rndr_list, rndr, link);
831 sc_render_remove(sc_renderer_t *rndr)
834 LIST_REMOVE(rndr, link);
836 return EBUSY; /* XXX */
840 *sc_render_match(scr_stat *scp, char *name, int mode)
842 const sc_renderer_t **list;
843 const sc_renderer_t *p;
845 if (!LIST_EMPTY(&sc_rndr_list)) {
846 LIST_FOREACH(p, &sc_rndr_list, link) {
847 if ((strcmp(p->name, name) == 0)
848 && (mode == p->mode)) {
850 ~(VR_CURSOR_ON | VR_CURSOR_BLINK);
855 SET_FOREACH(list, scrndr_set) {
857 if ((strcmp(p->name, name) == 0)
858 && (mode == p->mode)) {
860 ~(VR_CURSOR_ON | VR_CURSOR_BLINK);