Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 Unfortunately the current MTRR code can't g...



details:   https://anonhg.NetBSD.org/src/rev/136d8488ae66
branches:  trunk
changeset: 761884:136d8488ae66
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Thu Feb 10 10:21:40 2011 +0000

description:
Unfortunately the current MTRR code can't grow an existing WC mapping, and
since we don't know the total framebuffer size setting up an MTRR here
would prevent X from creating a larger one later.

Instead map the framebuffer with BUS_SPACE_MAP_PREFETCHABLE and hope that
PAT is supported.

diffstat:

 sys/arch/x86/x86/genfb_machdep.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (43 lines):

diff -r f1ddf56e306a -r 136d8488ae66 sys/arch/x86/x86/genfb_machdep.c
--- a/sys/arch/x86/x86/genfb_machdep.c  Thu Feb 10 08:54:12 2011 +0000
+++ b/sys/arch/x86/x86/genfb_machdep.c  Thu Feb 10 10:21:40 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb_machdep.c,v 1.7 2011/02/09 13:24:24 jmcneill Exp $ */
+/* $NetBSD: genfb_machdep.c,v 1.8 2011/02/10 10:21:40 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.7 2011/02/09 13:24:24 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.8 2011/02/10 10:21:40 jmcneill Exp $");
 
 #include "opt_mtrr.h"
 
@@ -100,6 +100,7 @@
 void
 x86_genfb_mtrr_init(uint64_t physaddr, uint32_t size)
 {
+#if notyet
 #ifdef MTRR
        struct mtrr mtrr;
        int error, n;
@@ -129,6 +130,7 @@
 #else
        aprint_debug("%s: kernel lacks MTRR option\n", __func__);
 #endif
+#endif
 }
 
 int
@@ -158,7 +160,7 @@
 
        err = _x86_memio_map(t, (bus_addr_t)fbinfo->physaddr,
            fbinfo->width * fbinfo->stride,
-           BUS_SPACE_MAP_LINEAR, &h);
+           BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE, &h);
        if (err) {
                aprint_error("x86_genfb_cnattach: couldn't map framebuffer\n");
                return 0;



Home | Main Index | Thread Index | Old Index