Module Name: src
Committed By: macallan
Date: Fri May 19 19:25:53 UTC 2017
Modified Files:
src/sys/arch/sgimips/dev: crmfb.c
src/sys/arch/sparc64/dev: ffb.c
Log Message:
enable font loading / screen resizing
To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/sgimips/dev/crmfb.c
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/sparc64/dev/ffb.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/sgimips/dev/crmfb.c
diff -u src/sys/arch/sgimips/dev/crmfb.c:1.43 src/sys/arch/sgimips/dev/crmfb.c:1.44
--- src/sys/arch/sgimips/dev/crmfb.c:1.43 Sun Feb 14 19:11:19 2016
+++ src/sys/arch/sgimips/dev/crmfb.c Fri May 19 19:25:53 2017
@@ -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 <[email protected]>
@@ -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 @@ struct wsscreen_descr crmfb_defaultscree
0, 0,
NULL,
8, 16,
- WSSCREEN_WSCOLORS,
+ WSSCREEN_WSCOLORS | WSSCREEN_RESIZE,
NULL,
};
@@ -356,6 +356,7 @@ crmfb_attach(device_t parent, device_t s
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 @@ crmfb_attach(device_t parent, device_t s
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 @@ crmfb_init_screen(void *c, struct vcons_
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 @@ crmfb_init_screen(void *c, struct vcons_
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;
Index: src/sys/arch/sparc64/dev/ffb.c
diff -u src/sys/arch/sparc64/dev/ffb.c:1.60 src/sys/arch/sparc64/dev/ffb.c:1.61
--- src/sys/arch/sparc64/dev/ffb.c:1.60 Thu Apr 27 23:17:21 2017
+++ src/sys/arch/sparc64/dev/ffb.c Fri May 19 19:25:53 2017
@@ -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 @@ struct wsscreen_descr ffb_stdscreen = {
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_setfg(struct ffb_sof
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 @@ ffb_attach(device_t self)
/* 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 @@ ffb_attach(device_t self)
* 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_attach(device_t self)
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 @@ ffb_init_screen(void *cookie, struct vco
* 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 @@ ffb_init_screen(void *cookie, struct vco
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;