Module Name: src
Committed By: riastradh
Date: Wed Feb 16 23:30:10 UTC 2022
Modified Files:
src/sys/external/bsd/drm2/drm: drmfb.c
Log Message:
drm: Respect is_console property on main drm device, not fb child.
The MD device enumeration sets the property on, e.g., PCI devices --
not on drm framebuffer children, which are mostly a software
abstraction. Not sure examining the nouveaufb, intelfb, &c., device
properties is worthwhile at all, but in case it breaks something
let's just leave it in while we're fixing other things.
To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/drm2/drm/drmfb.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/external/bsd/drm2/drm/drmfb.c
diff -u src/sys/external/bsd/drm2/drm/drmfb.c:1.12 src/sys/external/bsd/drm2/drm/drmfb.c:1.13
--- src/sys/external/bsd/drm2/drm/drmfb.c:1.12 Mon Dec 20 20:34:59 2021
+++ src/sys/external/bsd/drm2/drm/drmfb.c Wed Feb 16 23:30:10 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: drmfb.c,v 1.12 2021/12/20 20:34:59 chs Exp $ */
+/* $NetBSD: drmfb.c,v 1.13 2022/02/16 23:30:10 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.12 2021/12/20 20:34:59 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drmfb.c,v 1.13 2022/02/16 23:30:10 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "vga.h"
@@ -93,6 +93,7 @@ drmfb_attach(struct drmfb_softc *sc, con
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;
+ device_t parent = device_parent(da->da_dev);
bool is_console;
int error;
@@ -114,7 +115,9 @@ drmfb_attach(struct drmfb_softc *sc, con
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(dict, "is_console", &is_console) &&
+ !prop_dictionary_get_bool(device_properties(parent), "is_console",
+ &is_console)) {
/* XXX Whattakludge! */
#if NVGA > 0
if ((da->da_params->dp_is_vga_console != NULL) &&