techpack: display: protect setting fod hbm status by allow_bl_update

In the current implementation the fod hbm command might set the backlight
of the panel before receiving a frame from the driver during the first commit.
There is chance for garbage content to be shown onto the panel.
This change imposes a condition to delay the fod hbm command until the
first frame is received from the HW.
This commit is contained in:
Cosmin Tanislav 2021-09-26 08:38:53 +03:00 committed by Giovanni Ricca
parent e76efb7e9b
commit 4b2243bc20
No known key found for this signature in database
3 changed files with 17 additions and 3 deletions

View file

@ -768,11 +768,22 @@ int dsi_panel_get_fod_hbm(struct dsi_panel *panel)
return value;
}
void dsi_panel_apply_requested_fod_hbm(struct dsi_panel *panel)
int dsi_panel_apply_requested_fod_hbm(struct dsi_panel *panel)
{
int rc = 0;
mutex_lock(&panel->panel_lock);
if (!panel->bl_config.allow_bl_update) {
rc = -EINVAL;
goto done;
}
dsi_panel_set_fod_hbm(panel, panel->fod_hbm_requested);
done:
mutex_unlock(&panel->panel_lock);
return rc;
}
int dsi_panel_set_backlight(struct dsi_panel *panel, u32 bl_lvl)

View file

@ -415,7 +415,7 @@ void dsi_panel_dealloc_cmd_packets(struct dsi_panel_cmd_set *set);
int dsi_panel_is_fod_hbm_applied(struct dsi_panel *panel);
int dsi_panel_get_fod_hbm(struct dsi_panel *panel);
void dsi_panel_apply_requested_fod_hbm(struct dsi_panel *panel);
int dsi_panel_apply_requested_fod_hbm(struct dsi_panel *panel);
void dsi_panel_set_fod_ui(struct dsi_panel *panel, bool status);
void dsi_panel_request_fod_hbm(struct dsi_panel *panel, bool status);

View file

@ -843,6 +843,7 @@ void sde_connector_fod_pre_kickoff(struct drm_connector *connector)
struct sde_connector *c_conn;
struct dsi_display *display;
struct dsi_panel *panel;
int rc;
if (!connector)
return;
@ -865,7 +866,9 @@ void sde_connector_fod_pre_kickoff(struct drm_connector *connector)
if (dsi_panel_is_fod_hbm_applied(panel))
return;
dsi_panel_apply_requested_fod_hbm(panel);
rc = dsi_panel_apply_requested_fod_hbm(panel);
if (rc)
return;
if (!dsi_panel_get_fod_hbm(panel))
dsi_panel_set_fod_ui(panel, 0);