[PATCH RFC 097/111] staging: etnaviv: use GPU device to construct MMU
Lucas Stach
l.stach at pengutronix.de
Thu Apr 2 08:30:39 PDT 2015
The MMU is per GPU (pipe), rather than per DRM device, so it makes
a lot more sense to use the GPU device instead of the DRM device for
the MMU to hang off from.
Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
---
drivers/staging/etnaviv/etnaviv_gpu.c | 2 +-
drivers/staging/etnaviv/etnaviv_mmu.c | 2 +-
drivers/staging/etnaviv/etnaviv_mmu.h | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/etnaviv/etnaviv_gpu.c b/drivers/staging/etnaviv/etnaviv_gpu.c
index 78955055d2eb..8221df820824 100644
--- a/drivers/staging/etnaviv/etnaviv_gpu.c
+++ b/drivers/staging/etnaviv/etnaviv_gpu.c
@@ -503,7 +503,7 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu)
/* TODO: we will leak here memory - fix it! */
- gpu->mmu = etnaviv_iommu_new(gpu->drm, iommu);
+ gpu->mmu = etnaviv_iommu_new(gpu->dev, iommu);
if (!gpu->mmu) {
ret = -ENOMEM;
goto fail;
diff --git a/drivers/staging/etnaviv/etnaviv_mmu.c b/drivers/staging/etnaviv/etnaviv_mmu.c
index 4bcc3eabb3a1..f2a9f7c049e4 100644
--- a/drivers/staging/etnaviv/etnaviv_mmu.c
+++ b/drivers/staging/etnaviv/etnaviv_mmu.c
@@ -248,7 +248,7 @@ void etnaviv_iommu_destroy(struct etnaviv_iommu *mmu)
kfree(mmu);
}
-struct etnaviv_iommu *etnaviv_iommu_new(struct drm_device *dev,
+struct etnaviv_iommu *etnaviv_iommu_new(struct device *dev,
struct iommu_domain *domain)
{
struct etnaviv_iommu *mmu;
diff --git a/drivers/staging/etnaviv/etnaviv_mmu.h b/drivers/staging/etnaviv/etnaviv_mmu.h
index 9a4b493015f6..ca509441c76c 100644
--- a/drivers/staging/etnaviv/etnaviv_mmu.h
+++ b/drivers/staging/etnaviv/etnaviv_mmu.h
@@ -23,7 +23,7 @@
struct etnaviv_vram_mapping;
struct etnaviv_iommu {
- struct drm_device *dev;
+ struct device *dev;
struct iommu_domain *domain;
/* memory manager for GPU address area */
@@ -48,7 +48,7 @@ void etnaviv_iommu_unmap_gem(struct etnaviv_iommu *mmu,
struct etnaviv_vram_mapping *mapping);
void etnaviv_iommu_destroy(struct etnaviv_iommu *iommu);
-struct etnaviv_iommu *etnaviv_iommu_new(struct drm_device *dev,
+struct etnaviv_iommu *etnaviv_iommu_new(struct device *dev,
struct iommu_domain *domain);
#endif /* __ETNAVIV_MMU_H__ */
--
2.1.4
More information about the dri-devel
mailing list