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>
        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;
 
                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;
 }