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_compat.h"
36 #include "opt_syscons.h"
38 #include <sys/param.h>
39 #include <sys/systm.h>
41 #include <sys/signalvar.h>
43 #include <sys/kernel.h>
45 #include <sys/consio.h>
46 #include <sys/filedesc.h>
49 #include <sys/mutex.h>
52 #include <dev/fb/fbreg.h>
53 #include <dev/syscons/syscons.h>
55 SET_DECLARE(scrndr_set, const sc_renderer_t);
57 /* for compatibility with previous versions */
58 /* 3.0-RELEASE used the following structure */
59 typedef struct old_video_adapter {
63 /* flag bits are the same as the -CURRENT
64 #define V_ADP_COLOR (1<<0)
65 #define V_ADP_MODECHANGE (1<<1)
66 #define V_ADP_STATESAVE (1<<2)
67 #define V_ADP_STATELOAD (1<<3)
68 #define V_ADP_FONT (1<<4)
69 #define V_ADP_PALETTE (1<<5)
70 #define V_ADP_BORDER (1<<6)
71 #define V_ADP_VESA (1<<7)
74 u_int va_window; /* virtual address */
75 size_t va_window_size;
76 size_t va_window_gran;
77 u_int va_buffer; /* virtual address */
78 size_t va_buffer_size;
80 int va_initial_bios_mode;
82 } old_video_adapter_t;
84 #define OLD_CONS_ADPINFO _IOWR('c', 101, old_video_adapter_t)
86 /* 3.1-RELEASE used the following structure */
87 typedef struct old_video_adapter_info {
98 u_int va_window; /* virtual address */
99 size_t va_window_size;
100 size_t va_window_gran;
102 size_t va_buffer_size;
104 int va_initial_bios_mode;
107 } old_video_adapter_info_t;
109 #define OLD_CONS_ADPINFO2 _IOWR('c', 101, old_video_adapter_info_t)
111 /* 3.0-RELEASE and 3.1-RELEASE used the following structure */
112 typedef struct old_video_info {
115 /* flag bits are the same as the -CURRENT
116 #define V_INFO_COLOR (1<<0)
117 #define V_INFO_GRAPHICS (1<<1)
118 #define V_INFO_LINEAR (1<<2)
119 #define V_INFO_VESA (1<<3)
127 u_int vi_window; /* physical address */
128 size_t vi_window_size;
129 size_t vi_window_gran;
130 u_int vi_buffer; /* physical address */
131 size_t vi_buffer_size;
134 #define OLD_CONS_MODEINFO _IOWR('c', 102, old_video_info_t)
135 #define OLD_CONS_FINDMODE _IOWR('c', 103, old_video_info_t)
138 sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, int xsize, int ysize,
139 int fontsize, int fontwidth)
148 if (vidd_get_info(scp->sc->adp, mode, &info))
151 /* adjust argument values */
153 fontwidth = info.vi_cwidth;
155 fontsize = info.vi_cheight;
158 else if (fontsize >= 16)
162 #ifndef SC_NO_FONT_LOADING
165 if ((scp->sc->fonts_loaded & FONT_8) == 0)
167 font = scp->sc->font_8;
170 if ((scp->sc->fonts_loaded & FONT_14) == 0)
172 font = scp->sc->font_14;
175 if ((scp->sc->fonts_loaded & FONT_16) == 0)
177 font = scp->sc->font_16;
183 if ((xsize <= 0) || (xsize > info.vi_width))
184 xsize = info.vi_width;
185 if ((ysize <= 0) || (ysize > info.vi_height))
186 ysize = info.vi_height;
188 /* stop screen saver, etc */
190 if ((error = sc_clean_up(scp))) {
195 if (sc_render_match(scp, scp->sc->adp->va_name, 0) == NULL) {
201 #ifndef SC_NO_HISTORY
202 if (scp->history != NULL)
205 prev_ysize = scp->ysize;
207 * This is a kludge to fend off scrn_update() while we
208 * muck around with scp. XXX
210 scp->status |= UNKNOWN_MODE | MOUSE_HIDDEN;
211 scp->status &= ~(GRAPHICS_MODE | PIXEL_MODE | MOUSE_VISIBLE);
217 scp->xpixel = scp->xsize*8;
218 scp->ypixel = scp->ysize*fontsize;
220 scp->font_size = fontsize;
221 scp->font_width = fontwidth;
223 /* allocate buffers */
224 sc_alloc_scr_buffer(scp, TRUE, TRUE);
225 sc_init_emulator(scp, NULL);
226 #ifndef SC_NO_CUTPASTE
227 sc_alloc_cut_buffer(scp, FALSE);
229 #ifndef SC_NO_HISTORY
230 sc_alloc_history_buffer(scp, 0, prev_ysize, FALSE);
234 if (scp == scp->sc->cur_scp)
236 scp->status &= ~UNKNOWN_MODE;
240 wsz.ws_col = scp->xsize;
241 wsz.ws_row = scp->ysize;
242 tty_set_winsize(tp, &wsz);
247 sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode)
249 #ifdef SC_NO_MODE_CHANGE
257 if (vidd_get_info(scp->sc->adp, mode, &info))
260 /* stop screen saver, etc */
262 if ((error = sc_clean_up(scp))) {
267 if (sc_render_match(scp, scp->sc->adp->va_name, GRAPHICS_MODE) == NULL) {
273 scp->status |= (UNKNOWN_MODE | GRAPHICS_MODE | MOUSE_HIDDEN);
274 scp->status &= ~(PIXEL_MODE | MOUSE_VISIBLE);
277 * Don't change xsize and ysize; preserve the previous vty
278 * and history buffers.
282 scp->xpixel = info.vi_width;
283 scp->ypixel = info.vi_height;
286 #ifndef SC_NO_SYSMOUSE
287 /* move the mouse cursor at the center of the screen */
288 sc_mouse_move(scp, scp->xpixel / 2, scp->ypixel / 2);
290 sc_init_emulator(scp, NULL);
293 if (scp == scp->sc->cur_scp)
295 /* clear_graphics();*/
296 scp->status &= ~UNKNOWN_MODE;
300 wsz.ws_col = scp->xsize;
301 wsz.ws_row = scp->ysize;
302 tty_set_winsize(tp, &wsz);
304 #endif /* SC_NO_MODE_CHANGE */
308 sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize,
309 int fontsize, int fontwidth)
311 #ifndef SC_PIXEL_MODE
321 if (vidd_get_info(scp->sc->adp, scp->mode, &info))
322 return ENODEV; /* this shouldn't happen */
324 /* adjust argument values */
326 fontsize = info.vi_cheight;
329 else if (fontsize >= 16)
333 #ifndef SC_NO_FONT_LOADING
336 if ((scp->sc->fonts_loaded & FONT_8) == 0)
338 font = scp->sc->font_8;
341 if ((scp->sc->fonts_loaded & FONT_14) == 0)
343 font = scp->sc->font_14;
346 if ((scp->sc->fonts_loaded & FONT_16) == 0)
348 font = scp->sc->font_16;
355 xsize = info.vi_width/8;
357 ysize = info.vi_height/fontsize;
359 if ((info.vi_width < xsize*8) || (info.vi_height < ysize*fontsize))
362 if (!sc_support_pixel_mode(&info))
365 /* stop screen saver, etc */
367 if ((error = sc_clean_up(scp))) {
372 if (sc_render_match(scp, scp->sc->adp->va_name, PIXEL_MODE) == NULL) {
379 (*scp->tsw->te_term)(scp, scp->ts);
385 #ifndef SC_NO_HISTORY
386 if (scp->history != NULL)
389 prev_ysize = scp->ysize;
390 scp->status |= (UNKNOWN_MODE | PIXEL_MODE | MOUSE_HIDDEN);
391 scp->status &= ~(GRAPHICS_MODE | MOUSE_VISIBLE);
394 scp->xoff = (scp->xpixel/8 - xsize)/2;
395 scp->yoff = (scp->ypixel/fontsize - ysize)/2;
397 scp->font_size = fontsize;
398 scp->font_width = fontwidth;
400 /* allocate buffers */
401 sc_alloc_scr_buffer(scp, TRUE, TRUE);
402 sc_init_emulator(scp, NULL);
403 #ifndef SC_NO_CUTPASTE
404 sc_alloc_cut_buffer(scp, FALSE);
406 #ifndef SC_NO_HISTORY
407 sc_alloc_history_buffer(scp, 0, prev_ysize, FALSE);
411 if (scp == scp->sc->cur_scp) {
412 sc_set_border(scp, scp->border);
413 sc_set_cursor_image(scp);
416 scp->status &= ~UNKNOWN_MODE;
420 wsz.ws_col = scp->xsize;
421 wsz.ws_row = scp->ysize;
422 tty_set_winsize(tp, &wsz);
424 #endif /* SC_PIXEL_MODE */
428 sc_support_pixel_mode(void *arg)
431 video_info_t *info = arg;
433 if ((info->vi_flags & V_INFO_GRAPHICS) == 0)
437 * We currently support the following graphic modes:
439 * - 4 bpp planar modes whose memory size does not exceed 64K
440 * - 15, 16, 24 and 32 bpp linear modes
442 switch (info->vi_mem_model) {
443 case V_INFO_MM_PLANAR:
444 if (info->vi_planes != 4)
447 * A memory size >64K requires bank switching to access
448 * the entire screen. XXX
450 if (info->vi_width * info->vi_height / 8 > info->vi_window_size)
453 case V_INFO_MM_DIRECT:
454 if ((info->vi_flags & V_INFO_LINEAR) == 0 &&
455 info->vi_depth != 15 && info->vi_depth != 16 &&
456 info->vi_depth != 24 && info->vi_depth != 32)
459 case V_INFO_MM_PACKED:
460 if ((info->vi_flags & V_INFO_LINEAR) == 0 &&
469 #define fb_ioctl(a, c, d) \
470 (((a) == NULL) ? ENODEV : \
471 vidd_ioctl((a), (c), (caddr_t)(d)))
474 sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td)
477 video_adapter_t *adp;
479 video_adapter_info_t adp_info;
482 #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
483 defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
488 if (scp == NULL) /* tp == SC_MOUSE */
491 if (adp == NULL) /* shouldn't happen??? */
496 case CONS_CURRENTADP: /* get current adapter index */
498 return fb_ioctl(adp, FBIO_ADAPTER, data);
500 case CONS_CURRENT: /* get current adapter type */
502 return fb_ioctl(adp, FBIO_ADPTYPE, data);
504 case OLD_CONS_ADPINFO: /* adapter information (old interface) */
505 if (((old_video_adapter_t *)data)->va_index >= 0) {
506 adp = vid_get_adapter(((old_video_adapter_t *)data)->va_index);
510 ((old_video_adapter_t *)data)->va_index = adp->va_index;
511 ((old_video_adapter_t *)data)->va_type = adp->va_type;
512 ((old_video_adapter_t *)data)->va_flags = adp->va_flags;
513 ((old_video_adapter_t *)data)->va_crtc_addr = adp->va_crtc_addr;
514 ((old_video_adapter_t *)data)->va_window = adp->va_window;
515 ((old_video_adapter_t *)data)->va_window_size = adp->va_window_size;
516 ((old_video_adapter_t *)data)->va_window_gran = adp->va_window_gran;
517 ((old_video_adapter_t *)data)->va_buffer = adp->va_buffer;
518 ((old_video_adapter_t *)data)->va_buffer_size = adp->va_buffer_size;
519 ((old_video_adapter_t *)data)->va_mode = adp->va_mode;
520 ((old_video_adapter_t *)data)->va_initial_mode = adp->va_initial_mode;
521 ((old_video_adapter_t *)data)->va_initial_bios_mode
522 = adp->va_initial_bios_mode;
525 case OLD_CONS_ADPINFO2: /* adapter information (yet another old I/F) */
526 adp_info.va_index = ((old_video_adapter_info_t *)data)->va_index;
527 if (adp_info.va_index >= 0) {
528 adp = vid_get_adapter(adp_info.va_index);
532 error = fb_ioctl(adp, FBIO_ADPINFO, &adp_info);
534 bcopy(&adp_info, data, sizeof(old_video_adapter_info_t));
537 case CONS_ADPINFO: /* adapter information */
539 if (((video_adapter_info_t *)data)->va_index >= 0) {
540 adp = vid_get_adapter(((video_adapter_info_t *)data)->va_index);
544 return fb_ioctl(adp, FBIO_ADPINFO, data);
546 case CONS_GET: /* get current video mode */
548 *(int *)data = scp->mode;
551 #ifndef SC_NO_MODE_CHANGE
552 case FBIO_SETMODE: /* set video mode */
553 if (!(adp->va_flags & V_ADP_MODECHANGE))
555 info.vi_mode = *(int *)data;
556 error = fb_ioctl(adp, FBIO_MODEINFO, &info);
559 if (info.vi_flags & V_INFO_GRAPHICS)
560 return sc_set_graphics_mode(scp, tp, *(int *)data);
562 return sc_set_text_mode(scp, tp, *(int *)data, 0, 0, 0, 0);
563 #endif /* SC_NO_MODE_CHANGE */
565 case OLD_CONS_MODEINFO: /* get mode information (old infterface) */
566 info.vi_mode = ((old_video_info_t *)data)->vi_mode;
567 error = fb_ioctl(adp, FBIO_MODEINFO, &info);
569 bcopy(&info, (old_video_info_t *)data, sizeof(old_video_info_t));
572 case CONS_MODEINFO: /* get mode information */
574 return fb_ioctl(adp, FBIO_MODEINFO, data);
576 case OLD_CONS_FINDMODE: /* find a matching video mode (old interface) */
577 bzero(&info, sizeof(info));
578 bcopy((old_video_info_t *)data, &info, sizeof(old_video_info_t));
579 error = fb_ioctl(adp, FBIO_FINDMODE, &info);
581 bcopy(&info, (old_video_info_t *)data, sizeof(old_video_info_t));
584 case CONS_FINDMODE: /* find a matching video mode */
586 return fb_ioctl(adp, FBIO_FINDMODE, data);
588 #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
589 defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
591 ival = IOCPARM_IVAL(data);
592 data = (caddr_t)&ival;
595 case CONS_SETWINORG: /* set frame buffer window origin */
597 if (scp != scp->sc->cur_scp)
598 return ENODEV; /* XXX */
599 return fb_ioctl(adp, FBIO_SETWINORG, data);
601 case FBIO_GETWINORG: /* get frame buffer window origin */
602 if (scp != scp->sc->cur_scp)
603 return ENODEV; /* XXX */
604 return fb_ioctl(adp, FBIO_GETWINORG, data);
606 case FBIO_GETDISPSTART:
607 case FBIO_SETDISPSTART:
608 case FBIO_GETLINEWIDTH:
609 case FBIO_SETLINEWIDTH:
610 if (scp != scp->sc->cur_scp)
611 return ENODEV; /* XXX */
612 return fb_ioctl(adp, cmd, data);
614 case FBIO_GETPALETTE:
615 case FBIO_SETPALETTE:
627 if (scp != scp->sc->cur_scp)
628 return ENODEV; /* XXX */
629 return fb_ioctl(adp, cmd, data);
632 if (scp != scp->sc->cur_scp)
633 return ENODEV; /* XXX */
634 return fb_ioctl(adp, cmd, data);
636 #ifndef SC_NO_MODE_CHANGE
637 /* generic text modes */
638 case SW_TEXT_80x25: case SW_TEXT_80x30:
639 case SW_TEXT_80x43: case SW_TEXT_80x50:
645 case SW_VGA_C80x25: case SW_VGA_M80x25:
646 case SW_VGA_C80x30: case SW_VGA_M80x30:
647 case SW_VGA_C80x50: case SW_VGA_M80x50:
648 case SW_VGA_C80x60: case SW_VGA_M80x60:
649 case SW_VGA_C90x25: case SW_VGA_M90x25:
650 case SW_VGA_C90x30: case SW_VGA_M90x30:
651 case SW_VGA_C90x43: case SW_VGA_M90x43:
652 case SW_VGA_C90x50: case SW_VGA_M90x50:
653 case SW_VGA_C90x60: case SW_VGA_M90x60:
654 case SW_B40x25: case SW_C40x25:
655 case SW_B80x25: case SW_C80x25:
656 case SW_ENH_B40x25: case SW_ENH_C40x25:
657 case SW_ENH_B80x25: case SW_ENH_C80x25:
658 case SW_ENH_B80x43: case SW_ENH_C80x43:
659 case SW_EGAMONO80x25:
660 if (!(adp->va_flags & V_ADP_MODECHANGE))
662 return sc_set_text_mode(scp, tp, cmd & 0xff, 0, 0, 0, 0);
665 case SW_BG320: case SW_BG640:
666 case SW_CG320: case SW_CG320_D: case SW_CG640_E:
667 case SW_CG640x350: case SW_ENH_CG640:
668 case SW_BG640x480: case SW_CG640x480: case SW_VGA_CG320:
670 if (!(adp->va_flags & V_ADP_MODECHANGE))
672 return sc_set_graphics_mode(scp, tp, cmd & 0xff);
673 #endif /* SC_NO_MODE_CHANGE */
675 #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
676 defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
678 ival = IOCPARM_IVAL(data);
679 data = (caddr_t)&ival;
682 case KDSETMODE: /* set current mode of this (virtual) console */
683 switch (*(int *)data) {
684 case KD_TEXT: /* switch to TEXT (known) mode */
686 * If scp->mode is of graphics modes, we don't know which
687 * text mode to switch back to...
689 if (scp->status & GRAPHICS_MODE)
691 /* restore fonts & palette ! */
693 #ifndef SC_NO_FONT_LOADING
694 if (ISFONTAVAIL(adp->va_flags)
695 && !(scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
698 * Don't load fonts for now... XXX
700 if (scp->sc->fonts_loaded & FONT_8)
701 sc_load_font(scp, 0, 8, 8, scp->sc->font_8, 0, 256);
702 if (scp->sc->fonts_loaded & FONT_14)
703 sc_load_font(scp, 0, 14, 8, scp->sc->font_14, 0, 256);
704 if (scp->sc->fonts_loaded & FONT_16)
705 sc_load_font(scp, 0, 16, 8, scp->sc->font_16, 0, 256);
707 #endif /* SC_NO_FONT_LOADING */
710 #ifndef SC_NO_PALETTE_LOADING
712 if (adp->va_info.vi_mem_model == V_INFO_MM_DIRECT)
713 vidd_load_palette(adp, scp->sc->palette2);
716 vidd_load_palette(adp, scp->sc->palette);
719 /* move hardware cursor out of the way */
720 vidd_set_hw_cursor(adp, -1, -1);
724 case KD_TEXT1: /* switch to TEXT (known) mode */
726 * If scp->mode is of graphics modes, we don't know which
727 * text/pixel mode to switch back to...
729 if (scp->status & GRAPHICS_MODE)
732 if ((error = sc_clean_up(scp))) {
736 scp->status |= UNKNOWN_MODE | MOUSE_HIDDEN;
738 /* no restore fonts & palette */
739 if (scp == scp->sc->cur_scp)
741 sc_clear_screen(scp);
742 scp->status &= ~UNKNOWN_MODE;
746 case KD_PIXEL: /* pixel (raster) display */
747 if (!(scp->status & (GRAPHICS_MODE | PIXEL_MODE)))
749 if (scp->status & GRAPHICS_MODE)
750 return sc_set_pixel_mode(scp, tp, scp->xsize, scp->ysize,
751 scp->font_size, scp->font_width);
753 if ((error = sc_clean_up(scp))) {
757 scp->status |= (UNKNOWN_MODE | PIXEL_MODE | MOUSE_HIDDEN);
759 if (scp == scp->sc->cur_scp) {
761 #ifndef SC_NO_PALETTE_LOADING
762 if (adp->va_info.vi_mem_model == V_INFO_MM_DIRECT)
763 vidd_load_palette(adp, scp->sc->palette2);
765 vidd_load_palette(adp, scp->sc->palette);
768 sc_clear_screen(scp);
769 scp->status &= ~UNKNOWN_MODE;
771 #endif /* SC_PIXEL_MODE */
773 case KD_GRAPHICS: /* switch to GRAPHICS (unknown) mode */
775 if ((error = sc_clean_up(scp))) {
779 scp->status |= UNKNOWN_MODE | MOUSE_HIDDEN;
789 case KDRASTER: /* set pixel (raster) display mode */
790 if (ISUNKNOWNSC(scp) || ISTEXTSC(scp))
792 return sc_set_pixel_mode(scp, tp, ((int *)data)[0], ((int *)data)[1],
793 ((int *)data)[2], 8);
794 #endif /* SC_PIXEL_MODE */
796 case KDGETMODE: /* get current mode of this (virtual) console */
798 * From the user program's point of view, KD_PIXEL is the same
801 *data = ISGRAPHSC(scp) ? KD_GRAPHICS : KD_TEXT;
804 #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
805 defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
807 ival = IOCPARM_IVAL(data);
808 data = (caddr_t)&ival;
811 case KDSBORDER: /* set border color of this (virtual) console */
812 scp->border = *(int *)data;
813 if (scp == scp->sc->cur_scp)
814 sc_set_border(scp, scp->border);
821 static LIST_HEAD(, sc_renderer) sc_rndr_list =
822 LIST_HEAD_INITIALIZER(sc_rndr_list);
825 sc_render_add(sc_renderer_t *rndr)
827 LIST_INSERT_HEAD(&sc_rndr_list, rndr, link);
832 sc_render_remove(sc_renderer_t *rndr)
835 LIST_REMOVE(rndr, link);
837 return EBUSY; /* XXX */
841 *sc_render_match(scr_stat *scp, char *name, int mode)
843 const sc_renderer_t **list;
844 const sc_renderer_t *p;
846 if (!LIST_EMPTY(&sc_rndr_list)) {
847 LIST_FOREACH(p, &sc_rndr_list, link) {
848 if ((strcmp(p->name, name) == 0)
849 && (mode == p->mode)) {
851 ~(VR_CURSOR_ON | VR_CURSOR_BLINK);
856 SET_FOREACH(list, scrndr_set) {
858 if ((strcmp(p->name, name) == 0)
859 && (mode == p->mode)) {
861 ~(VR_CURSOR_ON | VR_CURSOR_BLINK);