summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDale S. Rahn <rahnds@cvs.openbsd.org>1998-09-28 01:10:35 +0000
committerDale S. Rahn <rahnds@cvs.openbsd.org>1998-09-28 01:10:35 +0000
commitc8151eab40b7e5da76d1bc0578a5696077406b81 (patch)
treefc3154c84f772479e71ec9f6fd2b43a05e685879 /sys/dev
parent749bfbcb4ceae88a68c87f581f192fe4a5537ce2 (diff)
fix bug in vgafb_copycols() use bus_space_copy_4() instead of
bus_space_copy_1() for efficiency reasons.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/vgafb.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/sys/dev/ic/vgafb.c b/sys/dev/ic/vgafb.c
index 1f577446efc..b81d0d5098e 100644
--- a/sys/dev/ic/vgafb.c
+++ b/sys/dev/ic/vgafb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vgafb.c,v 1.2 1998/09/27 05:29:59 rahnds Exp $ */
+/* $OpenBSD: vgafb.c,v 1.3 1998/09/28 01:10:34 rahnds Exp $ */
/* $NetBSD: vga.c,v 1.3 1996/12/02 22:24:54 cgd Exp $ */
/*
@@ -382,11 +382,15 @@ vgafb_copycols(id, row, srccol, dstcol, ncols)
bus_size_t srcoff, dstoff;
int i;
- srcoff = ((row*FONT_HEIGHT) * (vc->vc_ncol*FONT_WIDTH)
- + srccol*FONT_WIDTH);
- dstoff = ((row*FONT_HEIGHT) * (vc->vc_ncol*FONT_WIDTH)
- + dstcol*FONT_WIDTH);
for (i = 0; i < FONT_HEIGHT; i++) {
+ srcoff = ((row*FONT_HEIGHT) * (vc->vc_ncol*FONT_WIDTH)
+ + srccol*FONT_WIDTH) + (i * (vc->vc_ncol*FONT_WIDTH));
+ dstoff = ((row*FONT_HEIGHT) * (vc->vc_ncol*FONT_WIDTH)
+ + dstcol*FONT_WIDTH) + (i * (vc->vc_ncol*FONT_WIDTH));
+
+/* this could be sped up using bus_space_copy_4, but the copies tend
+ * to be slow and it didn't work correctly on ppc???
+ */
bus_space_copy_1(vc->vc_memt, vc->vc_memh, srcoff,
vc->vc_memh, dstoff, ncols*FONT_WIDTH);
}
@@ -417,8 +421,18 @@ vgafb_copyrows(id, srcrow, dstrow, nrows)
srcoff = ((srcrow*FONT_HEIGHT) * (vc->vc_ncol*FONT_WIDTH) + 0);
dstoff = ((dstrow*FONT_HEIGHT) * (vc->vc_ncol*FONT_WIDTH) + 0);
+#if 0
bus_space_copy_1(vc->vc_memt, vc->vc_memh, srcoff, vc->vc_memh, dstoff,
(nrows*FONT_HEIGHT) * (vc->vc_ncol*FONT_WIDTH));
+#else
+ /* since pci memory space base address is a power of two, and
+ * the screen is a mulitple of 4 (since FONT_WIDTH is 8)
+ * aka The Screen base is always 4 byte aligned RIGHT?
+ * copying words will be faster than bytes.
+ */
+ bus_space_copy_4(vc->vc_memt, vc->vc_memh, srcoff, vc->vc_memh, dstoff,
+ (nrows*FONT_HEIGHT) * (vc->vc_ncol*FONT_WIDTH)/4);
+#endif
}
void