Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/hpc hpcfb_cnattach(): If fbconf == NULL, this is for...



details:   https://anonhg.NetBSD.org/src/rev/ef8339e88c0d
branches:  trunk
changeset: 1021569:ef8339e88c0d
user:      rin <rin%NetBSD.org@localhost>
date:      Sat Jun 05 02:27:08 2021 +0000

description:
hpcfb_cnattach(): If fbconf == NULL, this is for early console output
(used for hpcmips/VR41xx machines), and wsdisplay_preattach() should be
used instead of wsdisplay_cnattach().

Fix KASSERT failure for double attach of wsdisplay, reported in port-mips.

diffstat:

 sys/dev/hpc/hpcfb.c |  17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 27dc31606c3e -r ef8339e88c0d sys/dev/hpc/hpcfb.c
--- a/sys/dev/hpc/hpcfb.c       Sat Jun 05 01:40:53 2021 +0000
+++ b/sys/dev/hpc/hpcfb.c       Sat Jun 05 02:27:08 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hpcfb.c,v 1.61 2021/04/24 23:36:54 thorpej Exp $       */
+/*     $NetBSD: hpcfb.c,v 1.62 2021/06/05 02:27:08 rin Exp $   */
 
 /*-
  * Copyright (c) 1999
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hpcfb.c,v 1.61 2021/04/24 23:36:54 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpcfb.c,v 1.62 2021/06/05 02:27:08 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_hpcfb.h"
@@ -410,8 +410,17 @@
        hpcfb_console_wsscreen.capabilities = hpcfb_console_dc.dc_rinfo.ri_caps;
        hpcfb_allocattr(&hpcfb_console_dc,
                        WSCOL_WHITE, WSCOL_BLACK, 0, &defattr);
-       wsdisplay_cnattach(&hpcfb_console_wsscreen, &hpcfb_console_dc,
-           0, 0, defattr);
+#if NBIVIDEO > 0
+       /*
+        * This is early console. Do not really attach wsdisplay.
+        */
+       if (fbconf == &__fbconf)
+               wsdisplay_preattach(&hpcfb_console_wsscreen, &hpcfb_console_dc,
+                   0, 0, defattr);
+       else
+#endif
+               wsdisplay_cnattach(&hpcfb_console_wsscreen, &hpcfb_console_dc,
+                   0, 0, defattr);
        hpcfbconsole = 1;
 
        return (0);



Home | Main Index | Thread Index | Old Index