Source-Changes-HG archive

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

[src/trunk]: src/sys/arch If genfb.type=<int> is passed on cmdline, override ...



details:   https://anonhg.NetBSD.org/src/rev/feb61424f11d
branches:  trunk
changeset: 783828:feb61424f11d
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Jan 09 23:58:40 2013 +0000

description:
If genfb.type=<int> is passed on cmdline, override the wsdisplay type
returned by WSDISPLAYIO_GTYPE ioctl.

diffstat:

 sys/arch/arm/broadcom/bcm2835_genfb.c |  13 ++++++++++---
 sys/arch/evbarm/rpi/rpi_machdep.c     |  11 +++++++++--
 2 files changed, 19 insertions(+), 5 deletions(-)

diffs (97 lines):

diff -r 8d5c00523b91 -r feb61424f11d sys/arch/arm/broadcom/bcm2835_genfb.c
--- a/sys/arch/arm/broadcom/bcm2835_genfb.c     Wed Jan 09 23:50:59 2013 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_genfb.c     Wed Jan 09 23:58:40 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_genfb.c,v 1.1 2013/01/08 23:52:48 jmcneill Exp $ */
+/* $NetBSD: bcm2835_genfb.c,v 1.2 2013/01/09 23:58:40 jmcneill 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.1 2013/01/08 23:52:48 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_genfb.c,v 1.2 2013/01/09 23:58:40 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -49,6 +49,8 @@
        struct genfb_softc      sc_gen;
        bus_space_tag_t         sc_iot;
        bus_space_handle_t      sc_ioh;
+
+       uint32_t                sc_wstype;
 };
 
 static int     bcmgenfb_match(device_t, cfdata_t, void *);
@@ -73,12 +75,16 @@
 {
        struct bcmgenfb_softc *sc = device_private(self);
        struct amba_attach_args *aaa = aux;
+       prop_dictionary_t dict = device_properties(self);
        struct genfb_ops ops;
        int error;
 
        sc->sc_gen.sc_dev = self;
        sc->sc_iot = aaa->aaa_iot;
 
+       sc->sc_wstype = WSDISPLAY_TYPE_VC4;
+       prop_dictionary_get_uint32(dict, "wsdisplay_type", &sc->sc_wstype);
+
        genfb_init(&sc->sc_gen);
 
        if (sc->sc_gen.sc_width == 0 ||
@@ -110,11 +116,12 @@
 static int
 bcmgenfb_ioctl(void *v, void *vs, u_long cmd, void *data, int flag, lwp_t *l)
 {
+       struct bcmgenfb_softc *sc = v;
        struct wsdisplayio_bus_id *busid;
 
        switch (cmd) {
        case WSDISPLAYIO_GTYPE:
-               *(u_int *)data = WSDISPLAY_TYPE_VC4;
+               *(u_int *)data = sc->sc_wstype;
                return 0;
        case WSDISPLAYIO_GET_BUSID:
                busid = data;
diff -r 8d5c00523b91 -r feb61424f11d sys/arch/evbarm/rpi/rpi_machdep.c
--- a/sys/arch/evbarm/rpi/rpi_machdep.c Wed Jan 09 23:50:59 2013 +0000
+++ b/sys/arch/evbarm/rpi/rpi_machdep.c Wed Jan 09 23:58:40 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpi_machdep.c,v 1.25 2013/01/09 23:04:10 skrll Exp $   */
+/*     $NetBSD: rpi_machdep.c,v 1.26 2013/01/09 23:58:40 jmcneill 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.25 2013/01/09 23:04:10 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.26 2013/01/09 23:58:40 jmcneill Exp $");
 
 #include "opt_evbarm_boardtype.h"
 
@@ -641,6 +641,7 @@
        uint32_t width = 0, height = 0;
        uint32_t res;
        char *ptr;
+       int integer; 
        int error;
 
        if (get_bootconf_option(boot_args, "console",
@@ -722,6 +723,12 @@
        if (vb_setfb.vbt_pixelorder.state == VCPROP_PIXEL_BGR)
                prop_dictionary_set_bool(dict, "is_bgr", true);
 
+       /* if "genfb.type=<n>" is passed in cmdline, override wsdisplay type */
+       if (get_bootconf_option(boot_args, "genfb.type",
+                               BOOTOPT_TYPE_INT, &integer)) {
+               prop_dictionary_set_uint32(dict, "wsdisplay_type", integer);
+       }
+
        return true;
 }
 #endif



Home | Main Index | Thread Index | Old Index