diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-09-07 18:19:59 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-09-07 18:19:59 +0000 |
commit | cf31bcc318141dcdc255b387297f1a1ba01fd776 (patch) | |
tree | e5fada5e357c5ca536021e6d2c50b11cddae53bf | |
parent | 244e9281ad619efd69119512b81c5cefda39d00f (diff) |
Remap the framebuffer as write-combining when we actually attach. Speeds up
scrolling by a factor of 20 on my x1.
-rw-r--r-- | sys/arch/amd64/amd64/efifb.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/efifb.c b/sys/arch/amd64/amd64/efifb.c index 8c372f868ce..4f3375f077a 100644 --- a/sys/arch/amd64/amd64/efifb.c +++ b/sys/arch/amd64/amd64/efifb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efifb.c,v 1.5 2015/09/07 18:06:00 kettenis Exp $ */ +/* $OpenBSD: efifb.c,v 1.6 2015/09/07 18:19:58 kettenis Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net> @@ -104,10 +104,11 @@ efifb_attach(struct device *parent, struct device *self, void *aux) { struct efifb *fb; struct efifb_softc *sc = (struct efifb_softc *)self; - struct wsemuldisplaydev_attach_args - aa; + struct wsemuldisplaydev_attach_args aa; struct rasops_info *ri; int ccol = 0, crow = 0; + bus_space_tag_t iot = X86_BUS_SPACE_MEM; + bus_space_handle_t ioh; long defattr; printf("\n"); @@ -119,6 +120,11 @@ efifb_attach(struct device *parent, struct device *self, void *aux) ccol = ri->ri_ccol; crow = ri->ri_crow; + if (bus_space_map(iot, fb->paddr, fb->psize, + BUS_SPACE_MAP_PREFETCHABLE | BUS_SPACE_MAP_LINEAR, + &ioh) == 0) + ri->ri_origbits = bus_space_vaddr(iot, ioh); + efifb_rasops_preinit(fb); ri->ri_flg &= ~RI_CLEAR; ri->ri_flg |= RI_VCONS | RI_WRONLY; |