]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amd/display: fix initial backlight brightness calculation
authorLauri Tirkkonen <lauri@hacktheplanet.fi>
Mon, 21 Jul 2025 00:59:40 +0000 (09:59 +0900)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 28 Jul 2025 20:25:34 +0000 (16:25 -0400)
commit9c2883057b3c861879b647f34e8bc448954e8729
tree27136a777ebd3ee6566aa7ca8cdfc4e9fe380d28
parent1f02f2044bda1db1fd995bc35961ab075fa7b5a2
drm/amd/display: fix initial backlight brightness calculation

DIV_ROUND_CLOSEST(x, 100) returns either 0 or 1 if 0<x<=100, so the
division needs to be performed after the multiplication and not the
other way around, to properly scale the value.

Fixes: 8b5f3a229a70 ("drm/amd/display: Fix default DC and AC levels")
Signed-off-by: Lauri Tirkkonen <lauri@hacktheplanet.fi>
Cc: stable@vger.kernel.org
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/aH2Q_HJvxKbW74vU@hacktheplanet.fi
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c