Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci/voyager use probed VRAM size to determine where ...



details:   https://anonhg.NetBSD.org/src/rev/cc96feb97665
branches:  trunk
changeset: 379230:cc96feb97665
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri May 21 20:22:15 2021 +0000

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

 sys/dev/pci/voyager/voyagerfb.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 2c81c05d967b -r cc96feb97665 sys/dev/pci/voyager/voyagerfb.c
--- a/sys/dev/pci/voyager/voyagerfb.c   Fri May 21 17:32:49 2021 +0000
+++ b/sys/dev/pci/voyager/voyagerfb.c   Fri May 21 20:22:15 2021 +0000
@@ -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
                        (*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 *s
            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);



Home | Main Index | Thread Index | Old Index