Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu/display/mst: update mst_mgr relevant variable when long HPD

[Why & How]
Now the vc_start_slot is controlled at drm side. When we
service a long HPD, we still need to run
dm_helpers_dp_mst_write_payload_allocation_table() to update
drm mst_mgr's relevant variable. Otherwise, on the next plug-in,
payload will get assigned with a wrong start slot.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2171
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Fixes: 4d07b0bc4034 ("drm/display/dp_mst: Move all payload info into the atomic state")
Cc: stable@vger.kernel.org # 6.1
Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Tested-by: Didier Raboud <odyx@debian.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Wayne Lin and committed by
Alex Deucher
f85c5e25 cb1e0b01

+12 -2
+12 -2
drivers/gpu/drm/amd/display/dc/core/dc_link.c
··· 3995 3995 struct fixed31_32 avg_time_slots_per_mtp = dc_fixpt_from_int(0); 3996 3996 int i; 3997 3997 bool mst_mode = (link->type == dc_connection_mst_branch); 3998 + /* adjust for drm changes*/ 3999 + bool update_drm_mst_state = true; 3998 4000 const struct link_hwss *link_hwss = get_link_hwss(link, &pipe_ctx->link_res); 3999 4001 const struct dc_link_settings empty_link_settings = {0}; 4000 4002 DC_LOGGER_INIT(link->ctx->logger); 4003 + 4001 4004 4002 4005 /* deallocate_mst_payload is called before disable link. When mode or 4003 4006 * disable/enable monitor, new stream is created which is not in link ··· 4017 4014 &empty_link_settings, 4018 4015 avg_time_slots_per_mtp); 4019 4016 4020 - if (mst_mode) { 4017 + if (mst_mode || update_drm_mst_state) { 4021 4018 /* when link is in mst mode, reply on mst manager to remove 4022 4019 * payload 4023 4020 */ ··· 4080 4077 stream->ctx, 4081 4078 stream); 4082 4079 4080 + if (!update_drm_mst_state) 4081 + dm_helpers_dp_mst_send_payload_allocation( 4082 + stream->ctx, 4083 + stream, 4084 + false); 4085 + } 4086 + 4087 + if (update_drm_mst_state) 4083 4088 dm_helpers_dp_mst_send_payload_allocation( 4084 4089 stream->ctx, 4085 4090 stream, 4086 4091 false); 4087 - } 4088 4092 4089 4093 return DC_OK; 4090 4094 }