Skip to content

Commit b2adc53

Browse files
Andrzej Hajdadaeinki
authored andcommitted
drm/exynos/decon5433: simplify shadow protect code
There is no point in protecting only particular windows during update. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
1 parent 3ba8084 commit b2adc53

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

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

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -313,23 +313,20 @@ static void decon_win_set_pixfmt(struct decon_context *ctx, unsigned int win,
313313
writel(val, ctx->addr + DECON_WINCONx(win));
314314
}
315315

316-
static void decon_shadow_protect_win(struct decon_context *ctx, int win,
317-
bool protect)
316+
static void decon_shadow_protect(struct decon_context *ctx, bool protect)
318317
{
319-
decon_set_bits(ctx, DECON_SHADOWCON, SHADOWCON_Wx_PROTECT(win),
318+
decon_set_bits(ctx, DECON_SHADOWCON, SHADOWCON_PROTECT_MASK,
320319
protect ? ~0 : 0);
321320
}
322321

323322
static void decon_atomic_begin(struct exynos_drm_crtc *crtc)
324323
{
325324
struct decon_context *ctx = crtc->ctx;
326-
int i;
327325

328326
if (test_bit(BIT_SUSPENDED, &ctx->flags))
329327
return;
330328

331-
for (i = ctx->first_win; i < WINDOWS_NR; i++)
332-
decon_shadow_protect_win(ctx, i, true);
329+
decon_shadow_protect(ctx, true);
333330
}
334331

335332
#define BIT_VAL(x, e, s) (((x) & ((1 << ((e) - (s) + 1)) - 1)) << (s))
@@ -412,15 +409,13 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc)
412409
{
413410
struct decon_context *ctx = crtc->ctx;
414411
unsigned long flags;
415-
int i;
416412

417413
if (test_bit(BIT_SUSPENDED, &ctx->flags))
418414
return;
419415

420416
spin_lock_irqsave(&ctx->vblank_lock, flags);
421417

422-
for (i = ctx->first_win; i < WINDOWS_NR; i++)
423-
decon_shadow_protect_win(ctx, i, false);
418+
decon_shadow_protect(ctx, false);
424419

425420
decon_set_bits(ctx, DECON_UPDATE, STANDALONE_UPDATE_F, ~0);
426421

@@ -540,11 +535,10 @@ static void decon_clear_channels(struct exynos_drm_crtc *crtc)
540535
goto err;
541536
}
542537

543-
for (win = 0; win < WINDOWS_NR; win++) {
544-
decon_shadow_protect_win(ctx, win, true);
538+
decon_shadow_protect(ctx, true);
539+
for (win = 0; win < WINDOWS_NR; win++)
545540
decon_set_bits(ctx, DECON_WINCONx(win), WINCONx_ENWIN_F, 0);
546-
decon_shadow_protect_win(ctx, win, false);
547-
}
541+
decon_shadow_protect(ctx, false);
548542

549543
decon_set_bits(ctx, DECON_UPDATE, STANDALONE_UPDATE_F, ~0);
550544

‎include/video/exynos5433_decon.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
#define WINCONx_ENWIN_F (1 << 0)
119119

120120
/* SHADOWCON */
121+
#define SHADOWCON_PROTECT_MASK GENMASK(14, 10)
121122
#define SHADOWCON_Wx_PROTECT(n) (1 << (10 + (n)))
122123

123124
/* VIDOSDxD */

0 commit comments

Comments
 (0)