Source-Changes-HG archive

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

[src/trunk]: src/sys/arch allow "hdmi.forcemode=dvi" kernel option to force H...



details:   https://anonhg.NetBSD.org/src/rev/f957e9c8de8d
branches:  trunk
changeset: 341135:f957e9c8de8d
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Oct 19 22:00:09 2015 +0000

description:
allow "hdmi.forcemode=dvi" kernel option to force HDMI transmitter into DVI mode

diffstat:

 sys/arch/arm/nvidia/tegra_hdmi.c      |  13 ++++++++++---
 sys/arch/evbarm/tegra/tegra_machdep.c |   7 +++++--
 2 files changed, 15 insertions(+), 5 deletions(-)

diffs (73 lines):

diff -r de396b2473d2 -r f957e9c8de8d sys/arch/arm/nvidia/tegra_hdmi.c
--- a/sys/arch/arm/nvidia/tegra_hdmi.c  Mon Oct 19 21:18:36 2015 +0000
+++ b/sys/arch/arm/nvidia/tegra_hdmi.c  Mon Oct 19 22:00:09 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_hdmi.c,v 1.9 2015/07/31 23:07:14 jmcneill Exp $ */
+/* $NetBSD: tegra_hdmi.c,v 1.10 2015/10/19 22:00:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_hdmi.c,v 1.9 2015/07/31 23:07:14 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_hdmi.c,v 1.10 2015/10/19 22:00:09 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -198,10 +198,12 @@
 static void
 tegra_hdmi_connect(struct tegra_hdmi_softc *sc)
 {
+       prop_dictionary_t prop = device_properties(sc->sc_dev);
        const struct videomode *mode;
        char edid[128], *pedid = NULL;
        struct edid_info ei;
        int retry = 4, error;
+       bool force_dvi = false;
 
        memset(&ei, 0, sizeof(ei));
 
@@ -237,7 +239,12 @@
        }
 
        sc->sc_curmode = mode;
-       sc->sc_hdmimode = tegra_hdmi_is_hdmi(sc, &ei);
+       prop_dictionary_get_bool(prop, "force-dvi", &force_dvi);
+       if (force_dvi) {
+               sc->sc_hdmimode = false;
+       } else {
+               sc->sc_hdmimode = tegra_hdmi_is_hdmi(sc, &ei);
+       }
 
        tegra_hdmi_enable(sc, pedid);
 }
diff -r de396b2473d2 -r f957e9c8de8d sys/arch/evbarm/tegra/tegra_machdep.c
--- a/sys/arch/evbarm/tegra/tegra_machdep.c     Mon Oct 19 21:18:36 2015 +0000
+++ b/sys/arch/evbarm/tegra/tegra_machdep.c     Mon Oct 19 22:00:09 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_machdep.c,v 1.20 2015/10/18 17:07:36 jmcneill Exp $ */
+/* $NetBSD: tegra_machdep.c,v 1.21 2015/10/19 22:00:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_machdep.c,v 1.20 2015/10/18 17:07:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_machdep.c,v 1.21 2015/10/19 22:00:09 jmcneill Exp $");
 
 #include "opt_tegra.h"
 #include "opt_machdep.h"
@@ -472,6 +472,9 @@
                prop_dictionary_set_cstring(dict, "power-gpio", "K6");
                prop_dictionary_set_cstring(dict, "ddc-device", "ddc0");
                prop_dictionary_set_cstring(dict, "display-device", "tegradc1");
+               if (tegra_bootconf_match("hdmi.forcemode", "dvi")) {
+                       prop_dictionary_set_bool(dict, "force-dvi", true);
+               }
        }
 #endif
 



Home | Main Index | Thread Index | Old Index