Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci use WSFONT_GLYPH()



details:   https://anonhg.NetBSD.org/src/rev/ad0eec4e8615
branches:  trunk
changeset: 772457:ad0eec4e8615
user:      macallan <macallan%NetBSD.org@localhost>
date:      Wed Jan 04 15:56:18 2012 +0000

description:
use WSFONT_GLYPH()

diffstat:

 sys/dev/pci/r128fb.c   |  15 ++++++---------
 sys/dev/pci/radeonfb.c |   8 ++++----
 2 files changed, 10 insertions(+), 13 deletions(-)

diffs (93 lines):

diff -r 894fa6862e36 -r ad0eec4e8615 sys/dev/pci/r128fb.c
--- a/sys/dev/pci/r128fb.c      Wed Jan 04 15:55:35 2012 +0000
+++ b/sys/dev/pci/r128fb.c      Wed Jan 04 15:56:18 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: r128fb.c,v 1.25 2012/01/04 08:38:20 macallan Exp $     */
+/*     $NetBSD: r128fb.c,v 1.26 2012/01/04 15:56:18 macallan Exp $     */
 
 /*
  * Copyright (c) 2007 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: r128fb.c,v 1.25 2012/01/04 08:38:20 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: r128fb.c,v 1.26 2012/01/04 15:56:18 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -825,8 +825,7 @@
        struct r128fb_softc *sc = scr->scr_cookie;
        void *data;
        uint32_t fg, bg;
-       int uc, i;
-       int x, y, wi, he, offset;
+       int i, x, y, wi, he, offset;
 
        if (sc->sc_mode != WSDISPLAYIO_MODE_EMUL) 
                return;
@@ -847,8 +846,7 @@
                return;
        }
 
-       uc = c - font->firstchar;
-       data = (uint8_t *)font->data + uc * ri->ri_fontscale;
+       data = WSFONT_GLYPH(c, font);
 
        r128fb_wait(sc, 8);
 
@@ -926,7 +924,7 @@
        struct vcons_screen *scr = ri->ri_hw;
        struct r128fb_softc *sc = scr->scr_cookie;
        uint32_t bg, latch = 0, bg8, fg8, pixel;
-       int uc, i, x, y, wi, he, r, g, b, aval;
+       int i, x, y, wi, he, r, g, b, aval;
        int r1, g1, b1, r0, g0, b0, fgo, bgo;
        uint8_t *data8;
 
@@ -947,8 +945,7 @@
                return;
        }
 
-       uc = c - font->firstchar;
-       data8 = (uint8_t *)font->data + uc * ri->ri_fontscale;
+       data8 = WSFONT_GLYPH(c, font);
 
        r128fb_wait(sc, 5);
        bus_space_write_4(sc->sc_memt, sc->sc_regh, 
diff -r 894fa6862e36 -r ad0eec4e8615 sys/dev/pci/radeonfb.c
--- a/sys/dev/pci/radeonfb.c    Wed Jan 04 15:55:35 2012 +0000
+++ b/sys/dev/pci/radeonfb.c    Wed Jan 04 15:56:18 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeonfb.c,v 1.49 2012/01/03 00:25:49 macallan Exp $ */
+/*     $NetBSD: radeonfb.c,v 1.50 2012/01/04 15:56:18 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.49 2012/01/03 00:25:49 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.50 2012/01/04 15:56:18 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2432,7 +2432,7 @@
                radeonfb_rectfill(dp, xd, yd, w, h, bg);
                return;
        }
-       data = (uint8_t *)font->data + (c - font->firstchar) * ri->ri_fontscale;
+       data = WSFONT_GLYPH(c, font);
 
        gmc = dp->rd_format << RADEON_GMC_DST_DATATYPE_SHIFT;
 
@@ -2521,7 +2521,7 @@
                radeonfb_rectfill(dp, xd, yd, w, h, bg);
                return;
        }
-       data = (uint8_t *)font->data + (c - font->firstchar) * ri->ri_fontscale;
+       data = WSFONT_GLYPH(c, font);
 
        gmc = dp->rd_format << RADEON_GMC_DST_DATATYPE_SHIFT;
 



Home | Main Index | Thread Index | Old Index