summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormacallan <macallan@NetBSD.org>2014-01-14 01:35:13 +0000
committermacallan <macallan@NetBSD.org>2014-01-14 01:35:13 +0000
commit9783553a9a52a60dfce8a3f4794f51de80bc4d1e (patch)
tree57210587b81460dd74ed38d907e6dec666d4b21d /sys/dev
parent3c32d2e3c34dad77adee3090893606f6b082e6eb (diff)
- move cursor area to the end of each display's chunk of fb RAM
- use memory between display and cursor as glyph cache instead of blindly trying to use 8MB should fix PR 48492
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/radeonfb.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/dev/pci/radeonfb.c b/sys/dev/pci/radeonfb.c
index a5ab02b64f9..e94b30c01d2 100644
--- a/sys/dev/pci/radeonfb.c
+++ b/sys/dev/pci/radeonfb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: radeonfb.c,v 1.79 2013/10/09 17:18:23 macallan Exp $ */
+/* $NetBSD: radeonfb.c,v 1.80 2014/01/14 01:35:13 macallan Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.79 2013/10/09 17:18:23 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.80 2014/01/14 01:35:13 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -816,7 +816,8 @@ radeonfb_attach(device_t parent, device_t dev, void *aux)
aprint_normal("%s: display %d: "
"initial virtual resolution %dx%d at %d bpp\n",
XNAME(sc), i, dp->rd_virtx, dp->rd_virty, dp->rd_bpp);
-
+ aprint_normal_dev(sc->sc_dev, "using %d MB per display\n",
+ sc->sc_fboffset >> 20);
/* now select the *video mode* that we will use */
for (j = 0; j < dp->rd_ncrtcs; j++) {
const struct videomode *vmp;
@@ -848,7 +849,7 @@ radeonfb_attach(device_t parent, device_t dev, void *aux)
dp->rd_offset = sc->sc_fboffset * i;
dp->rd_fbptr = (vaddr_t)bus_space_vaddr(sc->sc_memt,
sc->sc_memh) + dp->rd_offset;
- dp->rd_curoff = sc->sc_fbsize;
+ dp->rd_curoff = sc->sc_fboffset - 4096; /* 4KB cursor space */
dp->rd_curptr = dp->rd_fbptr + dp->rd_curoff;
DPRINTF(("fpbtr = %p\n", (void *)dp->rd_fbptr));
@@ -924,8 +925,13 @@ radeonfb_attach(device_t parent, device_t dev, void *aux)
dp->rd_gc.gc_rectfill = radeonfb_rectfill_a;
dp->rd_gc.gc_rop = RADEON_ROP3_S;
dp->rd_gc.gc_blitcookie = dp;
+ /*
+ * use memory between framebuffer and cursor area as glyph
+ * cache, cap at 4096 lines
+ */
glyphcache_init(&dp->rd_gc, dp->rd_virty + 4,
- (0x800000 / dp->rd_stride) - (dp->rd_virty + 4),
+ min(4096,
+ (dp->rd_curoff / dp->rd_stride) - (dp->rd_virty + 4)),
dp->rd_virtx,
ri->ri_font->fontwidth,
ri->ri_font->fontheight,