diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2017-04-05 03:28:36 -0400 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2017-06-01 03:21:38 -0400 |
commit | 2073ddb4ff8492dcd2c5f3a9f01252ce7f5a2974 (patch) | |
tree | 94b6b2118d780aad789a8dad1d290fd7771eb5b0 | |
parent | a48ff5010153946355d6d7e171807977e712c9c8 (diff) |
drm/exynos/decon5433: kill BIT_SUSPENDED flag
Exynos tracked suspend state to prevent touching disabled HW. After
fixing disable order in HDMI and moving TE handling to DECON it is
not needed anymore - all IRQ handlers and callbacks touching HW
are called only with enabled DECON.
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 | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c index b81c12b1f857..1cb4b86eb33c 100644 --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c | |||
@@ -47,10 +47,6 @@ static const char * const decon_clks_name[] = { | |||
47 | "sclk_decon_eclk", | 47 | "sclk_decon_eclk", |
48 | }; | 48 | }; |
49 | 49 | ||
50 | enum decon_flag_bits { | ||
51 | BIT_SUSPENDED | ||
52 | }; | ||
53 | |||
54 | struct decon_context { | 50 | struct decon_context { |
55 | struct device *dev; | 51 | struct device *dev; |
56 | struct drm_device *drm_dev; | 52 | struct drm_device *drm_dev; |
@@ -62,7 +58,6 @@ struct decon_context { | |||
62 | struct clk *clks[ARRAY_SIZE(decon_clks_name)]; | 58 | struct clk *clks[ARRAY_SIZE(decon_clks_name)]; |
63 | unsigned int irq; | 59 | unsigned int irq; |
64 | unsigned int te_irq; | 60 | unsigned int te_irq; |
65 | unsigned long flags; | ||
66 | unsigned long out_type; | 61 | unsigned long out_type; |
67 | int first_win; | 62 | int first_win; |
68 | spinlock_t vblank_lock; | 63 | spinlock_t vblank_lock; |
@@ -94,9 +89,6 @@ static int decon_enable_vblank(struct exynos_drm_crtc *crtc) | |||
94 | struct decon_context *ctx = crtc->ctx; | 89 | struct decon_context *ctx = crtc->ctx; |
95 | u32 val; | 90 | u32 val; |
96 | 91 | ||
97 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) | ||
98 | return -EPERM; | ||
99 | |||
100 | val = VIDINTCON0_INTEN; | 92 | val = VIDINTCON0_INTEN; |
101 | if (ctx->out_type & IFTYPE_I80) | 93 | if (ctx->out_type & IFTYPE_I80) |
102 | val |= VIDINTCON0_FRAMEDONE; | 94 | val |= VIDINTCON0_FRAMEDONE; |
@@ -116,9 +108,6 @@ static void decon_disable_vblank(struct exynos_drm_crtc *crtc) | |||
116 | { | 108 | { |
117 | struct decon_context *ctx = crtc->ctx; | 109 | struct decon_context *ctx = crtc->ctx; |
118 | 110 | ||
119 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) | ||
120 | return; | ||
121 | |||
122 | if (!(ctx->out_type & I80_HW_TRG)) | 111 | if (!(ctx->out_type & I80_HW_TRG)) |
123 | disable_irq_nosync(ctx->te_irq); | 112 | disable_irq_nosync(ctx->te_irq); |
124 | disable_irq_nosync(ctx->irq); | 113 | disable_irq_nosync(ctx->irq); |
@@ -172,9 +161,6 @@ static u32 decon_get_vblank_counter(struct exynos_drm_crtc *crtc) | |||
172 | { | 161 | { |
173 | struct decon_context *ctx = crtc->ctx; | 162 | struct decon_context *ctx = crtc->ctx; |
174 | 163 | ||
175 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) | ||
176 | return 0; | ||
177 | |||
178 | return decon_get_frame_count(ctx, false); | 164 | return decon_get_frame_count(ctx, false); |
179 | } | 165 | } |
180 | 166 | ||
@@ -205,9 +191,6 @@ static void decon_commit(struct exynos_drm_crtc *crtc) | |||
205 | bool interlaced = false; | 191 | bool interlaced = false; |
206 | u32 val; | 192 | u32 val; |
207 | 193 | ||
208 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) | ||
209 | return; | ||
210 | |||
211 | if (ctx->out_type & IFTYPE_HDMI) { | 194 | if (ctx->out_type & IFTYPE_HDMI) { |
212 | m->crtc_hsync_start = m->crtc_hdisplay + 10; | 195 | m->crtc_hsync_start = m->crtc_hdisplay + 10; |
213 | m->crtc_hsync_end = m->crtc_htotal - 92; | 196 | m->crtc_hsync_end = m->crtc_htotal - 92; |
@@ -331,9 +314,6 @@ static void decon_atomic_begin(struct exynos_drm_crtc *crtc) | |||
331 | { | 314 | { |
332 | struct decon_context *ctx = crtc->ctx; | 315 | struct decon_context *ctx = crtc->ctx; |
333 | 316 | ||
334 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) | ||
335 | return; | ||
336 | |||
337 | decon_shadow_protect(ctx, true); | 317 | decon_shadow_protect(ctx, true); |
338 | } | 318 | } |
339 | 319 | ||
@@ -354,9 +334,6 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, | |||
354 | dma_addr_t dma_addr = exynos_drm_fb_dma_addr(fb, 0); | 334 | dma_addr_t dma_addr = exynos_drm_fb_dma_addr(fb, 0); |
355 | u32 val; | 335 | u32 val; |
356 | 336 | ||
357 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) | ||
358 | return; | ||
359 | |||
360 | if (crtc->base.mode.flags & DRM_MODE_FLAG_INTERLACE) { | 337 | if (crtc->base.mode.flags & DRM_MODE_FLAG_INTERLACE) { |
361 | val = COORDINATE_X(state->crtc.x) | | 338 | val = COORDINATE_X(state->crtc.x) | |
362 | COORDINATE_Y(state->crtc.y / 2); | 339 | COORDINATE_Y(state->crtc.y / 2); |
@@ -407,9 +384,6 @@ static void decon_disable_plane(struct exynos_drm_crtc *crtc, | |||
407 | struct decon_context *ctx = crtc->ctx; | 384 | struct decon_context *ctx = crtc->ctx; |
408 | unsigned int win = plane->index; | 385 | unsigned int win = plane->index; |
409 | 386 | ||
410 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) | ||
411 | return; | ||
412 | |||
413 | decon_set_bits(ctx, DECON_WINCONx(win), WINCONx_ENWIN_F, 0); | 387 | decon_set_bits(ctx, DECON_WINCONx(win), WINCONx_ENWIN_F, 0); |
414 | } | 388 | } |
415 | 389 | ||
@@ -418,9 +392,6 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc) | |||
418 | struct decon_context *ctx = crtc->ctx; | 392 | struct decon_context *ctx = crtc->ctx; |
419 | unsigned long flags; | 393 | unsigned long flags; |
420 | 394 | ||
421 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) | ||
422 | return; | ||
423 | |||
424 | spin_lock_irqsave(&ctx->vblank_lock, flags); | 395 | spin_lock_irqsave(&ctx->vblank_lock, flags); |
425 | 396 | ||
426 | decon_shadow_protect(ctx, false); | 397 | decon_shadow_protect(ctx, false); |
@@ -474,9 +445,6 @@ static void decon_enable(struct exynos_drm_crtc *crtc) | |||
474 | { | 445 | { |
475 | struct decon_context *ctx = crtc->ctx; | 446 | struct decon_context *ctx = crtc->ctx; |
476 | 447 | ||
477 | if (!test_and_clear_bit(BIT_SUSPENDED, &ctx->flags)) | ||
478 | return; | ||
479 | |||
480 | pm_runtime_get_sync(ctx->dev); | 448 | pm_runtime_get_sync(ctx->dev); |
481 | 449 | ||
482 | exynos_drm_pipe_clk_enable(crtc, true); | 450 | exynos_drm_pipe_clk_enable(crtc, true); |
@@ -495,9 +463,6 @@ static void decon_disable(struct exynos_drm_crtc *crtc) | |||
495 | synchronize_irq(ctx->te_irq); | 463 | synchronize_irq(ctx->te_irq); |
496 | synchronize_irq(ctx->irq); | 464 | synchronize_irq(ctx->irq); |
497 | 465 | ||
498 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) | ||
499 | return; | ||
500 | |||
501 | /* | 466 | /* |
502 | * We need to make sure that all windows are disabled before we | 467 | * We need to make sure that all windows are disabled before we |
503 | * suspend that connector. Otherwise we might try to scan from | 468 | * suspend that connector. Otherwise we might try to scan from |
@@ -511,8 +476,6 @@ static void decon_disable(struct exynos_drm_crtc *crtc) | |||
511 | exynos_drm_pipe_clk_enable(crtc, false); | 476 | exynos_drm_pipe_clk_enable(crtc, false); |
512 | 477 | ||
513 | pm_runtime_put_sync(ctx->dev); | 478 | pm_runtime_put_sync(ctx->dev); |
514 | |||
515 | set_bit(BIT_SUSPENDED, &ctx->flags); | ||
516 | } | 479 | } |
517 | 480 | ||
518 | static irqreturn_t decon_te_irq_handler(int irq, void *dev_id) | 481 | static irqreturn_t decon_te_irq_handler(int irq, void *dev_id) |
@@ -750,7 +713,6 @@ static int exynos5433_decon_probe(struct platform_device *pdev) | |||
750 | if (!ctx) | 713 | if (!ctx) |
751 | return -ENOMEM; | 714 | return -ENOMEM; |
752 | 715 | ||
753 | __set_bit(BIT_SUSPENDED, &ctx->flags); | ||
754 | ctx->dev = dev; | 716 | ctx->dev = dev; |
755 | ctx->out_type = (unsigned long)of_device_get_match_data(dev); | 717 | ctx->out_type = (unsigned long)of_device_get_match_data(dev); |
756 | spin_lock_init(&ctx->vblank_lock); | 718 | spin_lock_init(&ctx->vblank_lock); |