Skip to content

Commit 3c1a467

Browse files
George Shenalexdeucher
George Shen
authored andcommitted
drm/amd/display: fix link_set_dpms_off multi-display MST corner case
[Why & How] When MST config is unplugged/replugged too quickly, it can potentially result in a scenario where previous DC state has not been reset before the HPD link detection sequence begins. In this case, driver will disable the streams/link prior to re-enabling the link for link training. There is a bug in the current logic that does not account for the fact that current_state can be released and cleared prior to swapping to a new state (resulting in the pipe_ctx stream pointers to be cleared) in between disabling streams. To resolve this, cache the original streams prior to committing any stream updates. Reviewed-by: Wenjing Liu <[email protected]> Signed-off-by: George Shen <[email protected]> Signed-off-by: Ray Wu <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 1561782)
1 parent 874697e commit 3c1a467

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

drivers/gpu/drm/amd/display/dc/link/link_dpms.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ void link_blank_dp_stream(struct dc_link *link, bool hw_init)
148148
void link_set_all_streams_dpms_off_for_link(struct dc_link *link)
149149
{
150150
struct pipe_ctx *pipes[MAX_PIPES];
151+
struct dc_stream_state *streams[MAX_PIPES];
151152
struct dc_state *state = link->dc->current_state;
152153
uint8_t count;
153154
int i;
@@ -160,10 +161,18 @@ void link_set_all_streams_dpms_off_for_link(struct dc_link *link)
160161

161162
link_get_master_pipes_with_dpms_on(link, state, &count, pipes);
162163

164+
/* The subsequent call to dc_commit_updates_for_stream for a full update
165+
* will release the current state and swap to a new state. Releasing the
166+
* current state results in the stream pointers in the pipe_ctx structs
167+
* to be zero'd. Hence, cache all streams prior to dc_commit_updates_for_stream.
168+
*/
169+
for (i = 0; i < count; i++)
170+
streams[i] = pipes[i]->stream;
171+
163172
for (i = 0; i < count; i++) {
164-
stream_update.stream = pipes[i]->stream;
173+
stream_update.stream = streams[i];
165174
dc_commit_updates_for_stream(link->ctx->dc, NULL, 0,
166-
pipes[i]->stream, &stream_update,
175+
streams[i], &stream_update,
167176
state);
168177
}
169178

0 commit comments

Comments
 (0)