All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: mediatek: Fix display vblank timeout when disable dsi
@ 2022-09-14  6:18 ` xinlei.lee
  0 siblings, 0 replies; 9+ messages in thread
From: xinlei.lee @ 2022-09-14  6:18 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg, jitao.shi,
	angelogioacchino.delregno
  Cc: rex-bc.chen, dri-devel, linux-mediatek, linux-arm-kernel,
	linux-kernel, Project_Global_Chrome_Upstream_Group, Xinlei Lee

From: Xinlei Lee <xinlei.lee@mediatek.com>

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")
Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
---
Base on linux-next.
---
---
 drivers/gpu/drm/mediatek/mtk_dsi.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index 9cc406e1eee1..157248309c32 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -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);
 }
 
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] drm: mediatek: Fix display vblank timeout when disable dsi
@ 2022-09-14  6:18 ` xinlei.lee
  0 siblings, 0 replies; 9+ messages in thread
From: xinlei.lee @ 2022-09-14  6:18 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg, jitao.shi,
	angelogioacchino.delregno
  Cc: Xinlei Lee, linux-kernel, dri-devel,
	Project_Global_Chrome_Upstream_Group, linux-mediatek,
	rex-bc.chen, linux-arm-kernel

From: Xinlei Lee <xinlei.lee@mediatek.com>

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")
Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
---
Base on linux-next.
---
---
 drivers/gpu/drm/mediatek/mtk_dsi.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index 9cc406e1eee1..157248309c32 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -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);
 }
 
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] drm: mediatek: Fix display vblank timeout when disable dsi
@ 2022-09-14  6:18 ` xinlei.lee
  0 siblings, 0 replies; 9+ messages in thread
From: xinlei.lee @ 2022-09-14  6:18 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg, jitao.shi,
	angelogioacchino.delregno
  Cc: rex-bc.chen, dri-devel, linux-mediatek, linux-arm-kernel,
	linux-kernel, Project_Global_Chrome_Upstream_Group, Xinlei Lee

From: Xinlei Lee <xinlei.lee@mediatek.com>

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")
Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
---
Base on linux-next.
---
---
 drivers/gpu/drm/mediatek/mtk_dsi.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index 9cc406e1eee1..157248309c32 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -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);
 }
 
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm: mediatek: Fix display vblank timeout when disable dsi
  2022-09-14  6:18 ` xinlei.lee
  (?)
@ 2022-09-14  8:17   ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 9+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-09-14  8:17 UTC (permalink / raw)
  To: xinlei.lee, chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	jitao.shi
  Cc: rex-bc.chen, dri-devel, linux-mediatek, linux-arm-kernel,
	linux-kernel, Project_Global_Chrome_Upstream_Group

Il 14/09/22 08:18, xinlei.lee@mediatek.com ha scritto:
> From: Xinlei Lee <xinlei.lee@mediatek.com>
> 
> 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")
> Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>

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/20220721172727.14624-1-angelogioacchino.delregno@collabora.com/


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm: mediatek: Fix display vblank timeout when disable dsi
@ 2022-09-14  8:17   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 9+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-09-14  8:17 UTC (permalink / raw)
  To: xinlei.lee, chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	jitao.shi
  Cc: linux-kernel, dri-devel, Project_Global_Chrome_Upstream_Group,
	linux-mediatek, rex-bc.chen, linux-arm-kernel

Il 14/09/22 08:18, xinlei.lee@mediatek.com ha scritto:
> From: Xinlei Lee <xinlei.lee@mediatek.com>
> 
> 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")
> Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>

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/20220721172727.14624-1-angelogioacchino.delregno@collabora.com/


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm: mediatek: Fix display vblank timeout when disable dsi
@ 2022-09-14  8:17   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 9+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-09-14  8:17 UTC (permalink / raw)
  To: xinlei.lee, chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	jitao.shi
  Cc: rex-bc.chen, dri-devel, linux-mediatek, linux-arm-kernel,
	linux-kernel, Project_Global_Chrome_Upstream_Group

Il 14/09/22 08:18, xinlei.lee@mediatek.com ha scritto:
> From: Xinlei Lee <xinlei.lee@mediatek.com>
> 
> 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")
> Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>

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/20220721172727.14624-1-angelogioacchino.delregno@collabora.com/


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm: mediatek: Fix display vblank timeout when disable dsi
       [not found]     ` <3dd03eea-84cf-73bc-0bd4-3450c44ac8ba@collabora.com>
  2022-09-15  5:19         ` Allen-KH Cheng
@ 2022-09-15  5:19         ` Allen-KH Cheng
  0 siblings, 0 replies; 9+ messages in thread
From: Allen-KH Cheng @ 2022-09-15  5:19 UTC (permalink / raw)
  To: Chun-Kuang Hu, Philipp Zabel, David Airlie, Daniel Vetter,
	Matthias Brugger, AngeloGioacchino Del Regno
  Cc: Project_Global_Chrome_Upstream_Group, dri-devel,
	linux-arm-kernel, linux-kernel, linux-mediatek,
	Xinlei Lee (李昕磊),
	Allen-KH Cheng (程冠勳)

Hi maintainer,

Patch v2 has been sent to [1].

[1]
https://patchwork.kernel.org/project/linux-mediatek/patch/20220914140031.18578-1-allen-kh.cheng@mediatek.com/

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

Below is the most recent information.

Thanks,
Allen

On 9/14/22 21:34, AngeloGioacchino Del Regno wrote:
> Il 14/09/22 15:30, Allen-KH Cheng ha scritto:
>> 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
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm: mediatek: Fix display vblank timeout when disable dsi
@ 2022-09-15  5:19         ` Allen-KH Cheng
  0 siblings, 0 replies; 9+ messages in thread
From: Allen-KH Cheng @ 2022-09-15  5:19 UTC (permalink / raw)
  To: Chun-Kuang Hu, Philipp Zabel, David Airlie, Daniel Vetter,
	Matthias Brugger, AngeloGioacchino Del Regno
  Cc: Xinlei Lee (李昕磊),
	linux-kernel, dri-devel, Project_Global_Chrome_Upstream_Group,
	linux-mediatek, linux-arm-kernel,
	Allen-KH Cheng (程冠勳)

Hi maintainer,

Patch v2 has been sent to [1].

[1]
https://patchwork.kernel.org/project/linux-mediatek/patch/20220914140031.18578-1-allen-kh.cheng@mediatek.com/

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

Below is the most recent information.

Thanks,
Allen

On 9/14/22 21:34, AngeloGioacchino Del Regno wrote:
> Il 14/09/22 15:30, Allen-KH Cheng ha scritto:
>> 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
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm: mediatek: Fix display vblank timeout when disable dsi
@ 2022-09-15  5:19         ` Allen-KH Cheng
  0 siblings, 0 replies; 9+ messages in thread
From: Allen-KH Cheng @ 2022-09-15  5:19 UTC (permalink / raw)
  To: Chun-Kuang Hu, Philipp Zabel, David Airlie, Daniel Vetter,
	Matthias Brugger, AngeloGioacchino Del Regno
  Cc: Project_Global_Chrome_Upstream_Group, dri-devel,
	linux-arm-kernel, linux-kernel, linux-mediatek,
	Xinlei Lee (李昕磊),
	Allen-KH Cheng (程冠勳)

Hi maintainer,

Patch v2 has been sent to [1].

[1]
https://patchwork.kernel.org/project/linux-mediatek/patch/20220914140031.18578-1-allen-kh.cheng@mediatek.com/

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

Below is the most recent information.

Thanks,
Allen

On 9/14/22 21:34, AngeloGioacchino Del Regno wrote:
> Il 14/09/22 15:30, Allen-KH Cheng ha scritto:
>> 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
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-09-15  5:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14  6:18 [PATCH] drm: mediatek: Fix display vblank timeout when disable dsi xinlei.lee
2022-09-14  6:18 ` xinlei.lee
2022-09-14  6:18 ` xinlei.lee
2022-09-14  8:17 ` AngeloGioacchino Del Regno
2022-09-14  8:17   ` AngeloGioacchino Del Regno
2022-09-14  8:17   ` AngeloGioacchino Del Regno
     [not found]   ` <64bf6d7b-5a28-9b7d-fc3e-4c3c8eaa7d25@mediatek.com>
     [not found]     ` <3dd03eea-84cf-73bc-0bd4-3450c44ac8ba@collabora.com>
2022-09-15  5:19       ` Allen-KH Cheng
2022-09-15  5:19         ` Allen-KH Cheng
2022-09-15  5:19         ` Allen-KH Cheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.