Module Name:    src
Committed By:   macallan
Date:           Mon Jul 23 00:51:40 UTC 2018

Modified Files:
        src/sys/dev/fdt: simplefb.c

Log Message:
if the framebuffer address isn't page aligned, set fbi_fboffset appropriately


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/fdt/simplefb.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/fdt/simplefb.c
diff -u src/sys/dev/fdt/simplefb.c:1.5 src/sys/dev/fdt/simplefb.c:1.6
--- src/sys/dev/fdt/simplefb.c:1.5	Sun May  6 10:31:10 2018
+++ src/sys/dev/fdt/simplefb.c	Mon Jul 23 00:51:40 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: simplefb.c,v 1.5 2018/05/06 10:31:10 jmcneill Exp $ */
+/* $NetBSD: simplefb.c,v 1.6 2018/07/23 00:51:40 macallan Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcne...@invisible.ca>
@@ -29,7 +29,7 @@
 #include "opt_wsdisplay_compat.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: simplefb.c,v 1.5 2018/05/06 10:31:10 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: simplefb.c,v 1.6 2018/07/23 00:51:40 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -85,8 +85,15 @@ simplefb_ioctl(void *v, void *vs, u_long
 		fbi = data;
 		ri = &sc->sc_gen.vd.active->scr_ri;
 		error = wsdisplayio_get_fbinfo(ri, fbi);
-		if (error == 0)
+		if (error == 0) {
+	                /*
+	                 * XXX
+	                 * if the fb isn't page aligned, tell wsfb to skip the
+			 * unaligned part
+			 */
+			fbi->fbi_fboffset = sc->sc_paddr & PAGE_MASK;
 			fbi->fbi_flags |= WSFB_VRAM_IS_RAM;
+		}
 		return error;
 	case WSDISPLAYIO_SVIDEO:
 		video = *(u_int *)data;

Reply via email to