From: Wenjing Liu Date: Tue, 7 May 2019 19:18:44 +0000 (-0400) Subject: drm/amd/display: assign new stream id in dc_copy_stream X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b1432fcbdbea5de6e4ec2e1b2fa2b3c13ade4785;p=linux.git drm/amd/display: assign new stream id in dc_copy_stream [why] stream id should uniquely identify an instance of stream. the copy constructor should be treated as a new stream instance. [how] assign a new stream id in this copy constructor. Signed-off-by: Wenjing Liu Reviewed-by: Jun Lei Acked-by: Leo Li 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 59b247af5b81e..a002e690814f4 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c @@ -179,6 +179,9 @@ struct dc_stream_state *dc_copy_stream(const struct dc_stream_state *stream) if (new_stream->out_transfer_func) dc_transfer_func_retain(new_stream->out_transfer_func); + new_stream->stream_id = new_stream->ctx->dc_stream_id_count; + new_stream->ctx->dc_stream_id_count++; + kref_init(&new_stream->refcount); return new_stream;