Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Fix up the VCONS_DRAW_INTR support and DDB.



details:   https://anonhg.NetBSD.org/src/rev/c8c76dcf6658
branches:  trunk
changeset: 786793:c8c76dcf6658
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat May 11 07:42:34 2013 +0000

description:
Fix up the VCONS_DRAW_INTR support and DDB.

>From reinoud.

diffstat:

 sys/arch/arm/broadcom/bcm2835_genfb.c |  38 +++++++++++++++++++++++++++++++++-
 sys/arch/evbarm/rpi/rpi_machdep.c     |  19 +++++++++++++++-
 2 files changed, 53 insertions(+), 4 deletions(-)

diffs (124 lines):

diff -r 306853e339ca -r c8c76dcf6658 sys/arch/arm/broadcom/bcm2835_genfb.c
--- a/sys/arch/arm/broadcom/bcm2835_genfb.c     Sat May 11 07:38:42 2013 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_genfb.c     Sat May 11 07:42:34 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_genfb.c,v 1.4 2013/01/31 11:00:44 macallan Exp $ */
+/* $NetBSD: bcm2835_genfb.c,v 1.5 2013/05/11 07:42:34 skrll Exp $ */
 
 /*-
  * Copyright (c) 2013 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_genfb.c,v 1.4 2013/01/31 11:00:44 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_genfb.c,v 1.5 2013/05/11 07:42:34 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -58,6 +58,12 @@
 
 static int     bcmgenfb_ioctl(void *, void *, u_long, void *, int, lwp_t *);
 static paddr_t bcmgenfb_mmap(void *, void *, off_t, int);
+static bool    bcmgenfb_shutdown(device_t, int);
+
+void           bcmgenfb_set_console_dev(device_t);
+void           bcmgenfb_ddb_trap_callback(int);
+
+static device_t bcmgenfb_console_dev = NULL;
 
 CFATTACH_DECL_NEW(bcmgenfb, sizeof(struct bcmgenfb_softc),
     bcmgenfb_match, bcmgenfb_attach, NULL, NULL);
@@ -95,6 +101,8 @@
                return;
        }
 
+       pmf_device_register1(self, NULL, NULL, bcmgenfb_shutdown);
+
        error = bus_space_map(sc->sc_iot, sc->sc_gen.sc_fboffset,
            sc->sc_gen.sc_fbsize,
            BUS_SPACE_MAP_LINEAR|BUS_SPACE_MAP_PREFETCHABLE, &sc->sc_ioh);
@@ -159,3 +167,29 @@
        return bus_space_mmap(sc->sc_iot, sc->sc_gen.sc_fboffset, offset,
            prot, BUS_SPACE_MAP_LINEAR|BUS_SPACE_MAP_PREFETCHABLE);
 }
+
+static bool
+bcmgenfb_shutdown(device_t self, int flags)
+{
+       genfb_enable_polling(self);
+       return true;
+}
+void
+bcmgenfb_set_console_dev(device_t dev)
+{
+       KASSERT(bcmgenfb_console_dev == NULL);
+       bcmgenfb_console_dev = dev;
+}
+
+void
+bcmgenfb_ddb_trap_callback(int where)
+{
+       if (bcmgenfb_console_dev == NULL)
+               return;
+
+       if (where) {
+               genfb_enable_polling(bcmgenfb_console_dev);
+       } else {
+               genfb_disable_polling(bcmgenfb_console_dev);
+       }
+}
diff -r 306853e339ca -r c8c76dcf6658 sys/arch/evbarm/rpi/rpi_machdep.c
--- a/sys/arch/evbarm/rpi/rpi_machdep.c Sat May 11 07:38:42 2013 +0000
+++ b/sys/arch/evbarm/rpi/rpi_machdep.c Sat May 11 07:42:34 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpi_machdep.c,v 1.35 2013/03/19 22:16:55 garbled Exp $ */
+/*     $NetBSD: rpi_machdep.c,v 1.36 2013/05/11 07:42:34 skrll Exp $   */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.35 2013/03/19 22:16:55 garbled Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.36 2013/05/11 07:42:34 skrll Exp $");
 
 #include "opt_evbarm_boardtype.h"
 
@@ -74,6 +74,12 @@
 
 #include <evbarm/rpi/rpi.h>
 
+#ifdef DDB
+#include <machine/db_machdep.h>
+#include <ddb/db_sym.h>
+#include <ddb/db_extern.h>
+#endif
+
 #if NPLCOM > 0
 #include <evbarm/dev/plcomreg.h>
 #include <evbarm/dev/plcomvar.h>
@@ -345,6 +351,9 @@
                .vpt_tag = VCPROPTAG_NULL,
        },
 };
+
+extern void bcmgenfb_set_console_dev(device_t dev);
+extern void bcmgenfb_ddb_trap_callback(int where);
 #endif
 
 static void
@@ -771,6 +780,12 @@
 #if NGENFB > 0
        if (device_is_a(dev, "genfb")) {
                char *ptr;
+
+               bcmgenfb_set_console_dev(dev);
+#ifdef DDB
+               db_trap_callback = bcmgenfb_ddb_trap_callback;
+#endif
+
                if (rpi_fb_init(dict) == false)
                        return;
                if (get_bootconf_option(boot_args, "console",



Home | Main Index | Thread Index | Old Index