diff options
Diffstat (limited to 'sys/dev/ic')
| -rw-r--r-- | sys/dev/ic/pcdisplay_subr.c | 43 | ||||
| -rw-r--r-- | sys/dev/ic/pcdisplayvar.h | 3 | ||||
| -rw-r--r-- | sys/dev/ic/vga.c | 23 |
3 files changed, 58 insertions, 11 deletions
diff --git a/sys/dev/ic/pcdisplay_subr.c b/sys/dev/ic/pcdisplay_subr.c index 74213f967bf..86ca0daf48f 100644 --- a/sys/dev/ic/pcdisplay_subr.c +++ b/sys/dev/ic/pcdisplay_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: pcdisplay_subr.c,v 1.26 2004/05/28 21:42:29 christos Exp $ */ +/* $NetBSD: pcdisplay_subr.c,v 1.27 2004/07/28 12:34:04 jmmv Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -28,7 +28,10 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pcdisplay_subr.c,v 1.26 2004/05/28 21:42:29 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pcdisplay_subr.c,v 1.27 2004/07/28 12:34:04 jmmv Exp $"); + +#include "opt_wsdisplay_compat.h" /* for WSDISPLAY_CHARFUNCS */ +#include "opt_wsmsgattrs.h" /* for WSDISPLAY_CUSTOM_OUTPUT */ #include <sys/param.h> #include <sys/systm.h> @@ -41,8 +44,6 @@ __KERNEL_RCSID(0, "$NetBSD: pcdisplay_subr.c,v 1.26 2004/05/28 21:42:29 christos #include <dev/wscons/wsdisplayvar.h> -#include "opt_wsdisplay_compat.h" /* for WSDISPLAY_CHARFUNCS */ - void pcdisplay_cursor_init(scr, existing) struct pcdisplayscreen *scr; @@ -278,6 +279,40 @@ pcdisplay_eraserows(id, startrow, nrows, fillattr) scr->mem[off + i] = val; } +#ifdef WSDISPLAY_CUSTOM_OUTPUT +void +pcdisplay_replaceattr(id, oldattr, newattr) + void *id; + long oldattr, newattr; +{ + struct pcdisplayscreen *scr = id; + bus_space_tag_t memt = scr->hdl->ph_memt; + bus_space_handle_t memh = scr->hdl->ph_memh; + int off; + uint16_t chardata; + + if (scr->active) + for (off = 0; off < scr->type->nrows * scr->type->ncols; + off++) { + chardata = bus_space_read_2(memt, memh, + scr->dispoffset + off * 2); + if ((long)(chardata >> 8) == oldattr) + bus_space_write_2(memt, memh, + scr->dispoffset + off * 2, + ((u_int16_t)(newattr << 8)) | + (chardata & 0x00FF)); + } + else + for (off = 0; off < scr->type->nrows * scr->type->ncols; + off++) { + chardata = scr->mem[off]; + if ((long)(chardata >> 8) == oldattr) + scr->mem[off] = ((u_int16_t)(newattr << 8)) | + (chardata & 0x00FF); + } +} +#endif /* WSDISPLAY_CUSTOM_OUTPUT */ + #ifdef WSDISPLAY_CHARFUNCS int pcdisplay_getwschar(id, wschar) diff --git a/sys/dev/ic/pcdisplayvar.h b/sys/dev/ic/pcdisplayvar.h index 28ac8e6215f..11415421a71 100644 --- a/sys/dev/ic/pcdisplayvar.h +++ b/sys/dev/ic/pcdisplayvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: pcdisplayvar.h,v 1.13 2004/05/28 21:42:29 christos Exp $ */ +/* $NetBSD: pcdisplayvar.h,v 1.14 2004/07/28 12:34:04 jmmv Exp $ */ /* * Copyright (c) 1998 @@ -88,6 +88,7 @@ void pcdisplay_copycols(void *, int, int, int,int); void pcdisplay_erasecols(void *, int, int, int, long); void pcdisplay_copyrows(void *, int, int, int); void pcdisplay_eraserows(void *, int, int, long); +void pcdisplay_replaceattr(void *, long, long); struct wsdisplay_char; int pcdisplay_getwschar(void *, struct wsdisplay_char *); int pcdisplay_putwschar(void *, struct wsdisplay_char *); diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c index f4e3cb87555..9fd61a19a5f 100644 --- a/sys/dev/ic/vga.c +++ b/sys/dev/ic/vga.c @@ -1,4 +1,4 @@ -/* $NetBSD: vga.c,v 1.74 2004/05/29 02:04:56 christos Exp $ */ +/* $NetBSD: vga.c,v 1.75 2004/07/28 12:34:04 jmmv Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -27,8 +27,13 @@ * rights to redistribute these changes. */ +/* for WSCONS_SUPPORT_PCVTFONTS and WSDISPLAY_CHARFUNCS */ +#include "opt_wsdisplay_compat.h" +/* for WSDISPLAY_CUSTOM_OUTPUT */ +#include "opt_wsmsgattrs.h" + #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vga.c,v 1.74 2004/05/29 02:04:56 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vga.c,v 1.75 2004/07/28 12:34:04 jmmv Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -51,9 +56,6 @@ __KERNEL_RCSID(0, "$NetBSD: vga.c,v 1.74 2004/05/29 02:04:56 christos Exp $"); #include <dev/ic/pcdisplay.h> -/* for WSCONS_SUPPORT_PCVTFONTS and WSDISPLAY_CHARFUNCS */ -#include "opt_wsdisplay_compat.h" - int vga_no_builtinfont = 0; static struct wsdisplay_font _vga_builtinfont = { @@ -134,7 +136,12 @@ const struct wsdisplay_emulops vga_emulops = { pcdisplay_erasecols, vga_copyrows, pcdisplay_eraserows, - vga_allocattr + vga_allocattr, +#ifdef WSDISPLAY_CUSTOM_OUTPUT + pcdisplay_replaceattr, +#else + NULL, +#endif }; /* @@ -476,6 +483,10 @@ vga_init_screen(struct vga_config *vc, struct vgascreen *scr, if (!vc->hdl.vh_mono) /* * DEC firmware uses a blue background. + * XXX These should be specified as kernel options for + * XXX alpha only, not hardcoded here (which is wrong + * XXX anyway because the emulation layer will assume + * XXX the default attribute is white on black). */ res = vga_allocattr(scr, WSCOL_WHITE, WSCOL_BLUE, WSATTR_WSCOLORS, attrp); |
