aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x/dev.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2019-10-28 13:37:13 +0100
committerThierry Reding <treding@nvidia.com>2019-10-29 15:04:35 +0100
commitaf1cbfb9bf0fe079ca328231451fd4db8b3eafec (patch)
tree136ba6066a4ed6b84181e5850e76dc751aeda168 /drivers/gpu/host1x/dev.c
parentgpu: host1x: Allocate gather copy for host1x (diff)
downloadlinux-dev-af1cbfb9bf0fe079ca328231451fd4db8b3eafec.tar.xz
linux-dev-af1cbfb9bf0fe079ca328231451fd4db8b3eafec.zip
gpu: host1x: Support DMA mapping of buffers
If host1x_bo_pin() returns an SG table, create a DMA mapping for the buffer. For buffers that the host1x client has already mapped itself, host1x_bo_pin() returns NULL and the existing DMA address is used. Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/host1x/dev.c')
-rw-r--r--drivers/gpu/host1x/dev.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
index f30b8447a319..5bdc484398f4 100644
--- a/drivers/gpu/host1x/dev.c
+++ b/drivers/gpu/host1x/dev.c
@@ -18,10 +18,6 @@
#include <trace/events/host1x.h>
#undef CREATE_TRACE_POINTS
-#if IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU)
-#include <asm/dma-iommu.h>
-#endif
-
#include "bus.h"
#include "channel.h"
#include "debug.h"
@@ -276,17 +272,13 @@ static int host1x_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "failed to get reset: %d\n", err);
return err;
}
-#if IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU)
- if (host->dev->archdata.mapping) {
- struct dma_iommu_mapping *mapping =
- to_dma_iommu_mapping(host->dev);
- arm_iommu_detach_device(host->dev);
- arm_iommu_release_mapping(mapping);
- }
-#endif
+
if (IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL))
goto skip_iommu;
+ if (iommu_get_domain_for_dev(&pdev->dev))
+ goto skip_iommu;
+
host->group = iommu_group_get(&pdev->dev);
if (host->group) {
struct iommu_domain_geometry *geometry;