Skip to content

Commit 2073ddb

Browse files
Andrzej Hajdadaeinki
authored andcommitted
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>
1 parent a48ff50 commit 2073ddb

1 file changed

Lines changed: 0 additions & 38 deletions

File tree

‎drivers/gpu/drm/exynos/exynos5433_drm_decon.c‎

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ static const char * const decon_clks_name[] = {
4747
"sclk_decon_eclk",
4848
};
4949

50-
enum decon_flag_bits {
51-
BIT_SUSPENDED
52-
};
53-
5450
struct decon_context {
5551
struct device *dev;
5652
struct drm_device *drm_dev;
@@ -62,7 +58,6 @@ struct decon_context {
6258
struct clk *clks[ARRAY_SIZE(decon_clks_name)];
6359
unsigned int irq;
6460
unsigned int te_irq;
65-
unsigned long flags;
6661
unsigned long out_type;
6762
int first_win;
6863
spinlock_t vblank_lock;
@@ -94,9 +89,6 @@ static int decon_enable_vblank(struct exynos_drm_crtc *crtc)
9489
struct decon_context *ctx = crtc->ctx;
9590
u32 val;
9691

97-
if (test_bit(BIT_SUSPENDED, &ctx->flags))
98-
return -EPERM;
99-
10092
val = VIDINTCON0_INTEN;
10193
if (ctx->out_type & IFTYPE_I80)
10294
val |= VIDINTCON0_FRAMEDONE;
@@ -116,9 +108,6 @@ static void decon_disable_vblank(struct exynos_drm_crtc *crtc)
116108
{
117109
struct decon_context *ctx = crtc->ctx;
118110

119-
if (test_bit(BIT_SUSPENDED, &ctx->flags))
120-
return;
121-
122111
if (!(ctx->out_type & I80_HW_TRG))
123112
disable_irq_nosync(ctx->te_irq);
124113
disable_irq_nosync(ctx->irq);
@@ -172,9 +161,6 @@ static u32 decon_get_vblank_counter(struct exynos_drm_crtc *crtc)
172161
{
173162
struct decon_context *ctx = crtc->ctx;
174163

175-
if (test_bit(BIT_SUSPENDED, &ctx->flags))
176-
return 0;
177-
178164
return decon_get_frame_count(ctx, false);
179165
}
180166

@@ -205,9 +191,6 @@ static void decon_commit(struct exynos_drm_crtc *crtc)
205191
bool interlaced = false;
206192
u32 val;
207193

208-
if (test_bit(BIT_SUSPENDED, &ctx->flags))
209-
return;
210-
211194
if (ctx->out_type & IFTYPE_HDMI) {
212195
m->crtc_hsync_start = m->crtc_hdisplay + 10;
213196
m->crtc_hsync_end = m->crtc_htotal - 92;
@@ -331,9 +314,6 @@ static void decon_atomic_begin(struct exynos_drm_crtc *crtc)
331314
{
332315
struct decon_context *ctx = crtc->ctx;
333316

334-
if (test_bit(BIT_SUSPENDED, &ctx->flags))
335-
return;
336-
337317
decon_shadow_protect(ctx, true);
338318
}
339319

@@ -354,9 +334,6 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc,
354334
dma_addr_t dma_addr = exynos_drm_fb_dma_addr(fb, 0);
355335
u32 val;
356336

357-
if (test_bit(BIT_SUSPENDED, &ctx->flags))
358-
return;
359-
360337
if (crtc->base.mode.flags & DRM_MODE_FLAG_INTERLACE) {
361338
val = COORDINATE_X(state->crtc.x) |
362339
COORDINATE_Y(state->crtc.y / 2);
@@ -407,9 +384,6 @@ static void decon_disable_plane(struct exynos_drm_crtc *crtc,
407384
struct decon_context *ctx = crtc->ctx;
408385
unsigned int win = plane->index;
409386

410-
if (test_bit(BIT_SUSPENDED, &ctx->flags))
411-
return;
412-
413387
decon_set_bits(ctx, DECON_WINCONx(win), WINCONx_ENWIN_F, 0);
414388
}
415389

@@ -418,9 +392,6 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc)
418392
struct decon_context *ctx = crtc->ctx;
419393
unsigned long flags;
420394

421-
if (test_bit(BIT_SUSPENDED, &ctx->flags))
422-
return;
423-
424395
spin_lock_irqsave(&ctx->vblank_lock, flags);
425396

426397
decon_shadow_protect(ctx, false);
@@ -474,9 +445,6 @@ static void decon_enable(struct exynos_drm_crtc *crtc)
474445
{
475446
struct decon_context *ctx = crtc->ctx;
476447

477-
if (!test_and_clear_bit(BIT_SUSPENDED, &ctx->flags))
478-
return;
479-
480448
pm_runtime_get_sync(ctx->dev);
481449

482450
exynos_drm_pipe_clk_enable(crtc, true);
@@ -495,9 +463,6 @@ static void decon_disable(struct exynos_drm_crtc *crtc)
495463
synchronize_irq(ctx->te_irq);
496464
synchronize_irq(ctx->irq);
497465

498-
if (test_bit(BIT_SUSPENDED, &ctx->flags))
499-
return;
500-
501466
/*
502467
* We need to make sure that all windows are disabled before we
503468
* suspend that connector. Otherwise we might try to scan from
@@ -511,8 +476,6 @@ static void decon_disable(struct exynos_drm_crtc *crtc)
511476
exynos_drm_pipe_clk_enable(crtc, false);
512477

513478
pm_runtime_put_sync(ctx->dev);
514-
515-
set_bit(BIT_SUSPENDED, &ctx->flags);
516479
}
517480

518481
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)
750713
if (!ctx)
751714
return -ENOMEM;
752715

753-
__set_bit(BIT_SUSPENDED, &ctx->flags);
754716
ctx->dev = dev;
755717
ctx->out_type = (unsigned long)of_device_get_match_data(dev);
756718
spin_lock_init(&ctx->vblank_lock);

0 commit comments

Comments
 (0)