Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/rasops rasops8_putchar_aa():
details: https://anonhg.NetBSD.org/src/rev/fdf370b95b30
branches: trunk
changeset: 773037:fdf370b95b30
user: macallan <macallan%NetBSD.org@localhost>
date: Wed Jan 25 16:38:27 2012 +0000
description:
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:
sys/dev/rasops/rasops8.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diffs (41 lines):
diff -r ed9406ab7dbc -r fdf370b95b30 sys/dev/rasops/rasops8.c
--- a/sys/dev/rasops/rasops8.c Wed Jan 25 16:25:28 2012 +0000
+++ b/sys/dev/rasops/rasops8.c Wed Jan 25 16:38:27 2012 +0000
@@ -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 @@
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 @@
((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;
Home |
Main Index |
Thread Index |
Old Index