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>
This commit is contained in:
Tom Chung 2026-08-07 13:20:11 +08:00 committed by Alex Deucher
parent 22183b73a0
commit 0dd25075be

View File

@ -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);