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 drmfb: Take is_console property fr...



details:   https://anonhg.NetBSD.org/src/rev/2560d23678ff
branches:  trunk
changeset: 369794:2560d23678ff
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Sep 01 12:01:36 2022 +0000

description:
drmfb: Take is_console property from parent, not from self.

The parent is the pci or platform device that firmware knows about.
The `drmfb' device is more of a fictitious invention of the drm stack
that exists for the convenience of the genfb abstraction which needs
device_private to be a struct genfb_softc.

Let's see if this does any better than the last attempt to rework the
logic here.

diffstat:

 sys/external/bsd/drm2/drm/drmfb.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (48 lines):

diff -r 752befbe2aec -r 2560d23678ff sys/external/bsd/drm2/drm/drmfb.c
--- a/sys/external/bsd/drm2/drm/drmfb.c Thu Sep 01 11:49:23 2022 +0000
+++ b/sys/external/bsd/drm2/drm/drmfb.c Thu Sep 01 12:01:36 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drmfb.c,v 1.14 2022/02/18 18:31:18 wiz Exp $   */
+/*     $NetBSD: drmfb.c,v 1.15 2022/09/01 12:01:36 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drmfb.c,v 1.14 2022/02/18 18:31:18 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drmfb.c,v 1.15 2022/09/01 12:01:36 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "vga.h"
@@ -87,6 +87,8 @@
        struct drm_connector_list_iter conn_iter;
        struct drm_connector *connector;
        const prop_dictionary_t dict = device_properties(da->da_dev);
+       const device_t parent = device_parent(da->da_dev);
+       const prop_dictionary_t pdict = device_properties(parent);
 #if NVGA > 0
        struct drm_device *const dev = da->da_fb_helper->dev;
 #endif
@@ -114,7 +116,10 @@
        prop_dictionary_set_uint64(dict, "mode_callback",
            (uint64_t)(uintptr_t)&drmfb_genfb_mode_callback);
 
-       if (!prop_dictionary_get_bool(dict, "is_console", &is_console)) {
+       if (prop_dictionary_get_bool(pdict, "is_console", &is_console)) {
+               what_was_cons = CONS_NONE;
+               prop_dictionary_set_bool(dict, "is_console", is_console);
+       } else {
                /* XXX Whattakludge!  */
 #if NVGA > 0
                if ((da->da_params->dp_is_vga_console != NULL) &&
@@ -133,8 +138,6 @@
                        what_was_cons = CONS_NONE;
                        prop_dictionary_set_bool(dict, "is_console", false);
                }
-       } else {
-               what_was_cons = CONS_NONE;
        }
 
        /* Make the first EDID we find available to wsfb */



Home | Main Index | Thread Index | Old Index