Module Name: src Committed By: jmcneill Date: Sun Jan 17 00:23:38 UTC 2021
Modified Files: src/sys/dev/wsfb: genfb.c Log Message: Prefer printing the framebuffer's PA instead of VA. It's much more useful.. To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 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.78 src/sys/dev/wsfb/genfb.c:1.79 --- src/sys/dev/wsfb/genfb.c:1.78 Mon Oct 19 01:08:06 2020 +++ src/sys/dev/wsfb/genfb.c Sun Jan 17 00:23:38 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: genfb.c,v 1.78 2020/10/19 01:08:06 rin Exp $ */ +/* $NetBSD: genfb.c,v 1.79 2021/01/17 00:23:38 jmcneill Exp $ */ /*- * Copyright (c) 2007 Michael Lorenz @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.78 2020/10/19 01:08:06 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.79 2021/01/17 00:23:38 jmcneill Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -41,6 +41,8 @@ __KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1. #include <sys/kmem.h> #include <sys/reboot.h> +#include <uvm/uvm_extern.h> + #include <dev/wscons/wsconsio.h> #include <dev/wscons/wsdisplayvar.h> #include <dev/rasops/rasops.h> @@ -214,6 +216,7 @@ genfb_attach(struct genfb_softc *sc, str struct wsemuldisplaydev_attach_args aa; prop_dictionary_t dict; struct rasops_info *ri; + paddr_t fb_phys; uint16_t crow; long defattr; bool console; @@ -231,9 +234,16 @@ genfb_attach(struct genfb_softc *sc, str == false) sc->sc_want_clear = true; + fb_phys = (paddr_t)sc->sc_fboffset; + if (fb_phys == 0) { + KASSERT(sc->sc_fbaddr != NULL); + (void)pmap_extract(pmap_kernel(), (vaddr_t)sc->sc_fbaddr, + &fb_phys); + } + aprint_verbose_dev(sc->sc_dev, "framebuffer at %p, size %dx%d, depth %d, " "stride %d\n", - sc->sc_fboffset ? (void *)(intptr_t)sc->sc_fboffset : sc->sc_fbaddr, + fb_phys ? (void *)(intptr_t)fb_phys : sc->sc_fbaddr, sc->sc_width, sc->sc_height, sc->sc_depth, sc->sc_stride); sc->sc_defaultscreen_descr = (struct wsscreen_descr){