From: Jimmy Kizito Date: Tue, 21 Sep 2021 14:03:05 +0000 (-0400) Subject: drm/amd/display: Clear encoder assignment for copied streams X-Git-Tag: block-5.16-2021-11-13~77^2~5^2~53 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=4a0dc87fca19c51421a8ef5ca086f57898447c70;p=linux-block.git drm/amd/display: Clear encoder assignment for copied streams [Why] When copying a stream, the encoder assigned to it is copied too. Encoder assignment should only happen when executing the encoder assignment function link_encs_assign(). [How] Clear the link encoder pointer for copied stream. Reviewed-by: Meenakshikumar Somasundaram Reviewed-by: Jun Lei Acked-by: Agustin Gutierrez Sanchez Signed-off-by: Jimmy Kizito Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c index f0f54f4d3d9b..57cf4cb82370 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c @@ -202,6 +202,10 @@ struct dc_stream_state *dc_copy_stream(const struct dc_stream_state *stream) new_stream->stream_id = new_stream->ctx->dc_stream_id_count; new_stream->ctx->dc_stream_id_count++; + /* If using dynamic encoder assignment, wait till stream committed to assign encoder. */ + if (new_stream->ctx->dc->res_pool->funcs->link_encs_assign) + new_stream->link_enc = NULL; + kref_init(&new_stream->refcount); return new_stream;