Commit e095c8fe authored by Lucas Stach's avatar Lucas Stach

drm/etnaviv: indirect IOMMU restore through etnaviv MMU

So we can call the v2 restore code once it is there.
Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
parent 99f861bc
...@@ -569,7 +569,7 @@ static void etnaviv_gpu_hw_init(struct etnaviv_gpu *gpu) ...@@ -569,7 +569,7 @@ static void etnaviv_gpu_hw_init(struct etnaviv_gpu *gpu)
} }
/* setup the MMU */ /* setup the MMU */
etnaviv_iommuv1_restore(gpu); etnaviv_iommu_restore(gpu);
/* Start command processor */ /* Start command processor */
prefetch = etnaviv_buffer_init(gpu); prefetch = etnaviv_buffer_init(gpu);
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "etnaviv_drv.h" #include "etnaviv_drv.h"
#include "etnaviv_gem.h" #include "etnaviv_gem.h"
#include "etnaviv_gpu.h" #include "etnaviv_gpu.h"
#include "etnaviv_iommu.h"
#include "etnaviv_mmu.h" #include "etnaviv_mmu.h"
static int etnaviv_fault_handler(struct iommu_domain *iommu, struct device *dev, 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, ...@@ -281,6 +282,14 @@ struct etnaviv_iommu *etnaviv_iommu_new(struct etnaviv_gpu *gpu,
return mmu; 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) size_t etnaviv_iommu_dump_size(struct etnaviv_iommu *iommu)
{ {
struct etnaviv_iommu_ops *ops; struct etnaviv_iommu_ops *ops;
......
...@@ -67,5 +67,6 @@ void etnaviv_iommu_dump(struct etnaviv_iommu *iommu, void *buf); ...@@ -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 etnaviv_iommu *etnaviv_iommu_new(struct etnaviv_gpu *gpu,
struct iommu_domain *domain, enum etnaviv_iommu_version version); struct iommu_domain *domain, enum etnaviv_iommu_version version);
void etnaviv_iommu_restore(struct etnaviv_gpu *gpu);
#endif /* __ETNAVIV_MMU_H__ */ #endif /* __ETNAVIV_MMU_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment