Skip to content

Commit

Permalink
drm/amd/display: Explicitly call ->reset for each object
Browse files Browse the repository at this point in the history
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 <harry.wentland@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Harry Wentland authored and Alex Deucher committed Nov 2, 2017
1 parent cd8a2ae commit 96719c5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1433,8 +1433,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
goto fail;
}

drm_mode_config_reset(dm->ddev);

return 0;
fail:
kfree(aencoder);
Expand Down Expand Up @@ -3081,6 +3079,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;
}

Expand Down Expand Up @@ -3116,6 +3119,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;

Expand Down Expand Up @@ -3468,6 +3475,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,
Expand Down

0 comments on commit 96719c5

Please sign in to comment.