From a3c1fb46de93287ea500cca8ecd427423d4a714a Mon Sep 17 00:00:00 2001 From: tinno64 Date: Wed, 7 Jun 2023 14:11:42 +0800 Subject: [PATCH] dsi_panel: fix the bug of local HBM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dynamically modify some commands, t hen parse the next commands(cmds++) refer to:https://gerrit.mot.com/#/c/2360381/ https://gerrit.mot.com/#/c/2361625/ Change-Id: I15ced51a990faf1c05565e49f96e1d55f3c3e3a9 Signed-off-by: tinno64 Reviewed-on: https://gerrit.mot.com/2636365 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Zonghua Liu Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- msm/dsi/dsi_panel.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/msm/dsi/dsi_panel.c b/msm/dsi/dsi_panel.c index cb547af2b512..f316e02836c0 100644 --- a/msm/dsi/dsi_panel.c +++ b/msm/dsi/dsi_panel.c @@ -1192,7 +1192,7 @@ static int dsi_panel_set_local_hbm_param(struct dsi_panel *panel, cmds = param_map_state->cmds->cmds; count = param_map_state->cmds->count; - for (i =0; i < count; i++) { + for (i =0; i < count; i++, cmds++) { payload = (u8 *)cmds->msg.tx_buf; if(param_info->value == HBM_FOD_ON_STATE) { if(payload[0] == lhbm_config->alpha_reg) { @@ -1208,7 +1208,7 @@ static int dsi_panel_set_local_hbm_param(struct dsi_panel *panel, DSI_INFO("%s: alpha [%x]=%x%x\n", __func__, payload[0], payload[1], payload[2]); rc = 0; - goto end; + continue; } else if(payload[0] == 0X51 && lhbm_config->dc_hybird_threshold != 0) { if(lhbm_config->dbv_level < lhbm_config->dc_hybird_threshold) { @@ -1232,7 +1232,6 @@ static int dsi_panel_set_local_hbm_param(struct dsi_panel *panel, rc = 0; goto end; } - cmds++; } } @@ -4459,6 +4458,14 @@ static int dsi_panel_parse_local_hbm_config(struct dsi_panel *panel) return rc; } + rc = utils->read_u32(utils->data, + "qcom,mdss-dsi-panel-local-hbm-DC-HYBIRD-THRESHOLD-BL", + &(lhbm_config->dc_hybird_threshold)); + if (rc) { + DSI_ERR("%s:qcom,mdss-dsi-panel-local-hbm-DC-HYBIRD-THRESHOLD-BL is not defined, set it to 0\n", __func__); + lhbm_config->dc_hybird_threshold = 0; + } + lhbm_config->resend_lbhm_off = utils->read_bool(utils->data, "qcom,mdss-dsi-panel-resend-local-hbm-off");