Skip to content

Commit

Permalink
drm/panel: jd9365da: Modify the method of sending commands
Browse files Browse the repository at this point in the history
Currently, the init_code of the jd9365da driver is placed
in the enable() function and sent, but this seems to take
a long time. It takes 17ms to send each instruction (an init
code consists of about 200 instructions), so it takes
about 3.5s to send the init_code. So we moved the sending
of the inti_code to the prepare() function, and each
instruction seemed to take only 25μs.

We checked the DSI host and found that the difference in
command sending time is caused by the different modes of
the DSI host in prepare() and enable() functions.
Our DSI Host only supports sending cmd in LP mode, The
prepare() function can directly send init_code (LP->cmd)
in LP mode, but the enable() function is in HS mode and
needs to switch to LP mode before sending init code
(HS->LP->cmd->HS). Therefore, it takes longer to send
the command.

Signed-off-by: Zhaoxiong Lv <lvzhaoxiong@huaqin.corp-partner.google.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240624141926.5250-2-lvzhaoxiong@huaqin.corp-partner.google.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240624141926.5250-2-lvzhaoxiong@huaqin.corp-partner.google.com
  • Loading branch information
Zhaoxiong Lv authored and Neil Armstrong committed Jun 28, 2024
1 parent 6c2b2cd commit 38cae7b
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,9 @@ static int jadard_enable(struct drm_panel *panel)
{
struct device *dev = panel->dev;
struct jadard *jadard = panel_to_jadard(panel);
const struct jadard_panel_desc *desc = jadard->desc;
struct mipi_dsi_device *dsi = jadard->dsi;
unsigned int i;
int err;

msleep(10);

for (i = 0; i < desc->num_init_cmds; i++) {
const struct jadard_init_cmd *cmd = &desc->init_cmds[i];

err = mipi_dsi_dcs_write_buffer(dsi, cmd->data, JD9365DA_INIT_CMD_LEN);
if (err < 0)
return err;
}

msleep(120);

err = mipi_dsi_dcs_exit_sleep_mode(dsi);
Expand Down Expand Up @@ -100,6 +88,8 @@ static int jadard_disable(struct drm_panel *panel)
static int jadard_prepare(struct drm_panel *panel)
{
struct jadard *jadard = panel_to_jadard(panel);
const struct jadard_panel_desc *desc = jadard->desc;
unsigned int i;
int ret;

ret = regulator_enable(jadard->vccio);
Expand All @@ -117,7 +107,15 @@ static int jadard_prepare(struct drm_panel *panel)
msleep(10);

gpiod_set_value(jadard->reset, 1);
msleep(120);
msleep(130);

for (i = 0; i < desc->num_init_cmds; i++) {
const struct jadard_init_cmd *cmd = &desc->init_cmds[i];

ret = mipi_dsi_dcs_write_buffer(dsi, cmd->data, JD9365DA_INIT_CMD_LEN);
if (ret < 0)
return ret;
}

return 0;
}
Expand Down

0 comments on commit 38cae7b

Please sign in to comment.