summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormacallan <macallan@NetBSD.org>2021-05-21 20:22:15 +0000
committermacallan <macallan@NetBSD.org>2021-05-21 20:22:15 +0000
commit86be99eeebe807ccb4c03e0ed91579a8778c84ec (patch)
tree6b6192a01bc312ef817200bde749f65c8e66d992 /sys/dev
parent7d9a46764e149a4f4fb26f696b5b656b19767669 (diff)
use probed VRAM size to determine where to put the cursor instead of blindly
assuming 16MB also make sure the glyph cache can't overlap with the cursor
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/voyager/voyagerfb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/pci/voyager/voyagerfb.c b/sys/dev/pci/voyager/voyagerfb.c
index 6314fd73992..14d48f66b29 100644
--- a/sys/dev/pci/voyager/voyagerfb.c
+++ b/sys/dev/pci/voyager/voyagerfb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: voyagerfb.c,v 1.30 2021/04/24 23:36:58 thorpej Exp $ */
+/* $NetBSD: voyagerfb.c,v 1.31 2021/05/21 20:22:15 macallan Exp $ */
/*
* Copyright (c) 2009, 2011 Michael Lorenz
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: voyagerfb.c,v 1.30 2021/04/24 23:36:58 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: voyagerfb.c,v 1.31 2021/05/21 20:22:15 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -328,7 +328,8 @@ voyagerfb_attach(device_t parent, device_t self, void *aux)
(*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
}
glyphcache_init(&sc->sc_gc, sc->sc_height,
- (sc->sc_fbsize / sc->sc_stride) - sc->sc_height,
+ ((sc->sc_fbsize - 16 * 64) / sc->sc_stride) -
+ sc->sc_height,
sc->sc_width,
ri->ri_font->fontwidth,
ri->ri_font->fontheight,
@@ -780,7 +781,7 @@ voyagerfb_init(struct voyagerfb_softc *sc)
reg);
/* put the cursor at the end of video memory */
- sc->sc_cursor_addr = 16 * 1024 * 1024 - 16 * 64; /* XXX */
+ sc->sc_cursor_addr = sc->sc_fbsize - 16 * 64; /* XXX */
DPRINTF("%s: %08x\n", __func__, sc->sc_cursor_addr);
sc->sc_cursor = (uint32_t *)((uint8_t *)bus_space_vaddr(sc->sc_memt,
sc->sc_fbh) + sc->sc_cursor_addr);