Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci - move cursor area to the end of each display's ...



details:   https://anonhg.NetBSD.org/src/rev/aff8ece19da6
branches:  trunk
changeset: 792698:aff8ece19da6
user:      macallan <macallan%NetBSD.org@localhost>
date:      Tue Jan 14 01:35:13 2014 +0000

description:
- 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:

 sys/dev/pci/radeonfb.c |  16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diffs (52 lines):

diff -r feee1dc6cfe1 -r aff8ece19da6 sys/dev/pci/radeonfb.c
--- a/sys/dev/pci/radeonfb.c    Mon Jan 13 21:15:36 2014 +0000
+++ b/sys/dev/pci/radeonfb.c    Tue Jan 14 01:35:13 2014 +0000
@@ -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 @@
                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 @@
                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 @@
                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,



Home | Main Index | Thread Index | Old Index