From: Harry Wentland Date: Fri, 20 Oct 2017 08:43:40 -0400 Subject: drm/amd/display: Explicitly call ->reset for each object Git-commit: 96719c5439b4d75bfd6b3c5cb24f1a8e537125bb Patch-mainline: v4.15-rc1 References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166 We need to avoid calling reset after detection because the next commit adds freesync properties on the atomic_state which are set during detection. Calling reset after this clears them. The easiest way to accomplish this right now is to call ->reset on the connector right after creation but before detection. To stay consistent call ->reset on every other object as well after creation. v2: Provide better reason for this change in commit msg. Signed-off-by: Harry Wentland Reviewed-by: Roman Li Acked-by: Harry Wentland Reviewed-by: Andrey Grodzovsky Signed-off-by: Alex Deucher Acked-by: Petr Tesarik --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1433,8 +1433,6 @@ static int amdgpu_dm_initialize_drm_devi goto fail; } - drm_mode_config_reset(dm->ddev); - return 0; fail: kfree(aencoder); @@ -3081,6 +3079,11 @@ static int amdgpu_dm_plane_init(struct a drm_plane_helper_add(&aplane->base, &dm_plane_helper_funcs); + /* Create (reset) the plane state */ + if (aplane->base.funcs->reset) + aplane->base.funcs->reset(&aplane->base); + + return res; } @@ -3116,6 +3119,10 @@ static int amdgpu_dm_crtc_init(struct am drm_crtc_helper_add(&acrtc->base, &amdgpu_dm_crtc_helper_funcs); + /* Create (reset) the plane state */ + if (acrtc->base.funcs->reset) + acrtc->base.funcs->reset(&acrtc->base); + acrtc->max_cursor_width = dm->adev->dm.dc->caps.max_cursor_size; acrtc->max_cursor_height = dm->adev->dm.dc->caps.max_cursor_size; @@ -3468,6 +3475,9 @@ static int amdgpu_dm_connector_init(stru &aconnector->base, &amdgpu_dm_connector_helper_funcs); + if (aconnector->base.funcs->reset) + aconnector->base.funcs->reset(&aconnector->base); + amdgpu_dm_connector_init_helper( dm, aconnector,