drm_mode_config_reset() has a dual role: it creates the initial KMS state at probe time, and resets hardware and software state during suspend/resume cycles.
Since the two roles need different behaviors (notably for objects like drm_private_obj that must persist across suspend/resume), drm_mode_config_create_initial_state() was introduced to handle only the initial state creation at probe time. Switch to drm_mode_config_create_initial_state(). Signed-off-by: Maxime Ripard <[email protected]> --- drivers/gpu/drm/tests/drm_atomic_commit_test.c | 3 +-- drivers/gpu/drm/tests/drm_atomic_test.c | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_atomic_commit_test.c b/drivers/gpu/drm/tests/drm_atomic_commit_test.c index 97f60ce68b3e..a02859a0d8bf 100644 --- a/drivers/gpu/drm/tests/drm_atomic_commit_test.c +++ b/drivers/gpu/drm/tests/drm_atomic_commit_test.c @@ -133,12 +133,11 @@ drm_atomic_test_init_drm_components(struct kunit *test, bool has_connectors) drm_connector_attach_encoder(conn, &priv->encoders[i]); } done: ret = drm_mode_config_create_initial_state(drm); - if (ret) - return ERR_PTR(ret); + KUNIT_ASSERT_EQ(test, ret, 0); return priv; } static int set_up_atomic_state(struct kunit *test, diff --git a/drivers/gpu/drm/tests/drm_atomic_test.c b/drivers/gpu/drm/tests/drm_atomic_test.c index 541a0062f143..5e156d09e56f 100644 --- a/drivers/gpu/drm/tests/drm_atomic_test.c +++ b/drivers/gpu/drm/tests/drm_atomic_test.c @@ -84,11 +84,13 @@ static struct drm_atomic_test_priv *create_device(struct kunit *test) drm_connector_helper_add(connector, &drm_atomic_init_connector_helper_funcs); drm_connector_attach_encoder(connector, enc); - drm_mode_config_reset(drm); + ret = drm_mode_config_create_initial_state(drm); + if (ret) + return ERR_PTR(ret); return priv; } static void drm_test_drm_atomic_get_connector_for_encoder(struct kunit *test) -- 2.56.1
