Skip to content

Commit b54baa0

Browse files
committed
drm: various FOD fixes:
Revert 716cae3: was a semi-working bandaid to workaround intermittent breakages after 60hz hbm stuck fix. Mostly revert c5aa78c: Fixed 60hz hbm intermittently stuck after fod, but intermittently broke fod as a result. Additionally: - Only cache backlight value if not HBM. - On HBM off, update bl with cached backlight value. - Update sde bl scale on fod depress. The above properly fix and protect against post-FOD high backlight level or HBM at 60hz.
1 parent b41ca5d commit b54baa0

2 files changed

Lines changed: 26 additions & 8 deletions

File tree

drivers/gpu/drm/msm/dsi-staging/dsi_panel.c

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -891,19 +891,39 @@ static int dsi_panel_update_backlight(struct dsi_panel *panel,
891891
dsi = &panel->mipi_device;
892892
mode = panel->cur_mode;
893893

894+
895+
if (panel->is_hbm_enabled)
896+
return 0;
897+
894898
saved_backlight = bl_lvl;
895899

896900
if (panel->dc_dim)
897901
bl_lvl = 1023;
898902

899903
if (panel->bl_config.bl_high2bit) {
904+
if (HBM_flag == true)
905+
return 0;
906+
900907
if (cur_backlight == bl_lvl && (mode_fps != cur_fps ||
901908
cur_h != panel->cur_mode->timing.h_active)) {
902909
cur_fps = mode_fps;
903910
cur_h = panel->cur_mode->timing.h_active;
904911
return 0;
905912
}
906913

914+
if (hbm_brightness_flag == 1) {
915+
count = mode->priv_info->cmd_sets[DSI_CMD_SET_HBM_BRIGHTNESS_OFF].count;
916+
if (!count) {
917+
pr_debug("This panel does not support HBM brightness off mode.\n");
918+
goto error;
919+
}
920+
else {
921+
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_HBM_BRIGHTNESS_OFF);
922+
pr_debug("Send DSI_CMD_SET_HBM_BRIGHTNESS_OFF cmds.\n");
923+
hbm_brightness_flag = 0;
924+
}
925+
}
926+
907927
rc = mipi_dsi_dcs_set_display_brightness_samsung(dsi, bl_lvl);
908928
pr_debug("backlight = %d\n", bl_lvl);
909929
cur_backlight = bl_lvl;
@@ -950,8 +970,6 @@ int dsi_panel_op_set_hbm_mode(struct dsi_panel *panel, int level)
950970
printk(KERN_DEBUG
951971
"When HBM OFF -->hbm_backight = %d panel->bl_config.bl_level =%d\n",
952972
panel->hbm_backlight, panel->bl_config.bl_level);
953-
rc = dsi_panel_update_backlight(panel,
954-
panel->hbm_backlight);
955973
}
956974
break;
957975

@@ -5720,7 +5738,7 @@ int dsi_panel_set_hbm_mode(struct dsi_panel *panel, int level)
57205738
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_HBM_OFF);
57215739
pr_debug("Send DSI_CMD_SET_HBM_OFF cmds.\n");
57225740
pr_debug("hbm_backight = %d, panel->bl_config.bl_level = %d\n",panel->hbm_backlight, panel->bl_config.bl_level);
5723-
rc= dsi_panel_update_backlight(panel, panel->hbm_backlight);
5741+
rc = dsi_panel_update_backlight(panel, saved_backlight);
57245742
}
57255743
break;
57265744

@@ -5783,11 +5801,6 @@ int dsi_panel_set_hbm_mode(struct dsi_panel *panel, int level)
57835801
HBM_flag = true;
57845802
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_HBM_ON_5);
57855803
pr_debug("Send DSI_CMD_SET_HBM_ON_5 cmds.\n");
5786-
if (rc) {
5787-
pr_debug("Failed HBM_ON_5, try again.\n");
5788-
usleep_range(12000, 13000);
5789-
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_HBM_ON_5);
5790-
}
57915804
}
57925805
break;
57935806

@@ -5820,6 +5833,9 @@ int dsi_panel_set_hbm_brightness(struct dsi_panel *panel, int level)
58205833
dsi = &panel->mipi_device;
58215834
mode = panel->cur_mode;
58225835

5836+
if (panel->is_hbm_enabled)
5837+
return 0;
5838+
58235839
mutex_lock(&panel->panel_lock);
58245840
if (hbm_brightness_flag == 0) {
58255841
count = mode->priv_info->cmd_sets[DSI_CMD_SET_HBM_BRIGHTNESS_ON].count;

drivers/gpu/drm/msm/sde/sde_connector.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,8 @@ static void sde_connector_pre_update_fod_hbm(struct sde_connector *c_conn)
669669
MSM_ENC_VBLANK);
670670

671671
dsi_panel_set_fod_ui(panel, status);
672+
if (!status)
673+
_sde_connector_update_bl_scale(c_conn);
672674
}
673675

674676
int sde_connector_pre_kickoff(struct drm_connector *connector)

0 commit comments

Comments
 (0)