drm/amd/display: Clear dc remote sinks on MST disconnect
Subsystems (3)
PATCH 1/1 drm/amd/display: Clear dc remote sinks on MST disconnect
[Why&How]
Recent changes to upstream mst code remove the callback which cleared the internal state for mst. Move the missing functionality that was previously called through the destroy call back for mst connector destroy
--- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 22 +++++++++++++++++-- drivers/gpu/drm/amd/display/dc/dm_helpers.h | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +20 -2
@@ -418,9 +418,10 @@ bool dm_helpers_dp_mst_start_top_mgr(void dm_helpers_dp_mst_stop_top_mgr (struct dc_context *ctx, -const struct dc_link *link) +struct dc_link *link) {struct amdgpu_dm_connector *aconnector = link->priv; +uint8_t i;if (!aconnector) {DRM_ERROR ("Failed to find connector for link!" );
@@ -430,8 +431,25 @@ void dm_helpers_dp_mst_stop_top_mgr(DRM_INFO ("DM_MST: stopping TM on aconnector: %p [id: %d]\n" , aconnector, aconnector->base.base.id); -if (aconnector->mst_mgr.mst_state == true) +if (aconnector->mst_mgr.mst_state == true) {drm_dp_mst_topology_mgr_set_mst (&aconnector->mst_mgr, false); + +for (i =0 ; i <MAX_SINKS_PER_LINK ; i++) { +if (link->remote_sinks[i] ==NULL ) +continue ; + +if (link->remote_sinks[i]->sink_signal == +SIGNAL_TYPE_DISPLAY_PORT_MST ) { +dc_link_remove_remote_sink (link, link->remote_sinks[i]); + +if (aconnector->dc_sink) { +dc_sink_release (aconnector->dc_sink); + aconnector->dc_sink =NULL ; + aconnector->dc_link->cur_link_settings.lane_count =0 ; + } + } + } + } } bool dm_helpers_dp_read_dpcd(
drivers/gpu/drm/amd/display/dc/dm_helpers.h +1 -1
@@ -113,7 +113,7 @@ bool dm_helpers_dp_mst_start_top_mgr(void dm_helpers_dp_mst_stop_top_mgr (struct dc_context *ctx, -const struct dc_link *link); +struct dc_link *link);/** * OS specific aux read callback. */
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 34 lines · Aurabindo Pillai
[Why&How]
Recent changes to upstream mst code remove the callback which cleared the internal state for mst. Move the missing functionality that was previously called through the destroy call back for mst connector destroySigned-off-by Aurabindo Pillai <[email protected]>Signed-off-by Eryk Brol <[email protected]>--- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 22 +++++++++++++++++-- drivers/gpu/drm/amd/display/dc/dm_helpers.h | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +2
-2@@ -418,9 +418,10 @@ bool dm_helpers_dp_mst_start_top_mgr(void dm_helpers_dp_mst_stop_top_mgr (struct dc_context *ctx, -const struct dc_link *link) +struct dc_link *link) {struct amdgpu_dm_connector *aconnector = link->priv; +uint8_t i;if (!aconnector) {DRM_ERROR ("Failed to find connector for link!" );@@ -430,8 +431,25 @@ void dm_helpers_dp_mst_stop_top_mgr(DRM_INFO ("DM_MST: stopping TM on aconnector: %p [id: %d]\n" , aconnector, aconnector->base.base.id); -if (aconnector->mst_mgr.mst_state == true)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c void dm_helpers_dp_mst_stop_top_mgr( · line 443
Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +9
-0+if (aconnector->mst_mgr.mst_state == true) {drm_dp_mst_topology_mgr_set_mst (&aconnector->mst_mgr, false); + +for (i =0 ; i <MAX_SINKS_PER_LINK ; i++) { +if (link->remote_sinks[i] ==NULL ) +continue ; + +if (link->remote_sinks[i]->sink_signal == +SIGNAL_TYPE_DISPLAY_PORT_MST ) { +dc_link_remove_remote_sink (link, link->remote_sinks[i]);
In general I think this patch looks fine, and you can have the:
But I think that this loop is redundant - dc_link_remove_remote_sink should be removing all the remote sinks. Not sure if remote_sinks can start at an index other than 0 though.
Regards,
Nicholas Kazlauskas
Quoted 17 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +9
-0+ +if (aconnector->dc_sink) { +dc_sink_release (aconnector->dc_sink); + aconnector->dc_sink =NULL ; + aconnector->dc_link->cur_link_settings.lane_count =0 ; + } + } + } + } > } bool dm_helpers_dp_read_dpcd(drivers/gpu/drm/amd/display/dc/dm_helpers.h +0
-0
drivers/gpu/drm/amd/display/dc/dm_helpers.h bool dm_helpers_dp_mst_start_top_mgr( · line 119
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/dm_helpers.h +1
-1@@ -113,7 +113,7 @@ bool dm_helpers_dp_mst_start_top_mgr(void dm_helpers_dp_mst_stop_top_mgr (struct dc_context *ctx, -const struct dc_link *link); +struct dc_link *link);/** * OS specific aux read callback. */
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Harry Wentland
maintainerQuoted 45 lines · Nicholas
Quoted 31 lines · Aurabindo Pillai
[Why&How]
Recent changes to upstream mst code remove the callback which cleared the internal state for mst. Move the missing functionality that was previously called through the destroy call back for mst connector destroySigned-off-by Aurabindo Pillai <[email protected]>Signed-off-by Eryk Brol <[email protected]>---
.../amd/display/amdgpu_dm/amdgpu_dm_helpers.c| 22 +++++++++++++++++-- drivers/gpu/drm/amd/display/dc/dm_helpers.h | 2 +-2 files changed, 21 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +0
-0@@ -418,9 +418,10 @@ bool dm_helpers_dp_mst_start_top_mgr(void dm_helpers_dp_mst_stop_top_mgr(
structdc_context*ctx,
- const structdc_link*link)
+ structdc_link*link)
{
structamdgpu_dm_connector*aconnector =link->priv; +uint8_ti;
if (!aconnector) {
DRM_ERROR("Failed to find connector for link!");drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +0
-1@@ -430,8 +431,25 @@ void dm_helpers_dp_mst_stop_top_mgr( DRM_INFO("DM_MST: stopping TM on aconnector: %p [id: %d]\n", aconnector, aconnector->base.base.id); - if (aconnector->mst_mgr.mst_state == true)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c void dm_helpers_dp_mst_stop_top_mgr( · line 442
Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +9
-0+ if (aconnector->mst_mgr.mst_state == true) { drm_dp_mst_topology_mgr_set_mst(&aconnector->mst_mgr, false); + + for (i = 0; i < MAX_SINKS_PER_LINK; i++) { + if (link->remote_sinks[i] == NULL) + continue; + + if (link->remote_sinks[i]->sink_signal == + SIGNAL_TYPE_DISPLAY_PORT_MST) { + dc_link_remove_remote_sink(link, link->remote_sinks[i]);In general I think this patch looks fine, and you can have the:
Quoted 4 lines
Reviewed-by Nicholas Kazlauskas <[email protected]>But I think that this loop is redundant -
dc_link_remove_remote_sinkshould be removing all the remote sinks. Not sure ifremote_sinkscan start at an index other than 0 though.
I'd prefer we clean this up if it's redundant. Otherwise redundant code stays around forever and makes future debug more cumbersome.
Harry
Quoted 24 lines
Regards,
Nicholas KazlauskasQuoted 21 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +9
-0+ + if (aconnector->dc_sink) { + dc_sink_release(aconnector->dc_sink); + aconnector->dc_sink = NULL; + aconnector->dc_link->cur_link_settings.lane_count =0 ; + } + } + } + } > }bool dm_helpers_dp_read_dpcd(
drivers/gpu/drm/amd/display/dc/dm_helpers.h +0
-0@@ -113,7 +113,7 @@ bool dm_helpers_dp_mst_start_top_mgr(void dm_helpers_dp_mst_stop_top_mgr(
structdc_context*ctx,
- const structdc_link*link);
+ structdc_link*link);
/**
Quoted 9 lines
Quoted 3 lines
* OS specific aux read callback.
*/_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7CHARRY.WENTLAND%40amd.com%7C7576866a05154b66cdb208d8921898da%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637419981644444920%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=sm7jvbxW%2BgEUevWgjACydnjuiE7SgtunMBUIpLT99r4%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 47 lines · Nicholas
Quoted 33 lines · Aurabindo Pillai
[Why&How]
Recent changes to upstream mst code remove the callback which cleared the internal state for mst. Move the missing functionality that was previously called through the destroy call back for mst connector
destroySigned-off-by Aurabindo Pillai <[email protected]>Signed-off-by Eryk Brol <[email protected]>---
.../amd/display/amdgpu_dm/amdgpu_dm_helpers.c| 22 +++++++++++++++++-- drivers/gpu/drm/amd/display/dc/dm_helpers.h | 2 +-2 files changed, 21 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +0
-0@@ -418,9 +418,10 @@ bool dm_helpers_dp_mst_start_top_mgr(void dm_helpers_dp_mst_stop_top_mgr(
structdc_context*ctx,
- const structdc_link*link)
+ structdc_link*link)
{
structamdgpu_dm_connector*aconnector =link->priv; +uint8_ti;
if (!aconnector) {
DRM_ERROR("Failed to find connector for link!");drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +0
-0@@ -430,8 +431,25 @@ void dm_helpers_dp_mst_stop_top_mgr( DRM_INFO("DM_MST: stopping TM on aconnector: %p [id: %d]\n", aconnector, aconnector->base.base.id); - if (aconnector->mst_mgr.mst_state == true)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c void dm_helpers_dp_mst_stop_top_mgr( · line 443
Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +9
-0+ if (aconnector->mst_mgr.mst_state == true) { drm_dp_mst_topology_mgr_set_mst(&aconnector->mst_mgr, false); + + for (i = 0; i < MAX_SINKS_PER_LINK; i++) { + if (link->remote_sinks[i] == NULL) + continue; + + if (link->remote_sinks[i]->sink_signal == + SIGNAL_TYPE_DISPLAY_PORT_MST) { + dc_link_remove_remote_sink(link, link->remote_sinks[i]);In general I think this patch looks fine, and you can have the:
Quoted 5 lines
Reviewed-by Nicholas Kazlauskas <[email protected]>But I think that this loop is redundant -
dc_link_remove_remote_sinkshould be removing all the remote sinks. Not sure ifremote_sinkscan start at an index other than 0 though.
dc_link_remove_remote_sink() will only remove one sink. It returns as soon as it is done removing the sink we asked for.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx