Skip to content

Commit e7a6a3f

Browse files
committed
drm/amd/display: Fix default DC and AC levels
JIRA: https://issues.redhat.com/browse/RHEL-75958 commit 6c56c8ec6f9762c33bd22f31d43af4194d12da53 Author: Mario Limonciello <mario.limonciello@amd.com> Date: Wed May 14 16:06:40 2025 -0500 drm/amd/display: Fix default DC and AC levels commit 8b5f3a2 upstream. [Why] DC and AC levels are advertised in a percentage, not a luminance. [How] Scale DC and AC levels to supported values. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4221 Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: José Expósito <jexposit@redhat.com>
1 parent 6106a0e commit e7a6a3f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4849,9 +4849,9 @@ amdgpu_dm_register_backlight_device(struct amdgpu_dm_connector *aconnector)
48494849
amdgpu_acpi_get_backlight_caps(&caps);
48504850
if (caps.caps_valid && get_brightness_range(&caps, &min, &max)) {
48514851
if (power_supply_is_system_supplied() > 0)
4852-
props.brightness = caps.ac_level;
4852+
props.brightness = (max - min) * DIV_ROUND_CLOSEST(caps.ac_level, 100);
48534853
else
4854-
props.brightness = caps.dc_level;
4854+
props.brightness = (max - min) * DIV_ROUND_CLOSEST(caps.dc_level, 100);
48554855
/* min is zero, so max needs to be adjusted */
48564856
props.max_brightness = max - min;
48574857
drm_dbg(drm, "Backlight caps: min: %d, max: %d, ac %d, dc %d\n", min, max,

0 commit comments

Comments
 (0)