Commit f3fac948 authored by Wenjing Liu's avatar Wenjing Liu Committed by Alex Deucher

drm/amd/display: populate link res in both detection and validation

[why]
This commit is to populate link res in preparation of the next commit.
The next commit will replace all existing code to use link res instead
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: default avatarJun Lei <Jun.Lei@amd.com>
Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ef30f441
...@@ -881,6 +881,7 @@ static bool dc_link_detect_helper(struct dc_link *link, ...@@ -881,6 +881,7 @@ static bool dc_link_detect_helper(struct dc_link *link,
enum dc_connection_type pre_connection_type = dc_connection_none; enum dc_connection_type pre_connection_type = dc_connection_none;
bool perform_dp_seamless_boot = false; bool perform_dp_seamless_boot = false;
const uint32_t post_oui_delay = 30; // 30ms const uint32_t post_oui_delay = 30; // 30ms
struct link_resource link_res = { 0 };
DC_LOGGER_INIT(link->ctx->logger); DC_LOGGER_INIT(link->ctx->logger);
...@@ -974,8 +975,10 @@ static bool dc_link_detect_helper(struct dc_link *link, ...@@ -974,8 +975,10 @@ static bool dc_link_detect_helper(struct dc_link *link,
} }
#if defined(CONFIG_DRM_AMD_DC_DCN) #if defined(CONFIG_DRM_AMD_DC_DCN)
if (dp_get_link_encoding_format(&link->reported_link_cap) == DP_128b_132b_ENCODING) if (dp_get_link_encoding_format(&link->reported_link_cap) == DP_128b_132b_ENCODING) {
add_dp_hpo_link_encoder_to_link(link); add_dp_hpo_link_encoder_to_link(link);
link_res.hpo_dp_link_enc = link->hpo_dp_link_enc;
}
#endif #endif
if (link->type == dc_connection_mst_branch) { if (link->type == dc_connection_mst_branch) {
...@@ -986,7 +989,7 @@ static bool dc_link_detect_helper(struct dc_link *link, ...@@ -986,7 +989,7 @@ static bool dc_link_detect_helper(struct dc_link *link,
* empty which leads to allocate_mst_payload() has "0" * empty which leads to allocate_mst_payload() has "0"
* pbn_per_slot value leading to exception on dc_fixpt_div() * pbn_per_slot value leading to exception on dc_fixpt_div()
*/ */
dp_verify_mst_link_cap(link, NULL); dp_verify_mst_link_cap(link, &link_res);
/* /*
* This call will initiate MST topology discovery. Which * This call will initiate MST topology discovery. Which
...@@ -1150,7 +1153,7 @@ static bool dc_link_detect_helper(struct dc_link *link, ...@@ -1150,7 +1153,7 @@ static bool dc_link_detect_helper(struct dc_link *link,
// verify link cap for SST non-seamless boot // verify link cap for SST non-seamless boot
if (!perform_dp_seamless_boot) if (!perform_dp_seamless_boot)
dp_verify_link_cap_with_retries(link, dp_verify_link_cap_with_retries(link,
NULL, &link_res,
&link->reported_link_cap, &link->reported_link_cap,
LINK_TRAINING_MAX_VERIFY_RETRY); LINK_TRAINING_MAX_VERIFY_RETRY);
} else { } else {
......
...@@ -2161,6 +2161,7 @@ enum dc_status resource_map_pool_resources( ...@@ -2161,6 +2161,7 @@ enum dc_status resource_map_pool_resources(
&context->res_ctx, pool, &context->res_ctx, pool,
pipe_ctx->stream_res.hpo_dp_stream_enc, pipe_ctx->stream_res.hpo_dp_stream_enc,
true); true);
pipe_ctx->link_res.hpo_dp_link_enc = stream->link->hpo_dp_link_enc;
} }
} }
#endif #endif
......
...@@ -336,7 +336,11 @@ struct plane_resource { ...@@ -336,7 +336,11 @@ struct plane_resource {
/* all mappable hardware resources used to enable a link */ /* all mappable hardware resources used to enable a link */
struct link_resource { struct link_resource {
#if defined(CONFIG_DRM_AMD_DC_DCN)
struct hpo_dp_link_encoder *hpo_dp_link_enc;
#else
void *dummy; void *dummy;
#endif
}; };
union pipe_update_flags { union pipe_update_flags {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment