]> git.baikalelectronics.ru Git - kernel.git/commit
drm/mediatek: call mtk_dsi_stop() after mtk_drm_crtc_atomic_disable()
authorHsin-Yi Wang <hsinyi@chromium.org>
Thu, 30 May 2019 09:18:47 +0000 (17:18 +0800)
committerCK Hu <ck.hu@mediatek.com>
Tue, 4 Jun 2019 01:54:42 +0000 (09:54 +0800)
commit13be0a6586de156f87044882d06a7cf7d5d14671
treeca451993ee924f15d7df22dfae8692e1009b7528
parentdfff0df79a52a641f0a5f53a17173ee683f5e870
drm/mediatek: call mtk_dsi_stop() after mtk_drm_crtc_atomic_disable()

mtk_dsi_stop() should be called after mtk_drm_crtc_atomic_disable(), which
needs ovl irq for drm_crtc_wait_one_vblank(), since after mtk_dsi_stop() is
called, ovl irq will be disabled. If drm_crtc_wait_one_vblank() is called
after last irq, it will timeout with this message: "vblank wait timed out
on crtc 0". This happens sometimes when turning off the screen.

In drm_atomic_helper.c#disable_outputs(),
the calling sequence when turning off the screen is:

1. mtk_dsi_encoder_disable()
     --> mtk_output_dsi_disable()
       --> mtk_dsi_stop();  /* sometimes make vblank timeout in
                               atomic_disable */
       --> mtk_dsi_poweroff();
2. mtk_drm_crtc_atomic_disable()
     --> drm_crtc_wait_one_vblank();
     ...
       --> mtk_dsi_ddp_stop()
         --> mtk_dsi_poweroff();

mtk_dsi_poweroff() has reference count design, change to make
mtk_dsi_stop() called in mtk_dsi_poweroff() when refcount is 0.

Fixes: 6bc71492bbd7 ("drm/mediatek: update DSI sub driver flow for sending commands to panel")
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Signed-off-by: CK Hu <ck.hu@mediatek.com>
drivers/gpu/drm/mediatek/mtk_dsi.c