From 8186ecd8fbb8a8a2a9b7ecdfb31294d26a3db07e Mon Sep 17 00:00:00 2001 From: kettenis Date: Mon, 18 Dec 2017 10:13:45 +0000 Subject: [PATCH] Map framebuffer into userland as non-cachable (but normal) memory. We still map the framebuffer as device memory in the kernel. Using mismatched memory attributes like this is discouraged (and we should probably fix this at some point) but this particular case is well-defined and the potential side-effects should not matter for thus use-case. ok patrick@ --- sys/dev/fdt/simplefb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/fdt/simplefb.c b/sys/dev/fdt/simplefb.c index 893dafea658..11c1a28d94a 100644 --- a/sys/dev/fdt/simplefb.c +++ b/sys/dev/fdt/simplefb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: simplefb.c,v 1.2 2017/08/27 12:42:22 kettenis Exp $ */ +/* $OpenBSD: simplefb.c,v 1.3 2017/12/18 10:13:45 kettenis Exp $ */ /* * Copyright (c) 2016 Mark Kettenis * @@ -19,6 +19,8 @@ #include #include +#include + #include #include @@ -276,7 +278,7 @@ simplefb_wsmmap(void *v, off_t off, int prot) if (off < 0 || off >= sc->sc_psize) return -1; - return sc->sc_paddr + off; + return ((sc->sc_paddr + off) | PMAP_NOCACHE); } int -- 2.20.1