Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/dev Use fb_is_console(); retract fbconstty & ...



details:   https://anonhg.NetBSD.org/src/rev/eaf5adbc7454
branches:  trunk
changeset: 483843:eaf5adbc7454
user:      pk <pk%NetBSD.org@localhost>
date:      Sun Mar 19 15:38:45 2000 +0000

description:
Use fb_is_console(); retract fbconstty & fbnode from service.

diffstat:

 sys/arch/sparc/dev/bwtwo.c      |  29 +++++++++++++----------------
 sys/arch/sparc/dev/bwtwo_obio.c |   7 +++----
 sys/arch/sparc/dev/bwtwo_sbus.c |  10 +++-------
 sys/arch/sparc/dev/bwtwovar.h   |   4 ++--
 sys/arch/sparc/dev/cgeight.c    |   7 ++-----
 sys/arch/sparc/dev/cgfour.c     |   7 ++-----
 sys/arch/sparc/dev/cgfourteen.c |  10 +++-------
 sys/arch/sparc/dev/cgsix.c      |   8 +++-----
 sys/arch/sparc/dev/cgsix_obio.c |   7 +++----
 sys/arch/sparc/dev/cgsix_sbus.c |   9 +++------
 sys/arch/sparc/dev/cgsixvar.h   |   4 ++--
 sys/arch/sparc/dev/cgthree.c    |  21 ++++++++-------------
 sys/arch/sparc/dev/cgtwo.c      |   7 ++-----
 sys/arch/sparc/dev/p9100.c      |  17 ++++++++---------
 sys/arch/sparc/dev/tcx.c        |  11 +++--------
 15 files changed, 60 insertions(+), 98 deletions(-)

diffs (truncated from 595 to 300 lines):

diff -r ef22fcb87d5b -r eaf5adbc7454 sys/arch/sparc/dev/bwtwo.c
--- a/sys/arch/sparc/dev/bwtwo.c        Sun Mar 19 14:58:02 2000 +0000
+++ b/sys/arch/sparc/dev/bwtwo.c        Sun Mar 19 15:38:45 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bwtwo.c,v 1.42 1999/08/10 04:56:30 christos Exp $ */
+/*     $NetBSD: bwtwo.c,v 1.43 2000/03/19 15:38:45 pk Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -148,11 +148,10 @@
 }
 
 void
-bwtwoattach(sc, name, isconsole, isfb)
+bwtwoattach(sc, name, isconsole)
        struct  bwtwo_softc *sc;
        char    *name;
        int     isconsole;
-       int     isfb;
 {
        struct fbdevice *fb = &sc->sc_fb;
 
@@ -202,19 +201,17 @@
                printf("%s: %s overlay plane\n", sc->sc_dev.dv_xname, ovnam);
        }
 
-       if (isfb) {
-               /*
-                * If we're on an overlay plane of a color framebuffer,
-                * then we don't force the issue in fb_attach() because
-                * we'd like the color framebuffer to actually be the
-                * "console framebuffer".  We're only around to speed
-                * up rconsole.
-                */
-               if ((fb->fb_flags & FB_PFOUR) && (sc->sc_ovtype != BWO_NONE ))
-                       fb_attach(fb, 0);
-               else
-                       fb_attach(fb, isconsole);
-       }
+       /*
+        * If we're on an overlay plane of a color framebuffer,
+        * then we don't force the issue in fb_attach() because
+        * we'd like the color framebuffer to actually be the
+        * "console framebuffer".  We're only around to speed
+        * up rconsole.
+        */
+       if ((fb->fb_flags & FB_PFOUR) && (sc->sc_ovtype != BWO_NONE ))
+               fb_attach(fb, 0);
+       else
+               fb_attach(fb, isconsole);
 }
 
 int
diff -r ef22fcb87d5b -r eaf5adbc7454 sys/arch/sparc/dev/bwtwo_obio.c
--- a/sys/arch/sparc/dev/bwtwo_obio.c   Sun Mar 19 14:58:02 2000 +0000
+++ b/sys/arch/sparc/dev/bwtwo_obio.c   Sun Mar 19 15:38:45 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bwtwo_obio.c,v 1.1 1999/08/10 04:56:30 christos Exp $ */
+/*     $NetBSD: bwtwo_obio.c,v 1.2 2000/03/19 15:38:45 pk Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -127,7 +127,6 @@
 static void    bwtwo_set_video_sun4 __P((struct bwtwo_softc *, int));
 
 extern int fbnode;
-extern struct tty *fbconstty;
 
 static int
 bwtwomatch_obio(parent, cf, aux)
@@ -176,7 +175,7 @@
 
        constype = (fb->fb_flags & FB_PFOUR) ? EE_CONS_P4OPT : EE_CONS_BW;
        if (eep == NULL || eep->eeConsole == constype)
-               isconsole = (fbconstty != NULL);
+               isconsole = fb_is_console(0);
        else
                isconsole = 0;
 
@@ -257,7 +256,7 @@
                sc->sc_fb.fb_pixels = (char *)bh;
        }
 
-       bwtwoattach(sc, name, isconsole, 1);
+       bwtwoattach(sc, name, isconsole);
 }
 
 static void
diff -r ef22fcb87d5b -r eaf5adbc7454 sys/arch/sparc/dev/bwtwo_sbus.c
--- a/sys/arch/sparc/dev/bwtwo_sbus.c   Sun Mar 19 14:58:02 2000 +0000
+++ b/sys/arch/sparc/dev/bwtwo_sbus.c   Sun Mar 19 15:38:45 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bwtwo_sbus.c,v 1.1 1999/08/10 04:56:30 christos Exp $ */
+/*     $NetBSD: bwtwo_sbus.c,v 1.2 2000/03/19 15:38:45 pk Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -127,9 +127,6 @@
 static int     bwtwo_get_video_sun4c  __P((struct bwtwo_softc *));
 static void    bwtwo_set_video_sun4c __P((struct bwtwo_softc *, int));
 
-extern int fbnode;
-extern struct tty *fbconstty;
-
 /*
  * Match a bwtwo.
  */
@@ -159,7 +156,6 @@
        bus_space_handle_t bh;
        int isconsole, node;
        char *name;
-       extern struct tty *fbconstty;
 
        node = sa->sa_node;
 
@@ -191,7 +187,7 @@
 
        sc->sc_pixeloffset = BWREG_MEM;
 
-       isconsole = node == fbnode && fbconstty != NULL;
+       isconsole = fb_is_console(node);
        name = getpropstring(node, "model");
 
        /* Assume `bwtwo at sbus' only happens at sun4c's */
@@ -214,7 +210,7 @@
        }
 
        sbus_establish(&sc->sc_sd, &sc->sc_dev);
-       bwtwoattach(sc, name, isconsole, node == fbnode);
+       bwtwoattach(sc, name, isconsole);
 }
 
 static void
diff -r ef22fcb87d5b -r eaf5adbc7454 sys/arch/sparc/dev/bwtwovar.h
--- a/sys/arch/sparc/dev/bwtwovar.h     Sun Mar 19 14:58:02 2000 +0000
+++ b/sys/arch/sparc/dev/bwtwovar.h     Sun Mar 19 15:38:45 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bwtwovar.h,v 1.1 1999/08/10 04:56:30 christos Exp $ */
+/*     $NetBSD: bwtwovar.h,v 1.2 2000/03/19 15:38:45 pk Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -104,5 +104,5 @@
        void    (*sc_set_video) __P((struct bwtwo_softc *, int));
 };
 
-void   bwtwoattach __P((struct bwtwo_softc *, char *, int, int));
+void   bwtwoattach __P((struct bwtwo_softc *, char *, int));
 int    bwtwo_pfour_probe __P((void *, void *));
diff -r ef22fcb87d5b -r eaf5adbc7454 sys/arch/sparc/dev/cgeight.c
--- a/sys/arch/sparc/dev/cgeight.c      Sun Mar 19 14:58:02 2000 +0000
+++ b/sys/arch/sparc/dev/cgeight.c      Sun Mar 19 15:38:45 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgeight.c,v 1.19 1998/11/19 15:38:24 mrg Exp $ */
+/*     $NetBSD: cgeight.c,v 1.20 2000/03/19 15:38:45 pk Exp $  */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -149,9 +149,6 @@
        cgeightpoll, cgeightmmap
 };
 
-extern int fbnode;
-extern struct tty *fbconstty;
-
 static void cgeightloadcmap __P((struct cgeight_softc *, int, int));
 static int cgeight_get_video __P((struct cgeight_softc *));
 static void cgeight_set_video __P((struct cgeight_softc *, int));
@@ -248,7 +245,7 @@
                 * to be found.
                 */
                if (eep == NULL || eep->eeConsole == EE_CONS_P4OPT)
-                       isconsole = (fbconstty != NULL);
+                       isconsole = fb_is_console(0);
        }
 
 #if 0
diff -r ef22fcb87d5b -r eaf5adbc7454 sys/arch/sparc/dev/cgfour.c
--- a/sys/arch/sparc/dev/cgfour.c       Sun Mar 19 14:58:02 2000 +0000
+++ b/sys/arch/sparc/dev/cgfour.c       Sun Mar 19 15:38:45 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgfour.c,v 1.19 1998/11/19 15:38:24 mrg Exp $  */
+/*     $NetBSD: cgfour.c,v 1.20 2000/03/19 15:38:45 pk Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -154,9 +154,6 @@
        cgfourmmap
 };
 
-extern int fbnode;
-extern struct tty *fbconstty;
-
 static void cgfourloadcmap __P((struct cgfour_softc *, int, int));
 static int cgfour_get_video __P((struct cgfour_softc *));
 static void cgfour_set_video __P((struct cgfour_softc *, int));
@@ -252,7 +249,7 @@
                 * to be found.
                 */
                if (eep == NULL || eep->eeConsole == EE_CONS_P4OPT)
-                       isconsole = (fbconstty != NULL);
+                       isconsole = fb_is_console(0);
        }
 
 #if 0
diff -r ef22fcb87d5b -r eaf5adbc7454 sys/arch/sparc/dev/cgfourteen.c
--- a/sys/arch/sparc/dev/cgfourteen.c   Sun Mar 19 14:58:02 2000 +0000
+++ b/sys/arch/sparc/dev/cgfourteen.c   Sun Mar 19 15:38:45 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgfourteen.c,v 1.15 1999/03/24 05:51:10 mrg Exp $ */
+/*     $NetBSD: cgfourteen.c,v 1.16 2000/03/19 15:38:45 pk Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -119,9 +119,6 @@
        cgfourteenpoll, cgfourteenmmap
 };
 
-extern int fbnode;
-extern struct tty *fbconstty;
-
 static void cg14_set_video __P((struct cgfourteen_softc *, int));
 static int  cg14_get_video __P((struct cgfourteen_softc *));
 static int  cg14_get_cmap __P((struct fbcmap *, union cg14cmap *, int));
@@ -260,7 +257,7 @@
                sc->sc_cmap.cm_chip[i] = lut[i];
 
        /* See if we're the console */
-       isconsole = node == fbnode && fbconstty != NULL;
+       isconsole = fb_is_console(node);
 
        if (isconsole) {
                printf(" (console)\n");
@@ -277,8 +274,7 @@
                printf("\n");
 
        /* Attach to /dev/fb */
-       if (node == fbnode)
-               fb_attach(&sc->sc_fb, isconsole);
+       fb_attach(&sc->sc_fb, isconsole);
 }
 
 /*
diff -r ef22fcb87d5b -r eaf5adbc7454 sys/arch/sparc/dev/cgsix.c
--- a/sys/arch/sparc/dev/cgsix.c        Sun Mar 19 14:58:02 2000 +0000
+++ b/sys/arch/sparc/dev/cgsix.c        Sun Mar 19 15:38:45 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgsix.c,v 1.45 1999/08/26 22:53:42 thorpej Exp $ */
+/*     $NetBSD: cgsix.c,v 1.46 2000/03/19 15:38:45 pk Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -152,11 +152,10 @@
 
 
 void
-cg6attach(sc, name, isconsole, isfb)
+cg6attach(sc, name, isconsole)
        struct cgsix_softc *sc;
        char *name;
        int isconsole;
-       int isfb;
 {
        struct fbdevice *fb = &sc->sc_fb;
 
@@ -194,8 +193,7 @@
        }
 
        printf("\n");
-       if (isfb)
-               fb_attach(&sc->sc_fb, isconsole);
+       fb_attach(&sc->sc_fb, isconsole);
 }
 
 
diff -r ef22fcb87d5b -r eaf5adbc7454 sys/arch/sparc/dev/cgsix_obio.c
--- a/sys/arch/sparc/dev/cgsix_obio.c   Sun Mar 19 14:58:02 2000 +0000
+++ b/sys/arch/sparc/dev/cgsix_obio.c   Sun Mar 19 15:38:45 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgsix_obio.c,v 1.3 1999/08/09 12:16:10 christos Exp $ */
+/*     $NetBSD: cgsix_obio.c,v 1.4 2000/03/19 15:38:45 pk Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -132,7 +132,6 @@
        bus_space_handle_t bh;
        int constype, isconsole;
        char *name;
-       extern struct tty *fbconstty;
 
        oba = &uoba->uoba_oba4;
 
@@ -207,7 +206,7 @@
         * to be found.
         */
        if (eep == NULL || eep->eeConsole == constype)
-               isconsole = (fbconstty != NULL);
+               isconsole = fb_is_console(0);
        else
                isconsole = 0;



Home | Main Index | Thread Index | Old Index