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]> --- Cc: "Christian König" <[email protected]> Cc: Alex Deucher <[email protected]> Cc: [email protected] --- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 4 +++- .../gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c | 3 ++- .../gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_mst_types_test.c | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c index 5c7e2172a372..1f8b531eb946 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c @@ -362,5 +362,7 @@ static int amdgpu_vkms_output_init(struct drm_device *dev, struct } - drm_mode_config_reset(dev); + ret = drm_mode_config_create_initial_state(dev); + if (ret) + goto err_attach; return 0; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c index 009a017194e3..7966690dca96 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c @@ -9966,5 +9966,6 @@ dm_test_force_ctx_alloc(struct kunit *test, const struct drm_connector_funcs *fu ctx->aconnector->base.encoder = encoder; - drm_mode_config_reset(ctx->drm); + KUNIT_ASSERT_EQ(test, + drm_mode_config_create_initial_state(ctx->drm), 0); drm_modeset_acquire_init(&ctx->acquire_ctx, 0); diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_mst_types_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_mst_types_test.c index 8c3e32f40a96..c9fa8308d254 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_mst_types_test.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_mst_types_test.c @@ -3794,5 +3794,7 @@ dm_mst_test_alloc_dsc_link_ctx(struct kunit *test, int total_avail_slots) &dm_mst_test_dsc_link_conn_funcs, DRM_MODE_CONNECTOR_DisplayPort, NULL), 0); - drm_mode_config_reset(ctx->drm); + + KUNIT_ASSERT_EQ(test, + drm_mode_config_create_initial_state(ctx->drm), 0); KUNIT_ASSERT_EQ(test, -- 2.55.0
