summaryrefslogtreecommitdiff
path: root/sys/dev/isa/pcdisplay.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-11-29 19:08:24 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-11-29 19:08:24 +0000
commitf1383d2d04a9e6ec1da4df59ac0ff1478bb10f9b (patch)
tree512b51f4e326e33ded20210f85a3a55fcc606db9 /sys/dev/isa/pcdisplay.c
parent1b439ba33ce246b10f77ec8ccd4790e890966526 (diff)
Add an unpack_attr function to struct wsdisplay_emulops, to match the
existing alloc_attr function. This allows rasops_unpack_attr to be kept private to rasops, yet available to the screen drivers.
Diffstat (limited to 'sys/dev/isa/pcdisplay.c')
-rw-r--r--sys/dev/isa/pcdisplay.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/sys/dev/isa/pcdisplay.c b/sys/dev/isa/pcdisplay.c
index d39d4316ada..3a35f1fe1b7 100644
--- a/sys/dev/isa/pcdisplay.c
+++ b/sys/dev/isa/pcdisplay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcdisplay.c,v 1.8 2006/11/29 12:13:54 miod Exp $ */
+/* $OpenBSD: pcdisplay.c,v 1.9 2006/11/29 19:08:22 miod Exp $ */
/* $NetBSD: pcdisplay.c,v 1.9.4.1 2000/06/30 16:27:48 simonb Exp $ */
/*
@@ -71,6 +71,7 @@ static void pcdisplay_init(struct pcdisplay_config *,
bus_space_tag_t, bus_space_tag_t,
int);
static int pcdisplay_alloc_attr(void *, int, int, int, long *);
+static void pcdisplay_unpack_attr(void *, long, int *, int *, int *);
struct cfattach pcdisplay_ca = {
sizeof(struct pcdisplay_softc), pcdisplay_match, pcdisplay_attach,
@@ -84,7 +85,8 @@ const struct wsdisplay_emulops pcdisplay_emulops = {
pcdisplay_erasecols,
pcdisplay_copyrows,
pcdisplay_eraserows,
- pcdisplay_alloc_attr
+ pcdisplay_alloc_attr,
+ pcdisplay_unpack_attr
};
const struct wsscreen_descr pcdisplay_scr = {
@@ -416,6 +418,23 @@ pcdisplay_alloc_attr(id, fg, bg, flags, attrp)
return (0);
}
+static void
+pcdisplay_unpack_attr(id, attr, fg, bg, ul)
+ void *id;
+ long attr;
+ int *fg, *bg, *ul;
+{
+ if (attr == (FG_BLACK | BG_LIGHTGREY)) {
+ *fg = WSCOL_BLACK;
+ *bg = WSCOL_WHITE;
+ } else {
+ *fg = WSCOL_WHITE;
+ *bg = WSCOL_BLACK;
+ }
+ if (ul != NULL)
+ *ul = 0;
+}
+
struct cfdriver pcdisplay_cd = {
NULL, "pcdisplay", DV_DULL
};