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 Arm DMA tags with _nranges...



details:   https://anonhg.NetBSD.org/src/rev/6553d7cd02e6
branches:  trunk
changeset: 1004625:6553d7cd02e6
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Nov 05 23:27:23 2019 +0000

description:
Arm DMA tags with _nranges=0 require no address translation. Handle this
in PHYS_TO_BUS_MEM and BUS_TO_PHYS_MEM instead of panicing.

diffstat:

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

diffs (29 lines):

diff -r d0758582f005 -r 6553d7cd02e6 sys/external/bsd/drm2/include/drm/bus_dma_hacks.h
--- a/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h Tue Nov 05 22:22:42 2019 +0000
+++ b/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h Tue Nov 05 23:27:23 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma_hacks.h,v 1.17 2018/08/27 15:32:39 riastradh Exp $     */
+/*     $NetBSD: bus_dma_hacks.h,v 1.18 2019/11/05 23:27:23 jmcneill Exp $      */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -51,6 +51,9 @@
 {
        unsigned i;
 
+       if (dmat->_nranges == 0)
+               return (bus_addr_t)pa;
+
        for (i = 0; i < dmat->_nranges; i++) {
                const struct arm32_dma_range *dr = &dmat->_ranges[i];
 
@@ -64,6 +67,9 @@
 {
        unsigned i;
 
+       if (dmat->_nranges == 0)
+               return (paddr_t)ba;
+
        for (i = 0; i < dmat->_nranges; i++) {
                const struct arm32_dma_range *dr = &dmat->_ranges[i];
 



Home | Main Index | Thread Index | Old Index