diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-12-02 11:21:38 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-12-02 11:21:38 +0000 |
commit | 47be3564bc984482f5c3dcbe44140cce633080b0 (patch) | |
tree | 7dac97fbecf3a19d465911142b6a6b52b67c2095 /sys/arch | |
parent | 64a0a540b73ef8900580779dbd17f6717358d14d (diff) |
Use the unpack_attr emulops instead of doing an inline rasops_unpack_attr.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc/dev/cgsix.c | 12 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/creator.c | 10 |
2 files changed, 16 insertions, 6 deletions
diff --git a/sys/arch/sparc/dev/cgsix.c b/sys/arch/sparc/dev/cgsix.c index 8257445aacb..ed52176a230 100644 --- a/sys/arch/sparc/dev/cgsix.c +++ b/sys/arch/sparc/dev/cgsix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgsix.c,v 1.35 2006/07/25 21:23:30 miod Exp $ */ +/* $OpenBSD: cgsix.c,v 1.36 2006/12/02 11:21:35 miod Exp $ */ /* $NetBSD: cgsix.c,v 1.33 1997/08/07 19:12:30 pk Exp $ */ /* @@ -643,6 +643,7 @@ cgsix_ras_erasecols(void *cookie, int row, int col, int n, long attr) struct rasops_info *ri = cookie; struct cgsix_softc *sc = ri->ri_hw; volatile struct cgsix_fbc *fbc = sc->sc_fbc; + int fg, bg; if ((row < 0) || (row >= ri->ri_rows)) return; @@ -658,6 +659,8 @@ cgsix_ras_erasecols(void *cookie, int row, int col, int n, long attr) col *= ri->ri_font->fontwidth; row *= ri->ri_font->fontheight; + ri->ri_ops.unpack_attr(cookie, attr, &fg, &bg, NULL); + fbc->fbc_clip = 0; fbc->fbc_s = 0; fbc->fbc_offx = 0; @@ -667,7 +670,7 @@ cgsix_ras_erasecols(void *cookie, int row, int col, int n, long attr) fbc->fbc_clipmaxx = ri->ri_width - 1; fbc->fbc_clipmaxy = ri->ri_height - 1; fbc->fbc_alu = FBC_ALU_FILL; - fbc->fbc_fg = ri->ri_devcmap[(attr >> 16) & 0xf]; + fbc->fbc_fg = ri->ri_devcmap[bg]; fbc->fbc_arecty = ri->ri_yorigin + row; fbc->fbc_arectx = ri->ri_xorigin + col; fbc->fbc_arecty = ri->ri_yorigin + row + ri->ri_font->fontheight - 1; @@ -682,6 +685,7 @@ cgsix_ras_eraserows(void *cookie, int row, int n, long attr) struct rasops_info *ri = cookie; struct cgsix_softc *sc = ri->ri_hw; volatile struct cgsix_fbc *fbc = sc->sc_fbc; + int fg, bg; if (row < 0) { n += row; @@ -692,6 +696,8 @@ cgsix_ras_eraserows(void *cookie, int row, int n, long attr) if (n <= 0) return; + ri->ri_ops.unpack_attr(cookie, attr, &fg, &bg, NULL); + fbc->fbc_clip = 0; fbc->fbc_s = 0; fbc->fbc_offx = 0; @@ -701,7 +707,7 @@ cgsix_ras_eraserows(void *cookie, int row, int n, long attr) fbc->fbc_clipmaxx = ri->ri_width - 1; fbc->fbc_clipmaxy = ri->ri_height - 1; fbc->fbc_alu = FBC_ALU_FILL; - fbc->fbc_fg = ri->ri_devcmap[(attr >> 16) & 0xf]; + fbc->fbc_fg = ri->ri_devcmap[bg]; if ((n == ri->ri_rows) && (ri->ri_flg & RI_FULLCLEAR)) { fbc->fbc_arecty = 0; fbc->fbc_arectx = 0; diff --git a/sys/arch/sparc64/dev/creator.c b/sys/arch/sparc64/dev/creator.c index d384c338537..c52ca61496e 100644 --- a/sys/arch/sparc64/dev/creator.c +++ b/sys/arch/sparc64/dev/creator.c @@ -1,4 +1,4 @@ -/* $OpenBSD: creator.c,v 1.36 2006/06/30 21:38:19 miod Exp $ */ +/* $OpenBSD: creator.c,v 1.37 2006/12/02 11:21:37 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -620,6 +620,7 @@ creator_ras_eraserows(cookie, row, n, attr) { struct rasops_info *ri = cookie; struct creator_softc *sc = ri->ri_hw; + int bg, fg; if (row < 0) { n += row; @@ -630,8 +631,9 @@ creator_ras_eraserows(cookie, row, n, attr) if (n <= 0) return; + ri->ri_ops.unpack_attr(cookie, attr, &fg, &bg, NULL); creator_ras_fill(sc); - creator_ras_setfg(sc, ri->ri_devcmap[(attr >> 16) & 0xf]); + creator_ras_setfg(sc, ri->ri_devcmap[bg]); creator_ras_fifo_wait(sc, 4); if ((n == ri->ri_rows) && (ri->ri_flg & RI_FULLCLEAR)) { FBC_WRITE(sc, FFB_FBC_BY, 0); @@ -656,6 +658,7 @@ creator_ras_erasecols(cookie, row, col, n, attr) { struct rasops_info *ri = cookie; struct creator_softc *sc = ri->ri_hw; + int fg, bg; if ((row < 0) || (row >= ri->ri_rows)) return; @@ -671,8 +674,9 @@ creator_ras_erasecols(cookie, row, col, n, attr) col *= ri->ri_font->fontwidth; row *= ri->ri_font->fontheight; + ri->ri_ops.unpack_attr(cookie, attr, &fg, &bg, NULL); creator_ras_fill(sc); - creator_ras_setfg(sc, ri->ri_devcmap[(attr >> 16) & 0xf]); + creator_ras_setfg(sc, ri->ri_devcmap[bg]); creator_ras_fifo_wait(sc, 4); FBC_WRITE(sc, FFB_FBC_BY, ri->ri_yorigin + row); FBC_WRITE(sc, FFB_FBC_BX, ri->ri_xorigin + col); |