Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/wscons clear the RI_CURSOR flag when we overwrite th...



details:   https://anonhg.NetBSD.org/src/rev/1c3ce22de227
branches:  trunk
changeset: 1018189:1c3ce22de227
user:      macallan <macallan%NetBSD.org@localhost>
date:      Mon Jan 25 02:11:41 2021 +0000

description:
clear the RI_CURSOR flag when we overwrite the cursor so we can skip clearing
it when asked to do it later on
saves a bunch of framebuffer writes

diffstat:

 sys/dev/wscons/wsdisplay_vcons.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r ee4d63c9b494 -r 1c3ce22de227 sys/dev/wscons/wsdisplay_vcons.c
--- a/sys/dev/wscons/wsdisplay_vcons.c  Sun Jan 24 22:08:37 2021 +0000
+++ b/sys/dev/wscons/wsdisplay_vcons.c  Mon Jan 25 02:11:41 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wsdisplay_vcons.c,v 1.48 2021/01/21 21:45:42 macallan Exp $ */
+/*     $NetBSD: wsdisplay_vcons.c,v 1.49 2021/01/25 02:11:41 macallan Exp $ */
 
 /*-
  * Copyright (c) 2005, 2006 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.48 2021/01/21 21:45:42 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.49 2021/01/25 02:11:41 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1273,6 +1273,9 @@
 #ifdef VCONS_DRAW_INTR
                vcons_putchar_cached(cookie, row, col, c, attr);
 #else
+               if (row == ri->ri_crow && col == ri->ri_ccol) {
+                       ri->ri_flg &= ~RI_CURSOR;
+               }
                scr->putchar(cookie, row, col, c, attr);
 #endif
        }
@@ -1337,7 +1340,7 @@
 #endif
        if (SCREEN_IS_VISIBLE(scr) && SCREEN_CAN_DRAW(scr)) {
                int ofs = offset + ri->ri_crow * ri->ri_cols + ri->ri_ccol;
-               if (ri->ri_flg & RI_CURSOR) {
+               if (on && (ri->ri_flg & RI_CURSOR)) {
                        scr->putchar(cookie, ri->ri_crow, ri->ri_ccol,
                            scr->scr_chars[ofs], scr->scr_attrs[ofs]);
                        ri->ri_flg &= ~RI_CURSOR;



Home | Main Index | Thread Index | Old Index