[PATCH linux-next] drm/amd/display: give the dprx CRC test its connector state back
From: Sasha Levin
Date: Wed Nov 11 2026 - 11:21:53 EST
The merge fixup in commit c62c2736d82f ("amdgpu: Merge merge merge
cherry-pick cherry-pick cherry-pick") dropped the call to
drm_atomic_helper_connector_reset(), which drm-misc removed. But that
call is what gave the test's connector a state, so the assert right
after it always fails now.
Create the state with drm_atomic_helper_connector_create_state()
instead, and check it before storing it: cleanup would choke on an
error pointer in connector->state.
Fixes: af8e519642bd ("Merge branch 'drm-next' of https://gitlab.freedesktop.org/agd5f/linux.git")
Link: https://lore.kernel.org/all/avNxxfHK_Zh2GN2o@xxxxxxxxxxxxx/
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
The amdgpu_dm_crc KUnit suite goes from 34/35 to 35/35 with this.
.../gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_crc_test.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_crc_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_crc_test.c
index 2b94d1bcaf62c..32b33d72dd0f3 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_crc_test.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_crc_test.c
@@ -694,6 +694,7 @@ static void dm_test_crtc_set_crc_source_dprx_connector(struct kunit *test)
struct amdgpu_device *adev = dm_kunit_alloc_adev(test);
struct amdgpu_crtc *acrtc = dm_test_alloc_crc_crtc(test, adev);
struct amdgpu_dm_connector *aconn;
+ struct drm_connector_state *state;
int ret;
aconn = kunit_kzalloc(test, sizeof(*aconn), GFP_KERNEL);
@@ -704,7 +705,9 @@ static void dm_test_crtc_set_crc_source_dprx_connector(struct kunit *test)
KUNIT_ASSERT_EQ(test, ret, 0);
ret = kunit_add_action_or_reset(test, dm_test_crc_connector_cleanup, &aconn->base);
KUNIT_ASSERT_EQ(test, ret, 0);
- KUNIT_ASSERT_NOT_NULL(test, aconn->base.state);
+ state = drm_atomic_helper_connector_create_state(&aconn->base);
+ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, state);
+ aconn->base.state = state;
aconn->base.state->crtc = &acrtc->base;
/* Balance the reference the state destroy drops for a set CRTC. */
drm_connector_get(&aconn->base);
base-commit: 793807ca13bf3072fc6d16ce6d90e9ab9beff2a5
--
2.53.0