drm/amd/display: Test backlight level programming path
authorAlex Hung <alex.hung@amd.com>
Tue, 30 Jun 2026 00:37:52 +0000 (18:37 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 15 Jul 2026 13:15:39 +0000 (09:15 -0400)
commitee486cb800915b2fc7ecfd108982198045860060
tree7d5bd371d7bc324e0041889b18b9e88ee6b55d1a
parent9a77c86ec8f5e3186b77437958d918698f1d53dd
drm/amd/display: Test backlight level programming path

[WHAT]
Add KUnit coverage for the backlight level write path in
amdgpu_dm_backlight.c.

Tests cover stream lookup hit/miss, the connector-off and no-stream early
returns, and the AUX/PWM/idle-reallow programming branches. The DC
programming calls stay safe by injecting a NULL power module and keeping
idle optimizations a no-op via disable_idle_power_optimizations.

Assisted-by: Copilot:Claude-Opus-4.8
Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: George Zhang <george.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_backlight.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_backlight.h
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_backlight_test.c