From 483fe19458ba41364785b725a6ce9488586f4409 Mon Sep 17 00:00:00 2001 From: wangyq13 Date: Fri, 15 Jul 2022 15:14:08 +0800 Subject: [PATCH] drm/dsi_panel: resend hbm off commands drm: resend hbm off commands, sometimes lhbm is not closed successfully, send again to reduce the possibility. Change-Id: I23d2f23bc9920f1c824e2af50229d62d2d27c906 Signed-off-by: wangyq13 Reviewed-on: https://gerrit.mot.com/2334757 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Hua Tan Reviewed-by: Reviewed-by: Huosheng Liao Submit-Approved: Jira Key --- msm/dsi/dsi_panel.c | 13 +++++++++++-- msm/dsi/dsi_panel.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/msm/dsi/dsi_panel.c b/msm/dsi/dsi_panel.c index dfdda739db7c..0d7eb401c49c 100644 --- a/msm/dsi/dsi_panel.c +++ b/msm/dsi/dsi_panel.c @@ -1186,9 +1186,15 @@ static int dsi_panel_set_hbm(struct dsi_panel *panel, if (rc < 0) { DSI_ERR("%s: failed to send param cmds. ret=%d\n", __func__, rc); } else { - if(lhbm_config->enable) + if(lhbm_config->enable) { bl_lvl = lhbm_config->dbv_level; - else + if (lhbm_config->resend_lbhm_off && param_info->value == HBM_OFF_STATE) { + usleep_range(5000, 5010); + rc = dsi_panel_send_param_cmd(panel, param_info); + if (rc < 0) + DSI_ERR("%s: failed to resend param cmds. ret=%d\n", __func__, rc); + } + } else bl_lvl = HBM_BRIGHTNESS(param_info->value); rc = dsi_panel_set_backlight(panel, bl_lvl); if (rc) @@ -4271,6 +4277,9 @@ static int dsi_panel_parse_local_hbm_config(struct dsi_panel *panel) lhbm_config->enable = false; return rc; } + + lhbm_config->resend_lbhm_off = utils->read_bool(utils->data, + "qcom,mdss-dsi-panel-resend-local-hbm-off"); } else { DSI_INFO("%s:%d, no local hbm config\n", __func__, __LINE__); diff --git a/msm/dsi/dsi_panel.h b/msm/dsi/dsi_panel.h index b30913ae548b..784422840c6b 100644 --- a/msm/dsi/dsi_panel.h +++ b/msm/dsi/dsi_panel.h @@ -225,6 +225,7 @@ struct dsi_panel_spr_info { struct dsi_panel_lhbm_config { bool enable; + bool resend_lbhm_off; u32 dbv_level; u32 alpha_reg; u32 alpha_size;