Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/include/drm Use PHYS_TO_BUS_MEM in gen...



details:   https://anonhg.NetBSD.org/src/rev/094e0fcf1b44
branches:  trunk
changeset: 366389:094e0fcf1b44
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 15:11:58 2018 +0000

description:
Use PHYS_TO_BUS_MEM in generic bus_dmamap_load_pglist code.

For arm and x86, this is a noop.  For powerpc, it is defined by some
relevant header file.

diffstat:

 sys/external/bsd/drm2/include/drm/bus_dma_hacks.h |  16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diffs (39 lines):

diff -r d5e3a03453e9 -r 094e0fcf1b44 sys/external/bsd/drm2/include/drm/bus_dma_hacks.h
--- a/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h Mon Aug 27 15:11:46 2018 +0000
+++ b/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h Mon Aug 27 15:11:58 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma_hacks.h,v 1.10 2018/08/27 07:17:47 riastradh Exp $     */
+/*     $NetBSD: bus_dma_hacks.h,v 1.11 2018/08/27 15:11:58 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -41,11 +41,14 @@
 #include <uvm/uvm_extern.h>
 
 #if defined(__i386__) || defined(__x86_64__)
-#include <x86/bus_private.h>
-#include <x86/machdep.h>
+#  include <x86/bus_private.h>
+#  include <x86/machdep.h>
+#  define      PHYS_TO_BUS_MEM(dmat, paddr)    (paddr)
 #elif defined(__arm__) || defined(__aarch64__)
+#  define      PHYS_TO_BUS_MEM(dmat, paddr)    (paddr)
+#elif defined(__powerpc__)
 #else
-#error DRM GEM/TTM need new MI bus_dma APIs!  Halp!
+#  error DRM GEM/TTM need new MI bus_dma APIs!  Halp!
 #endif
 
 static inline int
@@ -87,7 +90,10 @@
 
        seg = 0;
        TAILQ_FOREACH(page, pglist, pageq.queue) {
-               segs[seg].ds_addr = VM_PAGE_TO_PHYS(page);
+               paddr_t paddr = VM_PAGE_TO_PHYS(page);
+               bus_addr_t baddr = PHYS_TO_BUS_MEM(tag, paddr);
+
+               segs[seg].ds_addr = baddr;
                segs[seg].ds_len = PAGE_SIZE;
                seg++;
        }



Home | Main Index | Thread Index | Old Index