Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/wsfb genfb(4): Enabling/Disabling shadowfb can be co...
details: https://anonhg.NetBSD.org/src/rev/e484a0be65e6
branches: trunk
changeset: 351747:e484a0be65e6
user: nonaka <nonaka%NetBSD.org@localhost>
date: Sat Feb 25 01:11:55 2017 +0000
description:
genfb(4): Enabling/Disabling shadowfb can be controlled via prop.
diffstat:
sys/dev/wsfb/genfb.c | 29 +++++++++++++++++------------
sys/dev/wsfb/genfbvar.h | 5 ++---
2 files changed, 19 insertions(+), 15 deletions(-)
diffs (87 lines):
diff -r fadf38efcf41 -r e484a0be65e6 sys/dev/wsfb/genfb.c
--- a/sys/dev/wsfb/genfb.c Fri Feb 24 17:19:14 2017 +0000
+++ b/sys/dev/wsfb/genfb.c Sat Feb 25 01:11:55 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb.c,v 1.58 2015/06/01 20:47:59 nat Exp $ */
+/* $NetBSD: genfb.c,v 1.59 2017/02/25 01:11:55 nonaka Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.58 2015/06/01 20:47:59 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.59 2017/02/25 01:11:55 nonaka Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -130,6 +130,15 @@
sc->sc_fbaddr = (void *)(uintptr_t)fbaddr;
}
+ sc->sc_shadowfb = NULL;
+ if (!prop_dictionary_get_bool(dict, "enable_shadowfb",
+ &sc->sc_enable_shadowfb))
+#ifdef GENFB_SHADOWFB
+ sc->sc_enable_shadowfb = true;
+#else
+ sc->sc_enable_shadowfb = false;
+#endif
+
if (!prop_dictionary_get_uint32(dict, "linebytes", &sc->sc_stride))
sc->sc_stride = (sc->sc_width * sc->sc_depth) >> 3;
@@ -240,11 +249,11 @@
sc->sc_accessops.mmap = genfb_mmap;
sc->sc_accessops.pollc = genfb_pollc;
-#ifdef GENFB_SHADOWFB
- sc->sc_shadowfb = kmem_alloc(sc->sc_fbsize, KM_SLEEP);
- if (sc->sc_want_clear == false && sc->sc_shadowfb != NULL)
- memcpy(sc->sc_shadowfb, sc->sc_fbaddr, sc->sc_fbsize);
-#endif
+ if (sc->sc_enable_shadowfb) {
+ sc->sc_shadowfb = kmem_alloc(sc->sc_fbsize, KM_SLEEP);
+ if (sc->sc_want_clear == false && sc->sc_shadowfb != NULL)
+ memcpy(sc->sc_shadowfb, sc->sc_fbaddr, sc->sc_fbsize);
+ }
vcons_init(&sc->vd, sc, &sc->sc_defaultscreen_descr,
&sc->sc_accessops);
@@ -529,14 +538,10 @@
if (sc->sc_want_clear)
ri->ri_flg |= RI_FULLCLEAR;
-#ifdef GENFB_SHADOWFB
if (sc->sc_shadowfb != NULL) {
-
ri->ri_hwbits = (char *)sc->sc_fbaddr;
ri->ri_bits = (char *)sc->sc_shadowfb;
- } else
-#endif
- {
+ } else {
ri->ri_bits = (char *)sc->sc_fbaddr;
scr->scr_flags |= VCONS_DONT_READ;
}
diff -r fadf38efcf41 -r e484a0be65e6 sys/dev/wsfb/genfbvar.h
--- a/sys/dev/wsfb/genfbvar.h Fri Feb 24 17:19:14 2017 +0000
+++ b/sys/dev/wsfb/genfbvar.h Sat Feb 25 01:11:55 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfbvar.h,v 1.24 2014/07/24 21:35:13 riastradh Exp $ */
+/* $NetBSD: genfbvar.h,v 1.25 2017/02/25 01:11:55 nonaka Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@@ -111,9 +111,8 @@
struct genfb_mode_callback *sc_modecb;
int sc_backlight_level, sc_backlight_on;
void *sc_fbaddr; /* kva */
-#ifdef GENFB_SHADOWFB
void *sc_shadowfb;
-#endif
+ bool sc_enable_shadowfb;
bus_addr_t sc_fboffset; /* bus address */
int sc_width, sc_height, sc_stride, sc_depth;
size_t sc_fbsize;
Home |
Main Index |
Thread Index |
Old Index