Source-Changes-HG archive

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

[src/trunk]: src/sys/arch enable font loading / screen resizing



details:   https://anonhg.NetBSD.org/src/rev/033a91aedd96
branches:  trunk
changeset: 353741:033a91aedd96
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri May 19 19:25:53 2017 +0000

description:
enable font loading / screen resizing

diffstat:

 sys/arch/sgimips/dev/crmfb.c |  16 +++++++++++-----
 sys/arch/sparc64/dev/ffb.c   |  17 +++++++++--------
 2 files changed, 20 insertions(+), 13 deletions(-)

diffs (149 lines):

diff -r 5a3fe40877fe -r 033a91aedd96 sys/arch/sgimips/dev/crmfb.c
--- a/sys/arch/sgimips/dev/crmfb.c      Fri May 19 19:23:24 2017 +0000
+++ b/sys/arch/sgimips/dev/crmfb.c      Fri May 19 19:25:53 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crmfb.c,v 1.43 2016/02/14 19:11:19 dholland Exp $ */
+/* $NetBSD: crmfb.c,v 1.44 2017/05/19 19:25:53 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: crmfb.c,v 1.43 2016/02/14 19:11:19 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crmfb.c,v 1.44 2017/05/19 19:25:53 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -74,7 +74,7 @@
        0, 0,
        NULL,
        8, 16,
-       WSSCREEN_WSCOLORS,
+       WSSCREEN_WSCOLORS | WSSCREEN_RESIZE,
        NULL,
 };
 
@@ -356,6 +356,7 @@
            sc->sc_dma.size, 0, BUS_DMA_NOWAIT, &sc->sc_dma.map);
        if (rv)
                panic("crmfb_attach: can't create DMA map");
+
        rv = bus_dmamap_load(sc->sc_dmat, sc->sc_dma.map, sc->sc_dma.addr,
            sc->sc_dma.size, NULL, BUS_DMA_NOWAIT);
        if (rv)
@@ -366,8 +367,10 @@
        for (i = 0; i < (sc->sc_tiles_x * sc->sc_tiles_y); i++) {
                p[i] = ((uint32_t)v >> 16) + i;
        }
+
        bus_dmamap_sync(sc->sc_dmat, sc->sc_dmai.map, 0, sc->sc_dmai.size,
            BUS_DMASYNC_PREWRITE);
+
        sc->sc_linear = (paddr_t)DMAADDR(sc->sc_dma) + 0x100000 * sc->sc_tiles_x;
        sc->sc_lptr =  (char *)KERNADDR(sc->sc_dma) + (0x100000 * sc->sc_tiles_x);
 
@@ -602,7 +605,10 @@
        sc = (struct crmfb_softc *)c;
        ri = &scr->scr_ri;
 
-       ri->ri_flg = RI_CENTER | RI_FULLCLEAR | RI_ENABLE_ALPHA;
+       scr->scr_flags |= VCONS_LOADFONT;
+
+       ri->ri_flg = RI_CENTER | RI_FULLCLEAR |
+                    RI_ENABLE_ALPHA | RI_PREFER_ALPHA;
        ri->ri_depth = sc->sc_console_depth;
        ri->ri_width = sc->sc_width;
        ri->ri_height = sc->sc_height;
@@ -629,7 +635,7 @@
        ri->ri_bits = NULL;
 
        rasops_init(ri, 0, 0);
-       ri->ri_caps = WSSCREEN_WSCOLORS;
+       ri->ri_caps = WSSCREEN_WSCOLORS | WSSCREEN_RESIZE;
        rasops_reconfig(ri, ri->ri_height / ri->ri_font->fontheight,
            ri->ri_width / ri->ri_font->fontwidth);
        ri->ri_hw = scr;
diff -r 5a3fe40877fe -r 033a91aedd96 sys/arch/sparc64/dev/ffb.c
--- a/sys/arch/sparc64/dev/ffb.c        Fri May 19 19:23:24 2017 +0000
+++ b/sys/arch/sparc64/dev/ffb.c        Fri May 19 19:25:53 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffb.c,v 1.60 2017/04/27 23:17:21 macallan Exp $        */
+/*     $NetBSD: ffb.c,v 1.61 2017/05/19 19:25:53 macallan Exp $        */
 /*     $OpenBSD: creator.c,v 1.20 2002/07/30 19:48:15 jason Exp $      */
 
 /*
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffb.c,v 1.60 2017/04/27 23:17:21 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffb.c,v 1.61 2017/05/19 19:25:53 macallan Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -100,7 +100,8 @@
        0, 0,   /* will be filled in -- XXX shouldn't, it's global. */
        0,
        0, 0,
-       WSSCREEN_REVERSE | WSSCREEN_WSCOLORS,
+       WSSCREEN_REVERSE | WSSCREEN_WSCOLORS | WSSCREEN_UNDERLINE |
+           WSSCREEN_RESIZE,
        NULL    /* modecookie */
 };
 
@@ -131,7 +132,6 @@
 static void    ffb_ras_setbg(struct ffb_softc *, int32_t);
 
 void   ffb_clearscreen(struct ffb_softc *);
-int    ffb_load_font(void *, void *, struct wsdisplay_font *);
 void   ffb_init_screen(void *, struct vcons_screen *, int, 
            long *);
 int    ffb_allocattr(void *, int, int, int, long *);
@@ -338,6 +338,7 @@
 
        /* we mess with ffb_console_screen only once */
        if (sc->sc_console) {
+               ffb_console_screen.scr_flags = VCONS_SCREEN_IS_STATIC;
                vcons_init_screen(&sc->vd, &ffb_console_screen, 1, &defattr);
                SCREEN_VISIBLE((&ffb_console_screen));
                /* 
@@ -345,7 +346,6 @@
                 * screen
                 */
                sc->vd.active = &ffb_console_screen;
-               ffb_console_screen.scr_flags = VCONS_SCREEN_IS_STATIC;
        } else {
                if (ffb_console_screen.scr_ri.ri_rows == 0) {
                        /* do some minimal setup to avoid weirdnesses later */
@@ -357,7 +357,6 @@
        ffb_stdscreen.nrows = ri->ri_rows;
        ffb_stdscreen.ncols = ri->ri_cols;
        ffb_stdscreen.textops = &ri->ri_ops;
-       ffb_stdscreen.capabilities = ri->ri_caps;
        
        sc->sc_fb.fb_driver = &ffb_fbdriver;
        sc->sc_fb.fb_type.fb_cmsize = 0;
@@ -1255,7 +1254,8 @@
         * we can't accelerate copycols() so instead of falling back to
         * software use vcons' putchar() based implementation
         */
-       scr->scr_flags |= VCONS_NO_COPYCOLS;
+       scr->scr_flags |= VCONS_NO_COPYCOLS | VCONS_LOADFONT;
+
 #ifdef VCONS_DRAW_INTR
         scr->scr_flags |= VCONS_DONT_READ;
 #endif
@@ -1270,9 +1270,10 @@
        ri->ri_bpos = 16;
 
        rasops_init(ri, 0, 0);
-       ri->ri_caps = WSSCREEN_WSCOLORS | WSSCREEN_UNDERLINE | WSSCREEN_REVERSE;
        rasops_reconfig(ri, sc->sc_height / ri->ri_font->fontheight,
                    sc->sc_width / ri->ri_font->fontwidth);
+       ri->ri_caps = WSSCREEN_WSCOLORS | WSSCREEN_UNDERLINE | 
+                     WSSCREEN_REVERSE | WSSCREEN_RESIZE;
 
        /* enable acceleration */
        ri->ri_ops.copyrows = ffb_ras_copyrows;



Home | Main Index | Thread Index | Old Index