All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Reduce lcm_reset to DSI LP11 send cmd time
@ 2023-01-10  5:54 ` xinlei.lee
  0 siblings, 0 replies; 27+ messages in thread
From: xinlei.lee @ 2023-01-10  5:54 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	angelogioacchino.delregno, jitao.shi, thierry.reding, sam
  Cc: Xinlei Lee, linux-kernel, dri-devel,
	Project_Global_Chrome_Upstream_Group, linux-mediatek,
	linux-arm-kernel

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

The panel spec stipulates that after lcm_reset is pulled high, cmd
should be sent to initialize the panel. Within the allowable range of
the DSI spec, this time needs to be reduced to avoid panel exceptions.

Base on the branch of linus/master v6.2.

Change since v1:
1. Added fine-tuning panel power sequence modification.

Xinlei Lee (3):
  drm/mediatek: dsi: Reduce the time of dsi from LP11 to sending cmd
  drm/panel: boe-tv101wum-nl6: Reduce lcm_reset to send initial code
    time
  drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence

 drivers/gpu/drm/mediatek/mtk_dsi.c             | 2 +-
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

-- 
2.18.0


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

* [PATCH v2 0/3] Reduce lcm_reset to DSI LP11 send cmd time
@ 2023-01-10  5:54 ` xinlei.lee
  0 siblings, 0 replies; 27+ messages in thread
From: xinlei.lee @ 2023-01-10  5:54 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	angelogioacchino.delregno, jitao.shi, thierry.reding, sam
  Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group, Xinlei Lee

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

The panel spec stipulates that after lcm_reset is pulled high, cmd
should be sent to initialize the panel. Within the allowable range of
the DSI spec, this time needs to be reduced to avoid panel exceptions.

Base on the branch of linus/master v6.2.

Change since v1:
1. Added fine-tuning panel power sequence modification.

Xinlei Lee (3):
  drm/mediatek: dsi: Reduce the time of dsi from LP11 to sending cmd
  drm/panel: boe-tv101wum-nl6: Reduce lcm_reset to send initial code
    time
  drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence

 drivers/gpu/drm/mediatek/mtk_dsi.c             | 2 +-
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

-- 
2.18.0


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

* [PATCH v2 0/3] Reduce lcm_reset to DSI LP11 send cmd time
@ 2023-01-10  5:54 ` xinlei.lee
  0 siblings, 0 replies; 27+ messages in thread
From: xinlei.lee @ 2023-01-10  5:54 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	angelogioacchino.delregno, jitao.shi, thierry.reding, sam
  Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group, Xinlei Lee

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

The panel spec stipulates that after lcm_reset is pulled high, cmd
should be sent to initialize the panel. Within the allowable range of
the DSI spec, this time needs to be reduced to avoid panel exceptions.

Base on the branch of linus/master v6.2.

Change since v1:
1. Added fine-tuning panel power sequence modification.

Xinlei Lee (3):
  drm/mediatek: dsi: Reduce the time of dsi from LP11 to sending cmd
  drm/panel: boe-tv101wum-nl6: Reduce lcm_reset to send initial code
    time
  drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence

 drivers/gpu/drm/mediatek/mtk_dsi.c             | 2 +-
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

-- 
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	[flat|nested] 27+ messages in thread

* [PATCH v2 1/3] drm/mediatek: dsi: Reduce the time of dsi from LP11 to sending cmd
  2023-01-10  5:54 ` xinlei.lee
  (?)
@ 2023-01-10  5:54   ` xinlei.lee
  -1 siblings, 0 replies; 27+ messages in thread
From: xinlei.lee @ 2023-01-10  5:54 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	angelogioacchino.delregno, jitao.shi, thierry.reding, sam
  Cc: Xinlei Lee, linux-kernel, dri-devel,
	Project_Global_Chrome_Upstream_Group, linux-mediatek,
	linux-arm-kernel

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

According to Figure 16 Turnaround Procedure on page 36 in [1], you
can see the status of LP-00 -> LP10 -> LP11. This state can correspond
to the state of DSI from LP00 -> LP11 in mtk_dsi_lane_ready function
in mtk_dsi.c.

LP-00 -> LP10 -> LP11 takes about 2*TLPX time (refer to [1] page 51
to see that TLPX is 50ns)

The delay at the end of the mtk_dsi_lane_ready function should be
greater than the 2*TLPX specified by the DSI spec, and less than
the time specified by the DSI_RX (generally 6ms to 40ms), to avoid
problems caused by the RX specification

[1]:mipi_D-PHY_specification_v1-1

Fixes: 39e8d062b03c ("drm/mediatek: Keep dsi as LP00 before dcs cmds transfer")
Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index 3b7d13028fb6..9e1363c9fcdb 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -721,7 +721,7 @@ static void mtk_dsi_lane_ready(struct mtk_dsi *dsi)
 		mtk_dsi_clk_ulp_mode_leave(dsi);
 		mtk_dsi_lane0_ulp_mode_leave(dsi);
 		mtk_dsi_clk_hs_mode(dsi, 0);
-		msleep(20);
+		usleep_range(1000, 3000);
 		/* The reaction time after pulling up the mipi signal for dsi_rx */
 	}
 }
-- 
2.18.0


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

* [PATCH v2 1/3] drm/mediatek: dsi: Reduce the time of dsi from LP11 to sending cmd
@ 2023-01-10  5:54   ` xinlei.lee
  0 siblings, 0 replies; 27+ messages in thread
From: xinlei.lee @ 2023-01-10  5:54 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	angelogioacchino.delregno, jitao.shi, thierry.reding, sam
  Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group, Xinlei Lee

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

According to Figure 16 Turnaround Procedure on page 36 in [1], you
can see the status of LP-00 -> LP10 -> LP11. This state can correspond
to the state of DSI from LP00 -> LP11 in mtk_dsi_lane_ready function
in mtk_dsi.c.

LP-00 -> LP10 -> LP11 takes about 2*TLPX time (refer to [1] page 51
to see that TLPX is 50ns)

The delay at the end of the mtk_dsi_lane_ready function should be
greater than the 2*TLPX specified by the DSI spec, and less than
the time specified by the DSI_RX (generally 6ms to 40ms), to avoid
problems caused by the RX specification

[1]:mipi_D-PHY_specification_v1-1

Fixes: 39e8d062b03c ("drm/mediatek: Keep dsi as LP00 before dcs cmds transfer")
Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index 3b7d13028fb6..9e1363c9fcdb 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -721,7 +721,7 @@ static void mtk_dsi_lane_ready(struct mtk_dsi *dsi)
 		mtk_dsi_clk_ulp_mode_leave(dsi);
 		mtk_dsi_lane0_ulp_mode_leave(dsi);
 		mtk_dsi_clk_hs_mode(dsi, 0);
-		msleep(20);
+		usleep_range(1000, 3000);
 		/* The reaction time after pulling up the mipi signal for dsi_rx */
 	}
 }
-- 
2.18.0


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

* [PATCH v2 1/3] drm/mediatek: dsi: Reduce the time of dsi from LP11 to sending cmd
@ 2023-01-10  5:54   ` xinlei.lee
  0 siblings, 0 replies; 27+ messages in thread
From: xinlei.lee @ 2023-01-10  5:54 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	angelogioacchino.delregno, jitao.shi, thierry.reding, sam
  Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group, Xinlei Lee

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

According to Figure 16 Turnaround Procedure on page 36 in [1], you
can see the status of LP-00 -> LP10 -> LP11. This state can correspond
to the state of DSI from LP00 -> LP11 in mtk_dsi_lane_ready function
in mtk_dsi.c.

LP-00 -> LP10 -> LP11 takes about 2*TLPX time (refer to [1] page 51
to see that TLPX is 50ns)

The delay at the end of the mtk_dsi_lane_ready function should be
greater than the 2*TLPX specified by the DSI spec, and less than
the time specified by the DSI_RX (generally 6ms to 40ms), to avoid
problems caused by the RX specification

[1]:mipi_D-PHY_specification_v1-1

Fixes: 39e8d062b03c ("drm/mediatek: Keep dsi as LP00 before dcs cmds transfer")
Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index 3b7d13028fb6..9e1363c9fcdb 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -721,7 +721,7 @@ static void mtk_dsi_lane_ready(struct mtk_dsi *dsi)
 		mtk_dsi_clk_ulp_mode_leave(dsi);
 		mtk_dsi_lane0_ulp_mode_leave(dsi);
 		mtk_dsi_clk_hs_mode(dsi, 0);
-		msleep(20);
+		usleep_range(1000, 3000);
 		/* The reaction time after pulling up the mipi signal for dsi_rx */
 	}
 }
-- 
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] 27+ messages in thread

* [PATCH v2 2/3] drm/panel: boe-tv101wum-nl6: Reduce lcm_reset to send initial code time
  2023-01-10  5:54 ` xinlei.lee
  (?)
@ 2023-01-10  5:54   ` xinlei.lee
  -1 siblings, 0 replies; 27+ messages in thread
From: xinlei.lee @ 2023-01-10  5:54 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	angelogioacchino.delregno, jitao.shi, thierry.reding, sam
  Cc: Xinlei Lee, linux-kernel, dri-devel,
	Project_Global_Chrome_Upstream_Group, linux-mediatek,
	linux-arm-kernel

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

Since the panel spec stipulates that the time from lcm_reset to DSI to
send the initial code should be greater than 6ms and less than 40ms,
so reduce the delay before sending the initial code and avoid panel
exceptions.

Fixes: a869b9db7adf ("drm/panel: support for boe tv101wum-nl6 wuxga dsi video mode panel")
Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
---
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index 857a2f0420d7..f0093035f1ff 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -780,7 +780,6 @@ static const struct panel_init_cmd inx_hj110iz_init_cmd[] = {
 };
 
 static const struct panel_init_cmd boe_init_cmd[] = {
-	_INIT_DELAY_CMD(24),
 	_INIT_DCS_CMD(0xB0, 0x05),
 	_INIT_DCS_CMD(0xB1, 0xE5),
 	_INIT_DCS_CMD(0xB3, 0x52),
-- 
2.18.0


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

* [PATCH v2 2/3] drm/panel: boe-tv101wum-nl6: Reduce lcm_reset to send initial code time
@ 2023-01-10  5:54   ` xinlei.lee
  0 siblings, 0 replies; 27+ messages in thread
From: xinlei.lee @ 2023-01-10  5:54 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	angelogioacchino.delregno, jitao.shi, thierry.reding, sam
  Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group, Xinlei Lee

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

Since the panel spec stipulates that the time from lcm_reset to DSI to
send the initial code should be greater than 6ms and less than 40ms,
so reduce the delay before sending the initial code and avoid panel
exceptions.

Fixes: a869b9db7adf ("drm/panel: support for boe tv101wum-nl6 wuxga dsi video mode panel")
Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
---
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index 857a2f0420d7..f0093035f1ff 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -780,7 +780,6 @@ static const struct panel_init_cmd inx_hj110iz_init_cmd[] = {
 };
 
 static const struct panel_init_cmd boe_init_cmd[] = {
-	_INIT_DELAY_CMD(24),
 	_INIT_DCS_CMD(0xB0, 0x05),
 	_INIT_DCS_CMD(0xB1, 0xE5),
 	_INIT_DCS_CMD(0xB3, 0x52),
-- 
2.18.0


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

* [PATCH v2 2/3] drm/panel: boe-tv101wum-nl6: Reduce lcm_reset to send initial code time
@ 2023-01-10  5:54   ` xinlei.lee
  0 siblings, 0 replies; 27+ messages in thread
From: xinlei.lee @ 2023-01-10  5:54 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	angelogioacchino.delregno, jitao.shi, thierry.reding, sam
  Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group, Xinlei Lee

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

Since the panel spec stipulates that the time from lcm_reset to DSI to
send the initial code should be greater than 6ms and less than 40ms,
so reduce the delay before sending the initial code and avoid panel
exceptions.

Fixes: a869b9db7adf ("drm/panel: support for boe tv101wum-nl6 wuxga dsi video mode panel")
Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
---
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index 857a2f0420d7..f0093035f1ff 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -780,7 +780,6 @@ static const struct panel_init_cmd inx_hj110iz_init_cmd[] = {
 };
 
 static const struct panel_init_cmd boe_init_cmd[] = {
-	_INIT_DELAY_CMD(24),
 	_INIT_DCS_CMD(0xB0, 0x05),
 	_INIT_DCS_CMD(0xB1, 0xE5),
 	_INIT_DCS_CMD(0xB3, 0x52),
-- 
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] 27+ messages in thread

* [PATCH v2 3/3] drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence
  2023-01-10  5:54 ` xinlei.lee
  (?)
@ 2023-01-10  5:54   ` xinlei.lee
  -1 siblings, 0 replies; 27+ messages in thread
From: xinlei.lee @ 2023-01-10  5:54 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	angelogioacchino.delregno, jitao.shi, thierry.reding, sam
  Cc: Xinlei Lee, linux-kernel, dri-devel,
	Project_Global_Chrome_Upstream_Group, linux-mediatek,
	linux-arm-kernel

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

For "boe,tv105wum-nw0" this special panel, it is stipulated in the 
panel spec that MIPI needs to keep the LP11 state before the 
lcm_reset pin is pulled high.

Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
---
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index f0093035f1ff..67df61de64ae 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -36,6 +36,7 @@ struct panel_desc {
 	const struct panel_init_cmd *init_cmds;
 	unsigned int lanes;
 	bool discharge_on_disable;
+	bool lp11_before_reset;
 };
 
 struct boe_panel {
@@ -1261,6 +1262,10 @@ static int boe_panel_prepare(struct drm_panel *panel)
 
 	usleep_range(10000, 11000);
 
+	if (boe->desc->lp11_before_reset) {
+		mipi_dsi_dcs_nop(boe->dsi);
+		usleep_range(1000, 2000);
+	}
 	gpiod_set_value(boe->enable_gpio, 1);
 	usleep_range(1000, 2000);
 	gpiod_set_value(boe->enable_gpio, 0);
@@ -1487,6 +1492,7 @@ static const struct panel_desc boe_tv105wum_nw0_desc = {
 	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
 		      MIPI_DSI_MODE_LPM,
 	.init_cmds = boe_init_cmd,
+	.lp11_before_reset = true,
 };
 
 static int boe_panel_get_modes(struct drm_panel *panel,
-- 
2.18.0


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

* [PATCH v2 3/3] drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence
@ 2023-01-10  5:54   ` xinlei.lee
  0 siblings, 0 replies; 27+ messages in thread
From: xinlei.lee @ 2023-01-10  5:54 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	angelogioacchino.delregno, jitao.shi, thierry.reding, sam
  Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group, Xinlei Lee

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

For "boe,tv105wum-nw0" this special panel, it is stipulated in the 
panel spec that MIPI needs to keep the LP11 state before the 
lcm_reset pin is pulled high.

Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
---
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index f0093035f1ff..67df61de64ae 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -36,6 +36,7 @@ struct panel_desc {
 	const struct panel_init_cmd *init_cmds;
 	unsigned int lanes;
 	bool discharge_on_disable;
+	bool lp11_before_reset;
 };
 
 struct boe_panel {
@@ -1261,6 +1262,10 @@ static int boe_panel_prepare(struct drm_panel *panel)
 
 	usleep_range(10000, 11000);
 
+	if (boe->desc->lp11_before_reset) {
+		mipi_dsi_dcs_nop(boe->dsi);
+		usleep_range(1000, 2000);
+	}
 	gpiod_set_value(boe->enable_gpio, 1);
 	usleep_range(1000, 2000);
 	gpiod_set_value(boe->enable_gpio, 0);
@@ -1487,6 +1492,7 @@ static const struct panel_desc boe_tv105wum_nw0_desc = {
 	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
 		      MIPI_DSI_MODE_LPM,
 	.init_cmds = boe_init_cmd,
+	.lp11_before_reset = true,
 };
 
 static int boe_panel_get_modes(struct drm_panel *panel,
-- 
2.18.0


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

* [PATCH v2 3/3] drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence
@ 2023-01-10  5:54   ` xinlei.lee
  0 siblings, 0 replies; 27+ messages in thread
From: xinlei.lee @ 2023-01-10  5:54 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	angelogioacchino.delregno, jitao.shi, thierry.reding, sam
  Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group, Xinlei Lee

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

For "boe,tv105wum-nw0" this special panel, it is stipulated in the 
panel spec that MIPI needs to keep the LP11 state before the 
lcm_reset pin is pulled high.

Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
---
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index f0093035f1ff..67df61de64ae 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -36,6 +36,7 @@ struct panel_desc {
 	const struct panel_init_cmd *init_cmds;
 	unsigned int lanes;
 	bool discharge_on_disable;
+	bool lp11_before_reset;
 };
 
 struct boe_panel {
@@ -1261,6 +1262,10 @@ static int boe_panel_prepare(struct drm_panel *panel)
 
 	usleep_range(10000, 11000);
 
+	if (boe->desc->lp11_before_reset) {
+		mipi_dsi_dcs_nop(boe->dsi);
+		usleep_range(1000, 2000);
+	}
 	gpiod_set_value(boe->enable_gpio, 1);
 	usleep_range(1000, 2000);
 	gpiod_set_value(boe->enable_gpio, 0);
@@ -1487,6 +1492,7 @@ static const struct panel_desc boe_tv105wum_nw0_desc = {
 	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
 		      MIPI_DSI_MODE_LPM,
 	.init_cmds = boe_init_cmd,
+	.lp11_before_reset = true,
 };
 
 static int boe_panel_get_modes(struct drm_panel *panel,
-- 
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] 27+ messages in thread

* Re: [PATCH v2 2/3] drm/panel: boe-tv101wum-nl6: Reduce lcm_reset to send initial code time
  2023-01-10  5:54   ` xinlei.lee
  (?)
@ 2023-01-10  9:20     ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 27+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-01-10  9:20 UTC (permalink / raw)
  To: xinlei.lee, chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	jitao.shi, thierry.reding, sam
  Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group

Il 10/01/23 06:54, xinlei.lee@mediatek.com ha scritto:
> From: Xinlei Lee <xinlei.lee@mediatek.com>
> 
> Since the panel spec stipulates that the time from lcm_reset to DSI to
> send the initial code should be greater than 6ms and less than 40ms,
> so reduce the delay before sending the initial code and avoid panel
> exceptions.

Please change the commit title to describe what you're doing.

drm/panel: boe-tv101wum-nl6: Remove extra delay in init commands


....and the commit description should also contain something like

Reduce the delay after LCM reset by removing an extra delay in the
initialization commands array. The required delay of at least 6ms after
reset is guaranteed by boe_panel_prepare().

Regards,
Angelo


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

* Re: [PATCH v2 2/3] drm/panel: boe-tv101wum-nl6: Reduce lcm_reset to send initial code time
@ 2023-01-10  9:20     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 27+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-01-10  9:20 UTC (permalink / raw)
  To: xinlei.lee, chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	jitao.shi, thierry.reding, sam
  Cc: linux-arm-kernel, Project_Global_Chrome_Upstream_Group,
	linux-mediatek, linux-kernel, dri-devel

Il 10/01/23 06:54, xinlei.lee@mediatek.com ha scritto:
> From: Xinlei Lee <xinlei.lee@mediatek.com>
> 
> Since the panel spec stipulates that the time from lcm_reset to DSI to
> send the initial code should be greater than 6ms and less than 40ms,
> so reduce the delay before sending the initial code and avoid panel
> exceptions.

Please change the commit title to describe what you're doing.

drm/panel: boe-tv101wum-nl6: Remove extra delay in init commands


....and the commit description should also contain something like

Reduce the delay after LCM reset by removing an extra delay in the
initialization commands array. The required delay of at least 6ms after
reset is guaranteed by boe_panel_prepare().

Regards,
Angelo


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

* Re: [PATCH v2 2/3] drm/panel: boe-tv101wum-nl6: Reduce lcm_reset to send initial code time
@ 2023-01-10  9:20     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 27+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-01-10  9:20 UTC (permalink / raw)
  To: xinlei.lee, chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	jitao.shi, thierry.reding, sam
  Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group

Il 10/01/23 06:54, xinlei.lee@mediatek.com ha scritto:
> From: Xinlei Lee <xinlei.lee@mediatek.com>
> 
> Since the panel spec stipulates that the time from lcm_reset to DSI to
> send the initial code should be greater than 6ms and less than 40ms,
> so reduce the delay before sending the initial code and avoid panel
> exceptions.

Please change the commit title to describe what you're doing.

drm/panel: boe-tv101wum-nl6: Remove extra delay in init commands


....and the commit description should also contain something like

Reduce the delay after LCM reset by removing an extra delay in the
initialization commands array. The required delay of at least 6ms after
reset is guaranteed by boe_panel_prepare().

Regards,
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] 27+ messages in thread

* Re: [PATCH v2 3/3] drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence
  2023-01-10  5:54   ` xinlei.lee
  (?)
@ 2023-01-10  9:22     ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 27+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-01-10  9:22 UTC (permalink / raw)
  To: xinlei.lee, chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	jitao.shi, thierry.reding, sam
  Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group

Il 10/01/23 06:54, xinlei.lee@mediatek.com ha scritto:
> From: Xinlei Lee <xinlei.lee@mediatek.com>
> 
> For "boe,tv105wum-nw0" this special panel, it is stipulated in the
> panel spec that MIPI needs to keep the LP11 state before the
> lcm_reset pin is pulled high.
> 
> Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
> ---
>   drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> index f0093035f1ff..67df61de64ae 100644
> --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> @@ -36,6 +36,7 @@ struct panel_desc {
>   	const struct panel_init_cmd *init_cmds;
>   	unsigned int lanes;
>   	bool discharge_on_disable;
> +	bool lp11_before_reset;
>   };
>   
>   struct boe_panel {
> @@ -1261,6 +1262,10 @@ static int boe_panel_prepare(struct drm_panel *panel)
>   
>   	usleep_range(10000, 11000);
>   
> +	if (boe->desc->lp11_before_reset) {
> +		mipi_dsi_dcs_nop(boe->dsi);

NOP will never reach the driveric if it is in reset, which should apparently be
the state of it at that point in code.

I guess that you wanted to do that after LCM reset and before sending init cmds.

Regards,
Angelo


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

* Re: [PATCH v2 3/3] drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence
@ 2023-01-10  9:22     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 27+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-01-10  9:22 UTC (permalink / raw)
  To: xinlei.lee, chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	jitao.shi, thierry.reding, sam
  Cc: linux-arm-kernel, Project_Global_Chrome_Upstream_Group,
	linux-mediatek, linux-kernel, dri-devel

Il 10/01/23 06:54, xinlei.lee@mediatek.com ha scritto:
> From: Xinlei Lee <xinlei.lee@mediatek.com>
> 
> For "boe,tv105wum-nw0" this special panel, it is stipulated in the
> panel spec that MIPI needs to keep the LP11 state before the
> lcm_reset pin is pulled high.
> 
> Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
> ---
>   drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> index f0093035f1ff..67df61de64ae 100644
> --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> @@ -36,6 +36,7 @@ struct panel_desc {
>   	const struct panel_init_cmd *init_cmds;
>   	unsigned int lanes;
>   	bool discharge_on_disable;
> +	bool lp11_before_reset;
>   };
>   
>   struct boe_panel {
> @@ -1261,6 +1262,10 @@ static int boe_panel_prepare(struct drm_panel *panel)
>   
>   	usleep_range(10000, 11000);
>   
> +	if (boe->desc->lp11_before_reset) {
> +		mipi_dsi_dcs_nop(boe->dsi);

NOP will never reach the driveric if it is in reset, which should apparently be
the state of it at that point in code.

I guess that you wanted to do that after LCM reset and before sending init cmds.

Regards,
Angelo


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

* Re: [PATCH v2 3/3] drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence
@ 2023-01-10  9:22     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 27+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-01-10  9:22 UTC (permalink / raw)
  To: xinlei.lee, chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	jitao.shi, thierry.reding, sam
  Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group

Il 10/01/23 06:54, xinlei.lee@mediatek.com ha scritto:
> From: Xinlei Lee <xinlei.lee@mediatek.com>
> 
> For "boe,tv105wum-nw0" this special panel, it is stipulated in the
> panel spec that MIPI needs to keep the LP11 state before the
> lcm_reset pin is pulled high.
> 
> Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
> ---
>   drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> index f0093035f1ff..67df61de64ae 100644
> --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> @@ -36,6 +36,7 @@ struct panel_desc {
>   	const struct panel_init_cmd *init_cmds;
>   	unsigned int lanes;
>   	bool discharge_on_disable;
> +	bool lp11_before_reset;
>   };
>   
>   struct boe_panel {
> @@ -1261,6 +1262,10 @@ static int boe_panel_prepare(struct drm_panel *panel)
>   
>   	usleep_range(10000, 11000);
>   
> +	if (boe->desc->lp11_before_reset) {
> +		mipi_dsi_dcs_nop(boe->dsi);

NOP will never reach the driveric if it is in reset, which should apparently be
the state of it at that point in code.

I guess that you wanted to do that after LCM reset and before sending init cmds.

Regards,
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] 27+ messages in thread

* Re: [PATCH v2 2/3] drm/panel: boe-tv101wum-nl6: Reduce lcm_reset to send initial code time
  2023-01-10  9:20     ` AngeloGioacchino Del Regno
  (?)
@ 2023-01-12  9:41       ` Xinlei Lee (李昕磊)
  -1 siblings, 0 replies; 27+ messages in thread
From: Xinlei Lee (李昕磊) @ 2023-01-12  9:41 UTC (permalink / raw)
  To: chunkuang.hu, sam, Jitao Shi (石记涛),
	daniel, p.zabel, thierry.reding, matthias.bgg, airlied,
	angelogioacchino.delregno
  Cc: linux-arm-kernel, Project_Global_Chrome_Upstream_Group,
	linux-mediatek, linux-kernel, dri-devel

[-- Attachment #1: Type: text/html, Size: 2618 bytes --]

[-- Attachment #2: Type: text/plain, Size: 1010 bytes --]

On Tue, 2023-01-10 at 10:20 +0100, AngeloGioacchino Del Regno wrote:
> Il 10/01/23 06:54, xinlei.lee@mediatek.com ha scritto:
> > From: Xinlei Lee <xinlei.lee@mediatek.com>
> > 
> > Since the panel spec stipulates that the time from lcm_reset to DSI
> > to
> > send the initial code should be greater than 6ms and less than
> > 40ms,
> > so reduce the delay before sending the initial code and avoid panel
> > exceptions.
> 
> Please change the commit title to describe what you're doing.
> 
> drm/panel: boe-tv101wum-nl6: Remove extra delay in init commands
> 
> 
> ....and the commit description should also contain something like
> 
> Reduce the delay after LCM reset by removing an extra delay in the
> initialization commands array. The required delay of at least 6ms
> after
> reset is guaranteed by boe_panel_prepare().
> 
> Regards,
> Angelo
> 

Hi Angelo:

Thanks for your suggestions and careful revisions, I will revise my
commit description.

Best Regards!
xinlei

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

* Re: [PATCH v2 2/3] drm/panel: boe-tv101wum-nl6: Reduce lcm_reset to send initial code time
@ 2023-01-12  9:41       ` Xinlei Lee (李昕磊)
  0 siblings, 0 replies; 27+ messages in thread
From: Xinlei Lee (李昕磊) @ 2023-01-12  9:41 UTC (permalink / raw)
  To: chunkuang.hu, sam, Jitao Shi (石记涛),
	daniel, p.zabel, thierry.reding, matthias.bgg, airlied,
	angelogioacchino.delregno
  Cc: dri-devel, linux-kernel, linux-mediatek, linux-arm-kernel,
	Project_Global_Chrome_Upstream_Group

On Tue, 2023-01-10 at 10:20 +0100, AngeloGioacchino Del Regno wrote:
> Il 10/01/23 06:54, xinlei.lee@mediatek.com ha scritto:
> > From: Xinlei Lee <xinlei.lee@mediatek.com>
> > 
> > Since the panel spec stipulates that the time from lcm_reset to DSI
> > to
> > send the initial code should be greater than 6ms and less than
> > 40ms,
> > so reduce the delay before sending the initial code and avoid panel
> > exceptions.
> 
> Please change the commit title to describe what you're doing.
> 
> drm/panel: boe-tv101wum-nl6: Remove extra delay in init commands
> 
> 
> ....and the commit description should also contain something like
> 
> Reduce the delay after LCM reset by removing an extra delay in the
> initialization commands array. The required delay of at least 6ms
> after
> reset is guaranteed by boe_panel_prepare().
> 
> Regards,
> Angelo
> 

Hi Angelo:

Thanks for your suggestions and careful revisions, I will revise my
commit description.

Best Regards!
xinlei

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

* Re: [PATCH v2 2/3] drm/panel: boe-tv101wum-nl6: Reduce lcm_reset to send initial code time
@ 2023-01-12  9:41       ` Xinlei Lee (李昕磊)
  0 siblings, 0 replies; 27+ messages in thread
From: Xinlei Lee (李昕磊) @ 2023-01-12  9:41 UTC (permalink / raw)
  To: chunkuang.hu, sam, Jitao Shi (石记涛),
	daniel, p.zabel, thierry.reding, matthias.bgg, airlied,
	angelogioacchino.delregno
  Cc: dri-devel, linux-kernel, linux-mediatek, linux-arm-kernel,
	Project_Global_Chrome_Upstream_Group

On Tue, 2023-01-10 at 10:20 +0100, AngeloGioacchino Del Regno wrote:
> Il 10/01/23 06:54, xinlei.lee@mediatek.com ha scritto:
> > From: Xinlei Lee <xinlei.lee@mediatek.com>
> > 
> > Since the panel spec stipulates that the time from lcm_reset to DSI
> > to
> > send the initial code should be greater than 6ms and less than
> > 40ms,
> > so reduce the delay before sending the initial code and avoid panel
> > exceptions.
> 
> Please change the commit title to describe what you're doing.
> 
> drm/panel: boe-tv101wum-nl6: Remove extra delay in init commands
> 
> 
> ....and the commit description should also contain something like
> 
> Reduce the delay after LCM reset by removing an extra delay in the
> initialization commands array. The required delay of at least 6ms
> after
> reset is guaranteed by boe_panel_prepare().
> 
> Regards,
> Angelo
> 

Hi Angelo:

Thanks for your suggestions and careful revisions, I will revise my
commit description.

Best Regards!
xinlei
_______________________________________________
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] 27+ messages in thread

* Re: [PATCH v2 3/3] drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence
  2023-01-10  9:22     ` AngeloGioacchino Del Regno
  (?)
@ 2023-01-12 10:00       ` Xinlei Lee (李昕磊)
  -1 siblings, 0 replies; 27+ messages in thread
From: Xinlei Lee (李昕磊) @ 2023-01-12 10:00 UTC (permalink / raw)
  To: chunkuang.hu, sam, Jitao Shi (石记涛),
	daniel, p.zabel, thierry.reding, matthias.bgg, airlied,
	angelogioacchino.delregno
  Cc: linux-arm-kernel, Project_Global_Chrome_Upstream_Group,
	linux-mediatek, linux-kernel, dri-devel

[-- Attachment #1: Type: text/html, Size: 4292 bytes --]

[-- Attachment #2: Type: text/plain, Size: 2006 bytes --]

On Tue, 2023-01-10 at 10:22 +0100, AngeloGioacchino Del Regno wrote:
> Il 10/01/23 06:54, xinlei.lee@mediatek.com ha scritto:
> > From: Xinlei Lee <xinlei.lee@mediatek.com>
> > 
> > For "boe,tv105wum-nw0" this special panel, it is stipulated in the
> > panel spec that MIPI needs to keep the LP11 state before the
> > lcm_reset pin is pulled high.
> > 
> > Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
> > ---
> >   drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 ++++++
> >   1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> > b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> > index f0093035f1ff..67df61de64ae 100644
> > --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> > +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> > @@ -36,6 +36,7 @@ struct panel_desc {
> >   	const struct panel_init_cmd *init_cmds;
> >   	unsigned int lanes;
> >   	bool discharge_on_disable;
> > +	bool lp11_before_reset;
> >   };
> >   
> >   struct boe_panel {
> > @@ -1261,6 +1262,10 @@ static int boe_panel_prepare(struct
> > drm_panel *panel)
> >   
> >   	usleep_range(10000, 11000);
> >   
> > +	if (boe->desc->lp11_before_reset) {
> > +		mipi_dsi_dcs_nop(boe->dsi);
> 
> NOP will never reach the driveric if it is in reset, which should
> apparently be
> the state of it at that point in code.
> 
> I guess that you wanted to do that after LCM reset and before sending
> init cmds.
> 
> Regards,
> Angelo
> 

Hi Angelo:

To explain to you that in my patch, sending a NOP before lcm_reset is 
what this particular panel driver needs.

Indeed, the NOP will not reach the panel driveric before lcm_reset,
but the driveric specification stipulates that the MIPI signal needs
to be pulled high before lcm_reset is pulled high(NOP 
-> mtk_dsi_host_transfer -> mtk_dsi_lane_ready) . In order to avoid 
special driver initialization exceptions, this control was added.

Best Regards!
xinlei

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

* Re: [PATCH v2 3/3] drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence
@ 2023-01-12 10:00       ` Xinlei Lee (李昕磊)
  0 siblings, 0 replies; 27+ messages in thread
From: Xinlei Lee (李昕磊) @ 2023-01-12 10:00 UTC (permalink / raw)
  To: chunkuang.hu, sam, Jitao Shi (石记涛),
	daniel, p.zabel, thierry.reding, matthias.bgg, airlied,
	angelogioacchino.delregno
  Cc: dri-devel, linux-kernel, linux-mediatek, linux-arm-kernel,
	Project_Global_Chrome_Upstream_Group

On Tue, 2023-01-10 at 10:22 +0100, AngeloGioacchino Del Regno wrote:
> Il 10/01/23 06:54, xinlei.lee@mediatek.com ha scritto:
> > From: Xinlei Lee <xinlei.lee@mediatek.com>
> > 
> > For "boe,tv105wum-nw0" this special panel, it is stipulated in the
> > panel spec that MIPI needs to keep the LP11 state before the
> > lcm_reset pin is pulled high.
> > 
> > Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
> > ---
> >   drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 ++++++
> >   1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> > b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> > index f0093035f1ff..67df61de64ae 100644
> > --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> > +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> > @@ -36,6 +36,7 @@ struct panel_desc {
> >   	const struct panel_init_cmd *init_cmds;
> >   	unsigned int lanes;
> >   	bool discharge_on_disable;
> > +	bool lp11_before_reset;
> >   };
> >   
> >   struct boe_panel {
> > @@ -1261,6 +1262,10 @@ static int boe_panel_prepare(struct
> > drm_panel *panel)
> >   
> >   	usleep_range(10000, 11000);
> >   
> > +	if (boe->desc->lp11_before_reset) {
> > +		mipi_dsi_dcs_nop(boe->dsi);
> 
> NOP will never reach the driveric if it is in reset, which should
> apparently be
> the state of it at that point in code.
> 
> I guess that you wanted to do that after LCM reset and before sending
> init cmds.
> 
> Regards,
> Angelo
> 

Hi Angelo:

To explain to you that in my patch, sending a NOP before lcm_reset is 
what this particular panel driver needs.

Indeed, the NOP will not reach the panel driveric before lcm_reset,
but the driveric specification stipulates that the MIPI signal needs
to be pulled high before lcm_reset is pulled high(NOP 
-> mtk_dsi_host_transfer -> mtk_dsi_lane_ready) . In order to avoid 
special driver initialization exceptions, this control was added.

Best Regards!
xinlei

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

* Re: [PATCH v2 3/3] drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence
@ 2023-01-12 10:00       ` Xinlei Lee (李昕磊)
  0 siblings, 0 replies; 27+ messages in thread
From: Xinlei Lee (李昕磊) @ 2023-01-12 10:00 UTC (permalink / raw)
  To: chunkuang.hu, sam, Jitao Shi (石记涛),
	daniel, p.zabel, thierry.reding, matthias.bgg, airlied,
	angelogioacchino.delregno
  Cc: dri-devel, linux-kernel, linux-mediatek, linux-arm-kernel,
	Project_Global_Chrome_Upstream_Group

On Tue, 2023-01-10 at 10:22 +0100, AngeloGioacchino Del Regno wrote:
> Il 10/01/23 06:54, xinlei.lee@mediatek.com ha scritto:
> > From: Xinlei Lee <xinlei.lee@mediatek.com>
> > 
> > For "boe,tv105wum-nw0" this special panel, it is stipulated in the
> > panel spec that MIPI needs to keep the LP11 state before the
> > lcm_reset pin is pulled high.
> > 
> > Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
> > ---
> >   drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 ++++++
> >   1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> > b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> > index f0093035f1ff..67df61de64ae 100644
> > --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> > +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> > @@ -36,6 +36,7 @@ struct panel_desc {
> >   	const struct panel_init_cmd *init_cmds;
> >   	unsigned int lanes;
> >   	bool discharge_on_disable;
> > +	bool lp11_before_reset;
> >   };
> >   
> >   struct boe_panel {
> > @@ -1261,6 +1262,10 @@ static int boe_panel_prepare(struct
> > drm_panel *panel)
> >   
> >   	usleep_range(10000, 11000);
> >   
> > +	if (boe->desc->lp11_before_reset) {
> > +		mipi_dsi_dcs_nop(boe->dsi);
> 
> NOP will never reach the driveric if it is in reset, which should
> apparently be
> the state of it at that point in code.
> 
> I guess that you wanted to do that after LCM reset and before sending
> init cmds.
> 
> Regards,
> Angelo
> 

Hi Angelo:

To explain to you that in my patch, sending a NOP before lcm_reset is 
what this particular panel driver needs.

Indeed, the NOP will not reach the panel driveric before lcm_reset,
but the driveric specification stipulates that the MIPI signal needs
to be pulled high before lcm_reset is pulled high(NOP 
-> mtk_dsi_host_transfer -> mtk_dsi_lane_ready) . In order to avoid 
special driver initialization exceptions, this control was added.

Best Regards!
xinlei
_______________________________________________
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] 27+ messages in thread

* Re: [PATCH v2 1/3] drm/mediatek: dsi: Reduce the time of dsi from LP11 to sending cmd
  2023-01-10  5:54   ` xinlei.lee
  (?)
@ 2023-01-27  0:12     ` Chun-Kuang Hu
  -1 siblings, 0 replies; 27+ messages in thread
From: Chun-Kuang Hu @ 2023-01-27  0:12 UTC (permalink / raw)
  To: xinlei.lee
  Cc: chunkuang.hu, jitao.shi, airlied, linux-kernel, dri-devel,
	Project_Global_Chrome_Upstream_Group, thierry.reding,
	linux-mediatek, matthias.bgg, sam, linux-arm-kernel,
	angelogioacchino.delregno

Hi, Xinlei:

<xinlei.lee@mediatek.com> 於 2023年1月10日 週二 下午1:55寫道:
>
> From: Xinlei Lee <xinlei.lee@mediatek.com>
>
> According to Figure 16 Turnaround Procedure on page 36 in [1], you
> can see the status of LP-00 -> LP10 -> LP11. This state can correspond
> to the state of DSI from LP00 -> LP11 in mtk_dsi_lane_ready function
> in mtk_dsi.c.
>
> LP-00 -> LP10 -> LP11 takes about 2*TLPX time (refer to [1] page 51
> to see that TLPX is 50ns)
>
> The delay at the end of the mtk_dsi_lane_ready function should be
> greater than the 2*TLPX specified by the DSI spec, and less than
> the time specified by the DSI_RX (generally 6ms to 40ms), to avoid
> problems caused by the RX specification

Applied to mediatek-drm-next [1], thanks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next

Regards,
Chun-Kuang.

>
> [1]:mipi_D-PHY_specification_v1-1
>
> Fixes: 39e8d062b03c ("drm/mediatek: Keep dsi as LP00 before dcs cmds transfer")
> Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index 3b7d13028fb6..9e1363c9fcdb 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -721,7 +721,7 @@ static void mtk_dsi_lane_ready(struct mtk_dsi *dsi)
>                 mtk_dsi_clk_ulp_mode_leave(dsi);
>                 mtk_dsi_lane0_ulp_mode_leave(dsi);
>                 mtk_dsi_clk_hs_mode(dsi, 0);
> -               msleep(20);
> +               usleep_range(1000, 3000);
>                 /* The reaction time after pulling up the mipi signal for dsi_rx */
>         }
>  }
> --
> 2.18.0
>

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

* Re: [PATCH v2 1/3] drm/mediatek: dsi: Reduce the time of dsi from LP11 to sending cmd
@ 2023-01-27  0:12     ` Chun-Kuang Hu
  0 siblings, 0 replies; 27+ messages in thread
From: Chun-Kuang Hu @ 2023-01-27  0:12 UTC (permalink / raw)
  To: xinlei.lee
  Cc: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	angelogioacchino.delregno, jitao.shi, thierry.reding, sam,
	dri-devel, linux-kernel, linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group

Hi, Xinlei:

<xinlei.lee@mediatek.com> 於 2023年1月10日 週二 下午1:55寫道:
>
> From: Xinlei Lee <xinlei.lee@mediatek.com>
>
> According to Figure 16 Turnaround Procedure on page 36 in [1], you
> can see the status of LP-00 -> LP10 -> LP11. This state can correspond
> to the state of DSI from LP00 -> LP11 in mtk_dsi_lane_ready function
> in mtk_dsi.c.
>
> LP-00 -> LP10 -> LP11 takes about 2*TLPX time (refer to [1] page 51
> to see that TLPX is 50ns)
>
> The delay at the end of the mtk_dsi_lane_ready function should be
> greater than the 2*TLPX specified by the DSI spec, and less than
> the time specified by the DSI_RX (generally 6ms to 40ms), to avoid
> problems caused by the RX specification

Applied to mediatek-drm-next [1], thanks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next

Regards,
Chun-Kuang.

>
> [1]:mipi_D-PHY_specification_v1-1
>
> Fixes: 39e8d062b03c ("drm/mediatek: Keep dsi as LP00 before dcs cmds transfer")
> Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index 3b7d13028fb6..9e1363c9fcdb 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -721,7 +721,7 @@ static void mtk_dsi_lane_ready(struct mtk_dsi *dsi)
>                 mtk_dsi_clk_ulp_mode_leave(dsi);
>                 mtk_dsi_lane0_ulp_mode_leave(dsi);
>                 mtk_dsi_clk_hs_mode(dsi, 0);
> -               msleep(20);
> +               usleep_range(1000, 3000);
>                 /* The reaction time after pulling up the mipi signal for dsi_rx */
>         }
>  }
> --
> 2.18.0
>

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

* Re: [PATCH v2 1/3] drm/mediatek: dsi: Reduce the time of dsi from LP11 to sending cmd
@ 2023-01-27  0:12     ` Chun-Kuang Hu
  0 siblings, 0 replies; 27+ messages in thread
From: Chun-Kuang Hu @ 2023-01-27  0:12 UTC (permalink / raw)
  To: xinlei.lee
  Cc: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	angelogioacchino.delregno, jitao.shi, thierry.reding, sam,
	dri-devel, linux-kernel, linux-arm-kernel, linux-mediatek,
	Project_Global_Chrome_Upstream_Group

Hi, Xinlei:

<xinlei.lee@mediatek.com> 於 2023年1月10日 週二 下午1:55寫道:
>
> From: Xinlei Lee <xinlei.lee@mediatek.com>
>
> According to Figure 16 Turnaround Procedure on page 36 in [1], you
> can see the status of LP-00 -> LP10 -> LP11. This state can correspond
> to the state of DSI from LP00 -> LP11 in mtk_dsi_lane_ready function
> in mtk_dsi.c.
>
> LP-00 -> LP10 -> LP11 takes about 2*TLPX time (refer to [1] page 51
> to see that TLPX is 50ns)
>
> The delay at the end of the mtk_dsi_lane_ready function should be
> greater than the 2*TLPX specified by the DSI spec, and less than
> the time specified by the DSI_RX (generally 6ms to 40ms), to avoid
> problems caused by the RX specification

Applied to mediatek-drm-next [1], thanks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next

Regards,
Chun-Kuang.

>
> [1]:mipi_D-PHY_specification_v1-1
>
> Fixes: 39e8d062b03c ("drm/mediatek: Keep dsi as LP00 before dcs cmds transfer")
> Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index 3b7d13028fb6..9e1363c9fcdb 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -721,7 +721,7 @@ static void mtk_dsi_lane_ready(struct mtk_dsi *dsi)
>                 mtk_dsi_clk_ulp_mode_leave(dsi);
>                 mtk_dsi_lane0_ulp_mode_leave(dsi);
>                 mtk_dsi_clk_hs_mode(dsi, 0);
> -               msleep(20);
> +               usleep_range(1000, 3000);
>                 /* The reaction time after pulling up the mipi signal for dsi_rx */
>         }
>  }
> --
> 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	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2023-01-27  0:19 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-10  5:54 [PATCH v2 0/3] Reduce lcm_reset to DSI LP11 send cmd time xinlei.lee
2023-01-10  5:54 ` xinlei.lee
2023-01-10  5:54 ` xinlei.lee
2023-01-10  5:54 ` [PATCH v2 1/3] drm/mediatek: dsi: Reduce the time of dsi from LP11 to sending cmd xinlei.lee
2023-01-10  5:54   ` xinlei.lee
2023-01-10  5:54   ` xinlei.lee
2023-01-27  0:12   ` Chun-Kuang Hu
2023-01-27  0:12     ` Chun-Kuang Hu
2023-01-27  0:12     ` Chun-Kuang Hu
2023-01-10  5:54 ` [PATCH v2 2/3] drm/panel: boe-tv101wum-nl6: Reduce lcm_reset to send initial code time xinlei.lee
2023-01-10  5:54   ` xinlei.lee
2023-01-10  5:54   ` xinlei.lee
2023-01-10  9:20   ` AngeloGioacchino Del Regno
2023-01-10  9:20     ` AngeloGioacchino Del Regno
2023-01-10  9:20     ` AngeloGioacchino Del Regno
2023-01-12  9:41     ` Xinlei Lee (李昕磊)
2023-01-12  9:41       ` Xinlei Lee (李昕磊)
2023-01-12  9:41       ` Xinlei Lee (李昕磊)
2023-01-10  5:54 ` [PATCH v2 3/3] drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence xinlei.lee
2023-01-10  5:54   ` xinlei.lee
2023-01-10  5:54   ` xinlei.lee
2023-01-10  9:22   ` AngeloGioacchino Del Regno
2023-01-10  9:22     ` AngeloGioacchino Del Regno
2023-01-10  9:22     ` AngeloGioacchino Del Regno
2023-01-12 10:00     ` Xinlei Lee (李昕磊)
2023-01-12 10:00       ` Xinlei Lee (李昕磊)
2023-01-12 10:00       ` Xinlei Lee (李昕磊)

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.