summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2013-09-16 16:07:24 +0200
committerLucas Stach <l.stach@pengutronix.de>2013-09-17 08:45:24 +0200
commit0cfdf63b987e5a6dc8df7784110312bb99101920 (patch)
tree5b6bd5fd12b4c8b4d7bad37e0be299eab851fb93
parent1043a4036b2e8ca7dc12da3a7018fb3271699c1b (diff)
downloadlinux-0cfdf63b987e5a6dc8df7784110312bb99101920.tar.gz
WIP: move all iommu handling into msm specific driver part
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
-rw-r--r--drivers/gpu/drm/msm/adreno/adreno_gpu.c10
-rw-r--r--drivers/gpu/drm/msm/msm_gpu.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 0e995f1..f5abcc1 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -303,11 +303,6 @@ void adreno_wait_ring(struct adreno_gpu *gpu, uint32_t ndwords)
} while(freedwords < ndwords);
}
-static const char *iommu_ports[] = {
- "gfx3d_user", "gfx3d_priv",
- "gfx3d1_user", "gfx3d1_priv",
-};
-
static inline bool _rev_match(uint8_t entry, uint8_t id)
{
return (entry == ANY_ID) || (entry == id);
@@ -432,11 +427,6 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
if (ret)
return ret;
- ret = msm_iommu_attach(drm, gpu->base.iommu,
- iommu_ports, ARRAY_SIZE(iommu_ports));
- if (ret)
- return ret;
-
gpu->memptrs_bo = gpu->gem->gem_new(gpu->gem->priv,
sizeof(*gpu->memptrs), MSM_BO_UNCACHED);
if (IS_ERR(gpu->memptrs_bo)) {
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index f815247..4b93c81 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -102,6 +102,11 @@ int msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
* Init/Cleanup:
*/
+static const char *iommu_ports[] = {
+ "gfx3d_user", "gfx3d_priv",
+ "gfx3d1_user", "gfx3d1_priv",
+};
+
int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
struct msm_gpu *gpu, const struct adreno_gpu_funcs *funcs,
const char *ioname, const char *irqname, int ringsz)
@@ -126,6 +131,11 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
}
gpu->id = msm_register_iommu(drm, gpu->iommu);
+ ret = msm_iommu_attach(drm, gpu->iommu,
+ iommu_ports, ARRAY_SIZE(iommu_ports));
+ if (ret)
+ goto fail;
+
return 0;
fail: