diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-09-22 17:41:53 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-09-22 17:41:53 +0000 |
commit | 086f558ac311426b8d18d747120d2a4accb5206b (patch) | |
tree | b8c34e7a5ae703cf18eb19253f103ffc235a74d8 /sys/arch/amd64 | |
parent | 4c7d9c2a27578f7c2581e858326103b2594d50eb (diff) |
Remap the UEFI buffer early such that we can use a write combining mapping
which speeds things up considerably compared to an uncached mapping.
ok deraadt@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/efifb.c | 30 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/mainbus.c | 6 | ||||
-rw-r--r-- | sys/arch/amd64/include/efifbvar.h | 3 |
3 files changed, 31 insertions, 8 deletions
diff --git a/sys/arch/amd64/amd64/efifb.c b/sys/arch/amd64/amd64/efifb.c index 3a2ed3625fc..255b8f7760d 100644 --- a/sys/arch/amd64/amd64/efifb.c +++ b/sys/arch/amd64/amd64/efifb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efifb.c,v 1.17 2018/07/12 12:47:57 fcambus Exp $ */ +/* $OpenBSD: efifb.c,v 1.18 2018/09/22 17:41:52 kettenis Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net> @@ -215,11 +215,6 @@ 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; @@ -428,6 +423,7 @@ efifb_efiinfo_init(struct efifb *fb) fb->psize = bios_efiinfo->fb_height * bios_efiinfo->fb_pixpsl * (fb->depth / 8); } + void efifb_cnattach_common(void) { @@ -452,6 +448,28 @@ efifb_cnattach_common(void) wsdisplay_cnattach(&efifb_std_descr, ri, 0, 0, defattr); } +void +efifb_cnremap(void) +{ + struct efifb *fb = &efifb_console; + struct rasops_info *ri = &fb->rinfo; + bus_space_tag_t iot = X86_BUS_SPACE_MEM; + bus_space_handle_t ioh; + + if (fb->paddr == 0) + return; + + 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_CENTER | RI_WRONLY; + + rasops_init(ri, efifb_std_descr.nrows, efifb_std_descr.ncols); +} + int efifb_is_console(struct pci_attach_args *pa) { diff --git a/sys/arch/amd64/amd64/mainbus.c b/sys/arch/amd64/amd64/mainbus.c index 2f0a74f51d2..f4fb3ec02fd 100644 --- a/sys/arch/amd64/amd64/mainbus.c +++ b/sys/arch/amd64/amd64/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.44 2018/07/13 08:30:34 sf Exp $ */ +/* $OpenBSD: mainbus.c,v 1.45 2018/09/22 17:41:52 kettenis Exp $ */ /* $NetBSD: mainbus.c,v 1.1 2003/04/26 18:39:29 fvdl Exp $ */ /* @@ -171,6 +171,10 @@ mainbus_attach(struct device *parent, struct device *self, void *aux) pvbus_identify(); #endif +#if NEFIFB > 0 + efifb_cnremap(); +#endif + #if NBIOS > 0 { mba.mba_bios.ba_name = "bios"; diff --git a/sys/arch/amd64/include/efifbvar.h b/sys/arch/amd64/include/efifbvar.h index 558199631b6..a900cd0238d 100644 --- a/sys/arch/amd64/include/efifbvar.h +++ b/sys/arch/amd64/include/efifbvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: efifbvar.h,v 1.7 2018/04/25 00:46:28 jsg Exp $ */ +/* $OpenBSD: efifbvar.h,v 1.8 2018/09/22 17:41:52 kettenis Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net> @@ -26,6 +26,7 @@ struct efifb_attach_args { struct pci_attach_args; int efifb_cnattach(void); +void efifb_cnremap(void); int efifb_is_console(struct pci_attach_args *); void efifb_cndetach(void); void efifb_cnreattach(void); |