diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2017-03-15 10:41:06 -0400 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2017-06-01 03:21:34 -0400 |
commit | 2949390eb1be95633afdc39923f53ea5b326242a (patch) | |
tree | 04d8a88a09e47afe12e519f122b3ae2341637467 | |
parent | 2c82607b56ad7035077dbb0d37093d8f2b21e235 (diff) |
drm/exynos: kill pipe field from drivers contexts
Since possible_crtcs are set by Exynos core helper pipe fields have no
raison d'etre. The only place it was used, as a hack, is
fimd_clear_channels, to avoid calling drm_crtc_handle_vblank, but DRM core
has already other protection mechanism (vblank->enabled), so it could be
safely removed.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r-- | drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos7_drm_decon.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fimd.c | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_vidi.c | 15 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_mixer.c | 2 |
5 files changed, 4 insertions, 30 deletions
diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c index 8a3aa8ef940a..21ab839ea29a 100644 --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c | |||
@@ -64,7 +64,6 @@ struct decon_context { | |||
64 | void __iomem *addr; | 64 | void __iomem *addr; |
65 | struct regmap *sysreg; | 65 | struct regmap *sysreg; |
66 | struct clk *clks[ARRAY_SIZE(decon_clks_name)]; | 66 | struct clk *clks[ARRAY_SIZE(decon_clks_name)]; |
67 | int pipe; | ||
68 | unsigned long flags; | 67 | unsigned long flags; |
69 | unsigned long out_type; | 68 | unsigned long out_type; |
70 | int first_win; | 69 | int first_win; |
@@ -592,7 +591,6 @@ static int decon_bind(struct device *dev, struct device *master, void *data) | |||
592 | int ret; | 591 | int ret; |
593 | 592 | ||
594 | ctx->drm_dev = drm_dev; | 593 | ctx->drm_dev = drm_dev; |
595 | ctx->pipe = drm_dev->mode_config.num_crtc; | ||
596 | drm_dev->max_vblank_count = 0xffffffff; | 594 | drm_dev->max_vblank_count = 0xffffffff; |
597 | 595 | ||
598 | for (win = ctx->first_win; win < WINDOWS_NR; win++) { | 596 | for (win = ctx->first_win; win < WINDOWS_NR; win++) { |
diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c index 4320b3bbc4c0..1ffb0b13fbdc 100644 --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c | |||
@@ -55,7 +55,6 @@ struct decon_context { | |||
55 | unsigned long irq_flags; | 55 | unsigned long irq_flags; |
56 | bool i80_if; | 56 | bool i80_if; |
57 | bool suspended; | 57 | bool suspended; |
58 | int pipe; | ||
59 | wait_queue_head_t wait_vsync_queue; | 58 | wait_queue_head_t wait_vsync_queue; |
60 | atomic_t wait_vsync_event; | 59 | atomic_t wait_vsync_event; |
61 | 60 | ||
@@ -131,7 +130,6 @@ static int decon_ctx_initialize(struct decon_context *ctx, | |||
131 | struct drm_device *drm_dev) | 130 | struct drm_device *drm_dev) |
132 | { | 131 | { |
133 | ctx->drm_dev = drm_dev; | 132 | ctx->drm_dev = drm_dev; |
134 | ctx->pipe = drm_dev->mode_config.num_crtc; | ||
135 | 133 | ||
136 | decon_clear_channels(ctx->crtc); | 134 | decon_clear_channels(ctx->crtc); |
137 | 135 | ||
@@ -605,7 +603,7 @@ static irqreturn_t decon_irq_handler(int irq, void *dev_id) | |||
605 | writel(clear_bit, ctx->regs + VIDINTCON1); | 603 | writel(clear_bit, ctx->regs + VIDINTCON1); |
606 | 604 | ||
607 | /* check the crtc is detached already from encoder */ | 605 | /* check the crtc is detached already from encoder */ |
608 | if (ctx->pipe < 0 || !ctx->drm_dev) | 606 | if (!ctx->drm_dev) |
609 | goto out; | 607 | goto out; |
610 | 608 | ||
611 | if (!ctx->i80_if) { | 609 | if (!ctx->i80_if) { |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 969145fd8083..6d073e2e7453 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c | |||
@@ -179,7 +179,6 @@ struct fimd_context { | |||
179 | u32 i80ifcon; | 179 | u32 i80ifcon; |
180 | bool i80_if; | 180 | bool i80_if; |
181 | bool suspended; | 181 | bool suspended; |
182 | int pipe; | ||
183 | wait_queue_head_t wait_vsync_queue; | 182 | wait_queue_head_t wait_vsync_queue; |
184 | atomic_t wait_vsync_event; | 183 | atomic_t wait_vsync_event; |
185 | atomic_t win_updated; | 184 | atomic_t win_updated; |
@@ -354,18 +353,13 @@ static void fimd_clear_channels(struct exynos_drm_crtc *crtc) | |||
354 | 353 | ||
355 | /* Wait for vsync, as disable channel takes effect at next vsync */ | 354 | /* Wait for vsync, as disable channel takes effect at next vsync */ |
356 | if (ch_enabled) { | 355 | if (ch_enabled) { |
357 | int pipe = ctx->pipe; | ||
358 | |||
359 | /* ensure that vblank interrupt won't be reported to core */ | ||
360 | ctx->suspended = false; | 356 | ctx->suspended = false; |
361 | ctx->pipe = -1; | ||
362 | 357 | ||
363 | fimd_enable_vblank(ctx->crtc); | 358 | fimd_enable_vblank(ctx->crtc); |
364 | fimd_wait_for_vblank(ctx->crtc); | 359 | fimd_wait_for_vblank(ctx->crtc); |
365 | fimd_disable_vblank(ctx->crtc); | 360 | fimd_disable_vblank(ctx->crtc); |
366 | 361 | ||
367 | ctx->suspended = true; | 362 | ctx->suspended = true; |
368 | ctx->pipe = pipe; | ||
369 | } | 363 | } |
370 | 364 | ||
371 | clk_disable_unprepare(ctx->lcd_clk); | 365 | clk_disable_unprepare(ctx->lcd_clk); |
@@ -899,7 +893,7 @@ static void fimd_te_handler(struct exynos_drm_crtc *crtc) | |||
899 | u32 trg_type = ctx->driver_data->trg_type; | 893 | u32 trg_type = ctx->driver_data->trg_type; |
900 | 894 | ||
901 | /* Checks the crtc is detached already from encoder */ | 895 | /* Checks the crtc is detached already from encoder */ |
902 | if (ctx->pipe < 0 || !ctx->drm_dev) | 896 | if (!ctx->drm_dev) |
903 | return; | 897 | return; |
904 | 898 | ||
905 | if (trg_type == I80_HW_TRG) | 899 | if (trg_type == I80_HW_TRG) |
@@ -957,7 +951,7 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id) | |||
957 | writel(clear_bit, ctx->regs + VIDINTCON1); | 951 | writel(clear_bit, ctx->regs + VIDINTCON1); |
958 | 952 | ||
959 | /* check the crtc is detached already from encoder */ | 953 | /* check the crtc is detached already from encoder */ |
960 | if (ctx->pipe < 0 || !ctx->drm_dev) | 954 | if (!ctx->drm_dev) |
961 | goto out; | 955 | goto out; |
962 | 956 | ||
963 | if (!ctx->i80_if) | 957 | if (!ctx->i80_if) |
@@ -987,7 +981,6 @@ static int fimd_bind(struct device *dev, struct device *master, void *data) | |||
987 | int ret; | 981 | int ret; |
988 | 982 | ||
989 | ctx->drm_dev = drm_dev; | 983 | ctx->drm_dev = drm_dev; |
990 | ctx->pipe = drm_dev->mode_config.num_crtc; | ||
991 | 984 | ||
992 | for (i = 0; i < WINDOWS_NR; i++) { | 985 | for (i = 0; i < WINDOWS_NR; i++) { |
993 | ctx->configs[i].pixel_formats = fimd_formats; | 986 | ctx->configs[i].pixel_formats = fimd_formats; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index 92ebeaf50cdb..cb8a72842537 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c | |||
@@ -51,7 +51,6 @@ struct vidi_context { | |||
51 | bool suspended; | 51 | bool suspended; |
52 | struct timer_list timer; | 52 | struct timer_list timer; |
53 | struct mutex lock; | 53 | struct mutex lock; |
54 | int pipe; | ||
55 | }; | 54 | }; |
56 | 55 | ||
57 | static inline struct vidi_context *encoder_to_vidi(struct drm_encoder *e) | 56 | static inline struct vidi_context *encoder_to_vidi(struct drm_encoder *e) |
@@ -153,15 +152,6 @@ static void vidi_disable(struct exynos_drm_crtc *crtc) | |||
153 | mutex_unlock(&ctx->lock); | 152 | mutex_unlock(&ctx->lock); |
154 | } | 153 | } |
155 | 154 | ||
156 | static int vidi_ctx_initialize(struct vidi_context *ctx, | ||
157 | struct drm_device *drm_dev) | ||
158 | { | ||
159 | ctx->drm_dev = drm_dev; | ||
160 | ctx->pipe = drm_dev->mode_config.num_crtc; | ||
161 | |||
162 | return 0; | ||
163 | } | ||
164 | |||
165 | static const struct exynos_drm_crtc_ops vidi_crtc_ops = { | 155 | static const struct exynos_drm_crtc_ops vidi_crtc_ops = { |
166 | .enable = vidi_enable, | 156 | .enable = vidi_enable, |
167 | .disable = vidi_disable, | 157 | .disable = vidi_disable, |
@@ -175,9 +165,6 @@ static void vidi_fake_vblank_timer(unsigned long arg) | |||
175 | { | 165 | { |
176 | struct vidi_context *ctx = (void *)arg; | 166 | struct vidi_context *ctx = (void *)arg; |
177 | 167 | ||
178 | if (ctx->pipe < 0) | ||
179 | return; | ||
180 | |||
181 | if (drm_crtc_handle_vblank(&ctx->crtc->base)) | 168 | if (drm_crtc_handle_vblank(&ctx->crtc->base)) |
182 | mod_timer(&ctx->timer, | 169 | mod_timer(&ctx->timer, |
183 | jiffies + msecs_to_jiffies(VIDI_REFRESH_TIME) - 1); | 170 | jiffies + msecs_to_jiffies(VIDI_REFRESH_TIME) - 1); |
@@ -397,7 +384,7 @@ static int vidi_bind(struct device *dev, struct device *master, void *data) | |||
397 | unsigned int i; | 384 | unsigned int i; |
398 | int pipe, ret; | 385 | int pipe, ret; |
399 | 386 | ||
400 | vidi_ctx_initialize(ctx, drm_dev); | 387 | ctx->drm_dev = drm_dev; |
401 | 388 | ||
402 | plane_config.pixel_formats = formats; | 389 | plane_config.pixel_formats = formats; |
403 | plane_config.num_pixel_formats = ARRAY_SIZE(formats); | 390 | plane_config.num_pixel_formats = ARRAY_SIZE(formats); |
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 3722b5ffabd1..1cd84cb8d3fb 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c | |||
@@ -99,7 +99,6 @@ struct mixer_context { | |||
99 | struct drm_device *drm_dev; | 99 | struct drm_device *drm_dev; |
100 | struct exynos_drm_crtc *crtc; | 100 | struct exynos_drm_crtc *crtc; |
101 | struct exynos_drm_plane planes[MIXER_WIN_NR]; | 101 | struct exynos_drm_plane planes[MIXER_WIN_NR]; |
102 | int pipe; | ||
103 | unsigned long flags; | 102 | unsigned long flags; |
104 | 103 | ||
105 | struct mixer_resources mixer_res; | 104 | struct mixer_resources mixer_res; |
@@ -900,7 +899,6 @@ static int mixer_initialize(struct mixer_context *mixer_ctx, | |||
900 | priv = drm_dev->dev_private; | 899 | priv = drm_dev->dev_private; |
901 | 900 | ||
902 | mixer_ctx->drm_dev = drm_dev; | 901 | mixer_ctx->drm_dev = drm_dev; |
903 | mixer_ctx->pipe = drm_dev->mode_config.num_crtc; | ||
904 | 902 | ||
905 | /* acquire resources: regs, irqs, clocks */ | 903 | /* acquire resources: regs, irqs, clocks */ |
906 | ret = mixer_resources_init(mixer_ctx); | 904 | ret = mixer_resources_init(mixer_ctx); |