diff options
| author | macallan <macallan@NetBSD.org> | 2012-01-25 16:38:27 +0000 |
|---|---|---|
| committer | macallan <macallan@NetBSD.org> | 2012-01-25 16:38:27 +0000 |
| commit | e94c07fa43cb0a20f58177b14014233b9a4e791a (patch) | |
| tree | d08bf1e0d0f6e9defc550ee986f0cc0b8b681a6c /sys/dev/rasops | |
| parent | f999aaae72778093df8a937179feab055358507b (diff) | |
rasops8_putchar_aa():
render glyphs scanline by scanline into a 64bit-aligned buffer, then memcpy()
it into video memory instead of writing directly.
This gives >10% speedup even on valkyriefb, likely more on PCIe framebuffers.
Diffstat (limited to 'sys/dev/rasops')
| -rw-r--r-- | sys/dev/rasops/rasops8.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/rasops/rasops8.c b/sys/dev/rasops/rasops8.c index d0f8511b904..bd9c0ba4e6d 100644 --- a/sys/dev/rasops/rasops8.c +++ b/sys/dev/rasops/rasops8.c @@ -1,4 +1,4 @@ -/* $NetBSD: rasops8.c,v 1.30 2012/01/04 20:16:20 macallan Exp $ */ +/* $NetBSD: rasops8.c,v 1.31 2012/01/25 16:38:27 macallan Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rasops8.c,v 1.30 2012/01/04 20:16:20 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rasops8.c,v 1.31 2012/01/25 16:38:27 macallan Exp $"); #include "opt_rasops.h" @@ -205,6 +205,7 @@ rasops8_putchar_aa(void *cookie, int row, int col, u_int uc, long attr) struct wsdisplay_font *font = PICK_FONT(ri, uc); int x, y, r, g, b, aval; int r1, g1, b1, r0, g0, b0, fgo, bgo; + uint8_t scanline[32] __attribute__ ((aligned(8))); hp = hrp = NULL; @@ -278,11 +279,11 @@ rasops8_putchar_aa(void *cookie, int row, int col, u_int uc, long attr) ((g & 0xe000) >> 11) | ((b & 0xc000) >> 14); } - *dp = pixel; - dp++; + scanline[x] = pixel; } + memcpy(rp, scanline, width); if (ri->ri_hwbits) { - memcpy(rp, hrp, width); + memcpy(hrp, scanline, width); hrp += ri->ri_stride; } rp += ri->ri_stride; |
