• Thierry Reding's avatar
    drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping · eddbab90
    Thierry Reding authored
    [ Upstream commit b59fb482 ]
    
    Depending on the kernel configuration, early ARM architecture setup code
    may have attached the GPU to a DMA/IOMMU mapping that transparently uses
    the IOMMU to back the DMA API. Tegra requires special handling for IOMMU
    backed buffers (a special bit in the GPU's MMU page tables indicates the
    memory path to take: via the SMMU or directly to the memory controller).
    Transparently backing DMA memory with an IOMMU prevents Nouveau from
    properly handling such memory accesses and causes memory access faults.
    
    As a side-note: buffers other than those allocated in instance memory
    don't need to be physically contiguous from the GPU's perspective since
    the GPU can map them into contiguous buffers using its own MMU. Mapping
    these buffers through the IOMMU is unnecessary and will even lead to
    performance degradation because of the additional translation. One
    exception to this are compressible buffers which need large pages. In
    order to enable these large pages, multiple small pages will have to be
    combined into one large (I/O virtually contiguous) mapping via the
    IOMMU. However, that is a topic outside the scope of this fix and isn't
    currently supported. An implementation will want to explicitly create
    these large pages in the Nouveau driver, so detaching from a DMA/IOMMU
    mapping would still be required.
    Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
    Acked-by: default avatarChristoph Hellwig <hch@lst.de>
    Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
    Tested-by: default avatarNicolas Chauvet <kwizart@gmail.com>
    Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
    Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    eddbab90
tegra.c 7.91 KB