Module Name:    src
Committed By:   macallan
Date:           Mon Feb 16 14:10:00 UTC 2015

Modified Files:
        src/sys/arch/mips/mips: bus_dma.c

Log Message:
mmap() DMA buffers uncached if we know how.
>From sgimips, needed for X on O2.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/mips/mips/bus_dma.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/mips/bus_dma.c
diff -u src/sys/arch/mips/mips/bus_dma.c:1.32 src/sys/arch/mips/mips/bus_dma.c:1.33
--- src/sys/arch/mips/mips/bus_dma.c:1.32	Fri Feb 13 17:19:23 2015
+++ src/sys/arch/mips/mips/bus_dma.c	Mon Feb 16 14:10:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.32 2015/02/13 17:19:23 skrll Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.33 2015/02/16 14:10:00 macallan Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.32 2015/02/13 17:19:23 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.33 2015/02/16 14:10:00 macallan Exp $");
 
 #define _MIPS_BUS_DMA_PRIVATE
 
@@ -1162,7 +1162,16 @@ _bus_dmamem_mmap(bus_dma_tag_t t, bus_dm
 
 		pa = (paddr_t)segs[i].ds_addr + off;
 
+/*
+ * This is for machines which use normal RAM as video memory, so userland can
+ * mmap() it and treat it like device memory, which is normally uncached.
+ * Needed for X11 on SGI O2, will likely be needed on things like CI20.
+ */
+#if defined(_MIPS_PADDR_T_64BIT) || defined(_LP64)
+		return (mips_btop(pa | PGC_NOCACHE));
+#else
 		return mips_btop(pa);
+#endif
 	}
 
 	/* Page not found. */

Reply via email to