Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sun RASTERCONSOLE is gone, wsdisplay no longer optional



details:   https://anonhg.NetBSD.org/src/rev/2c37b1aad65c
branches:  trunk
changeset: 344803:2c37b1aad65c
user:      macallan <macallan%NetBSD.org@localhost>
date:      Thu Apr 21 18:06:06 2016 +0000

description:
RASTERCONSOLE is gone, wsdisplay no longer optional

diffstat:

 sys/dev/sun/bwtwo.c    |    7 +-
 sys/dev/sun/cgsix.c    |   88 +----------------------------
 sys/dev/sun/cgsixvar.h |   10 +---
 sys/dev/sun/cgthree.c  |   35 +++--------
 sys/dev/sun/fb.c       |  147 +------------------------------------------------
 sys/dev/sun/fbvar.h    |    9 +--
 6 files changed, 19 insertions(+), 277 deletions(-)

diffs (truncated from 573 to 300 lines):

diff -r 283ac7146b51 -r 2c37b1aad65c sys/dev/sun/bwtwo.c
--- a/sys/dev/sun/bwtwo.c       Thu Apr 21 17:59:18 2016 +0000
+++ b/sys/dev/sun/bwtwo.c       Thu Apr 21 18:06:06 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bwtwo.c,v 1.34 2014/07/25 08:10:39 dholland Exp $ */
+/*     $NetBSD: bwtwo.c,v 1.35 2016/04/21 18:06:06 macallan Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.34 2014/07/25 08:10:39 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.35 2016/04/21 18:06:06 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -310,7 +310,6 @@
                         * definition. In this case we fill it from fb to
                         * avoid problems in case no bwtwo is the console
                         */
-                       ri = &sc->sc_fb.fb_rinfo;
                        bwtwo_defaultscreen.textops = &ri->ri_ops;
                        bwtwo_defaultscreen.capabilities = ri->ri_caps;
                        bwtwo_defaultscreen.nrows = ri->ri_rows;
@@ -404,8 +403,8 @@
        struct vcons_data *vd = v;
        struct bwtwo_softc *sc = vd->cookie;
        struct wsdisplay_fbinfo *wdf;
-       struct rasops_info *ri = &sc->sc_fb.fb_rinfo;
        struct vcons_screen *ms = sc->vd.active;
+       struct rasops_info *ri = &ms->scr_ri;
        switch (cmd) {
                case WSDISPLAYIO_GTYPE:
                        *(u_int *)data = WSDISPLAY_TYPE_GENFB;
diff -r 283ac7146b51 -r 2c37b1aad65c sys/dev/sun/cgsix.c
--- a/sys/dev/sun/cgsix.c       Thu Apr 21 17:59:18 2016 +0000
+++ b/sys/dev/sun/cgsix.c       Thu Apr 21 18:06:06 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgsix.c,v 1.66 2016/04/13 17:26:08 macallan Exp $ */
+/*     $NetBSD: cgsix.c,v 1.67 2016/04/21 18:06:06 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.66 2016/04/13 17:26:08 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.67 2016/04/21 18:06:06 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -151,11 +151,6 @@
 static void cg6_setcursor (struct cgsix_softc *);/* set position */
 static void cg6_loadcursor (struct cgsix_softc *);/* set shape */
 
-#if NWSDISPLAY > 0
-#ifdef RASTERCONSOLE
-#error RASTERCONSOLE and wsdisplay are mutually exclusive
-#endif
-
 static void cg6_setup_palette(struct cgsix_softc *);
 
 struct wsscreen_descr cgsix_defaultscreen = {
@@ -208,18 +203,9 @@
 
 extern const u_char rasops_cmap[768];
 
-#endif /* NWSDISPLAY > 0 */
-
-#if (NWSDISPLAY > 0) || defined(RASTERCONSOLE)
 void   cg6_invert(struct cgsix_softc *, int, int, int, int);
 
-/* need this for both cases because ri_hw points to it */
 static struct vcons_screen cg6_console_screen;
-#endif
-
-#ifdef RASTERCONSOLE
-int cgsix_use_rasterconsole = 1;
-#endif
 
 /*
  * cg6 accelerated console routines.
@@ -326,15 +312,11 @@
                /*EMPTY*/;                                              \
 } while (0)
 
-#if (NWSDISPLAY > 0) || defined(RASTERCONSOLE)
 static void cg6_ras_init(struct cgsix_softc *);
 static void cg6_ras_copyrows(void *, int, int, int);
 static void cg6_ras_copycols(void *, int, int, int, int);
 static void cg6_ras_erasecols(void *, int, int, int, long int);
 static void cg6_ras_eraserows(void *, int, int, long int);
-#if defined(RASTERCONSOLE) && defined(CG6_BLIT_CURSOR)
-static void cg6_ras_do_cursor(struct rasops_info *);
-#endif
 
 static void
 cg6_ras_init(struct cgsix_softc *sc)
@@ -522,38 +504,13 @@
        CG6_DRAW(fbc);
 }
 
-#if defined(RASTERCONSOLE) && defined(CG6_BLIT_CURSOR)
-/*
- * Really want something more like fg^bg here, but that would be more
- * or less impossible to migrate to colors.  So we hope there's
- * something not too inappropriate in the colormap...besides, it's what
- * the non-accelerated code did. :-)
- */
-static void
-cg6_ras_do_cursor(struct rasops_info *ri)
-{
-       struct vcons_screen *scr = ri->ri_hw;
-       struct cgsix_softc *sc = scr->cookie;
-       int row, col;
-       
-       row = ri->ri_crow * ri->ri_font->fontheight;
-       col = ri->ri_ccol * ri->ri_font->fontwidth;
-       cg6_invert(sc, ri->ri_xorigin + col,ri->ri_yorigin + 
-           row, ri->ri_font->fontwidth, ri->ri_font->fontheight);
-}
-#endif /* RASTERCONSOLE */
-
-#endif /* (NWSDISPLAY > 0) || defined(RASTERCONSOLE) */
-
 void
 cg6attach(struct cgsix_softc *sc, const char *name, int isconsole)
 {
        struct fbdevice *fb = &sc->sc_fb;
-#if NWSDISPLAY > 0
        struct wsemuldisplaydev_attach_args aa;
        struct rasops_info *ri = &cg6_console_screen.scr_ri;
        unsigned long defattr;
-#endif
        
        fb->fb_driver = &cg6_fbdriver;
 
@@ -580,27 +537,6 @@
 
        if (isconsole) {
                printf(" (console)");
-
-/* this is the old console attachment stuff - sparc still needs it */
-#ifdef RASTERCONSOLE
-               if (cgsix_use_rasterconsole) {
-                       fbrcons_init(&sc->sc_fb);
-                       /* 
-                        * we don't use the screen struct but keep it here to 
-                        * avoid ugliness in the cg6_ras_* functions
-                        */
-                       cg6_console_screen.scr_cookie = sc;
-                       sc->sc_fb.fb_rinfo.ri_hw = &cg6_console_screen;
-                       sc->sc_fb.fb_rinfo.ri_ops.copyrows = cg6_ras_copyrows;
-                       sc->sc_fb.fb_rinfo.ri_ops.copycols = cg6_ras_copycols;
-                       sc->sc_fb.fb_rinfo.ri_ops.erasecols = cg6_ras_erasecols;
-                       sc->sc_fb.fb_rinfo.ri_ops.eraserows = cg6_ras_eraserows;
-#ifdef CG6_BLIT_CURSOR
-                       sc->sc_fb.fb_rinfo.ri_do_cursor = cg6_ras_do_cursor;
-#endif
-                       cg6_ras_init(sc);
-               }
-#endif
        }
        printf("\n");
 
@@ -612,7 +548,6 @@
        printf("%s: framebuffer size: %d MB\n", device_xname(sc->sc_dev), 
            sc->sc_ramsize >> 20);
 
-#if NWSDISPLAY
        /* setup rasops and so on for wsdisplay */
        memcpy(sc->sc_default_cmap, rasops_cmap, 768);
        wsfont_init();
@@ -693,11 +628,6 @@
        aa.accessops = &cgsix_accessops;
        aa.accesscookie = &sc->vd;
        config_found(sc->sc_dev, &aa, wsemuldisplaydevprint);
-#else
-       bt_initcmap(&sc->sc_cmap, 256); 
-       cg6_loadcmap(sc, 0, 256);
-       
-#endif
 }
 
 
@@ -723,7 +653,6 @@
        cg6_reset(sc);
        sc->sc_fb_is_open = FALSE;
 
-#if NWSDISPLAY > 0
        if (IS_IN_EMUL_MODE(sc)) {
                struct vcons_screen *ms = sc->vd.active;
 
@@ -735,12 +664,6 @@
                if (ms != NULL)
                        vcons_redraw_screen(ms);
        }
-#else
-       /* (re-)initialize the default color map */
-       bt_initcmap(&sc->sc_cmap, 256);
-       
-       cg6_loadcmap(sc, 0, 256);
-#endif
        return 0;
 }
 
@@ -1149,8 +1072,6 @@
        return -1;      /* not a user-map offset */
 }
 
-#if NWSDISPLAY > 0
-
 static void
 cg6_setup_palette(struct cgsix_softc *sc)
 {
@@ -1645,9 +1566,6 @@
        }
 }
 
-#endif /* NWSDISPLAY > 0 */
-
-#if (NWSDISPLAY > 0) || defined(RASTERCONSOLE)
 void
 cg6_invert(struct cgsix_softc *sc, int x, int y, int wi, int he)
 {
@@ -1664,5 +1582,3 @@
        CG6_DRAW(fbc);
 }
 
-#endif
-
diff -r 283ac7146b51 -r 2c37b1aad65c sys/dev/sun/cgsixvar.h
--- a/sys/dev/sun/cgsixvar.h    Thu Apr 21 17:59:18 2016 +0000
+++ b/sys/dev/sun/cgsixvar.h    Thu Apr 21 18:06:06 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgsixvar.h,v 1.13 2012/07/12 01:20:22 macallan Exp $ */
+/*     $NetBSD: cgsixvar.h,v 1.14 2016/04/21 18:06:06 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -73,13 +73,11 @@
        uint32_t sc_mono_width; /* how many monochrome pixels to write */
        uint32_t sc_ramsize;            /* VRAM size in bytes */
        int sc_fb_is_open;
-#if NWSDISPLAY > 0     
        int sc_mode;
        uint32_t sc_bg;
        struct vcons_data vd;
        uint8_t sc_default_cmap[768];
        glyphcache sc_gc;       
-#endif
        union   bt_cmap sc_cmap;        /* Brooktree color map */
 };
 
@@ -87,10 +85,4 @@
        ((sc->sc_fb_is_open == 0) && \
         (sc->sc_mode == WSDISPLAYIO_MODE_EMUL))
 
-#ifdef RASTERCONSOLE
-extern int cgsix_use_rasterconsole;
-#else
-#define cgsix_use_rasterconsole 0
-#endif
-
 void   cg6attach(struct cgsix_softc *, const char *, int);
diff -r 283ac7146b51 -r 2c37b1aad65c sys/dev/sun/cgthree.c
--- a/sys/dev/sun/cgthree.c     Thu Apr 21 17:59:18 2016 +0000
+++ b/sys/dev/sun/cgthree.c     Thu Apr 21 18:06:06 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgthree.c,v 1.31 2014/07/25 08:10:39 dholland Exp $ */
+/*     $NetBSD: cgthree.c,v 1.32 2016/04/21 18:06:06 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.31 2014/07/25 08:10:39 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.32 2016/04/21 18:06:06 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -115,11 +115,6 @@
        }
 };
 
-#if NWSDISPLAY > 0
-#ifdef RASTERCONSOLE
-#error RASTERCONSOLE and wsdisplay are mutually exclusive
-#endif
-
 static void cg3_setup_palette(struct cgthree_softc *);
 
 struct wsscreen_descr cgthree_defaultscreen = {
@@ -162,18 +157,15 @@
 extern const u_char rasops_cmap[768];



Home | Main Index | Thread Index | Old Index