Skip to content

Commit 6a2bbdc

Browse files
authored
Merge pull request #70 from bcrtvkcs/claude/investigate-kernel-issue-44r0L
Fix brightness stuck at 100%: disable sysfs HBM for AMB670YF01
2 parents 5412b96 + 1dd56ed commit 6a2bbdc

File tree

6 files changed

+13
-46
lines changed

6 files changed

+13
-46
lines changed

techpack/display/msm/dsi/dsi_display.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ int dsi_display_set_backlight(struct drm_connector *connector,
304304

305305
/* Add some delay to avoid screen flash */
306306
if (panel->need_power_on_backlight && bl_lvl) {
307-
pr_err("BRIGHTNESS_DEBUG: POST_ON_BACKLIGHT triggered bl_lvl=%d\n", bl_lvl);
308307
panel->need_power_on_backlight = false;
309308
rc = dsi_display_clk_ctrl(dsi_display->dsi_clk_handle,
310309
DSI_CORE_CLK, DSI_CLK_ON);
@@ -331,10 +330,8 @@ int dsi_display_set_backlight(struct drm_connector *connector,
331330
#endif /* OPLUS_BUG_STABILITY */
332331
panel->bl_config.bl_level = bl_lvl;
333332
#ifdef OPLUS_BUG_STABILITY
334-
if (oplus_ffl_trigger_finish == false) {
335-
pr_err("BRIGHTNESS_DEBUG: BLOCKED by FFL bl_lvl=%d\n", bl_lvl);
333+
if (oplus_ffl_trigger_finish == false)
336334
goto error;
337-
}
338335
#endif /* OPLUS_BUG_STABILITY */
339336

340337
/* scale backlight */
@@ -362,8 +359,6 @@ int dsi_display_set_backlight(struct drm_connector *connector,
362359
}
363360
#endif /*OPLUS_BUG_STABILITY*/
364361

365-
pr_err("BRIGHTNESS_DEBUG: writing bl_temp=%u to panel (bl_lvl=%d lcd_closebl=%d)\n",
366-
(u32)bl_temp, bl_lvl, lcd_closebl_flag);
367362
rc = dsi_panel_set_backlight(panel, (u32)bl_temp);
368363
if (rc)
369364
DSI_ERR("unable to set backlight\n");

techpack/display/msm/dsi/dsi_panel.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -965,11 +965,7 @@ static int dsi_panel_update_backlight(struct dsi_panel *panel,
965965
bl_lvl = (((bl_lvl & 0xff) << 8) | (bl_lvl >> 8));
966966

967967
#ifdef OPLUS_BUG_STABILITY
968-
pr_err("BRIGHTNESS_DEBUG: update_backlight bl_lvl=%d scene=%d is_hbm=%d hbm_mode=%d\n",
969-
bl_lvl, get_oplus_display_scene(), panel->is_hbm_enabled, oplus_display_get_hbm_mode());
970-
971968
if ((get_oplus_display_scene() == OPLUS_DISPLAY_AOD_SCENE) && ( bl_lvl == 1)) {
972-
pr_err("BRIGHTNESS_DEBUG: BLOCKED by AOD_SCENE bl_lvl=%d\n", bl_lvl);
973969
pr_err("dsi_cmd AOD mode return bl_lvl:%d\n",bl_lvl);
974970
return 0;
975971
}
@@ -982,7 +978,6 @@ static int dsi_panel_update_backlight(struct dsi_panel *panel,
982978
}
983979

984980
if (panel->is_hbm_enabled && (bl_lvl != 0)) {
985-
pr_err("BRIGHTNESS_DEBUG: BLOCKED by is_hbm_enabled bl_lvl=%d\n", bl_lvl);
986981
pr_err("backlight smooth check racing issue is_hbm_enabled\n");
987982
return 0;
988983
}
@@ -992,13 +987,6 @@ static int dsi_panel_update_backlight(struct dsi_panel *panel,
992987
__oplus_display_set_hbm(0);
993988
}
994989

995-
if (oplus_display_get_hbm_mode()) {
996-
pr_err("BRIGHTNESS_DEBUG: BLOCKED by hbm_mode=%d bl_lvl=%d\n",
997-
oplus_display_get_hbm_mode(), bl_lvl);
998-
pr_err("backlight smooth check racing issue oplus_display_get_hbm_mode\n");
999-
return rc;
1000-
}
1001-
1002990
/* PSW.MM.Display.LCD.Stability,2021/7/1,add for peacock boe panel min bl_lvl */
1003991
if (!strcmp(panel->name, "20085 boe nt37701 amoled fhd+ panel")) {
1004992
if (bl_lvl <= BL_LEVEL_9 && bl_lvl > 1)
@@ -1249,8 +1237,6 @@ static int dsi_panel_update_backlight(struct dsi_panel *panel,
12491237
rc = mipi_dsi_dcs_set_display_brightness(dsi, bl_lvl);
12501238
if (rc < 0)
12511239
DSI_ERR("failed to update dcs backlight:%d\n", bl_lvl);
1252-
else
1253-
pr_err("BRIGHTNESS_DEBUG: PANEL WRITE SUCCESS bl_lvl=%d\n", bl_lvl);
12541240

12551241
#ifdef OPLUS_BUG_STABILITY
12561242
if (OPLUS_DEBUG_LOG_BACKLIGHT & oplus_dsi_log_type) {

techpack/display/msm/sde/sde_connector.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,7 @@ static int sde_backlight_device_update_status(struct backlight_device *bd)
236236
if (!bl_lvl && brightness)
237237
bl_lvl = 1;
238238

239-
pr_err("BRIGHTNESS_DEBUG: sde_backlight brightness=%d bl_lvl=%d allow=%d\n",
240-
brightness, bl_lvl, c_conn->allow_bl_update);
241-
242239
if (!c_conn->allow_bl_update) {
243-
pr_err("BRIGHTNESS_DEBUG: BLOCKED by allow_bl_update=0 bl_lvl=%d\n", bl_lvl);
244240
c_conn->unset_bl_level = bl_lvl;
245241
return 0;
246242
}

techpack/display/oplus/oplus_dc_diming.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -577,10 +577,6 @@ int sde_connector_update_hbm(struct drm_connector *connector)
577577
unsigned int fps_period_us =
578578
1000000/dsi_display->modes->timing.refresh_rate + 1;
579579

580-
pr_err("BRIGHTNESS_DEBUG: HBM state change fp_mode=%d is_hbm=%d dimlayer_hbm=%d hbm_mode=%d\n",
581-
fingerprint_mode, dsi_display->panel->is_hbm_enabled,
582-
oplus_dimlayer_hbm, oplus_display_get_hbm_mode());
583-
584580
if (oplus_fod_on_vblank >= 0) {
585581
panel->cur_mode->priv_info->fod_on_vblank = oplus_fod_on_vblank;
586582
}
@@ -672,8 +668,6 @@ int sde_connector_update_hbm(struct drm_connector *connector)
672668
usleep_range(6 * 1000, 6 * 1000 + 100);
673669
}
674670
}
675-
pr_err("BRIGHTNESS_DEBUG: HBM_ON SENT TO PANEL (FOD enter, normal) dimlayer_hbm=%d bl_level=%d\n",
676-
oplus_dimlayer_hbm, dsi_display->panel->bl_config.bl_level);
677671
SDE_ATRACE_BEGIN("DSI_CMD_HBM_ON");
678672
rc = dsi_panel_tx_cmd_set(dsi_display->panel, DSI_CMD_HBM_ON);
679673
SDE_ATRACE_END("DSI_CMD_HBM_ON");
@@ -715,7 +709,6 @@ int sde_connector_update_hbm(struct drm_connector *connector)
715709
if (OPLUS_DISPLAY_AOD_SCENE == get_oplus_display_scene()) {
716710
if ((!strcmp(dsi_display->panel->oplus_priv.vendor_name, "AMB670YF01") && (panel->panel_id2 >= 5)) ||
717711
(!strcmp(dsi_display->panel->oplus_priv.vendor_name, "S6E3HC3") && (panel->panel_id2 >= 5))) {
718-
pr_err("BRIGHTNESS_DEBUG: AOD_HBM_ON_PVT SENT (FOD enter, AOD scene) dimlayer_hbm=%d\n", oplus_dimlayer_hbm);
719712
rc = dsi_panel_tx_cmd_set(dsi_display->panel, DSI_CMD_AOD_HBM_ON_PVT);
720713
} else if (!strcmp(dsi_display->panel->oplus_priv.vendor_name, "AMB655X") ||
721714
!strcmp(dsi_display->panel->oplus_priv.vendor_name, "AMS662ZS01")) {
@@ -724,7 +717,6 @@ int sde_connector_update_hbm(struct drm_connector *connector)
724717
rc = dsi_panel_tx_cmd_set(dsi_display->panel, DSI_CMD_HBM_ON);
725718
}
726719
} else {
727-
pr_err("BRIGHTNESS_DEBUG: HBM_ON SENT (FOD enter, non-AOD alt path) dimlayer_hbm=%d\n", oplus_dimlayer_hbm);
728720
rc = dsi_panel_tx_cmd_set(dsi_display->panel, DSI_CMD_HBM_ON);
729721
}
730722
} else {
@@ -854,10 +846,6 @@ int sde_connector_update_hbm(struct drm_connector *connector)
854846
}
855847
}
856848

857-
} else if (oplus_display_get_hbm_mode()) {
858-
pr_err("BRIGHTNESS_DEBUG: FOD exit SKIPPED HBM OFF due to hbm_mode=%d\n",
859-
oplus_display_get_hbm_mode());
860-
/* Do nothing to skip hbm off */
861849
} else if (OPLUS_DISPLAY_AOD_SCENE == get_oplus_display_scene()) {
862850
if ((!strcmp(dsi_display->panel->oplus_priv.vendor_name, "S6E3HC3") && (panel->panel_id2 >= 5)) ||
863851
(!strcmp(dsi_display->panel->oplus_priv.vendor_name, "AMB670YF01") && (panel->panel_id2 >= 5))) {
@@ -880,8 +868,6 @@ int sde_connector_update_hbm(struct drm_connector *connector)
880868
}
881869
dsi_panel_seed_mode(dsi_display->panel, seed_mode);
882870
dsi_panel_tx_cmd_set(dsi_display->panel, DSI_CMD_HBM_AOR_RESTORE);
883-
pr_err("BRIGHTNESS_DEBUG: HBM_OFF SENT (FOD exit) bl_level=%d hbm_mode=%d\n",
884-
panel->bl_config.bl_level, oplus_display_get_hbm_mode());
885871
rc = dsi_panel_tx_cmd_set(dsi_display->panel, DSI_CMD_HBM_OFF);
886872
oplus_panel_update_backlight_unlock(panel);
887873
}

techpack/display/oplus/oplus_display_panel_hbm.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,6 @@ int __oplus_display_set_hbm(int mode)
236236
mutex_lock(&oplus_hbm_lock);
237237

238238
if (mode != hbm_mode) {
239-
pr_err("BRIGHTNESS_DEBUG: hbm_mode CHANGED %d -> %d\n", hbm_mode, mode);
240-
dump_stack();
241239
hbm_mode = mode;
242240
}
243241

@@ -268,8 +266,12 @@ int oplus_display_panel_set_hbm(void *buf)
268266

269267
__oplus_display_set_hbm((*temp_save));
270268

271-
if ((!strcmp(display->panel->oplus_priv.vendor_name, "S6E3HC3")) ||
272-
(!strcmp(display->panel->oplus_priv.vendor_name, "AMB670YF01"))) {
269+
if (!strcmp(display->panel->oplus_priv.vendor_name, "AMB670YF01")) {
270+
/* Skip DSI commands for AMB670YF01 - crDroid framework incorrectly
271+
* writes hbm_mode=1 which sends DSI_CMD_NORMAL_HBM_ON (max brightness)
272+
* and blocks all brightness updates. FOD fingerprint HBM uses a
273+
* separate path (sde_connector_update_hbm) and is not affected. */
274+
} else if (!strcmp(display->panel->oplus_priv.vendor_name, "S6E3HC3")) {
273275
if((hbm_mode > 1) &&(hbm_mode <= 10)) {
274276
ret = dsi_display_normal_hbm_on(get_main_display());
275277
} else if(hbm_mode == 1) {

techpack/display/oplus/oplus_display_private_api.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,12 @@ static ssize_t oplus_display_set_hbm(struct kobject *obj,
490490

491491
__oplus_display_set_hbm(temp_save);
492492

493-
if ((!strcmp(display->panel->oplus_priv.vendor_name, "S6E3HC3")) ||
494-
(!strcmp(display->panel->oplus_priv.vendor_name, "AMB670YF01"))) {
493+
if (!strcmp(display->panel->oplus_priv.vendor_name, "AMB670YF01")) {
494+
/* Skip DSI commands for AMB670YF01 - crDroid framework incorrectly
495+
* writes hbm_mode=1 which sends DSI_CMD_NORMAL_HBM_ON (max brightness)
496+
* and blocks all brightness updates. FOD fingerprint HBM uses a
497+
* separate path (sde_connector_update_hbm) and is not affected. */
498+
} else if (!strcmp(display->panel->oplus_priv.vendor_name, "S6E3HC3")) {
495499
if((hbm_mode > 1) &&(hbm_mode <= 10)) {
496500
ret = dsi_display_normal_hbm_on(get_main_display());
497501
} else if(hbm_mode == 1) {
@@ -2067,8 +2071,6 @@ static ssize_t oplus_display_set_dimlayer_hbm(struct kobject *obj,
20672071
oplus_dimlayer_hbm = value;
20682072

20692073
#ifdef OPLUS_BUG_STABILITY
2070-
pr_err("BRIGHTNESS_DEBUG: oplus_dimlayer_hbm CHANGED to %d\n", oplus_dimlayer_hbm);
2071-
dump_stack();
20722074
pr_err("debug for oplus_display_set_dimlayer_hbm set oplus_dimlayer_hbm = %d\n",
20732075
oplus_dimlayer_hbm);
20742076
#endif

0 commit comments

Comments
 (0)