aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/exynos/exynos5433_drm_decon.c3
-rw-r--r--drivers/gpu/drm/exynos/exynos7_drm_decon.c3
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimd.c9
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_g2d.c6
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_iommu.c11
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_ipp.c16
-rw-r--r--drivers/gpu/drm/exynos/exynos_mixer.c3
7 files changed, 13 insertions, 38 deletions
diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
index 8b1225f245fc..ba43437014ce 100644
--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
@@ -514,8 +514,7 @@ static void decon_unbind(struct device *dev, struct device *master, void *data)
514 decon_disable(ctx->crtc); 514 decon_disable(ctx->crtc);
515 515
516 /* detach this sub driver from iommu mapping if supported. */ 516 /* detach this sub driver from iommu mapping if supported. */
517 if (is_drm_iommu_supported(ctx->drm_dev)) 517 drm_iommu_detach_device(ctx->drm_dev, ctx->dev);
518 drm_iommu_detach_device(ctx->drm_dev, ctx->dev);
519} 518}
520 519
521static const struct component_ops decon_component_ops = { 520static const struct component_ops decon_component_ops = {
diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
index 362532afd1a5..2c296353c9c3 100644
--- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
@@ -136,8 +136,7 @@ static int decon_ctx_initialize(struct decon_context *ctx,
136static void decon_ctx_remove(struct decon_context *ctx) 136static void decon_ctx_remove(struct decon_context *ctx)
137{ 137{
138 /* detach this sub driver from iommu mapping if supported. */ 138 /* detach this sub driver from iommu mapping if supported. */
139 if (is_drm_iommu_supported(ctx->drm_dev)) 139 drm_iommu_detach_device(ctx->drm_dev, ctx->dev);
140 drm_iommu_detach_device(ctx->drm_dev, ctx->dev);
141} 140}
142 141
143static u32 decon_calc_clkdiv(struct decon_context *ctx, 142static u32 decon_calc_clkdiv(struct decon_context *ctx,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 794e56c8798e..300730c7af63 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -348,13 +348,6 @@ static void fimd_clear_channels(struct exynos_drm_crtc *crtc)
348 pm_runtime_put(ctx->dev); 348 pm_runtime_put(ctx->dev);
349} 349}
350 350
351static void fimd_iommu_detach_devices(struct fimd_context *ctx)
352{
353 /* detach this sub driver from iommu mapping if supported. */
354 if (is_drm_iommu_supported(ctx->drm_dev))
355 drm_iommu_detach_device(ctx->drm_dev, ctx->dev);
356}
357
358static u32 fimd_calc_clkdiv(struct fimd_context *ctx, 351static u32 fimd_calc_clkdiv(struct fimd_context *ctx,
359 const struct drm_display_mode *mode) 352 const struct drm_display_mode *mode)
360{ 353{
@@ -978,7 +971,7 @@ static void fimd_unbind(struct device *dev, struct device *master,
978 971
979 fimd_disable(ctx->crtc); 972 fimd_disable(ctx->crtc);
980 973
981 fimd_iommu_detach_devices(ctx); 974 drm_iommu_detach_device(ctx->drm_dev, ctx->dev);
982 975
983 if (ctx->display) 976 if (ctx->display)
984 exynos_dpi_remove(ctx->display); 977 exynos_dpi_remove(ctx->display);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
index 81a250830808..ba008391a2fc 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
@@ -1319,9 +1319,6 @@ static int g2d_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
1319 return ret; 1319 return ret;
1320 } 1320 }
1321 1321
1322 if (!is_drm_iommu_supported(drm_dev))
1323 return 0;
1324
1325 ret = drm_iommu_attach_device(drm_dev, dev); 1322 ret = drm_iommu_attach_device(drm_dev, dev);
1326 if (ret < 0) { 1323 if (ret < 0) {
1327 dev_err(dev, "failed to enable iommu.\n"); 1324 dev_err(dev, "failed to enable iommu.\n");
@@ -1334,9 +1331,6 @@ static int g2d_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
1334 1331
1335static void g2d_subdrv_remove(struct drm_device *drm_dev, struct device *dev) 1332static void g2d_subdrv_remove(struct drm_device *drm_dev, struct device *dev)
1336{ 1333{
1337 if (!is_drm_iommu_supported(drm_dev))
1338 return;
1339
1340 drm_iommu_detach_device(drm_dev, dev); 1334 drm_iommu_detach_device(drm_dev, dev);
1341} 1335}
1342 1336
diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.c b/drivers/gpu/drm/exynos/exynos_drm_iommu.c
index d4ec7465e9cc..4c2ec1bef252 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_iommu.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_iommu.c
@@ -87,10 +87,8 @@ int drm_iommu_attach_device(struct drm_device *drm_dev,
87 struct device *dev = drm_dev->dev; 87 struct device *dev = drm_dev->dev;
88 int ret; 88 int ret;
89 89
90 if (!dev->archdata.mapping) { 90 if (!dev->archdata.mapping)
91 DRM_ERROR("iommu_mapping is null.\n"); 91 return 0;
92 return -EFAULT;
93 }
94 92
95 subdrv_dev->dma_parms = devm_kzalloc(subdrv_dev, 93 subdrv_dev->dma_parms = devm_kzalloc(subdrv_dev,
96 sizeof(*subdrv_dev->dma_parms), 94 sizeof(*subdrv_dev->dma_parms),
@@ -148,13 +146,10 @@ void drm_iommu_detach_device(struct drm_device *drm_dev,
148int drm_iommu_attach_device_if_possible(struct exynos_drm_crtc *exynos_crtc, 146int drm_iommu_attach_device_if_possible(struct exynos_drm_crtc *exynos_crtc,
149 struct drm_device *drm_dev, struct device *subdrv_dev) 147 struct drm_device *drm_dev, struct device *subdrv_dev)
150{ 148{
151 int ret = 0;
152
153 if (is_drm_iommu_supported(drm_dev)) { 149 if (is_drm_iommu_supported(drm_dev)) {
154 if (exynos_crtc->ops->clear_channels) 150 if (exynos_crtc->ops->clear_channels)
155 exynos_crtc->ops->clear_channels(exynos_crtc); 151 exynos_crtc->ops->clear_channels(exynos_crtc);
156 return drm_iommu_attach_device(drm_dev, subdrv_dev);
157 } 152 }
158 153
159 return ret; 154 return drm_iommu_attach_device(drm_dev, subdrv_dev);
160} 155}
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index 67e5451e066f..67d24236e745 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -1622,12 +1622,10 @@ static int ipp_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
1622 INIT_LIST_HEAD(&ippdrv->cmd_list); 1622 INIT_LIST_HEAD(&ippdrv->cmd_list);
1623 mutex_init(&ippdrv->cmd_lock); 1623 mutex_init(&ippdrv->cmd_lock);
1624 1624
1625 if (is_drm_iommu_supported(drm_dev)) { 1625 ret = drm_iommu_attach_device(drm_dev, ippdrv->dev);
1626 ret = drm_iommu_attach_device(drm_dev, ippdrv->dev); 1626 if (ret) {
1627 if (ret) { 1627 DRM_ERROR("failed to activate iommu\n");
1628 DRM_ERROR("failed to activate iommu\n"); 1628 goto err;
1629 goto err;
1630 }
1631 } 1629 }
1632 } 1630 }
1633 1631
@@ -1637,8 +1635,7 @@ err:
1637 /* get ipp driver entry */ 1635 /* get ipp driver entry */
1638 list_for_each_entry_continue_reverse(ippdrv, &exynos_drm_ippdrv_list, 1636 list_for_each_entry_continue_reverse(ippdrv, &exynos_drm_ippdrv_list,
1639 drv_list) { 1637 drv_list) {
1640 if (is_drm_iommu_supported(drm_dev)) 1638 drm_iommu_detach_device(drm_dev, ippdrv->dev);
1641 drm_iommu_detach_device(drm_dev, ippdrv->dev);
1642 1639
1643 ipp_remove_id(&ctx->ipp_idr, &ctx->ipp_lock, 1640 ipp_remove_id(&ctx->ipp_idr, &ctx->ipp_lock,
1644 ippdrv->prop_list.ipp_id); 1641 ippdrv->prop_list.ipp_id);
@@ -1654,8 +1651,7 @@ static void ipp_subdrv_remove(struct drm_device *drm_dev, struct device *dev)
1654 1651
1655 /* get ipp driver entry */ 1652 /* get ipp driver entry */
1656 list_for_each_entry_safe(ippdrv, t, &exynos_drm_ippdrv_list, drv_list) { 1653 list_for_each_entry_safe(ippdrv, t, &exynos_drm_ippdrv_list, drv_list) {
1657 if (is_drm_iommu_supported(drm_dev)) 1654 drm_iommu_detach_device(drm_dev, ippdrv->dev);
1658 drm_iommu_detach_device(drm_dev, ippdrv->dev);
1659 1655
1660 ipp_remove_id(&ctx->ipp_idr, &ctx->ipp_lock, 1656 ipp_remove_id(&ctx->ipp_idr, &ctx->ipp_lock,
1661 ippdrv->prop_list.ipp_id); 1657 ippdrv->prop_list.ipp_id);
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 4706b56902b4..b7e438fc7fdd 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -891,8 +891,7 @@ static int mixer_initialize(struct mixer_context *mixer_ctx,
891 891
892static void mixer_ctx_remove(struct mixer_context *mixer_ctx) 892static void mixer_ctx_remove(struct mixer_context *mixer_ctx)
893{ 893{
894 if (is_drm_iommu_supported(mixer_ctx->drm_dev)) 894 drm_iommu_detach_device(mixer_ctx->drm_dev, mixer_ctx->dev);
895 drm_iommu_detach_device(mixer_ctx->drm_dev, mixer_ctx->dev);
896} 895}
897 896
898static int mixer_enable_vblank(struct exynos_drm_crtc *crtc) 897static int mixer_enable_vblank(struct exynos_drm_crtc *crtc)