aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2015-07-02 08:49:39 -0400
committerInki Dae <inki.dae@samsung.com>2015-08-15 21:23:33 -0400
commiteb7a3fc74c58be9c01cdbe23947ae9eb032e8365 (patch)
tree2182384341e638fc4cca308025250e60249e8b2d /drivers
parent735c21c3c802e9e89ce302ab40ea92f5d1151e02 (diff)
drm/exynos: remove drm_iommu_attach_device_if_possible
Already drm_iommu_attach_device checks whether support iommu internally. It should clear channels always regardless iommu support. We didn't know because we can detect the problem when iommu is enabled, so we don't have to use drm_iommu_attach_device_if_possible and then we can remove drm_iommu_attach_device_if_possible and clear_channels function pointer. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/exynos/exynos5433_drm_decon.c5
-rw-r--r--drivers/gpu/drm/exynos/exynos7_drm_decon.c5
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_drv.h1
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimd.c5
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_iommu.c11
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_iommu.h11
-rw-r--r--drivers/gpu/drm/exynos/exynos_mixer.c3
7 files changed, 10 insertions, 31 deletions
diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
index ba43437014ce..b2794f815b3c 100644
--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
@@ -463,7 +463,6 @@ static struct exynos_drm_crtc_ops decon_crtc_ops = {
463 .win_commit = decon_win_commit, 463 .win_commit = decon_win_commit,
464 .win_disable = decon_win_disable, 464 .win_disable = decon_win_disable,
465 .te_handler = decon_te_irq_handler, 465 .te_handler = decon_te_irq_handler,
466 .clear_channels = decon_clear_channels,
467}; 466};
468 467
469static int decon_bind(struct device *dev, struct device *master, void *data) 468static int decon_bind(struct device *dev, struct device *master, void *data)
@@ -497,7 +496,9 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
497 goto err; 496 goto err;
498 } 497 }
499 498
500 ret = drm_iommu_attach_device_if_possible(ctx->crtc, drm_dev, dev); 499 decon_clear_channels(ctx->crtc);
500
501 ret = drm_iommu_attach_device(drm_dev, dev);
501 if (ret) 502 if (ret)
502 goto err; 503 goto err;
503 504
diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
index 2c296353c9c3..a80b9184c866 100644
--- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
@@ -126,7 +126,9 @@ static int decon_ctx_initialize(struct decon_context *ctx,
126 ctx->drm_dev = drm_dev; 126 ctx->drm_dev = drm_dev;
127 ctx->pipe = priv->pipe++; 127 ctx->pipe = priv->pipe++;
128 128
129 ret = drm_iommu_attach_device_if_possible(ctx->crtc, drm_dev, ctx->dev); 129 decon_clear_channels(ctx->crtc);
130
131 ret = drm_iommu_attach_device(drm_dev, ctx->dev);
130 if (ret) 132 if (ret)
131 priv->pipe--; 133 priv->pipe--;
132 134
@@ -622,7 +624,6 @@ static const struct exynos_drm_crtc_ops decon_crtc_ops = {
622 .wait_for_vblank = decon_wait_for_vblank, 624 .wait_for_vblank = decon_wait_for_vblank,
623 .win_commit = decon_win_commit, 625 .win_commit = decon_win_commit,
624 .win_disable = decon_win_disable, 626 .win_disable = decon_win_disable,
625 .clear_channels = decon_clear_channels,
626}; 627};
627 628
628 629
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index dd00f160c1e5..7da593fd081f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -177,7 +177,6 @@ struct exynos_drm_crtc_ops {
177 void (*win_disable)(struct exynos_drm_crtc *crtc, unsigned int zpos); 177 void (*win_disable)(struct exynos_drm_crtc *crtc, unsigned int zpos);
178 void (*te_handler)(struct exynos_drm_crtc *crtc); 178 void (*te_handler)(struct exynos_drm_crtc *crtc);
179 void (*clock_enable)(struct exynos_drm_crtc *crtc, bool enable); 179 void (*clock_enable)(struct exynos_drm_crtc *crtc, bool enable);
180 void (*clear_channels)(struct exynos_drm_crtc *crtc);
181}; 180};
182 181
183/* 182/*
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 300730c7af63..8d362b9365d3 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -887,7 +887,6 @@ static const struct exynos_drm_crtc_ops fimd_crtc_ops = {
887 .win_disable = fimd_win_disable, 887 .win_disable = fimd_win_disable,
888 .te_handler = fimd_te_handler, 888 .te_handler = fimd_te_handler,
889 .clock_enable = fimd_dp_clock_enable, 889 .clock_enable = fimd_dp_clock_enable,
890 .clear_channels = fimd_clear_channels,
891}; 890};
892 891
893static irqreturn_t fimd_irq_handler(int irq, void *dev_id) 892static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
@@ -957,7 +956,9 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
957 if (ctx->display) 956 if (ctx->display)
958 exynos_drm_create_enc_conn(drm_dev, ctx->display); 957 exynos_drm_create_enc_conn(drm_dev, ctx->display);
959 958
960 ret = drm_iommu_attach_device_if_possible(ctx->crtc, drm_dev, dev); 959 fimd_clear_channels(ctx->crtc);
960
961 ret = drm_iommu_attach_device(drm_dev, dev);
961 if (ret) 962 if (ret)
962 priv->pipe--; 963 priv->pipe--;
963 964
diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.c b/drivers/gpu/drm/exynos/exynos_drm_iommu.c
index 4c2ec1bef252..055e8ec2ef21 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_iommu.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_iommu.c
@@ -142,14 +142,3 @@ void drm_iommu_detach_device(struct drm_device *drm_dev,
142 iommu_detach_device(mapping->domain, subdrv_dev); 142 iommu_detach_device(mapping->domain, subdrv_dev);
143 drm_release_iommu_mapping(drm_dev); 143 drm_release_iommu_mapping(drm_dev);
144} 144}
145
146int drm_iommu_attach_device_if_possible(struct exynos_drm_crtc *exynos_crtc,
147 struct drm_device *drm_dev, struct device *subdrv_dev)
148{
149 if (is_drm_iommu_supported(drm_dev)) {
150 if (exynos_crtc->ops->clear_channels)
151 exynos_crtc->ops->clear_channels(exynos_crtc);
152 }
153
154 return drm_iommu_attach_device(drm_dev, subdrv_dev);
155}
diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.h b/drivers/gpu/drm/exynos/exynos_drm_iommu.h
index a90357fc163d..dc1b5441f491 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_iommu.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_iommu.h
@@ -34,10 +34,6 @@ static inline bool is_drm_iommu_supported(struct drm_device *drm_dev)
34 return dev->archdata.mapping ? true : false; 34 return dev->archdata.mapping ? true : false;
35} 35}
36 36
37int drm_iommu_attach_device_if_possible(
38 struct exynos_drm_crtc *exynos_crtc, struct drm_device *drm_dev,
39 struct device *subdrv_dev);
40
41#else 37#else
42 38
43static inline int drm_create_iommu_mapping(struct drm_device *drm_dev) 39static inline int drm_create_iommu_mapping(struct drm_device *drm_dev)
@@ -65,12 +61,5 @@ static inline bool is_drm_iommu_supported(struct drm_device *drm_dev)
65 return false; 61 return false;
66} 62}
67 63
68static inline int drm_iommu_attach_device_if_possible(
69 struct exynos_drm_crtc *exynos_crtc, struct drm_device *drm_dev,
70 struct device *subdrv_dev)
71{
72 return 0;
73}
74
75#endif 64#endif
76#endif 65#endif
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index c6384feaf2a2..370e0a306ad0 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -884,8 +884,7 @@ static int mixer_initialize(struct mixer_context *mixer_ctx,
884 } 884 }
885 } 885 }
886 886
887 ret = drm_iommu_attach_device_if_possible(mixer_ctx->crtc, drm_dev, 887 ret = drm_iommu_attach_device(drm_dev, mixer_ctx->dev);
888 mixer_ctx->dev);
889 if (ret) 888 if (ret)
890 priv->pipe--; 889 priv->pipe--;
891 890