2023-01-10 05:58:20

by Xinlei Lee (李昕磊)

[permalink] [raw]
Subject: [PATCH v2 0/3] Reduce lcm_reset to DSI LP11 send cmd time

From: Xinlei Lee <[email protected]>

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


2023-01-10 05:58:34

by Xinlei Lee (李昕磊)

[permalink] [raw]
Subject: [PATCH v2 3/3] drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence

From: Xinlei Lee <[email protected]>

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 <[email protected]>
---
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

2023-01-10 06:17:10

by Xinlei Lee (李昕磊)

[permalink] [raw]
Subject: [PATCH v2 2/3] drm/panel: boe-tv101wum-nl6: Reduce lcm_reset to send initial code time

From: Xinlei Lee <[email protected]>

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 <[email protected]>
---
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

Subject: Re: [PATCH v2 2/3] drm/panel: boe-tv101wum-nl6: Reduce lcm_reset to send initial code time

Il 10/01/23 06:54, [email protected] ha scritto:
> From: Xinlei Lee <[email protected]>
>
> 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

Subject: Re: [PATCH v2 3/3] drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence

Il 10/01/23 06:54, [email protected] ha scritto:
> From: Xinlei Lee <[email protected]>
>
> 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 <[email protected]>
> ---
> 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

2023-01-12 10:13:02

by Xinlei Lee (李昕磊)

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence

On Tue, 2023-01-10 at 10:22 +0100, AngeloGioacchino Del Regno wrote:
> Il 10/01/23 06:54, [email protected] ha scritto:
> > From: Xinlei Lee <[email protected]>
> >
> > 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 <[email protected]>
> > ---
> > 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

2023-01-12 10:46:38

by Xinlei Lee (李昕磊)

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] drm/panel: boe-tv101wum-nl6: Reduce lcm_reset to send initial code time

On Tue, 2023-01-10 at 10:20 +0100, AngeloGioacchino Del Regno wrote:
> Il 10/01/23 06:54, [email protected] ha scritto:
> > From: Xinlei Lee <[email protected]>
> >
> > 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