Module Name:    src
Committed By:   macallan
Date:           Wed Jan  4 15:56:18 UTC 2012

Modified Files:
        src/sys/dev/pci: r128fb.c radeonfb.c

Log Message:
use WSFONT_GLYPH()


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/r128fb.c
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/radeonfb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/r128fb.c
diff -u src/sys/dev/pci/r128fb.c:1.25 src/sys/dev/pci/r128fb.c:1.26
--- src/sys/dev/pci/r128fb.c:1.25	Wed Jan  4 08:38:20 2012
+++ src/sys/dev/pci/r128fb.c	Wed Jan  4 15:56:18 2012
@@ -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 @@ r128fb_putchar(void *cookie, int row, in
 	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 @@ r128fb_putchar(void *cookie, int row, in
 		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 @@ r128fb_putchar_aa(void *cookie, int row,
 	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 @@ r128fb_putchar_aa(void *cookie, int row,
 		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, 

Index: src/sys/dev/pci/radeonfb.c
diff -u src/sys/dev/pci/radeonfb.c:1.49 src/sys/dev/pci/radeonfb.c:1.50
--- src/sys/dev/pci/radeonfb.c:1.49	Tue Jan  3 00:25:49 2012
+++ src/sys/dev/pci/radeonfb.c	Wed Jan  4 15:56:18 2012
@@ -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_putchar(void *cookie, int row, 
 		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_putchar_aa32(void *cookie, int 
 		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;
 

Reply via email to