Skip to content

Commit 6106a0e

Browse files
committed
drm/amd/display: Add debugging message for brightness caps
JIRA: https://issues.redhat.com/browse/RHEL-75958 commit 66089fa8c9ed162744037ab0375e38cc74c7f7ed Author: Mario Limonciello <mario.limonciello@amd.com> Date: Wed May 14 16:00:43 2025 -0500 drm/amd/display: Add debugging message for brightness caps commit 4b61b8a upstream. [Why] Default BIOS brightness caps are buried in ACPI. [How] Add extra dynamic debug that can show default brightness caps. 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 749eb52 commit 6106a0e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4834,6 +4834,7 @@ amdgpu_dm_register_backlight_device(struct amdgpu_dm_connector *aconnector)
48344834
struct backlight_properties props = { 0 };
48354835
struct amdgpu_dm_backlight_caps caps = { 0 };
48364836
char bl_name[16];
4837+
int min, max;
48374838

48384839
if (aconnector->bl_idx == -1)
48394840
return;
@@ -4846,11 +4847,15 @@ amdgpu_dm_register_backlight_device(struct amdgpu_dm_connector *aconnector)
48464847
}
48474848

48484849
amdgpu_acpi_get_backlight_caps(&caps);
4849-
if (caps.caps_valid) {
4850+
if (caps.caps_valid && get_brightness_range(&caps, &min, &max)) {
48504851
if (power_supply_is_system_supplied() > 0)
48514852
props.brightness = caps.ac_level;
48524853
else
48534854
props.brightness = caps.dc_level;
4855+
/* min is zero, so max needs to be adjusted */
4856+
props.max_brightness = max - min;
4857+
drm_dbg(drm, "Backlight caps: min: %d, max: %d, ac %d, dc %d\n", min, max,
4858+
caps.ac_level, caps.dc_level);
48544859
} else
48554860
props.brightness = AMDGPU_MAX_BL_LEVEL;
48564861

0 commit comments

Comments
 (0)