Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 999d8b31 authored by YoungJun Cho's avatar YoungJun Cho Committed by Inki Dae
Browse files

drm/exynos: fimd: add fimd_enable_shadow_channel_path() to cleanup



This function is valid only the SoC has SHADOWCON register
and it should be used together with fimd_enable_video_output()
to match the ENWIN_F bit in WINCON# and C#_EN_F bit in SHADOWCON.

Signed-off-by: default avatarYoungJun Cho <yj44.cho@samsung.com>
Acked-by: default avatarInki Dae <inki.dae@samsung.com>
Acked-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent f181a543
Loading
Loading
Loading
Loading
+22 −18
Original line number Original line Diff line number Diff line
@@ -242,6 +242,19 @@ static void fimd_enable_video_output(struct fimd_context *ctx, int win,
	writel(val, ctx->regs + WINCON(win));
	writel(val, ctx->regs + WINCON(win));
}
}


static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, int win,
						bool enable)
{
	u32 val = readl(ctx->regs + SHADOWCON);

	if (enable)
		val |= SHADOWCON_CHx_ENABLE(win);
	else
		val &= ~SHADOWCON_CHx_ENABLE(win);

	writel(val, ctx->regs + SHADOWCON);
}

static void fimd_clear_channel(struct exynos_drm_manager *mgr)
static void fimd_clear_channel(struct exynos_drm_manager *mgr)
{
{
	struct fimd_context *ctx = mgr->ctx;
	struct fimd_context *ctx = mgr->ctx;
@@ -256,12 +269,10 @@ static void fimd_clear_channel(struct exynos_drm_manager *mgr)
		if (val & WINCONx_ENWIN) {
		if (val & WINCONx_ENWIN) {
			fimd_enable_video_output(ctx, win, false);
			fimd_enable_video_output(ctx, win, false);


			/* unprotect windows */
			if (ctx->driver_data->has_shadowcon)
			if (ctx->driver_data->has_shadowcon) {
				fimd_enable_shadow_channel_path(ctx, win,
				val = readl(ctx->regs + SHADOWCON);
								false);
				val &= ~SHADOWCON_CHx_ENABLE(win);

				writel(val, ctx->regs + SHADOWCON);
			}
			ch_enabled = 1;
			ch_enabled = 1;
		}
		}
	}
	}
@@ -759,11 +770,8 @@ static void fimd_win_commit(struct exynos_drm_manager *mgr, int zpos)


	fimd_enable_video_output(ctx, win, true);
	fimd_enable_video_output(ctx, win, true);


	if (ctx->driver_data->has_shadowcon) {
	if (ctx->driver_data->has_shadowcon)
		val = readl(ctx->regs + SHADOWCON);
		fimd_enable_shadow_channel_path(ctx, win, true);
		val |= SHADOWCON_CHx_ENABLE(win);
		writel(val, ctx->regs + SHADOWCON);
	}


	/* Enable DMA channel and unprotect windows */
	/* Enable DMA channel and unprotect windows */
	fimd_shadow_protect_win(ctx, win, false);
	fimd_shadow_protect_win(ctx, win, false);
@@ -779,7 +787,6 @@ static void fimd_win_disable(struct exynos_drm_manager *mgr, int zpos)
	struct fimd_context *ctx = mgr->ctx;
	struct fimd_context *ctx = mgr->ctx;
	struct fimd_win_data *win_data;
	struct fimd_win_data *win_data;
	int win = zpos;
	int win = zpos;
	u32 val;


	if (win == DEFAULT_ZPOS)
	if (win == DEFAULT_ZPOS)
		win = ctx->default_win;
		win = ctx->default_win;
@@ -800,13 +807,10 @@ static void fimd_win_disable(struct exynos_drm_manager *mgr, int zpos)


	fimd_enable_video_output(ctx, win, false);
	fimd_enable_video_output(ctx, win, false);


	/* unprotect windows */
	if (ctx->driver_data->has_shadowcon)
	if (ctx->driver_data->has_shadowcon) {
		fimd_enable_shadow_channel_path(ctx, win, false);
		val = readl(ctx->regs + SHADOWCON);
		val &= ~SHADOWCON_CHx_ENABLE(win);
		writel(val, ctx->regs + SHADOWCON);
	}


	/* unprotect windows */
	fimd_shadow_protect_win(ctx, win, false);
	fimd_shadow_protect_win(ctx, win, false);


	win_data->enabled = false;
	win_data->enabled = false;