Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/panel: jd9365da: Modify the method of sending commands

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

authored by

Zhaoxiong Lv and committed by
Neil Armstrong
38cae7b6 6c2b2cd3

+11 -13
+11 -13
drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c
··· 52 52 { 53 53 struct device *dev = panel->dev; 54 54 struct jadard *jadard = panel_to_jadard(panel); 55 - const struct jadard_panel_desc *desc = jadard->desc; 56 55 struct mipi_dsi_device *dsi = jadard->dsi; 57 - unsigned int i; 58 56 int err; 59 - 60 - msleep(10); 61 - 62 - for (i = 0; i < desc->num_init_cmds; i++) { 63 - const struct jadard_init_cmd *cmd = &desc->init_cmds[i]; 64 - 65 - err = mipi_dsi_dcs_write_buffer(dsi, cmd->data, JD9365DA_INIT_CMD_LEN); 66 - if (err < 0) 67 - return err; 68 - } 69 57 70 58 msleep(120); 71 59 ··· 88 100 static int jadard_prepare(struct drm_panel *panel) 89 101 { 90 102 struct jadard *jadard = panel_to_jadard(panel); 103 + const struct jadard_panel_desc *desc = jadard->desc; 104 + unsigned int i; 91 105 int ret; 92 106 93 107 ret = regulator_enable(jadard->vccio); ··· 107 117 msleep(10); 108 118 109 119 gpiod_set_value(jadard->reset, 1); 110 - msleep(120); 120 + msleep(130); 121 + 122 + for (i = 0; i < desc->num_init_cmds; i++) { 123 + const struct jadard_init_cmd *cmd = &desc->init_cmds[i]; 124 + 125 + ret = mipi_dsi_dcs_write_buffer(dsi, cmd->data, JD9365DA_INIT_CMD_LEN); 126 + if (ret < 0) 127 + return ret; 128 + } 111 129 112 130 return 0; 113 131 }