drm/amd/display: Don't write DP_MSTM_CTRL after LT
PATCH 1/1 drm/amd/display: Don't write DP_MSTM_CTRL after LT
From: Wayne Lin <[email protected]>
[ Upstream commit bc068194f548ef1f230d96c4398046bf59165992 ]
[Why]
Observe after suspend/resme, we can't light up mst monitors under specific mst hub. The reason is that driver still writes DPCD DP_MSTM_CTRL after LT. It's forbidden even we write the same value for that dpcd register.
[How]
We already resume the mst branch device dpcd settings during resume_mst_branch_status(). Leverage drm_dp_mst_topology_queue_probe() to only probe the topology, not calling drm_dp_mst_topology_mgr_resume() which will set DP_MSTM_CTRL as well.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -12
@@ -3231,8 +3231,7 @@ static int dm_resume(void *handle)struct dm_atomic_state *dm_state =to_dm_atomic_state (dm->atomic_obj.state);enum dc_connection_type new_connection_type = dc_connection_none;struct dc_state *dc_state; -int i, r, j, ret; -bool need_hotplug = false; +int i, r, j;struct dc_commit_streams_params commit_params = {};if (dm->dc->caps.ips_support) {
@@ -3427,23 +3426,16 @@ static int dm_resume(void *handle) aconnector->mst_root)continue ; - ret =drm_dp_mst_topology_mgr_resume (&aconnector->mst_mgr, true); - -if (ret <0 ) { -dm_helpers_dp_mst_stop_top_mgr (aconnector->dc_link->ctx, - aconnector->dc_link); - need_hotplug = true; - } +drm_dp_mst_topology_queue_probe (&aconnector->mst_mgr); }drm_connector_list_iter_end (&iter); -if (need_hotplug) -drm_kms_helper_hotplug_event (ddev); -amdgpu_dm_irq_resume_late (adev);amdgpu_dm_smu_write_watermarks_table (adev); +drm_kms_helper_hotplug_event (ddev); +return 0 ; }
Signature · 1 line
2.47.2
Quoted 7 lines · Thadeu Lima de Souza Cascardo
From: Wayne Lin <[email protected]>
[ Upstream commit
bc068194f548ef1f230d96c4398046bf59165992][Why]
Observe after suspend/resme, we can't light up mst monitors under specific mst hub.
This is already at stable backport stage, but it would really be helpful to log *which* specific mst hub we're talking about here. Now the information is lost in time, at least to outsiders.
BR,
Jani.
Quoted 59 lines
The reason is that driver still writes DPCD
DP_MSTM_CTRLafter LT. It's forbidden even we write the same value for that dpcd register.[How]
We already resume the mst branch device dpcd settings duringresume_mst_branch_status(). Leveragedrm_dp_mst_topology_queue_probe()to only probe the topology, not callingdrm_dp_mst_topology_mgr_resume()which will setDP_MSTM_CTRLas well.Reviewed-by Jerry Zuo <[email protected]>Signed-off-by Wayne Lin <[email protected]>Signed-off-by Zaeem Mohamed <[email protected]>Tested-by Daniel Wheeler <[email protected]>Signed-off-by Alex Deucher <[email protected]>Signed-off-by Thadeu Lima de Souza Cascardo <[email protected]>--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4
-12@@ -3231,8 +3231,7 @@ static int dm_resume(void *handle)struct dm_atomic_state *dm_state =to_dm_atomic_state (dm->atomic_obj.state);enum dc_connection_type new_connection_type = dc_connection_none;struct dc_state *dc_state; -int i, r, j, ret; -bool need_hotplug = false; +int i, r, j;struct dc_commit_streams_params commit_params = {};if (dm->dc->caps.ips_support) {@@ -3427,23 +3426,16 @@ static int dm_resume(void *handle) aconnector->mst_root)continue ; - ret =drm_dp_mst_topology_mgr_resume (&aconnector->mst_mgr, true); - -if (ret <0 ) { -dm_helpers_dp_mst_stop_top_mgr (aconnector->dc_link->ctx, - aconnector->dc_link); - need_hotplug = true; - } +drm_dp_mst_topology_queue_probe (&aconnector->mst_mgr); }drm_connector_list_iter_end (&iter); -if (need_hotplug) -drm_kms_helper_hotplug_event (ddev); -amdgpu_dm_irq_resume_late (adev);amdgpu_dm_smu_write_watermarks_table (adev); +drm_kms_helper_hotplug_event (ddev); +return 0 ; }
Signature · 1 line
Jani Nikula, Intel