]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amd/display: Validate backlight caps are sane
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 13 Sep 2024 18:00:39 +0000 (13:00 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:29:47 +0000 (16:29 +0200)
commitc886061bbdd1f37190939b11926055413e86a56c
treecd38a824e49dc506a6969a1b64e283e7ce43fbdb
parent9ce1ee22dc6829175ec2dfd74d78d79eb20e0732
drm/amd/display: Validate backlight caps are sane

commit 327e62f47eb57ae5ff63de82b0815557104e439a upstream.

Currently amdgpu takes backlight caps provided by the ACPI tables
on systems as is.  If the firmware sets maximums that are too low
this means that users don't get a good experience.

To avoid having to maintain a quirk list of such systems, do a sanity
check on the values.  Check that the spread is at least half of the
values that amdgpu would use if no ACPI table was found and if not
use the amdgpu defaults.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3020
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c