drm/amd/display: assign new stream id in dc_copy_stream
authorWenjing Liu <Wenjing.Liu@amd.com>
Tue, 7 May 2019 19:18:44 +0000 (15:18 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 31 May 2019 15:39:30 +0000 (10:39 -0500)
[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 <Wenjing.Liu@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_stream.c

index 59b247af5b81e1f0d1391353b608a8c25888d186..a002e690814f492ce9cc5e19ffb3c7770e198518 100644 (file)
@@ -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;