Map the video RAM cacheable/prefetchable, it's very slow and this helps a bit.

This commit is contained in:
ad 2019-12-01 14:18:51 +00:00
parent 80e17de9fd
commit 2ca6e3ffb4
3 changed files with 15 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: vga.c,v 1.116 2019/11/10 21:16:35 chs Exp $ */
/* $NetBSD: vga.c,v 1.117 2019/12/01 14:18:51 ad Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vga.c,v 1.116 2019/11/10 21:16:35 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: vga.c,v 1.117 2019/12/01 14:18:51 ad Exp $");
#include "opt_vga.h"
/* for WSCONS_SUPPORT_PCVTFONTS */
@ -544,7 +544,9 @@ vga_init(struct vga_config *vc, bus_space_tag_t iot, bus_space_tag_t memt)
&vh->vh_ioh_6845))
panic("vga_init: couldn't map 6845 io");
if (bus_space_map(vh->vh_memt, 0xa0000, 0x20000, 0, &vh->vh_allmemh))
if (bus_space_map(vh->vh_memt, 0xa0000, 0x20000,
BUS_SPACE_MAP_CACHEABLE | BUS_SPACE_MAP_PREFETCHABLE,
&vh->vh_allmemh))
panic("vga_init: couldn't map memory");
if (bus_space_subregion(vh->vh_memt, vh->vh_allmemh,

View File

@ -1,4 +1,4 @@
/* $NetBSD: vga_raster.c,v 1.45 2019/11/10 21:16:35 chs Exp $ */
/* $NetBSD: vga_raster.c,v 1.46 2019/12/01 14:18:51 ad Exp $ */
/*
* Copyright (c) 2001, 2002 Bang Jun-Young
@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vga_raster.c,v 1.45 2019/11/10 21:16:35 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: vga_raster.c,v 1.46 2019/12/01 14:18:51 ad Exp $");
#include "opt_vga.h"
#include "opt_wsmsgattrs.h" /* for WSDISPLAY_CUSTOM_OUTPUT */
@ -395,8 +395,10 @@ vga_raster_init(struct vga_config *vc, bus_space_tag_t iot,
&vh->vh_ioh_6845))
panic("vga_raster_init: couldn't map 6845 io");
if (bus_space_map(vh->vh_memt, 0xa0000, 0x20000, 0, &vh->vh_allmemh))
panic("vga_raster_init: couldn't map memory");
if (bus_space_map(vh->vh_memt, 0xa0000, 0x20000,
BUS_SPACE_MAP_CACHEABLE | BUS_SPACE_MAP_PREFETCHABLE,
&vh->vh_allmemh))
panic("vga_init: couldn't map memory");
if (bus_space_subregion(vh->vh_memt, vh->vh_allmemh, 0, 0x10000,
&vh->vh_memh))

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcdisplay.c,v 1.43 2018/04/21 15:10:28 mlelstv Exp $ */
/* $NetBSD: pcdisplay.c,v 1.44 2019/12/01 14:18:51 ad Exp $ */
/*
* Copyright (c) 1998
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pcdisplay.c,v 1.43 2018/04/21 15:10:28 mlelstv Exp $");
__KERNEL_RCSID(0, "$NetBSD: pcdisplay.c,v 1.44 2019/12/01 14:18:51 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -190,7 +190,8 @@ pcdisplay_init(struct pcdisplay_config *dc, bus_space_tag_t iot,
dc->mono = mono;
if (bus_space_map(memt, mono ? 0xb0000 : 0xb8000, 0x8000,
0, &ph->ph_memh))
BUS_SPACE_MAP_CACHEABLE | BUS_SPACE_MAP_PREFETCHABLE,
&ph->ph_memh))
panic("pcdisplay_init: cannot map memory");
if (bus_space_map(iot, mono ? 0x3b0 : 0x3d0, 0x10,
0, &ph->ph_ioh_6845))