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 Fix PHYS_TO_BUS_MEM and BU...



details:   https://anonhg.NetBSD.org/src/rev/cbadc99f3f44
branches:  trunk
changeset: 968611:cbadc99f3f44
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Jan 22 07:53:45 2020 +0000

description:
Fix PHYS_TO_BUS_MEM and BUS_MEM_TO_PHYS on arm and aarch64

diffstat:

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

diffs (27 lines):

diff -r 3550df4ca2e2 -r cbadc99f3f44 sys/external/bsd/drm2/include/drm/bus_dma_hacks.h
--- a/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h Wed Jan 22 07:29:23 2020 +0000
+++ b/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h Wed Jan 22 07:53:45 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma_hacks.h,v 1.18 2019/11/05 23:27:23 jmcneill Exp $      */
+/*     $NetBSD: bus_dma_hacks.h,v 1.19 2020/01/22 07:53:45 jmcneill Exp $      */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
                const struct arm32_dma_range *dr = &dmat->_ranges[i];
 
                if (dr->dr_sysbase <= pa && pa - dr->dr_sysbase <= dr->dr_len)
-                       return dr->dr_busbase + (dr->dr_sysbase - pa);
+                       return pa - dr->dr_sysbase + dr->dr_busbase;
        }
        panic("paddr has no bus address in dma tag %p: %"PRIxPADDR, dmat, pa);
 }
@@ -74,7 +74,7 @@
                const struct arm32_dma_range *dr = &dmat->_ranges[i];
 
                if (dr->dr_busbase <= ba && ba - dr->dr_busbase <= dr->dr_len)
-                       return dr->dr_sysbase + (dr->dr_busbase - ba);
+                       return ba - dr->dr_busbase + dr->dr_sysbase;
        }
        panic("bus addr has no bus address in dma tag %p: %"PRIxPADDR, dmat,
            ba);



Home | Main Index | Thread Index | Old Index