Skip to contentSkip to conversation

Revert "drm/amd/display: Fix backlight max_brightness to match exported range"

PATCH Applied Alex Deucher 2 participants 2 messages Aug 12 – Aug 15

Subsystems (4)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 Revert "drm/amd/display: Fix backlight max_brightness to match exported range"

This reverts commit 1191285ecb4233e5bf907da7e9394d7999055566.

This patch is apparently missing a dependency from 7.2 as users have not reported any regressions with 7.2-rc, but there are regressions on 7.1.

The regression manifests as inconsistent lower brightness at the top end (e.g., around 98%).

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -3
index 40d82a3eeec0..6f9d4bea3379 100644
@@ -5401,11 +5401,11 @@ amdgpu_dm_register_backlight_device(struct amdgpu_dm_connector *aconnector)
 	caps = &dm->backlight_caps[aconnector->bl_idx];
 	if (get_brightness_range(caps, &min, &max)) {
 		if (power_supply_is_system_supplied() > 0)
-			props.brightness = DIV_ROUND_CLOSEST(max * caps->ac_level, 100);
+			props.brightness = DIV_ROUND_CLOSEST((max - min) * caps->ac_level, 100);
 		else
-			props.brightness = DIV_ROUND_CLOSEST(max * caps->dc_level, 100);
+			props.brightness = DIV_ROUND_CLOSEST((max - min) * caps->dc_level, 100);
 		/* min is zero, so max needs to be adjusted */
-		props.max_brightness = max;
+		props.max_brightness = max - min;
 		drm_dbg(drm, "Backlight caps: min: %d, max: %d, ac %d, dc %d\n", min, max,
 			caps->ac_level, caps->dc_level);
 	} else
Signature · 1 line
2.55.0
maintainer Applied
#1 lore raw
Quoted 4 lines

This reverts commit 1191285ecb4233e5bf907da7e9394d7999055566.

This patch is apparently missing a dependency from 7.2 as users have not reported any regressions with 7.2-rc, but there are regressions on 7.1.

Queued for 7.1 and 6.18, thanks.

Signature · 2 lines
Thanks,
Sasha