drm/amd/display: Move Link Encoder Assignment Out Of dc_global_validate
authorAustin Zheng <Austin.Zheng@amd.com>
Thu, 26 Sep 2024 20:53:17 +0000 (16:53 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Oct 2024 18:16:37 +0000 (14:16 -0400)
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>
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/core/dc_resource.c

index 7b239cb..2d704c2 100644 (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;
index df513db..33125b9 100644 (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;
 }