|
@@ -603,75 +603,39 @@ static void decon_init(struct decon_context *ctx)
|
|
|
writel(VIDCON1_VCLK_HOLD, ctx->regs + VIDCON1(0));
|
|
|
}
|
|
|
|
|
|
-static int decon_poweron(struct decon_context *ctx)
|
|
|
+static void decon_enable(struct exynos_drm_crtc *crtc)
|
|
|
{
|
|
|
- int ret;
|
|
|
+ struct decon_context *ctx = crtc->ctx;
|
|
|
|
|
|
if (!ctx->suspended)
|
|
|
- return 0;
|
|
|
+ return;
|
|
|
|
|
|
ctx->suspended = false;
|
|
|
|
|
|
pm_runtime_get_sync(ctx->dev);
|
|
|
|
|
|
- ret = clk_prepare_enable(ctx->pclk);
|
|
|
- if (ret < 0) {
|
|
|
- DRM_ERROR("Failed to prepare_enable the pclk [%d]\n", ret);
|
|
|
- goto pclk_err;
|
|
|
- }
|
|
|
-
|
|
|
- ret = clk_prepare_enable(ctx->aclk);
|
|
|
- if (ret < 0) {
|
|
|
- DRM_ERROR("Failed to prepare_enable the aclk [%d]\n", ret);
|
|
|
- goto aclk_err;
|
|
|
- }
|
|
|
-
|
|
|
- ret = clk_prepare_enable(ctx->eclk);
|
|
|
- if (ret < 0) {
|
|
|
- DRM_ERROR("Failed to prepare_enable the eclk [%d]\n", ret);
|
|
|
- goto eclk_err;
|
|
|
- }
|
|
|
-
|
|
|
- ret = clk_prepare_enable(ctx->vclk);
|
|
|
- if (ret < 0) {
|
|
|
- DRM_ERROR("Failed to prepare_enable the vclk [%d]\n", ret);
|
|
|
- goto vclk_err;
|
|
|
- }
|
|
|
+ clk_prepare_enable(ctx->pclk);
|
|
|
+ clk_prepare_enable(ctx->aclk);
|
|
|
+ clk_prepare_enable(ctx->eclk);
|
|
|
+ clk_prepare_enable(ctx->vclk);
|
|
|
|
|
|
decon_init(ctx);
|
|
|
|
|
|
/* if vblank was enabled status, enable it again. */
|
|
|
- if (test_and_clear_bit(0, &ctx->irq_flags)) {
|
|
|
- ret = decon_enable_vblank(ctx->crtc);
|
|
|
- if (ret) {
|
|
|
- DRM_ERROR("Failed to re-enable vblank [%d]\n", ret);
|
|
|
- goto err;
|
|
|
- }
|
|
|
- }
|
|
|
+ if (test_and_clear_bit(0, &ctx->irq_flags))
|
|
|
+ decon_enable_vblank(ctx->crtc);
|
|
|
|
|
|
decon_window_resume(ctx);
|
|
|
|
|
|
decon_apply(ctx);
|
|
|
-
|
|
|
- return 0;
|
|
|
-
|
|
|
-err:
|
|
|
- clk_disable_unprepare(ctx->vclk);
|
|
|
-vclk_err:
|
|
|
- clk_disable_unprepare(ctx->eclk);
|
|
|
-eclk_err:
|
|
|
- clk_disable_unprepare(ctx->aclk);
|
|
|
-aclk_err:
|
|
|
- clk_disable_unprepare(ctx->pclk);
|
|
|
-pclk_err:
|
|
|
- ctx->suspended = true;
|
|
|
- return ret;
|
|
|
}
|
|
|
|
|
|
-static int decon_poweroff(struct decon_context *ctx)
|
|
|
+static void decon_disable(struct exynos_drm_crtc *crtc)
|
|
|
{
|
|
|
+ struct decon_context *ctx = crtc->ctx;
|
|
|
+
|
|
|
if (ctx->suspended)
|
|
|
- return 0;
|
|
|
+ return;
|
|
|
|
|
|
/*
|
|
|
* We need to make sure that all windows are disabled before we
|
|
@@ -688,30 +652,11 @@ static int decon_poweroff(struct decon_context *ctx)
|
|
|
pm_runtime_put_sync(ctx->dev);
|
|
|
|
|
|
ctx->suspended = true;
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-static void decon_dpms(struct exynos_drm_crtc *crtc, int mode)
|
|
|
-{
|
|
|
- DRM_DEBUG_KMS("%s, %d\n", __FILE__, mode);
|
|
|
-
|
|
|
- switch (mode) {
|
|
|
- case DRM_MODE_DPMS_ON:
|
|
|
- decon_poweron(crtc->ctx);
|
|
|
- break;
|
|
|
- case DRM_MODE_DPMS_STANDBY:
|
|
|
- case DRM_MODE_DPMS_SUSPEND:
|
|
|
- case DRM_MODE_DPMS_OFF:
|
|
|
- decon_poweroff(crtc->ctx);
|
|
|
- break;
|
|
|
- default:
|
|
|
- DRM_DEBUG_KMS("unspecified mode %d\n", mode);
|
|
|
- break;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
static const struct exynos_drm_crtc_ops decon_crtc_ops = {
|
|
|
- .dpms = decon_dpms,
|
|
|
+ .enable = decon_enable,
|
|
|
+ .disable = decon_disable,
|
|
|
.mode_fixup = decon_mode_fixup,
|
|
|
.commit = decon_commit,
|
|
|
.enable_vblank = decon_enable_vblank,
|
|
@@ -796,7 +741,7 @@ static void decon_unbind(struct device *dev, struct device *master,
|
|
|
{
|
|
|
struct decon_context *ctx = dev_get_drvdata(dev);
|
|
|
|
|
|
- decon_dpms(ctx->crtc, DRM_MODE_DPMS_OFF);
|
|
|
+ decon_disable(ctx->crtc);
|
|
|
|
|
|
if (ctx->display)
|
|
|
exynos_dpi_remove(ctx->display);
|