]> 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>
Thu, 17 Oct 2024 13:11:11 +0000 (15:11 +0200)
commit9113f60bce8058a4c1d89ce3a5b65d60d698e095
treeb5a9b9069444086ca616da1ab255950a1a41bac7
parent458c54c6f9477028ed286ac8a051a200521b0c4d
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