dsi_panel: fix the bug of local HBM

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 <tinno64@motorola.com>
Reviewed-on: https://gerrit.mot.com/2636365
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Zonghua Liu <a17671@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
tinno64 2023-06-07 14:11:42 +08:00
commit a3c1fb46de

View file

@ -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");