]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/amd/display: Fix backlight max_brightness to match exported range
authorMario Limonciello <mario.limonciello@amd.com>
Mon, 29 Jun 2026 20:27:00 +0000 (15:27 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 17 Jul 2026 21:37:40 +0000 (17:37 -0400)
commitf1b5d8f9cc54ae8a2567ac126867ae488e1bf625
tree199019b2e04fef40752bcf284164df646593b158
parent9b3aa1dec7c364b0d7b171dcc00ab1092e362aef
drm/amd/display: Fix backlight max_brightness to match exported range

[Why]
FWTS autobrightness fails on eDP panels because actual_brightness can
read higher than the advertised max_brightness (e.g. 63576 vs 62451).

The conversion helpers expose the firmware PWM range to userspace as
[0..max].  But max_brightness is advertised as (max - min), which is
smaller.  So reading the level can return a value above max_brightness.

This regressed in commit 4b61b8a39051 ("drm/amd/display: Add debugging
message for brightness caps"), which changed max_brightness to
(max - min) and undid commit 8dbd72cb7900 ("drm/amd/display: Export full
brightness range to userspace").

[How]
Advertise max_brightness as max, and scale the initial AC/DC brightness
against max too.  Update the KUnit expectations to match.

Fixes: 4b61b8a39051 ("drm/amd/display: Add debugging message for brightness caps")
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: George Zhang <george.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit bd9e2b5b0473c75abc0f4134dfe79ecbfb16610d)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c