summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Chung <chiahsuan.chung@amd.com>2026-08-07 13:20:11 +0800
committerAlex Deucher <alexander.deucher@amd.com>2026-08-25 18:25:26 -0400
commit0dd25075be610e5a597fafa276a775ec4ebe6098 (patch)
treebd06b682a6bc58ee9ff350b6359bd3e2b8b48ac3
parent22183b73a08eaa79bf451a1718138e76afa38958 (diff)
downloadlinux-next-0dd25075be610e5a597fafa276a775ec4ebe6098.tar.gz
linux-next-0dd25075be610e5a597fafa276a775ec4ebe6098.zip
drm/amd/display: set base.enable in cursor mode tests
[why] The CRTC state in the amdgpu_dm_crtc_get_cursor_mode() tests is zero-initialised, so base.enable is false in all of them. Nothing in the function reads it today, so they pass, but they are not describing the case they mean to describe: each one is meant to exercise an enabled CRTC driving real planes. [how] Set base.enable in the shared fixture, and in the no_change test which builds its own CRTC state instead of using the fixture. No functional change, since the function does not look at base.enable yet. Reviewed-by: Wayne Lin <wayne.lin@amd.com> Signed-off-by: Tom Chung <chiahsuan.chung@amd.com> Signed-off-by: James Lin <pinglei.lin@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_cursor_test.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_cursor_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_cursor_test.c
index 30fbacce0094..efd16575896e 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_cursor_test.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_cursor_test.c
@@ -147,6 +147,7 @@ static struct dm_cursor_mode_fixture dm_test_alloc_cursor_mode_fixture(struct ku
fixture.state->planes[1].old_state = fixture.old_primary_state;
fixture.state->planes[1].new_state = fixture.primary_state;
fixture.dm_crtc_state->base.crtc = fixture.crtc;
+ fixture.dm_crtc_state->base.enable = true;
fixture.dm_crtc_state->base.plane_mask = drm_plane_mask(fixture.cursor) |
drm_plane_mask(fixture.primary);
fixture.dm_crtc_state->base.zpos_changed = true;
@@ -556,6 +557,7 @@ static void dm_test_crtc_get_cursor_mode_no_change(struct kunit *test)
dm_crtc_state = kunit_kzalloc(test, sizeof(*dm_crtc_state), GFP_KERNEL);
KUNIT_ASSERT_NOT_NULL(test, dm_crtc_state);
state->dev = &adev->ddev;
+ dm_crtc_state->base.enable = true;
dm_crtc_state->cursor_mode = DM_CURSOR_OVERLAY_MODE;
ret = amdgpu_dm_crtc_get_cursor_mode(adev, state, dm_crtc_state, &cursor_mode);