Source-Changes-HG archive

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

[src/trunk]: src/sys/dev first step to fix PR 46461 - don't jump through a NU...



details:   https://anonhg.NetBSD.org/src/rev/3ba34f6ca5d5
branches:  trunk
changeset: 779375:3ba34f6ca5d5
user:      macallan <macallan%NetBSD.org@localhost>
date:      Wed May 23 18:39:30 2012 +0000

description:
first step to fix PR 46461 - don't jump through a NULL pointer when we're
not the console but the firmware set up the graphics hardware anyway

diffstat:

 sys/dev/ic/ct65550.c            |  13 +++++++------
 sys/dev/pci/pm2fb.c             |  14 +++++++-------
 sys/dev/pci/r128fb.c            |  10 +++++++---
 sys/dev/pci/voyager/voyagerfb.c |  13 ++++++-------
 4 files changed, 27 insertions(+), 23 deletions(-)

diffs (134 lines):

diff -r 55cda740b4fd -r 3ba34f6ca5d5 sys/dev/ic/ct65550.c
--- a/sys/dev/ic/ct65550.c      Wed May 23 16:11:37 2012 +0000
+++ b/sys/dev/ic/ct65550.c      Wed May 23 18:39:30 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ct65550.c,v 1.4 2012/03/13 18:40:31 elad Exp $ */
+/*     $NetBSD: ct65550.c,v 1.5 2012/05/23 18:39:30 macallan Exp $     */
 
 /*
  * Copyright (c) 2006 Michael Lorenz
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ct65550.c,v 1.4 2012/03/13 18:40:31 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ct65550.c,v 1.5 2012/05/23 18:39:30 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -254,10 +254,11 @@
                chipsfb_defaultscreen.ncols = ri->ri_cols;
                wsdisplay_cnattach(&chipsfb_defaultscreen, ri, 0, 0, defattr);
        } else {
-               /*
-                * since we're not the console we can postpone the rest
-                * until someone actually allocates a screen for us
-                */
+               if (chipsfb_console_screen.scr_ri.ri_rows == 0) {
+                       /* do some minimal setup to avoid weirdnesses later */
+                       vcons_init_screen(&sc->vd, &chipsfb_console_screen, 1,
+                           &defattr);
+               }
        }
 
        rasops_unpack_attr(defattr, &fg, &bg, &ul);
diff -r 55cda740b4fd -r 3ba34f6ca5d5 sys/dev/pci/pm2fb.c
--- a/sys/dev/pci/pm2fb.c       Wed May 23 16:11:37 2012 +0000
+++ b/sys/dev/pci/pm2fb.c       Wed May 23 18:39:30 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pm2fb.c,v 1.13 2012/03/13 18:40:33 elad Exp $  */
+/*     $NetBSD: pm2fb.c,v 1.14 2012/05/23 18:39:30 macallan Exp $      */
 
 /*
  * Copyright (c) 2009 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pm2fb.c,v 1.13 2012/03/13 18:40:33 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pm2fb.c,v 1.14 2012/05/23 18:39:30 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -326,11 +326,11 @@
                    defattr);
                vcons_replay_msgbuf(&sc->sc_console_screen);
        } else {
-               /*
-                * since we're not the console we can postpone the rest
-                * until someone actually allocates a screen for us
-                */
-               (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
+               if (sc->sc_console_screen.scr_ri.ri_rows == 0) {
+                       /* do some minimal setup to avoid weirdnesses later */
+                       vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
+                           &defattr);
+               }
        }
 
        aa.console = is_console;
diff -r 55cda740b4fd -r 3ba34f6ca5d5 sys/dev/pci/r128fb.c
--- a/sys/dev/pci/r128fb.c      Wed May 23 16:11:37 2012 +0000
+++ b/sys/dev/pci/r128fb.c      Wed May 23 18:39:30 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: r128fb.c,v 1.34 2012/04/19 08:59:42 macallan Exp $     */
+/*     $NetBSD: r128fb.c,v 1.35 2012/05/23 18:39:30 macallan Exp $     */
 
 /*
  * Copyright (c) 2007 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: r128fb.c,v 1.34 2012/04/19 08:59:42 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: r128fb.c,v 1.35 2012/05/23 18:39:30 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -307,7 +307,11 @@
                 * since we're not the console we can postpone the rest
                 * until someone actually allocates a screen for us
                 */
-               (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
+               if (sc->sc_console_screen.scr_ri.ri_rows == 0) {
+                       /* do some minimal setup to avoid weirdnesses later */
+                       vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
+                           &defattr);
+               }
                glyphcache_init(&sc->sc_gc, sc->sc_height + 5,
                                (0x800000 / sc->sc_stride) - sc->sc_height - 5,
                                sc->sc_width,
diff -r 55cda740b4fd -r 3ba34f6ca5d5 sys/dev/pci/voyager/voyagerfb.c
--- a/sys/dev/pci/voyager/voyagerfb.c   Wed May 23 16:11:37 2012 +0000
+++ b/sys/dev/pci/voyager/voyagerfb.c   Wed May 23 18:39:30 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: voyagerfb.c,v 1.20 2012/04/19 09:03:01 macallan Exp $  */
+/*     $NetBSD: voyagerfb.c,v 1.21 2012/05/23 18:39:30 macallan Exp $  */
 
 /*
  * Copyright (c) 2009, 2011 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: voyagerfb.c,v 1.20 2012/04/19 09:03:01 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: voyagerfb.c,v 1.21 2012/05/23 18:39:30 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -290,11 +290,10 @@
                sc->sc_defaultscreen_descr.nrows = ri->ri_rows;
                sc->sc_defaultscreen_descr.ncols = ri->ri_cols;
        } else {
-               /*
-                * since we're not the console we can postpone the rest
-                * until someone actually allocates a screen for us
-                */
-               (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
+               if (sc->sc_console_screen.scr_ri.ri_rows == 0) {
+                       /* do some minimal setup to avoid weirdnesses later */
+                       vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1, &defattr);
+               }
        }
        glyphcache_init(&sc->sc_gc, sc->sc_height,
                        (sc->sc_fbsize / sc->sc_stride) - sc->sc_height,



Home | Main Index | Thread Index | Old Index