drm/amd/display: Add KUnit test for PSR function
authorAlex Hung <alex.hung@amd.com>
Thu, 23 Apr 2026 00:12:46 +0000 (18:12 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 May 2026 15:54:36 +0000 (11:54 -0400)
commit53af0cf6c8e8712da2c30c55fd2b9118c8445b83
tree8ffba2ff88fe70f23295de028113b98ba5cf205c
parent647d1fd046527c3eafb4974433cb68b87f2d4e18
drm/amd/display: Add KUnit test for PSR function

Add KUnit tests for amdgpu_dm_psr_fill_caps() which
validates PSR capability population from DPCD data.

Export amdgpu_dm_psr_fill_caps() conditionally when
CONFIG_DRM_AMD_DC_KUNIT_TEST is enabled, following the
existing pattern used by CRC and HDCP test files.

The test covers PSR version mapping, RFB setup time
calculation, link training flag, DPCD field passthrough,
rate control caps, and power optimization flags.

Assisted-by: Copilot:Claude-Opus-4.6
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h
drivers/gpu/drm/amd/display/amdgpu_dm/tests/Makefile
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_psr_test.c [new file with mode: 0644]