Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc/dev only write the mask register if we're act...
details: https://anonhg.NetBSD.org/src/rev/1be088bc5a90
branches: trunk
changeset: 1027737:1be088bc5a90
user: macallan <macallan%NetBSD.org@localhost>
date: Fri Dec 17 19:27:57 2021 +0000
description:
only write the mask register if we're actually changing it
diffstat:
sys/arch/sparc/dev/cgfourteen.c | 29 ++++++++++++++++++++---------
sys/arch/sparc/dev/cgfourteenvar.h | 3 ++-
2 files changed, 22 insertions(+), 10 deletions(-)
diffs (105 lines):
diff -r ef6e24373b56 -r 1be088bc5a90 sys/arch/sparc/dev/cgfourteen.c
--- a/sys/arch/sparc/dev/cgfourteen.c Fri Dec 17 18:51:02 2021 +0000
+++ b/sys/arch/sparc/dev/cgfourteen.c Fri Dec 17 19:27:57 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgfourteen.c,v 1.91 2021/12/17 18:51:02 macallan Exp $ */
+/* $NetBSD: cgfourteen.c,v 1.92 2021/12/17 19:27:57 macallan Exp $ */
/*
* Copyright (c) 1996
@@ -1042,6 +1042,12 @@
{
int i;
+ /* init mask */
+ if (sc->sc_sx != NULL) {
+ sc->sc_mask = 0xffffffff;
+ sx_write(sc->sc_sx, SX_QUEUED(R_MASK), sc->sc_mask);
+ }
+
if (sc->sc_depth == depth)
return;
@@ -1226,6 +1232,13 @@
sc->sc_vd.active->scr_ri.ri_devcmap[(attr >> 24 & 0xf)]);
}
+static inline void
+cg14_set_mask(struct cgfourteen_softc *sc, uint32_t mask)
+{
+ if (mask == sc->sc_mask) return;
+ sc->sc_mask = mask;
+ sx_write(sc->sc_sx, SX_QUEUED(R_MASK), mask);
+}
/*
* invert a rectangle, used only to (un)draw the cursor.
* - does a scanline at a time
@@ -1258,27 +1271,27 @@
}
words = (wi + pre + 3) >> 2;
cnt = words - pwrds;
- sx_write(sc->sc_sx, SX_QUEUED(7), 0xe0e0e0e0); /* four red pixels */
+
for (line = 0; line < he; line++) {
pptr = addr;
/* load a whole scanline */
sta(pptr & ~7, ASI_SX, SX_LD(8, words - 1, pptr & 7));
reg = 8;
if (pre) {
- sx_write(sc->sc_sx, SX_QUEUED(R_MASK), lmask);
+ cg14_set_mask(sc, lmask);
sx_write(sc->sc_sx, SX_INSTRUCTIONS,
SX_ROPB(8, 8, 40, 0));
reg++;
}
if (cnt > 0) {
- sx_write(sc->sc_sx, SX_QUEUED(R_MASK), 0xffffffff);
+ cg14_set_mask(sc, 0xffffffff);
/* XXX handle cnt > 16 */
sx_write(sc->sc_sx, SX_INSTRUCTIONS,
SX_ROP(reg, reg, reg + 32, cnt - 1));
reg += cnt;
}
if (post) {
- sx_write(sc->sc_sx, SX_QUEUED(R_MASK), rmask);
+ cg14_set_mask(sc, rmask);
sx_write(sc->sc_sx, SX_INSTRUCTIONS,
SX_ROPB(reg, 7, reg + 32, 0));
reg++;
@@ -1500,8 +1513,7 @@
uint32_t reg;
for (i = 0; i < he; i++) {
reg = *data8;
- sx_write(sc->sc_sx, SX_QUEUED(R_MASK),
- reg << 24);
+ cg14_set_mask(sc, reg << 24);
sta(addr & ~7, ASI_SX, SX_STBS(8, wi - 1, addr & 7));
data8++;
addr += stride;
@@ -1513,8 +1525,7 @@
uint32_t reg;
for (i = 0; i < he; i++) {
reg = *data16;
- sx_write(sc->sc_sx, SX_QUEUED(R_MASK),
- reg << 16);
+ cg14_set_mask(sc, reg << 16);
sta(addr & ~7, ASI_SX, SX_STBS(8, wi - 1, addr & 7));
data16++;
addr += stride;
diff -r ef6e24373b56 -r 1be088bc5a90 sys/arch/sparc/dev/cgfourteenvar.h
--- a/sys/arch/sparc/dev/cgfourteenvar.h Fri Dec 17 18:51:02 2021 +0000
+++ b/sys/arch/sparc/dev/cgfourteenvar.h Fri Dec 17 19:27:57 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgfourteenvar.h,v 1.18 2016/04/30 05:23:03 macallan Exp $ */
+/* $NetBSD: cgfourteenvar.h,v 1.19 2021/12/17 19:27:57 macallan Exp $ */
/*
* Copyright (c) 1996
@@ -98,6 +98,7 @@
#if NSX > 0
struct sx_softc *sc_sx;
uint32_t sc_fb_paddr;
+ uint32_t sc_mask;
glyphcache sc_gc;
#endif /* NSX > 0 */
#endif
Home |
Main Index |
Thread Index |
Old Index