On 2017-10-26 10:51 PM, Andrey Grodzovsky wrote: > > > On 2017-10-26 02:35 PM, Harry Wentland wrote: >> We need to avoid calling reset after detection. > > Could you explain why please ? Reset creates new, clean atomic_state objects. In this case we want to attach the freesync_capable property on the atomic_state at detection (see next change to convert the property from legacy to atomic). Calling reset after detection would clear that. > >> This is much simpler >> if we call ->reset on the connector right after creation but before >> detection. To stay consistent call ->reset on every other object >> as well after creation. >> >> Signed-off-by: Harry Wentland <harry.wentland at amd.com> >> Reviewed-by: Roman Li <Roman.Li at amd.com> >> Acked-by: Harry Wentland <harry.wentland at amd.com> >> --- >> Â drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++++++-- >> Â 1 file changed, 12 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c >> index 6fc043957bbf..62e8db1f113c 100644 >> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c >> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c >> @@ -1436,8 +1436,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) >> Â Â Â Â Â Â Â Â Â goto fail; >> Â Â Â Â Â } >> Â -Â Â Â drm_mode_config_reset(dm->ddev); > > This is a standard helper called by many drivers on driver init , it's also called in drm_atomic_helper_resume > which we use on resume from suspend so now it's kind of asymmetrical behavior. > I'll have to take a look at the resume case. It seems atomic never intended to deal with immutable properties that are set in the driver (like freesync_capable). We might have to revisit that but in light of the fact that we need to redo these properties anyways in a generic fashion for upstream freesync I was hesitant to spend too much time on our non-upstream version of the freesync properties. Harry > Thanks, > Andrey > >> - >> Â Â Â Â Â return 0; >> Â fail: >> Â Â Â Â Â kfree(aencoder); >> @@ -3105,6 +3103,11 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, >> Â Â Â Â Â Â 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; >> Â } >> Â @@ -3140,6 +3143,10 @@ static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, >> Â Â Â Â Â Â 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; >> Â @@ -3500,6 +3507,9 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm, >> Â Â Â Â Â Â Â Â Â Â Â Â Â &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, >