Skip to content

Commit 5d91394

Browse files
mszyprowdaeinki
authored andcommitted
drm/exynos: fimd: Guard display clock control with runtime PM calls
Commit c9b1150 ("drm/atomic-helper: Re-order bridge chain pre-enable and post-disable") changed the call sequence to the CRTC enable/disable and bridge pre_enable/post_disable methods, so those bridge methods are now called when CRTC is not yet enabled. This causes a lockup observed on Samsung Peach-Pit/Pi Chromebooks. The source of this lockup is a call to fimd_dp_clock_enable() function, when FIMD device is not yet runtime resumed. It worked before the mentioned commit only because the CRTC implemented by the FIMD driver was always enabled what guaranteed the FIMD device to be runtime resumed. This patch adds runtime PM guards to the fimd_dp_clock_enable() function to enable its proper operation also when the CRTC implemented by FIMD is not yet enabled. Fixes: 196e059 ("drm/exynos: convert clock_enable crtc callback to pipeline clock") Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Inki Dae <[email protected]>
1 parent b846350 commit 5d91394

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/gpu/drm/exynos/exynos_drm_fimd.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ struct fimd_context {
187187
u32 i80ifcon;
188188
bool i80_if;
189189
bool suspended;
190+
bool dp_clk_enabled;
190191
wait_queue_head_t wait_vsync_queue;
191192
atomic_t wait_vsync_event;
192193
atomic_t win_updated;
@@ -1047,7 +1048,18 @@ static void fimd_dp_clock_enable(struct exynos_drm_clk *clk, bool enable)
10471048
struct fimd_context *ctx = container_of(clk, struct fimd_context,
10481049
dp_clk);
10491050
u32 val = enable ? DP_MIE_CLK_DP_ENABLE : DP_MIE_CLK_DISABLE;
1051+
1052+
if (enable == ctx->dp_clk_enabled)
1053+
return;
1054+
1055+
if (enable)
1056+
pm_runtime_resume_and_get(ctx->dev);
1057+
1058+
ctx->dp_clk_enabled = enable;
10501059
writel(val, ctx->regs + DP_MIE_CLKCON);
1060+
1061+
if (!enable)
1062+
pm_runtime_put(ctx->dev);
10511063
}
10521064

10531065
static const struct exynos_drm_crtc_ops fimd_crtc_ops = {

0 commit comments

Comments
 (0)