summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/sparc/dev/p9000.c4
-rw-r--r--sys/arch/sparc/dev/p9100.c7
-rw-r--r--sys/arch/sparc/dev/zx.c8
-rw-r--r--sys/dev/sbus/zx.c8
4 files changed, 17 insertions, 10 deletions
diff --git a/sys/arch/sparc/dev/p9000.c b/sys/arch/sparc/dev/p9000.c
index add708c2e8f..0e21f72607a 100644
--- a/sys/arch/sparc/dev/p9000.c
+++ b/sys/arch/sparc/dev/p9000.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: p9000.c,v 1.17 2006/11/29 19:08:22 miod Exp $ */
+/* $OpenBSD: p9000.c,v 1.18 2006/12/02 11:24:02 miod Exp $ */
/*
* Copyright (c) 2003, Miodrag Vallat.
@@ -686,7 +686,7 @@ p9000_ras_do_cursor(struct rasops_info *ri)
P9000_SELECT_DE_LOW(sc);
P9000_WRITE_CMD(sc, P9000_DE_RASTER,
(P9000_RASTER_PATTERN ^ P9000_RASTER_DST) & P9000_RASTER_MASK);
- P9000_WRITE_CMD(sc, P9000_DE_FG_COLOR, WSCOL_BLACK);
+ P9000_WRITE_CMD(sc, P9000_DE_FG_COLOR, ri->ri_devcmap[WSCOL_BLACK]);
P9000_SELECT_COORD(sc, P9000_LC_RECT);
P9000_WRITE_CMD(sc, P9000_LC_RECT + P9000_COORD_XY,
diff --git a/sys/arch/sparc/dev/p9100.c b/sys/arch/sparc/dev/p9100.c
index 793e4d3e08d..066241abeb3 100644
--- a/sys/arch/sparc/dev/p9100.c
+++ b/sys/arch/sparc/dev/p9100.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: p9100.c,v 1.40 2006/11/29 19:08:22 miod Exp $ */
+/* $OpenBSD: p9100.c,v 1.41 2006/12/02 11:24:02 miod Exp $ */
/*
* Copyright (c) 2003, 2005, Miodrag Vallat.
@@ -715,6 +715,7 @@ p9100_ras_erasecols(void *v, int row, int col, int n, long int attr)
int fg, bg;
ri->ri_ops.unpack_attr(v, attr, &fg, &bg, NULL);
+ bg = ri->ri_devcmap[bg];
n *= ri->ri_font->fontwidth;
col *= ri->ri_font->fontwidth;
@@ -747,6 +748,7 @@ p9100_ras_eraserows(void *v, int row, int n, long int attr)
int fg, bg;
ri->ri_ops.unpack_attr(v, attr, &fg, &bg, NULL);
+ bg = ri->ri_devcmap[bg];
p9100_drain(sc);
P9100_SELECT_DE_LOW(sc);
@@ -790,7 +792,8 @@ p9100_ras_do_cursor(struct rasops_info *ri)
P9100_SELECT_DE_LOW(sc);
P9100_WRITE_CMD(sc, P9000_DE_RASTER,
(P9100_RASTER_PATTERN ^ P9100_RASTER_DST) & P9100_RASTER_MASK);
- P9100_WRITE_CMD(sc, P9100_DE_COLOR0, P9100_COLOR8(WSCOL_BLACK));
+ P9100_WRITE_CMD(sc, P9100_DE_COLOR0,
+ P9100_COLOR8(ri->ri_devcmap[WSCOL_BLACK]));
P9100_SELECT_COORD(sc, P9000_LC_RECT);
P9100_WRITE_CMD(sc, P9000_LC_RECT + P9000_COORD_XY,
diff --git a/sys/arch/sparc/dev/zx.c b/sys/arch/sparc/dev/zx.c
index d792a6aa3a3..3deb53f5aeb 100644
--- a/sys/arch/sparc/dev/zx.c
+++ b/sys/arch/sparc/dev/zx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zx.c,v 1.16 2006/11/29 19:08:22 miod Exp $ */
+/* $OpenBSD: zx.c,v 1.17 2006/12/02 11:24:02 miod Exp $ */
/* $NetBSD: zx.c,v 1.5 2002/10/02 16:52:46 thorpej Exp $ */
/*
@@ -566,7 +566,7 @@ zx_fillrect(struct rasops_info *ri, int x, int y, int w, int h, long attr,
;
SETREG(zd->zd_rop, rop);
- SETREG(zd->zd_fg, bg << 24);
+ SETREG(zd->zd_fg, ri->ri_devcmap[bg] << 24);
SETREG(zc->zc_extent, ZX_COORDS(w, h));
SETREG(zc->zc_fill, ZX_COORDS(x, y) | ZX_EXTENT_DIR_BACKWARDS);
}
@@ -650,7 +650,7 @@ zx_eraserows(void *cookie, int row, int num, long attr)
;
SETREG(zd->zd_rop, ZX_STD_ROP);
- SETREG(zd->zd_fg, bg << 24);
+ SETREG(zd->zd_fg, ri->ri_devcmap[bg] << 24);
SETREG(zc->zc_extent,
ZX_COORDS(ri->ri_width - 1, ri->ri_height - 1));
SETREG(zc->zc_fill, ZX_COORDS(0, 0) | ZX_EXTENT_DIR_BACKWARDS);
@@ -693,6 +693,8 @@ zx_putchar(void *cookie, int row, int col, u_int uc, long attr)
ri = (struct rasops_info *)cookie;
font = ri->ri_font;
ri->ri_ops.unpack_attr(cookie, attr, &fg, &bg, &ul);
+ fg = ri->ri_devcmap[fg];
+ bg = ri->ri_devcmap[bg];
dp = (volatile u_int32_t *)ri->ri_bits +
ZX_COORDS(col * font->fontwidth, row * font->fontheight);
diff --git a/sys/dev/sbus/zx.c b/sys/dev/sbus/zx.c
index 73776e4c8c8..66da5f319ae 100644
--- a/sys/dev/sbus/zx.c
+++ b/sys/dev/sbus/zx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zx.c,v 1.9 2006/11/29 19:08:23 miod Exp $ */
+/* $OpenBSD: zx.c,v 1.10 2006/12/02 11:24:04 miod Exp $ */
/* $NetBSD: zx.c,v 1.5 2002/10/02 16:52:46 thorpej Exp $ */
/*
@@ -625,7 +625,7 @@ zx_fillrect(struct rasops_info *ri, int x, int y, int w, int h, long attr,
;
SETREG(zd->zd_rop, rop);
- SETREG(zd->zd_fg, bg << 24);
+ SETREG(zd->zd_fg, ri->ri_devcmap[bg] << 24);
SETREG(zc->zc_extent, ZX_COORDS(w, h));
SETREG(zc->zc_fill, ZX_COORDS(x, y) | ZX_EXTENT_DIR_BACKWARDS);
}
@@ -709,7 +709,7 @@ zx_eraserows(void *cookie, int row, int num, long attr)
;
SETREG(zd->zd_rop, ZX_STD_ROP);
- SETREG(zd->zd_fg, bg << 24);
+ SETREG(zd->zd_fg, ri->ri_devcmap[bg] << 24);
SETREG(zc->zc_extent,
ZX_COORDS(ri->ri_width - 1, ri->ri_height - 1));
SETREG(zc->zc_fill, ZX_COORDS(0, 0) | ZX_EXTENT_DIR_BACKWARDS);
@@ -752,6 +752,8 @@ zx_putchar(void *cookie, int row, int col, u_int uc, long attr)
ri = (struct rasops_info *)cookie;
font = ri->ri_font;
ri->ri_ops.unpack_attr(cookie, attr, &fg, &bg, &ul);
+ fg = ri->ri_devcmap[fg];
+ bg = ri->ri_devcmap[bg];
dp = (volatile u_int32_t *)ri->ri_bits +
ZX_COORDS(col * font->fontwidth, row * font->fontheight);