Module Name:    src
Committed By:   macallan
Date:           Wed Jun 21 21:40:36 UTC 2017

Modified Files:
        src/sys/dev/pci: r128fb.c

Log Message:
allow font loading etc.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pci/r128fb.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/dev/pci/r128fb.c
diff -u src/sys/dev/pci/r128fb.c:1.40 src/sys/dev/pci/r128fb.c:1.41
--- src/sys/dev/pci/r128fb.c:1.40	Fri Jan 20 12:25:07 2017
+++ src/sys/dev/pci/r128fb.c	Wed Jun 21 21:40:36 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: r128fb.c,v 1.40 2017/01/20 12:25:07 maya Exp $	*/
+/*	$NetBSD: r128fb.c,v 1.41 2017/06/21 21:40:36 macallan Exp $	*/
 
 /*
  * Copyright (c) 2007, 2012 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: r128fb.c,v 1.40 2017/01/20 12:25:07 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: r128fb.c,v 1.41 2017/06/21 21:40:36 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -262,7 +262,8 @@ r128fb_attach(device_t parent, device_t 
 		0, 0,
 		NULL,
 		8, 16,
-		WSSCREEN_WSCOLORS | WSSCREEN_HILIT,
+		WSSCREEN_WSCOLORS | WSSCREEN_HILIT | WSSCREEN_UNDERLINE |
+		      WSSCREEN_RESIZE,
 		NULL
 	};
 	sc->sc_screens[0] = &sc->sc_defaultscreen_descr;
@@ -273,6 +274,8 @@ r128fb_attach(device_t parent, device_t 
 	vcons_init(&sc->vd, sc, &sc->sc_defaultscreen_descr,
 	    &r128fb_accessops);
 	sc->vd.init_screen = r128fb_init_screen;
+	sc->vd.show_screen_cookie = &sc->sc_gc;
+	sc->vd.show_screen_cb = glyphcache_adapt;
 
 	/* init engine here */
 	r128fb_init(sc);
@@ -461,8 +464,10 @@ r128fb_ioctl(void *v, void *vs, u_long c
 		return wsdisplayio_get_edid(sc->sc_dev, d);
 	}
 
-	case WSDISPLAYIO_GET_FBINFO: {
-		struct wsdisplayio_fbinfo *fbi = data;
+	case WSDISPLAYIO_GET_FBINFO:
+	{
+			struct wsdisplayio_fbinfo *fbi = data;
+
 		return wsdisplayio_get_fbinfo(&ms->scr_ri, fbi);
 	}
 	}
@@ -540,13 +545,16 @@ r128fb_init_screen(void *cookie, struct 
 	ri->ri_stride = sc->sc_stride;
 	ri->ri_flg = RI_CENTER;
 	if (sc->sc_depth == 8)
-		ri->ri_flg |= RI_8BIT_IS_RGB | RI_ENABLE_ALPHA;
+		ri->ri_flg |= RI_8BIT_IS_RGB | RI_ENABLE_ALPHA |
+			      RI_PREFER_ALPHA;
 
 	rasops_init(ri, 0, 0);
-	ri->ri_caps = WSSCREEN_WSCOLORS;
+	ri->ri_caps = WSSCREEN_WSCOLORS | WSSCREEN_HILIT | WSSCREEN_UNDERLINE |
+		      WSSCREEN_RESIZE;
 #ifdef VCONS_DRAW_INTR
 	scr->scr_flags |= VCONS_DONT_READ;
 #endif
+	scr->scr_flags |= VCONS_LOADFONT;
 
 	rasops_reconfig(ri, sc->sc_height / ri->ri_font->fontheight,
 		    sc->sc_width / ri->ri_font->fontwidth);
@@ -803,9 +811,9 @@ r128fb_cursor(void *cookie, int on, int 
 	he = ri->ri_font->fontheight;
 	
 	if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
-		x = ri->ri_ccol * wi + ri->ri_xorigin;
-		y = ri->ri_crow * he + ri->ri_yorigin;
 		if (ri->ri_flg & RI_CURSOR) {
+			x = ri->ri_ccol * wi + ri->ri_xorigin;
+			y = ri->ri_crow * he + ri->ri_yorigin;
 			r128fb_bitblt(sc, x, y, x, y, wi, he, R128_ROP3_Dn);
 			ri->ri_flg &= ~RI_CURSOR;
 		}

Reply via email to