提交 ece4147f 编写于 作者: K Ken Chalmers 提交者: Alex Deucher

drm/amd/display: Fix new stream count check in dc_add_stream_to_ctx

[Why]
The previous code could allow through attempts to enable more streams
than there are timing generators, in designs where the number of pipes
is greater than the number of timing generators.

[How]
Compare the new stream count to the resource pool's timing generator
count, instead of its pipe count.  Also correct a typo in the error
message.
Signed-off-by: NKen Chalmers <ken.chalmers@amd.com>
Reviewed-by: NCharlene Liu <Charlene.Liu@amd.com>
Acked-by: NHarry Wentland <harry.wentland@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 245524d9
......@@ -1705,8 +1705,8 @@ enum dc_status dc_add_stream_to_ctx(
struct dc_context *dc_ctx = dc->ctx;
enum dc_status res;
if (new_ctx->stream_count >= dc->res_pool->pipe_count) {
DC_ERROR("Max streams reached, can add stream %p !\n", stream);
if (new_ctx->stream_count >= dc->res_pool->timing_generator_count) {
DC_ERROR("Max streams reached, can't add stream %p !\n", stream);
return DC_ERROR_UNEXPECTED;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册