]> www.infradead.org Git - users/jedix/linux-maple.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)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Apr 2025 22:01:07 +0000 (18:01 -0400)
commit03b979e1025fba1d47cae005022fcdbba140f043
tree4f5f898051d3576eb055750e13b2ed3bfed19f99
parentf9fbc338811c8d123f0c05cd699ffa3ae7f08d34
drm/amd/display: Optimize custom brightness curve

[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>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c