Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/drm If the "is_console" property is al...



details:   https://anonhg.NetBSD.org/src/rev/6bc7b6bad272
branches:  trunk
changeset: 341521:6bc7b6bad272
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Nov 09 23:11:18 2015 +0000

description:
If the "is_console" property is already specified, do not overwrite it.

diffstat:

 sys/external/bsd/drm2/drm/drmfb.c |  35 ++++++++++++++++++++---------------
 1 files changed, 20 insertions(+), 15 deletions(-)

diffs (67 lines):

diff -r f8aaf0ab1d4c -r 6bc7b6bad272 sys/external/bsd/drm2/drm/drmfb.c
--- a/sys/external/bsd/drm2/drm/drmfb.c Mon Nov 09 23:05:58 2015 +0000
+++ b/sys/external/bsd/drm2/drm/drmfb.c Mon Nov 09 23:11:18 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drmfb.c,v 1.1 2015/03/05 17:50:41 riastradh Exp $      */
+/*     $NetBSD: drmfb.c,v 1.2 2015/11/09 23:11:18 jmcneill Exp $       */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drmfb.c,v 1.1 2015/03/05 17:50:41 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drmfb.c,v 1.2 2015/11/09 23:11:18 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "vga.h"
@@ -91,6 +91,7 @@
        static const struct genfb_ops zero_genfb_ops;
        struct genfb_ops genfb_ops = zero_genfb_ops;
        enum { CONS_VGA, CONS_GENFB, CONS_NONE } what_was_cons;
+       bool is_console;
        int error;
 
        /* genfb requires this.  */
@@ -113,23 +114,27 @@
        prop_dictionary_set_uint64(dict, "mode_callback",
            (uint64_t)(uintptr_t)&drmfb_genfb_mode_callback);
 
-       /* XXX Whattakludge!  */
+       if (!prop_dictionary_get_bool(dict, "is_console", &is_console)) {
+               /* XXX Whattakludge!  */
 #if NVGA > 0
-       if ((da->da_params->dp_is_vga_console != NULL) &&
-           (*da->da_params->dp_is_vga_console)(dev)) {
-               what_was_cons = CONS_VGA;
-               prop_dictionary_set_bool(dict, "is_console", true);
-               vga_cndetach();
-               if (da->da_params->dp_disable_vga)
-                       (*da->da_params->dp_disable_vga)(dev);
-       } else
+               if ((da->da_params->dp_is_vga_console != NULL) &&
+                   (*da->da_params->dp_is_vga_console)(dev)) {
+                       what_was_cons = CONS_VGA;
+                       prop_dictionary_set_bool(dict, "is_console", true);
+                       vga_cndetach();
+                       if (da->da_params->dp_disable_vga)
+                               (*da->da_params->dp_disable_vga)(dev);
+               } else
 #endif
-       if (genfb_is_console() && genfb_is_enabled()) {
-               what_was_cons = CONS_GENFB;
-               prop_dictionary_set_bool(dict, "is_console", true);
+               if (genfb_is_console() && genfb_is_enabled()) {
+                       what_was_cons = CONS_GENFB;
+                       prop_dictionary_set_bool(dict, "is_console", true);
+               } else {
+                       what_was_cons = CONS_NONE;
+                       prop_dictionary_set_bool(dict, "is_console", false);
+               }
        } else {
                what_was_cons = CONS_NONE;
-               prop_dictionary_set_bool(dict, "is_console", false);
        }
 
        sc->sc_genfb.sc_dev = sc->sc_da.da_dev;



Home | Main Index | Thread Index | Old Index