]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/etnaviv: indirect IOMMU restore through etnaviv MMU
authorLucas Stach <l.stach@pengutronix.de>
Tue, 16 Aug 2016 09:54:51 +0000 (11:54 +0200)
committerLucas Stach <l.stach@pengutronix.de>
Thu, 15 Sep 2016 13:29:35 +0000 (15:29 +0200)
So we can call the v2 restore code once it is there.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
drivers/gpu/drm/etnaviv/etnaviv_gpu.c
drivers/gpu/drm/etnaviv/etnaviv_mmu.c
drivers/gpu/drm/etnaviv/etnaviv_mmu.h

index 0dde3f7fc678e01176afe12ad582a9bd466397a7..40610595a2d3e021eb0a627c7aaabf3b1b16f393 100644 (file)
@@ -569,7 +569,7 @@ static void etnaviv_gpu_hw_init(struct etnaviv_gpu *gpu)
        }
 
        /* setup the MMU */
-       etnaviv_iommuv1_restore(gpu);
+       etnaviv_iommu_restore(gpu);
 
        /* Start command processor */
        prefetch = etnaviv_buffer_init(gpu);
index e2013b5b3f6a9e41dee7e8da4068534737293e62..55d4229f693214c4f027fb8228c2093e392b3380 100644 (file)
@@ -17,6 +17,7 @@
 #include "etnaviv_drv.h"
 #include "etnaviv_gem.h"
 #include "etnaviv_gpu.h"
+#include "etnaviv_iommu.h"
 #include "etnaviv_mmu.h"
 
 static int etnaviv_fault_handler(struct iommu_domain *iommu, struct device *dev,
@@ -281,6 +282,14 @@ struct etnaviv_iommu *etnaviv_iommu_new(struct etnaviv_gpu *gpu,
        return mmu;
 }
 
+void etnaviv_iommu_restore(struct etnaviv_gpu *gpu)
+{
+       if (gpu->mmu->version == ETNAVIV_IOMMU_V1)
+               etnaviv_iommuv1_restore(gpu);
+       else
+               dev_err(gpu->dev, "IOMMUv2 restore not implemented\n");
+}
+
 size_t etnaviv_iommu_dump_size(struct etnaviv_iommu *iommu)
 {
        struct etnaviv_iommu_ops *ops;
index fff215a47630598db849c349b09394fd12eafaf0..dea1314fc44e148532e38f8f54caead6a990b5c5 100644 (file)
@@ -67,5 +67,6 @@ void etnaviv_iommu_dump(struct etnaviv_iommu *iommu, void *buf);
 
 struct etnaviv_iommu *etnaviv_iommu_new(struct etnaviv_gpu *gpu,
        struct iommu_domain *domain, enum etnaviv_iommu_version version);
+void etnaviv_iommu_restore(struct etnaviv_gpu *gpu);
 
 #endif /* __ETNAVIV_MMU_H__ */