Skip to content

Commit 2269448

Browse files
committed
display: Misc 1024-2047 bl fixes:
- Only 7T is capable of utilizing this range. - Hack of setting >1024 to 2047, and setting HBM on in this scenario. - We lose some configurable range on 7T but end up with an overall generic solution. - Bring back an early return which is needed to avoid dropping out of HBM on devices without the >1024 range.
1 parent 4447de3 commit 2269448

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,9 @@ int dsi_display_set_backlight(struct drm_connector *connector,
372372
if (rc)
373373
pr_debug("unable to set backlight\n");
374374

375-
if (bl_lvl > 1023 && panel->bl_config.bl_level <= 1023)
375+
if (bl_lvl == 2047 && panel->bl_config.bl_level <= 1023)
376376
rc = dsi_panel_set_hbm_mode(panel, 5);
377-
else if (bl_lvl <= 1023 && panel->bl_config.bl_level > 1023)
377+
else if (bl_lvl <= 1023 && panel->bl_config.bl_level == 2047)
378378
rc = dsi_panel_set_hbm_mode(panel, 0);
379379

380380
panel->bl_config.bl_level = bl_lvl;

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

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

894+
if (panel->is_hbm_enabled || HBM_flag == true)
895+
return 0;
896+
894897
saved_backlight = bl_lvl;
895898

896899
if (panel->dc_dim)

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ static int sde_backlight_device_update_status(struct backlight_device *bd)
9191
bl_lvl = mult_frac(brightness, display->panel->bl_config.bl_max_level,
9292
display->panel->bl_config.brightness_max_level);
9393

94-
//Hack to workaround this range having artifacts or being lower brightness
95-
//than 1023
96-
if (bl_lvl > 1023 && bl_lvl < 1600)
97-
bl_lvl = 1600;
98-
9994
if (!bl_lvl && brightness)
10095
bl_lvl = 1;
10196

97+
//Hack because 1024-2047 has different issues on different devices
98+
//Only 7T is capable of using this range, however we manual set HBM
99+
if (bl_lvl > 1023)
100+
bl_lvl = 2047;
101+
102102
if (!c_conn->allow_bl_update) {
103103
c_conn->unset_bl_level = bl_lvl;
104104
return 0;

0 commit comments

Comments
 (0)