Skip to content

Commit 5daef00

Browse files
nfrapradogregkh
authored andcommitted
drm/mediatek: dsi: Move mtk_dsi_stop() call back to mtk_dsi_poweroff()
[ Upstream commit 90144dd ] As the comment right before the mtk_dsi_stop() call advises, mtk_dsi_stop() should only be called after mtk_drm_crtc_atomic_disable(). That's because that function calls drm_crtc_wait_one_vblank(), which requires the vblank irq to be enabled. Previously mtk_dsi_stop(), being in mtk_dsi_poweroff() and guarded by a refcount, would only be called at the end of mtk_drm_crtc_atomic_disable(), through the call to mtk_crtc_ddp_hw_fini(). Commit cde7e2e ("drm/mediatek: Separate poweron/poweroff from enable/disable and define new funcs") moved the mtk_dsi_stop() call to mtk_output_dsi_disable(), causing it to be called before mtk_drm_crtc_atomic_disable(), and consequently generating vblank timeout warnings during suspend. Move the mtk_dsi_stop() call back to mtk_dsi_poweroff() so that we have a working vblank irq during mtk_drm_crtc_atomic_disable() and stop getting vblank timeout warnings. Fixes: cde7e2e ("drm/mediatek: Separate poweron/poweroff from enable/disable and define new funcs") Signed-off-by: Nícolas F. R. A. Prado <[email protected]> Tested-by: Hsin-Yi Wang <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Tested-by: Allen-KH Cheng <[email protected]> Link: http://lists.infradead.org/pipermail/linux-mediatek/2022-August/046713.html Signed-off-by: Chun-Kuang Hu <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent a08cba2 commit 5daef00

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

drivers/gpu/drm/mediatek/mtk_dsi.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,16 @@ static void mtk_dsi_poweroff(struct mtk_dsi *dsi)
673673
if (--dsi->refcount != 0)
674674
return;
675675

676+
/*
677+
* mtk_dsi_stop() and mtk_dsi_start() is asymmetric, since
678+
* mtk_dsi_stop() should be called after mtk_drm_crtc_atomic_disable(),
679+
* which needs irq for vblank, and mtk_dsi_stop() will disable irq.
680+
* mtk_dsi_start() needs to be called in mtk_output_dsi_enable(),
681+
* after dsi is fully set.
682+
*/
683+
mtk_dsi_stop(dsi);
684+
685+
mtk_dsi_switch_to_cmd_mode(dsi, VM_DONE_INT_FLAG, 500);
676686
mtk_dsi_reset_engine(dsi);
677687
mtk_dsi_lane0_ulp_mode_enter(dsi);
678688
mtk_dsi_clk_ulp_mode_enter(dsi);
@@ -723,17 +733,6 @@ static void mtk_output_dsi_disable(struct mtk_dsi *dsi)
723733
if (!dsi->enabled)
724734
return;
725735

726-
/*
727-
* mtk_dsi_stop() and mtk_dsi_start() is asymmetric, since
728-
* mtk_dsi_stop() should be called after mtk_drm_crtc_atomic_disable(),
729-
* which needs irq for vblank, and mtk_dsi_stop() will disable irq.
730-
* mtk_dsi_start() needs to be called in mtk_output_dsi_enable(),
731-
* after dsi is fully set.
732-
*/
733-
mtk_dsi_stop(dsi);
734-
735-
mtk_dsi_switch_to_cmd_mode(dsi, VM_DONE_INT_FLAG, 500);
736-
737736
dsi->enabled = false;
738737
}
739738

0 commit comments

Comments
 (0)