Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/wsfb make use of a shadow framebuffer optional, use ...



details:   https://anonhg.NetBSD.org/src/rev/fe3cb9ee677b
branches:  trunk
changeset: 757461:fe3cb9ee677b
user:      macallan <macallan%NetBSD.org@localhost>
date:      Tue Aug 31 02:49:17 2010 +0000

description:
make use of a shadow framebuffer optional, use VCONS_DONT_READ by default

diffstat:

 sys/dev/wsfb/files.wsfb |   6 +++---
 sys/dev/wsfb/genfb.c    |  11 +++++++++--
 sys/dev/wsfb/genfbvar.h |   9 ++++++---
 3 files changed, 18 insertions(+), 8 deletions(-)

diffs (103 lines):

diff -r 50dff3cd249b -r fe3cb9ee677b sys/dev/wsfb/files.wsfb
--- a/sys/dev/wsfb/files.wsfb   Mon Aug 30 19:23:25 2010 +0000
+++ b/sys/dev/wsfb/files.wsfb   Tue Aug 31 02:49:17 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.wsfb,v 1.6 2009/08/06 16:26:51 macallan Exp $
+# $NetBSD: files.wsfb,v 1.7 2010/08/31 02:49:17 macallan Exp $
 
 #
 # wsdisplay framebuffer drivers
@@ -9,6 +9,6 @@
 defflag opt_wsfb.h WSFB_ALLOW_OTHERS   # allow to mmap() foreign ranges
 
 # a generic framebuffer console
-device genfb: wsemuldisplaydev, rasops1, rasops8, rasops15, rasops16, rasops24, rasops32, vcons, drm
+device genfb: wsemuldisplaydev, rasops1, rasops2, rasops8, rasops15, rasops16, rasops24, rasops32, vcons, drm
 file   dev/wsfb/genfb.c        genfb   needs-flag
-defflag opt_genfb.h GENFB_DEBUG
+defflag opt_genfb.h GENFB_DEBUG GENFB_SHADOWFB
diff -r 50dff3cd249b -r fe3cb9ee677b sys/dev/wsfb/genfb.c
--- a/sys/dev/wsfb/genfb.c      Mon Aug 30 19:23:25 2010 +0000
+++ b/sys/dev/wsfb/genfb.c      Tue Aug 31 02:49:17 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfb.c,v 1.29 2010/02/22 05:55:10 ahoka Exp $ */
+/*     $NetBSD: genfb.c,v 1.30 2010/08/31 02:49:17 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.29 2010/02/22 05:55:10 ahoka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.30 2010/08/31 02:49:17 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -193,9 +193,11 @@
        memcpy(&sc->sc_ops, ops, sizeof(struct genfb_ops));
        sc->sc_mode = WSDISPLAYIO_MODE_EMUL;
 
+#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
 
        vcons_init(&sc->vd, sc, &sc->sc_defaultscreen_descr,
            &genfb_accessops);
@@ -415,12 +417,17 @@
        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
+       {
                ri->ri_bits = (char *)sc->sc_fbaddr;
+               scr->scr_flags |= VCONS_DONT_READ;
+       }
 
        if (existing && sc->sc_want_clear) {
                ri->ri_flg |= RI_CLEAR;
diff -r 50dff3cd249b -r fe3cb9ee677b sys/dev/wsfb/genfbvar.h
--- a/sys/dev/wsfb/genfbvar.h   Mon Aug 30 19:23:25 2010 +0000
+++ b/sys/dev/wsfb/genfbvar.h   Tue Aug 31 02:49:17 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfbvar.h,v 1.14 2010/02/24 22:38:09 dyoung Exp $ */
+/*     $NetBSD: genfbvar.h,v 1.15 2010/08/31 02:49:17 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfbvar.h,v 1.14 2010/02/24 22:38:09 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfbvar.h,v 1.15 2010/08/31 02:49:17 macallan Exp $");
 
 #ifndef GENFBVAR_H
 #define GENFBVAR_H
@@ -46,6 +46,7 @@
 #include <dev/rasops/rasops.h>
 
 #include <dev/wscons/wsdisplay_vconsvar.h>
+#include "opt_genfb.h"
 
 #ifdef SPLASHSCREEN
 #define GENFB_DISABLE_TEXT
@@ -81,7 +82,9 @@
        struct genfb_colormap_callback *sc_cmcb;
        struct genfb_pmf_callback *sc_pmfcb;
        void *sc_fbaddr;        /* kva */
-       void *sc_shadowfb; 
+#ifdef GENFB_SHADOWFB
+       void *sc_shadowfb;
+#endif
        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