diff options
author | Wenjing Liu | 2021-11-26 18:46:22 -0500 |
---|---|---|
committer | Alex Deucher | 2021-12-30 08:54:44 -0500 |
commit | f3fac9481bc7b9518df18f33b71a6109a245ccc6 (patch) | |
tree | b2f4e3c12a6a88dd2ea090d97169aeed7db0e316 /drivers/gpu | |
parent | ef30f441f6ac12875c9901e8ea1b9cfae6f0e8bf (diff) |
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: Daniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_link.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/inc/core_types.h | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c index 4130cd98f1ce..a394946ef513 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c @@ -881,6 +881,7 @@ static bool dc_link_detect_helper(struct dc_link *link, enum dc_connection_type pre_connection_type = dc_connection_none; bool perform_dp_seamless_boot = false; const uint32_t post_oui_delay = 30; // 30ms + struct link_resource link_res = { 0 }; DC_LOGGER_INIT(link->ctx->logger); @@ -974,8 +975,10 @@ static bool dc_link_detect_helper(struct dc_link *link, } #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); + link_res.hpo_dp_link_enc = link->hpo_dp_link_enc; + } #endif if (link->type == dc_connection_mst_branch) { @@ -986,7 +989,7 @@ static bool dc_link_detect_helper(struct dc_link *link, * empty which leads to allocate_mst_payload() has "0" * 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 @@ -1150,7 +1153,7 @@ static bool dc_link_detect_helper(struct dc_link *link, // verify link cap for SST non-seamless boot if (!perform_dp_seamless_boot) dp_verify_link_cap_with_retries(link, - NULL, + &link_res, &link->reported_link_cap, LINK_TRAINING_MAX_VERIFY_RETRY); } else { diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 0da692c9a543..60a9eb6e521f 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -2161,6 +2161,7 @@ enum dc_status resource_map_pool_resources( &context->res_ctx, pool, pipe_ctx->stream_res.hpo_dp_stream_enc, true); + pipe_ctx->link_res.hpo_dp_link_enc = stream->link->hpo_dp_link_enc; } } #endif diff --git a/drivers/gpu/drm/amd/display/dc/inc/core_types.h b/drivers/gpu/drm/amd/display/dc/inc/core_types.h index 9381ea0549d8..0bd28a332fcb 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/core_types.h +++ b/drivers/gpu/drm/amd/display/dc/inc/core_types.h @@ -336,7 +336,11 @@ struct plane_resource { /* all mappable hardware resources used to enable a link */ struct link_resource { +#if defined(CONFIG_DRM_AMD_DC_DCN) + struct hpo_dp_link_encoder *hpo_dp_link_enc; +#else void *dummy; +#endif }; union pipe_update_flags { |