drm/amd/display: Test backlight caps validation

[WHAT]
The sanity check applied to the backlight caps reported by the
firmware sits inside a CONFIG_ACPI block. The UML KUnit build cannot
enable CONFIG_ACPI, so that logic is never built and stays uncovered.

[HOW]
Move the check into amdgpu_dm_validate_backlight_caps() and build it
whenever CONFIG_ACPI or the KUnit tests are enabled. Behaviour of
amdgpu_dm_update_backlight_caps() is unchanged.

Add a parameterized test for amdgpu_dm_validate_backlight_caps()
covering sane caps, a max above the 8-bit range, a negative min and a
spread narrower than AMDGPU_DM_MIN_SPREAD.

Assisted-by: Copilot:Claude-Opus-5
Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Alex Hung 2026-08-17 19:10:49 -06:00 • committed by Alex Deucher
commit 4c812f0d8c
3 changed files with 66 additions and 12 deletions