summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2009-06-01 18:21:52 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2009-06-01 18:21:52 +0000
commit2d1386bf8aee8631a47cac75965392ee2b922f08 (patch)
tree5bf89cd6997396fd2e307d847673f7b7263e1dd8
parent9102ff44839e51594a4cf2a6e2fe087e9e556422 (diff)
Use the background color attribute in udl_erasecols and udl_eraserows
instead hardcoding ``0x0000''.
-rw-r--r--sys/dev/usb/udl.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/usb/udl.c b/sys/dev/usb/udl.c
index b318a8926f2..f2c3a0f5acd 100644
--- a/sys/dev/usb/udl.c
+++ b/sys/dev/usb/udl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udl.c,v 1.17 2009/06/01 18:07:55 mglocker Exp $ */
+/* $OpenBSD: udl.c,v 1.18 2009/06/01 18:21:51 mglocker Exp $ */
/*
* Copyright (c) 2009 Marcus Glocker <mglocker@openbsd.org>
@@ -534,6 +534,7 @@ udl_erasecols(void *cookie, int row, int col, int num, long attr)
{
struct rasops_info *ri = cookie;
struct udl_softc *sc = ri->ri_hw;
+ uint16_t bgc;
int fg, bg;
int x, y, cx, cy;
@@ -543,13 +544,14 @@ udl_erasecols(void *cookie, int row, int col, int num, long attr)
DN(sc), FUNC, row, col, num);
sc->sc_ri.ri_ops.unpack_attr(cookie, attr, &fg, &bg, NULL);
+ bgc = (uint16_t)sc->sc_ri.ri_devcmap[bg];
x = col * sc->sc_ri.ri_font->fontwidth;
y = row * sc->sc_ri.ri_font->fontheight;
cx = num * sc->sc_ri.ri_font->fontwidth;
cy = sc->sc_ri.ri_font->fontheight;
- udl_fb_block_write(sc, 0x0000, x, y, cx, cy);
+ udl_fb_block_write(sc, bgc, x, y, cx, cy);
(void)udl_cmd_send_async(sc);
}
@@ -559,18 +561,23 @@ udl_eraserows(void *cookie, int row, int num, long attr)
{
struct rasops_info *ri = cookie;
struct udl_softc *sc;
+ uint16_t bgc;
+ int fg, bg;
int x, y, cx, cy;
sc = ri->ri_hw;
DPRINTF(2, "%s: %s: row=%d, num=%d\n", DN(sc), FUNC, row, num);
+ sc->sc_ri.ri_ops.unpack_attr(cookie, attr, &fg, &bg, NULL);
+ bgc = (uint16_t)sc->sc_ri.ri_devcmap[bg];
+
x = 0;
y = row * sc->sc_ri.ri_font->fontheight;
cx = sc->sc_ri.ri_emuwidth;
cy = num * sc->sc_ri.ri_font->fontheight;
- udl_fb_block_write(sc, 0x0000, x, y, cx, cy);
+ udl_fb_block_write(sc, bgc, x, y, cx, cy);
(void)udl_cmd_send_async(sc);
}