Skip to content

Commit f3fac94

Browse files
Wenjing Liualexdeucher
authored andcommitted
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 <[email protected]> Reviewed-by: Jun Lei <[email protected]> Acked-by: Rodrigo Siqueira <[email protected]> Signed-off-by: Wenjing Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent ef30f44 commit f3fac94

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

drivers/gpu/drm/amd/display/dc/core/dc_link.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,7 @@ static bool dc_link_detect_helper(struct dc_link *link,
881881
enum dc_connection_type pre_connection_type = dc_connection_none;
882882
bool perform_dp_seamless_boot = false;
883883
const uint32_t post_oui_delay = 30; // 30ms
884+
struct link_resource link_res = { 0 };
884885

885886
DC_LOGGER_INIT(link->ctx->logger);
886887

@@ -974,8 +975,10 @@ static bool dc_link_detect_helper(struct dc_link *link,
974975
}
975976

976977
#if defined(CONFIG_DRM_AMD_DC_DCN)
977-
if (dp_get_link_encoding_format(&link->reported_link_cap) == DP_128b_132b_ENCODING)
978+
if (dp_get_link_encoding_format(&link->reported_link_cap) == DP_128b_132b_ENCODING) {
978979
add_dp_hpo_link_encoder_to_link(link);
980+
link_res.hpo_dp_link_enc = link->hpo_dp_link_enc;
981+
}
979982
#endif
980983

981984
if (link->type == dc_connection_mst_branch) {
@@ -986,7 +989,7 @@ static bool dc_link_detect_helper(struct dc_link *link,
986989
* empty which leads to allocate_mst_payload() has "0"
987990
* pbn_per_slot value leading to exception on dc_fixpt_div()
988991
*/
989-
dp_verify_mst_link_cap(link, NULL);
992+
dp_verify_mst_link_cap(link, &link_res);
990993

991994
/*
992995
* This call will initiate MST topology discovery. Which
@@ -1150,7 +1153,7 @@ static bool dc_link_detect_helper(struct dc_link *link,
11501153
// verify link cap for SST non-seamless boot
11511154
if (!perform_dp_seamless_boot)
11521155
dp_verify_link_cap_with_retries(link,
1153-
NULL,
1156+
&link_res,
11541157
&link->reported_link_cap,
11551158
LINK_TRAINING_MAX_VERIFY_RETRY);
11561159
} else {

drivers/gpu/drm/amd/display/dc/core/dc_resource.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,6 +2161,7 @@ enum dc_status resource_map_pool_resources(
21612161
&context->res_ctx, pool,
21622162
pipe_ctx->stream_res.hpo_dp_stream_enc,
21632163
true);
2164+
pipe_ctx->link_res.hpo_dp_link_enc = stream->link->hpo_dp_link_enc;
21642165
}
21652166
}
21662167
#endif

drivers/gpu/drm/amd/display/dc/inc/core_types.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,11 @@ struct plane_resource {
336336

337337
/* all mappable hardware resources used to enable a link */
338338
struct link_resource {
339+
#if defined(CONFIG_DRM_AMD_DC_DCN)
340+
struct hpo_dp_link_encoder *hpo_dp_link_enc;
341+
#else
339342
void *dummy;
343+
#endif
340344
};
341345

342346
union pipe_update_flags {

0 commit comments

Comments
 (0)