summaryrefslogtreecommitdiff
path: root/sys/dev/rasops
diff options
context:
space:
mode:
authorFrederic Cambus <fcambus@cvs.openbsd.org>2019-03-24 14:15:01 +0000
committerFrederic Cambus <fcambus@cvs.openbsd.org>2019-03-24 14:15:01 +0000
commit58141d1d9966efffea75e872a091ead9c9d78386 (patch)
treedc3b7ba96558260c844a6bbc2843b1880d537b9b /sys/dev/rasops
parent6ddbdf921670746a45440725cfb655792cf97646 (diff)
Revert rasops32_putchar() changes introduced in revision 1.8.
This significantly speeds up character plotting on inteldrm and radeondrm, and also on efifb(4) since the driver now remaps the framebuffer in write combining mode. OK kettenis@, jcs@
Diffstat (limited to 'sys/dev/rasops')
-rw-r--r--sys/dev/rasops/rasops32.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/dev/rasops/rasops32.c b/sys/dev/rasops/rasops32.c
index 437c39f031f..e02436da554 100644
--- a/sys/dev/rasops/rasops32.c
+++ b/sys/dev/rasops/rasops32.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rasops32.c,v 1.8 2017/02/20 15:35:05 jcs Exp $ */
+/* $OpenBSD: rasops32.c,v 1.9 2019/03/24 14:15:00 fcambus Exp $ */
/* $NetBSD: rasops32.c,v 1.7 2000/04/12 14:22:29 pk Exp $ */
/*-
@@ -69,7 +69,6 @@ rasops32_putchar(void *cookie, int row, int col, u_int uc, long attr)
struct rasops_info *ri;
int32_t *dp, *rp;
u_char *fr;
- uint32_t buffer[64];
ri = (struct rasops_info *)cookie;
@@ -91,13 +90,12 @@ rasops32_putchar(void *cookie, int row, int col, u_int uc, long attr)
clr[1] = ri->ri_devcmap[(attr >> 24) & 0xf];
if (uc == ' ') {
- for (cnt = 0; cnt < width; cnt++)
- buffer[cnt] = clr[0];
while (height--) {
dp = rp;
DELTA(rp, ri->ri_stride, int32_t *);
- memcpy(dp, buffer, width << 2);
+ for (cnt = width; cnt; cnt--)
+ *dp++ = clr[0];
}
} else {
uc -= ri->ri_font->firstchar;
@@ -111,11 +109,10 @@ rasops32_putchar(void *cookie, int row, int col, u_int uc, long attr)
fr += fs;
DELTA(rp, ri->ri_stride, int32_t *);
- for (cnt = 0; cnt < width; cnt++) {
- buffer[cnt] = clr[(fb >> 31) & 1];
+ for (cnt = width; cnt; cnt--) {
+ *dp++ = clr[(fb >> 31) & 1];
fb <<= 1;
}
- memcpy(dp, buffer, width << 2);
}
}