Skip to contentSkip to conversation

drm: mediatek: Fix display vblank timeout when disable dsi

PATCH In review [email protected] 3 participants 3 messages Sep 14, 2022 – Sep 15, 2022 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: mediatek: Fix display vblank timeout when disable dsi

From: Xinlei Lee <[email protected]>

Dsi is turned off at bridge.disable, causing crtc to wait for vblank timeout. It is necessary to add count protection to turn off dsi, and turn off at post_disable.

Fixes cde7e2e35c28 ("drm/mediatek: Separate poweron/poweroff from enable/disable and define new funcs")

---
Base on linux-next.
---

---
 drivers/gpu/drm/mediatek/mtk_dsi.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
drivers/gpu/drm/mediatek/mtk_dsi.c +6 -9
index 9cc406e1eee1..157248309c32 100644
@@ -768,14 +768,6 @@ static void mtk_dsi_bridge_mode_set(struct drm_bridge *bridge,
 	drm_display_mode_to_videomode(adjusted, &dsi->vm);
 }
 
-static void mtk_dsi_bridge_atomic_disable(struct drm_bridge *bridge,
-					  struct drm_bridge_state *old_bridge_state)
-{
-	struct mtk_dsi *dsi = bridge_to_dsi(bridge);
-
-	mtk_output_dsi_disable(dsi);
-}
-
 static void mtk_dsi_bridge_atomic_enable(struct drm_bridge *bridge,
 					 struct drm_bridge_state *old_bridge_state)
 {
@@ -803,12 +795,14 @@ static void mtk_dsi_bridge_atomic_post_disable(struct drm_bridge *bridge,
 {
 	struct mtk_dsi *dsi = bridge_to_dsi(bridge);
 
+	if (dsi->refcount == 1)
+		mtk_output_dsi_disable(dsi);
+
 	mtk_dsi_poweroff(dsi);
 }
 
 static const struct drm_bridge_funcs mtk_dsi_bridge_funcs = {
 	.attach = mtk_dsi_bridge_attach,
-	.atomic_disable = mtk_dsi_bridge_atomic_disable,
 	.atomic_enable = mtk_dsi_bridge_atomic_enable,
 	.atomic_pre_enable = mtk_dsi_bridge_atomic_pre_enable,
 	.atomic_post_disable = mtk_dsi_bridge_atomic_post_disable,
@@ -826,6 +820,9 @@ void mtk_dsi_ddp_stop(struct device *dev)
 {
 	struct mtk_dsi *dsi = dev_get_drvdata(dev);
 
+	if (dsi->refcount == 1)
+		mtk_output_dsi_disable(dsi);
+
 	mtk_dsi_poweroff(dsi);
 }
 
Signature · 1 line
2.18.0
#1 lore raw

Il 14/09/22 08:18, [email protected] ha scritto:

Quoted 7 lines

From: Xinlei Lee <[email protected]>

Dsi is turned off at bridge.disable, causing crtc to wait for vblank timeout. It is necessary to add count protection to turn off dsi, and turn off at post_disable.

Fixes cde7e2e35c28 ("drm/mediatek: Separate poweron/poweroff from enable/disable and define new funcs")

Hello Xinlei,
which machine is this commit targeting?

Can you please try to reproduce again the issue that you're seeing with my mtk_dsi fix [1], but without this commit?

Thanks,
Angelo

[1]: https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Hi maintainer,

Patch v2 has been sent to [1].

[1]
https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/

I'm sorry I didn't reply to all the email lists in the initial reply.

Below is the most recent information.

Thanks,
Allen

Quoted 17 lines · AngeloGioacchino Del Regno

Il 14/09/22 15:30, Allen-KH Cheng ha scritto:

Quoted 10 lines

Hi Angelo,

It's mt8186 corsola board. When this problem arises in system susepend/resume, we have your fix[1] in our dsi driver.

Because there is a conflict in mediatek-drm-fixes, kernel/git/chunkuang.hu/linux.git.

I'll assist Xinlei with another resend.

Ok, thanks for confirming!

Cheers,
Angelo