Module Name:    src
Committed By:   rin
Date:           Sat Jul  9 13:37:13 UTC 2022

Modified Files:
        src/sys/dev/wsfb: genfb.c

Log Message:
Fix GENFB_GLYPHCACHE with shadow fb.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/dev/wsfb/genfb.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/wsfb/genfb.c
diff -u src/sys/dev/wsfb/genfb.c:1.86 src/sys/dev/wsfb/genfb.c:1.87
--- src/sys/dev/wsfb/genfb.c:1.86	Mon Mar 28 11:21:40 2022
+++ src/sys/dev/wsfb/genfb.c	Sat Jul  9 13:37:12 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfb.c,v 1.86 2022/03/28 11:21:40 mlelstv Exp $ */
+/*	$NetBSD: genfb.c,v 1.87 2022/07/09 13:37:12 rin Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.86 2022/03/28 11:21:40 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.87 2022/07/09 13:37:12 rin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1004,7 +1004,7 @@ genfb_putchar(void *cookie, int row, int
 	struct rasops_info *ri = cookie;
 	struct vcons_screen *scr = ri->ri_hw;
 	struct genfb_softc *sc = scr->scr_cookie;
-	uint8_t *src, *dst;
+	uint8_t *src, *dst, *hwdst;
 	gc_bucket *b;
 	int i, idx, bi, cell;
 
@@ -1084,6 +1084,16 @@ genfb_putchar(void *cookie, int row, int
 		src += ri->ri_xscale;
 		dst += ri->ri_stride;
 	}
+	if (ri->ri_hwbits) {
+		src = sc->sc_cache + cell * sc->sc_cache_ri.ri_yscale;
+		hwdst = ri->ri_hwbits
+		    + row * ri->ri_yscale + col * ri->ri_xscale;
+		for (i = 0; i < ri->ri_font->fontheight; i++) {
+			memcpy(hwdst, src, ri->ri_xscale);
+			src += ri->ri_xscale;
+			hwdst += ri->ri_stride;
+		}
+	}
 	b->gb_lastread = time_uptime;
 	return;
 nope:

Reply via email to