]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amd/display: Optimize custom brightness curve
authorMario Limonciello <mario.limonciello@amd.com>
Mon, 24 Mar 2025 17:57:25 +0000 (12:57 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Jul 2025 09:04:26 +0000 (11:04 +0200)
commitd5df87e3fccecde67866f587e187e67b503a0be9
tree86435b38c4934a01b690ecc46dbead562b3d25ab
parentcd711c87c2862be5e71eee79901f94e1c943f9fc
drm/amd/display: Optimize custom brightness curve

commit 03b979e1025fba1d47cae005022fcdbba140f043 upstream.

[Why]
When BIOS includes a lot of custom brightness data points, walking
the entire list can be time consuming.  This is most noticed when
dragging a power slider.  The "higher" values are "slower" to drag
around.

[How]
Move custom brightness calculation loop into a static function. Before
starting the loop check the "half way" data point to see how it compares
to the input.  If greater than the half way data point use that as the
starting point instead.

Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Roman Li <roman.li@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>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c