Module Name: src Committed By: tsutsui Date: Thu Feb 10 11:08:24 UTC 2011
Modified Files: src/sys/arch/hp300/stand/common: ite_dv.c ite_gb.c ite_hy.c ite_rb.c ite_subr.c ite_tc.c itevar.h Log Message: Move and renamve hyper_ite_fontinit() to ite_fontinit1bpp() to share it among all monochrome framebuffers. Also rename ite_fontinit() to ite_fontinit8bpp(). From OpenBSD. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hp300/stand/common/ite_dv.c \ src/sys/arch/hp300/stand/common/ite_gb.c \ src/sys/arch/hp300/stand/common/ite_subr.c \ src/sys/arch/hp300/stand/common/ite_tc.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hp300/stand/common/ite_hy.c \ src/sys/arch/hp300/stand/common/itevar.h cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hp300/stand/common/ite_rb.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/arch/hp300/stand/common/ite_dv.c diff -u src/sys/arch/hp300/stand/common/ite_dv.c:1.8 src/sys/arch/hp300/stand/common/ite_dv.c:1.9 --- src/sys/arch/hp300/stand/common/ite_dv.c:1.8 Tue Feb 8 20:20:14 2011 +++ src/sys/arch/hp300/stand/common/ite_dv.c Thu Feb 10 11:08:23 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ite_dv.c,v 1.8 2011/02/08 20:20:14 rmind Exp $ */ +/* $NetBSD: ite_dv.c,v 1.9 2011/02/10 11:08:23 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -115,7 +115,7 @@ db_waitbusy(regbase); ite_fontinfo(ip); - ite_fontinit(ip); + ite_fontinit8bpp(ip); /* * Clear the (visible) framebuffer. Index: src/sys/arch/hp300/stand/common/ite_gb.c diff -u src/sys/arch/hp300/stand/common/ite_gb.c:1.8 src/sys/arch/hp300/stand/common/ite_gb.c:1.9 --- src/sys/arch/hp300/stand/common/ite_gb.c:1.8 Tue Feb 8 20:20:14 2011 +++ src/sys/arch/hp300/stand/common/ite_gb.c Thu Feb 10 11:08:23 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ite_gb.c,v 1.8 2011/02/08 20:20:14 rmind Exp $ */ +/* $NetBSD: ite_gb.c,v 1.9 2011/02/10 11:08:23 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -91,7 +91,7 @@ gbcm_waitbusy(regbase); ite_fontinfo(ip); - ite_fontinit(ip); + ite_fontinit8bpp(ip); /* * Clear the display. This used to be before the font unpacking Index: src/sys/arch/hp300/stand/common/ite_subr.c diff -u src/sys/arch/hp300/stand/common/ite_subr.c:1.8 src/sys/arch/hp300/stand/common/ite_subr.c:1.9 --- src/sys/arch/hp300/stand/common/ite_subr.c:1.8 Thu Feb 10 10:44:22 2011 +++ src/sys/arch/hp300/stand/common/ite_subr.c Thu Feb 10 11:08:23 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ite_subr.c,v 1.8 2011/02/10 10:44:22 tsutsui Exp $ */ +/* $NetBSD: ite_subr.c,v 1.9 2011/02/10 11:08:23 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -82,7 +82,35 @@ } void -ite_fontinit(struct ite_data *ip) +ite_fontinit1bpp(struct ite_data *ip) +{ + u_char *fbmem, *dp; + int c, l, b; + int stride, width; + + dp = (u_char *)(getword(ip, getword(ip, FONTROM) + FONTADDR) + + (char *)ip->regbase) + FONTDATA; + stride = ip->fbwidth >> 3; + width = (ip->ftwidth + 7) / 8; + + for (c = 0; c < 128; c++) { + fbmem = (u_char *) FBBASE + + (ip->fonty + (c / ip->cpl) * ip->ftheight) * + stride; + fbmem += (ip->fontx >> 3) + (c % ip->cpl) * width; + for (l = 0; l < ip->ftheight; l++) { + for (b = 0; b < width; b++) { + *fbmem++ = *dp; + dp += 2; + } + fbmem -= width; + fbmem += stride; + } + } +} + +void +ite_fontinit8bpp(struct ite_data *ip) { int bytewidth = (((ip->ftwidth - 1) / 8) + 1); int glyphsize = bytewidth * ip->ftheight; Index: src/sys/arch/hp300/stand/common/ite_tc.c diff -u src/sys/arch/hp300/stand/common/ite_tc.c:1.8 src/sys/arch/hp300/stand/common/ite_tc.c:1.9 --- src/sys/arch/hp300/stand/common/ite_tc.c:1.8 Tue Feb 8 20:20:14 2011 +++ src/sys/arch/hp300/stand/common/ite_tc.c Thu Feb 10 11:08:23 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ite_tc.c,v 1.8 2011/02/08 20:20:14 rmind Exp $ */ +/* $NetBSD: ite_tc.c,v 1.9 2011/02/10 11:08:23 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -99,7 +99,7 @@ topcat_windowmove(ip, 0, 0, 0, 0, ip->fbheight, ip->fbwidth, RR_CLEAR); tc_waitbusy(regbase, ip->planemask); - ite_fontinit(ip); + ite_fontinit8bpp(ip); /* * Stash the inverted cursor. Index: src/sys/arch/hp300/stand/common/ite_hy.c diff -u src/sys/arch/hp300/stand/common/ite_hy.c:1.10 src/sys/arch/hp300/stand/common/ite_hy.c:1.11 --- src/sys/arch/hp300/stand/common/ite_hy.c:1.10 Tue Feb 8 20:20:14 2011 +++ src/sys/arch/hp300/stand/common/ite_hy.c Thu Feb 10 11:08:23 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ite_hy.c,v 1.10 2011/02/08 20:20:14 rmind Exp $ */ +/* $NetBSD: ite_hy.c,v 1.11 2011/02/10 11:08:23 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -55,7 +55,6 @@ #define charX(ip,c) \ (((c) % (ip)->cpl) * ((((ip)->ftwidth + 7) / 8) * 8) + (ip)->fontx) -void hyper_ite_fontinit(struct ite_data *); void hyper_windowmove(struct ite_data *, int, int, int, int, int, int, int); void @@ -76,7 +75,7 @@ */ hyper_windowmove(ip, 0, 0, 0, 0, ip->fbheight, ip->fbwidth, RR_CLEAR); - hyper_ite_fontinit(ip); + ite_fontinit1bpp(ip); /* * Stash the inverted cursor. @@ -87,34 +86,6 @@ } void -hyper_ite_fontinit(struct ite_data *ip) -{ - u_char *fbmem, *dp; - int c, l, b; - int stride, width; - - dp = (u_char *)(getword(ip, getword(ip, FONTROM) + FONTADDR) + - (char *)ip->regbase) + FONTDATA; - stride = ip->fbwidth >> 3; - width = (ip->ftwidth + 7) / 8; - - for (c = 0; c < 128; c++) { - fbmem = (u_char *) FBBASE + - (ip->fonty + (c / ip->cpl) * ip->ftheight) * - stride; - fbmem += (ip->fontx >> 3) + (c % ip->cpl) * width; - for (l = 0; l < ip->ftheight; l++) { - for (b = 0; b < width; b++) { - *fbmem++ = *dp; - dp += 2; - } - fbmem -= width; - fbmem += stride; - } - } -} - -void hyper_putc(struct ite_data *ip, int c, int dy, int dx, int mode) { Index: src/sys/arch/hp300/stand/common/itevar.h diff -u src/sys/arch/hp300/stand/common/itevar.h:1.10 src/sys/arch/hp300/stand/common/itevar.h:1.11 --- src/sys/arch/hp300/stand/common/itevar.h:1.10 Thu Feb 10 10:52:01 2011 +++ src/sys/arch/hp300/stand/common/itevar.h Thu Feb 10 11:08:23 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: itevar.h,v 1.10 2011/02/10 10:52:01 tsutsui Exp $ */ +/* $NetBSD: itevar.h,v 1.11 2011/02/10 11:08:23 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -186,7 +186,8 @@ * Prototypes. */ void ite_fontinfo(struct ite_data *); -void ite_fontinit(struct ite_data *); +void ite_fontinit1bpp(struct ite_data *); +void ite_fontinit8bpp(struct ite_data *); /* * Framebuffer-specific ITE prototypes. Index: src/sys/arch/hp300/stand/common/ite_rb.c diff -u src/sys/arch/hp300/stand/common/ite_rb.c:1.9 src/sys/arch/hp300/stand/common/ite_rb.c:1.10 --- src/sys/arch/hp300/stand/common/ite_rb.c:1.9 Tue Feb 8 20:20:14 2011 +++ src/sys/arch/hp300/stand/common/ite_rb.c Thu Feb 10 11:08:23 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ite_rb.c,v 1.9 2011/02/08 20:20:14 rmind Exp $ */ +/* $NetBSD: ite_rb.c,v 1.10 2011/02/10 11:08:23 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -113,7 +113,7 @@ regbase->write_enable = 0x01; regbase->opwen = 0x00; - ite_fontinit(ip); + ite_fontinit8bpp(ip); /* * Stash the inverted cursor.