summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/exynos/exynos_drm_fimd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_fimd.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimd.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index ae576122873e..700ca4fa6665 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -343,13 +343,18 @@ static void fimd_enable_shadow_channel_path(struct fimd_context *ctx,
writel(val, ctx->regs + SHADOWCON);
}
-static void fimd_clear_channels(struct exynos_drm_crtc *crtc)
+static int fimd_clear_channels(struct exynos_drm_crtc *crtc)
{
struct fimd_context *ctx = crtc->ctx;
unsigned int win, ch_enabled = 0;
+ int ret;
/* Hardware is in unknown state, so ensure it gets enabled properly */
- pm_runtime_get_sync(ctx->dev);
+ ret = pm_runtime_resume_and_get(ctx->dev);
+ if (ret < 0) {
+ dev_err(ctx->dev, "failed to enable FIMD device.\n");
+ return ret;
+ }
clk_prepare_enable(ctx->bus_clk);
clk_prepare_enable(ctx->lcd_clk);
@@ -384,6 +389,8 @@ static void fimd_clear_channels(struct exynos_drm_crtc *crtc)
clk_disable_unprepare(ctx->bus_clk);
pm_runtime_put(ctx->dev);
+
+ return 0;
}
@@ -905,7 +912,10 @@ static void fimd_atomic_enable(struct exynos_drm_crtc *crtc)
ctx->suspended = false;
- pm_runtime_get_sync(ctx->dev);
+ if (pm_runtime_resume_and_get(ctx->dev) < 0) {
+ dev_warn(ctx->dev, "failed to enable FIMD device.\n");
+ return;
+ }
/* if vblank was enabled status, enable it again. */
if (test_and_clear_bit(0, &ctx->irq_flags))
@@ -1089,8 +1099,13 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
if (ctx->encoder)
exynos_dpi_bind(drm_dev, ctx->encoder);
- if (is_drm_iommu_supported(drm_dev))
- fimd_clear_channels(ctx->crtc);
+ if (is_drm_iommu_supported(drm_dev)) {
+ int ret;
+
+ ret = fimd_clear_channels(ctx->crtc);
+ if (ret < 0)
+ return ret;
+ }
return exynos_drm_register_dma(drm_dev, dev, &ctx->dma_priv);
}