Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/wscons keep track of VCONS_DRAW_INTR screen cache al...
details: https://anonhg.NetBSD.org/src/rev/e85ad84f554c
branches: trunk
changeset: 326153:e85ad84f554c
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Tue Jan 21 00:10:46 2014 +0000
description:
keep track of VCONS_DRAW_INTR screen cache also in erasecols/rows and
copycols/rows methods.
diffstat:
sys/dev/wscons/wsdisplay_vcons.c | 56 +++++++++++++++++++++++++++++++++------
1 files changed, 47 insertions(+), 9 deletions(-)
diffs (171 lines):
diff -r 6c7247259bac -r e85ad84f554c sys/dev/wscons/wsdisplay_vcons.c
--- a/sys/dev/wscons/wsdisplay_vcons.c Tue Jan 21 00:08:27 2014 +0000
+++ b/sys/dev/wscons/wsdisplay_vcons.c Tue Jan 21 00:10:46 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay_vcons.c,v 1.29 2013/09/15 16:12:00 martin Exp $ */
+/* $NetBSD: wsdisplay_vcons.c,v 1.30 2014/01/21 00:10:46 mlelstv Exp $ */
/*-
* Copyright (c) 2005, 2006 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.29 2013/09/15 16:12:00 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.30 2014/01/21 00:10:46 mlelstv Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -89,6 +89,8 @@
static void vcons_eraserows(void *, int, int, long);
static void vcons_putchar(void *, int, int, u_int, long);
#ifdef VCONS_DRAW_INTR
+static void vcons_erasecols_cached(void *, int, int, int, long);
+static void vcons_eraserows_cached(void *, int, int, long);
static void vcons_putchar_cached(void *, int, int, u_int, long);
#endif
static void vcons_cursor(void *, int, int, int);
@@ -731,6 +733,9 @@
vcons_lock(scr);
if (SCREEN_IS_VISIBLE(scr) && SCREEN_CAN_DRAW(scr)) {
scr->scr_vd->copycols(cookie, row, srccol, dstcol, ncols);
+#if defined(VCONS_DRAW_INTR)
+ vcons_invalidate_cache(scr->scr_vd);
+#endif
}
vcons_unlock(scr);
}
@@ -742,6 +747,7 @@
struct vcons_screen *scr = ri->ri_hw;
struct vcons_data *vd = scr->scr_vd;
+ vcons_lock(scr);
if (SCREEN_IS_VISIBLE(scr) && SCREEN_CAN_DRAW(scr)) {
int pos, c, offset, ppos;
@@ -769,6 +775,7 @@
ppos++;
}
}
+ vcons_unlock(scr);
}
static void
@@ -832,8 +839,8 @@
vcons_lock(scr);
if (SCREEN_IS_VISIBLE(scr) && SCREEN_CAN_DRAW(scr)) {
#ifdef VCONS_DRAW_INTR
- vcons_erasecols_cached(cookie, row, startcol, ncols,
- fillattr);
+ vcons_erasecols_cached(cookie, row, startcol, ncols,
+ fillattr);
#else
scr->scr_vd->erasecols(cookie, row, startcol, ncols, fillattr);
#endif
@@ -897,6 +904,9 @@
vcons_lock(scr);
if (SCREEN_IS_VISIBLE(scr) && SCREEN_CAN_DRAW(scr)) {
scr->scr_vd->copyrows(cookie, srcrow, dstrow, nrows);
+#if defined(VCONS_DRAW_INTR)
+ vcons_invalidate_cache(scr->scr_vd);
+#endif
}
vcons_unlock(scr);
}
@@ -908,6 +918,7 @@
struct vcons_screen *scr = ri->ri_hw;
struct vcons_data *vd = scr->scr_vd;
+ vcons_lock(scr);
if (SCREEN_IS_VISIBLE(scr) && SCREEN_CAN_DRAW(scr)) {
int pos, l, c, offset, ppos;
@@ -929,7 +940,7 @@
vd->attrs[ppos] = scr->scr_attrs[pos];
}
#else
- vd->putchar(cookie, l, c, scr->scr_chars[pos],
+ scr->scr_vd->putchar(cookie, l, c, scr->scr_chars[pos],
scr->scr_attrs[pos]);
#endif
pos++;
@@ -937,6 +948,7 @@
}
}
}
+ vcons_unlock(scr);
}
static void
@@ -967,6 +979,23 @@
#endif
}
+#ifdef VCONS_DRAW_INTR
+static void
+vcons_eraserows_cached(void *cookie, int row, int nrows, long fillattr)
+{
+ struct rasops_info *ri = cookie;
+ struct vcons_screen *scr = ri->ri_hw;
+ struct vcons_data *vd = scr->scr_vd;
+ int i, pos = row * ri->ri_cols, end = (row+nrows) * ri->ri_cols;
+
+ for (i = pos; i < end; i++) {
+ vd->chars[i] = 0x20;
+ vd->attrs[i] = fillattr;
+ }
+ vd->eraserows(cookie, row, nrows, fillattr);
+}
+#endif
+
static void
vcons_eraserows(void *cookie, int row, int nrows, long fillattr)
{
@@ -982,7 +1011,11 @@
vcons_lock(scr);
if (SCREEN_IS_VISIBLE(scr) && SCREEN_CAN_DRAW(scr)) {
+#ifdef VCONS_DRAW_INTR
+ vcons_eraserows_cached(cookie, row, nrows, fillattr);
+#else
scr->scr_vd->eraserows(cookie, row, nrows, fillattr);
+#endif
}
vcons_unlock(scr);
}
@@ -1262,10 +1295,15 @@
struct vcons_screen *scr = vd->active;
unsigned int dirty;
- if (scr && vd->use_intr == 1) {
+ if (scr && vd->use_intr) {
if (!SCREEN_IS_BUSY(scr)) {
dirty = atomic_swap_uint(&scr->scr_dirty, 0);
- if (dirty > 0) {
+ if (vd->use_intr == 2) {
+ if ((scr->scr_flags & VCONS_NO_REDRAW) == 0) {
+ vd->use_intr = 1;
+ vcons_redraw_screen(scr);
+ }
+ } else if (dirty > 0) {
if ((scr->scr_flags & VCONS_NO_REDRAW) == 0)
vcons_update_screen(scr);
}
@@ -1280,7 +1318,7 @@
{
/* the 'dev' arg we pass to config_interrupts isn't a device_t */
struct vcons_data *vd = (struct vcons_data *)dev;
- vd->use_intr = 1;
+ vd->use_intr = 2;
callout_schedule(&vd->intr, mstohz(33));
}
#endif /* VCONS_DRAW_INTR */
@@ -1309,7 +1347,7 @@
if (!vd->intr_valid)
return;
- vd->use_intr = 1;
+ vd->use_intr = 2;
if (scr)
atomic_inc_uint(&scr->scr_dirty);
#endif
Home |
Main Index |
Thread Index |
Old Index