Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci when drawing characters by software make sure th...
details: https://anonhg.NetBSD.org/src/rev/d4e8219c757e
branches: trunk
changeset: 758323:d4e8219c757e
user: macallan <macallan%NetBSD.org@localhost>
date: Tue Nov 02 14:32:58 2010 +0000
description:
when drawing characters by software make sure the engine is idle before
accessing video memory
diffstat:
sys/dev/pci/radeonfb.c | 24 ++++++++++++++++++++++--
sys/dev/pci/radeonfbvar.h | 4 ++--
2 files changed, 24 insertions(+), 4 deletions(-)
diffs (84 lines):
diff -r 66fb2f9a350e -r d4e8219c757e sys/dev/pci/radeonfb.c
--- a/sys/dev/pci/radeonfb.c Tue Nov 02 13:09:29 2010 +0000
+++ b/sys/dev/pci/radeonfb.c Tue Nov 02 14:32:58 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: radeonfb.c,v 1.37 2010/08/24 12:47:17 macallan Exp $ */
+/* $NetBSD: radeonfb.c,v 1.38 2010/11/02 14:32:58 macallan Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.37 2010/08/24 12:47:17 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.38 2010/11/02 14:32:58 macallan Exp $");
#define RADEONFB_DEFAULT_DEPTH 8
@@ -163,6 +163,7 @@
static void radeonfb_copycols(void *, int, int, int, int);
static void radeonfb_cursor(void *, int, int, int);
static void radeonfb_putchar(void *, int, int, unsigned, long);
+static void radeonfb_putchar_wrapper(void *, int, int, unsigned, long);
static int radeonfb_allocattr(void *, int, int, int, long *);
static int radeonfb_get_backlight(struct radeonfb_display *);
@@ -2206,6 +2207,7 @@
dp->rd_virtx / ri->ri_font->fontwidth);
/* enable acceleration */
+ dp->rd_putchar = ri->ri_ops.putchar;
ri->ri_ops.copyrows = radeonfb_copyrows;
ri->ri_ops.copycols = radeonfb_copycols;
ri->ri_ops.eraserows = radeonfb_eraserows;
@@ -2213,6 +2215,8 @@
ri->ri_ops.allocattr = radeonfb_allocattr;
if (!IS_R300(dp->rd_softc)) {
ri->ri_ops.putchar = radeonfb_putchar;
+ } else {
+ ri->ri_ops.putchar = radeonfb_putchar_wrapper;
}
ri->ri_ops.cursor = radeonfb_cursor;
}
@@ -2430,6 +2434,22 @@
}
}
+/*
+ * wrapper for software character drawing
+ * just sync the engine and call rasops*_putchar()
+ */
+
+static void
+radeonfb_putchar_wrapper(void *cookie, int row, int col, u_int c, long attr)
+{
+ struct rasops_info *ri = cookie;
+ struct vcons_screen *scr = ri->ri_hw;
+ struct radeonfb_display *dp = scr->scr_cookie;
+
+ radeonfb_engine_idle(dp->rd_softc);
+ dp->rd_putchar(ri, row, col, c, attr);
+}
+
static void
radeonfb_eraserows(void *cookie, int row, int nrows, long fillattr)
{
diff -r 66fb2f9a350e -r d4e8219c757e sys/dev/pci/radeonfbvar.h
--- a/sys/dev/pci/radeonfbvar.h Tue Nov 02 13:09:29 2010 +0000
+++ b/sys/dev/pci/radeonfbvar.h Tue Nov 02 14:32:58 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: radeonfbvar.h,v 1.8 2010/08/17 18:53:16 macallan Exp $ */
+/* $NetBSD: radeonfbvar.h,v 1.9 2010/11/02 14:32:58 macallan Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -190,7 +190,7 @@
struct wsscreen_descr *rd_wsscreens;
struct vcons_screen rd_vscreen;
struct vcons_data rd_vd;
-
+ void (*rd_putchar)(void *, int, int, u_int, long);
#if 0
uint8_t rd_cmap_red[256];
Home |
Main Index |
Thread Index |
Old Index