drm/amd/display: Move Link Encoder Assignment Out Of dc_global_validate

Assigning link encoder is not relevant to validating bandwidth so move
the logic outside of dc_global_validate.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Austin Zheng <Austin.Zheng@amd.com>
Signed-off-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Austin Zheng 2024-09-26 16:53:17 -04:00 committed by Alex Deucher
parent 94d904aec1
commit 5c7cc114dd
2 changed files with 8 additions and 8 deletions

View File

@ -2187,6 +2187,14 @@ enum dc_status dc_commit_streams(struct dc *dc, struct dc_commit_streams_params
context->power_source = params->power_source;
res = dc_validate_with_context(dc, set, params->stream_count, context, false);
/*
* Only update link encoder to stream assignment after bandwidth validation passed.
*/
if (res == DC_OK && dc->res_pool->funcs->link_encs_assign)
dc->res_pool->funcs->link_encs_assign(
dc, context, context->streams, context->stream_count);
if (res != DC_OK) {
BREAK_TO_DEBUGGER();
goto fail;

View File

@ -4091,14 +4091,6 @@ enum dc_status dc_validate_global_state(
if (!dc->res_pool->funcs->validate_bandwidth(dc, new_ctx, fast_validate))
result = DC_FAIL_BANDWIDTH_VALIDATE;
/*
* Only update link encoder to stream assignment after bandwidth validation passed.
* TODO: Split out assignment and validation.
*/
if (result == DC_OK && dc->res_pool->funcs->link_encs_assign && fast_validate == false)
dc->res_pool->funcs->link_encs_assign(
dc, new_ctx, new_ctx->streams, new_ctx->stream_count);
return result;
}