Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: convert link.h functions to function pointer style

[Why & How]
All dc subcomponents should call another dc component via function pointers
stored in a component structure. This is part of dc coding convention since
the beginning. The reason behind this is to improve encapsulation and
polymorphism. The function contract is extracted into a single link service
structure defined in link.h header file and implemented only in link_factory.c instead
of spreading across multiple files in link component file structure.

Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Wenjing Liu and committed by
Alex Deucher
98ce7d32 98ef3418

+799 -386
+2 -1
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 7184 7184 struct edid *edid = amdgpu_dm_connector->edid; 7185 7185 struct dc_link_settings *verified_link_cap = 7186 7186 &amdgpu_dm_connector->dc_link->verified_link_cap; 7187 + const struct dc *dc = amdgpu_dm_connector->dc_link->dc; 7187 7188 7188 7189 encoder = amdgpu_dm_connector_to_encoder(connector); 7189 7190 7190 7191 if (!drm_edid_is_valid(edid)) { 7191 7192 amdgpu_dm_connector->num_modes = 7192 7193 drm_add_modes_noedid(connector, 640, 480); 7193 - if (link_dp_get_encoding_format(verified_link_cap) == DP_128b_132b_ENCODING) 7194 + if (dc->link_srv->dp_get_encoding_format(verified_link_cap) == DP_128b_132b_ENCODING) 7194 7195 amdgpu_dm_connector->num_modes += 7195 7196 drm_add_modes_noedid(connector, 1920, 1080); 7196 7197 } else {
+1 -1
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
··· 2802 2802 struct dc_link *link = connector->dc_link; 2803 2803 u32 residency; 2804 2804 2805 - link_get_psr_residency(link, &residency); 2805 + link->dc->link_srv->edp_get_psr_residency(link, &residency); 2806 2806 2807 2807 *val = (u64)residency; 2808 2808
+2 -2
drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c
··· 116 116 if (!edp_link->psr_settings.psr_feature_enabled) 117 117 continue; 118 118 clk_mgr->psr_allow_active_cache = edp_link->psr_settings.psr_allow_active; 119 - dc_link_set_psr_allow_active(edp_link, &allow_active, false, false, NULL); 119 + dc->link_srv->edp_set_psr_allow_active(edp_link, &allow_active, false, false, NULL); 120 120 } 121 121 } 122 122 ··· 135 135 edp_link = edp_links[panel_inst]; 136 136 if (!edp_link->psr_settings.psr_feature_enabled) 137 137 continue; 138 - dc_link_set_psr_allow_active(edp_link, 138 + dc->link_srv->edp_set_psr_allow_active(edp_link, 139 139 &clk_mgr->psr_allow_active_cache, false, false, NULL); 140 140 } 141 141 }
+20 -13
drivers/gpu/drm/amd/display/dc/core/dc.c
··· 148 148 149 149 for (i = 0; i < dc->link_count; i++) { 150 150 if (NULL != dc->links[i]) 151 - link_destroy(&dc->links[i]); 151 + dc->link_srv->destroy_link(&dc->links[i]); 152 152 } 153 153 } 154 154 ··· 217 217 link_init_params.connector_index = i; 218 218 link_init_params.link_index = dc->link_count; 219 219 link_init_params.dc = dc; 220 - link = link_create(&link_init_params); 220 + link = dc->link_srv->create_link(&link_init_params); 221 221 222 222 if (link) { 223 223 dc->links[dc->link_count] = link; ··· 239 239 link_init_params.dc = dc; 240 240 link_init_params.is_dpia_link = true; 241 241 242 - link = link_create(&link_init_params); 242 + link = dc->link_srv->create_link(&link_init_params); 243 243 if (link) { 244 244 dc->links[dc->link_count] = link; 245 245 link->dc = dc; ··· 823 823 824 824 dc_destroy_resource_pool(dc); 825 825 826 + if (dc->link_srv) 827 + link_destroy_link_service(&dc->link_srv); 828 + 826 829 if (dc->ctx->gpio_service) 827 830 dal_gpio_service_destroy(&dc->ctx->gpio_service); 828 831 ··· 985 982 goto fail; 986 983 } 987 984 988 - dc->link_srv = link_get_link_service(); 985 + dc->link_srv = link_create_link_service(); 989 986 990 987 dc->res_pool = dc_create_resource_pool(dc, init_params, dc_ctx->dce_version); 991 988 if (!dc->res_pool) ··· 1266 1263 pipe->stream_res.pix_clk_params.requested_pix_clk_100hz; 1267 1264 1268 1265 if (pix_clk_100hz != requested_pix_clk_100hz) { 1269 - link_set_dpms_off(pipe); 1266 + dc->link_srv->set_dpms_off(pipe); 1270 1267 pipe->stream->dpms_off = false; 1271 1268 } 1272 1269 } ··· 1721 1718 return false; 1722 1719 } 1723 1720 1724 - if (link_is_edp_ilr_optimization_required(link, crtc_timing)) { 1721 + if (dc->link_srv->edp_is_ilr_optimization_required(link, crtc_timing)) { 1725 1722 DC_LOG_EVENT_LINK_TRAINING("Seamless boot disabled to optimize eDP link rate\n"); 1726 1723 return false; 1727 1724 } ··· 3195 3192 dc->hwss.update_info_frame(pipe_ctx); 3196 3193 3197 3194 if (dc_is_dp_signal(pipe_ctx->stream->signal)) 3198 - link_dp_source_sequence_trace(pipe_ctx->stream->link, DPCD_SOURCE_SEQ_AFTER_UPDATE_INFO_FRAME); 3195 + dc->link_srv->dp_trace_source_sequence( 3196 + pipe_ctx->stream->link, 3197 + DPCD_SOURCE_SEQ_AFTER_UPDATE_INFO_FRAME); 3199 3198 } 3200 3199 3201 3200 if (stream_update->hdr_static_metadata && ··· 3233 3228 continue; 3234 3229 3235 3230 if (stream_update->dsc_config) 3236 - link_update_dsc_config(pipe_ctx); 3231 + dc->link_srv->update_dsc_config(pipe_ctx); 3237 3232 3238 3233 if (stream_update->mst_bw_update) { 3239 3234 if (stream_update->mst_bw_update->is_increase) 3240 - link_increase_mst_payload(pipe_ctx, stream_update->mst_bw_update->mst_stream_bw); 3235 + dc->link_srv->increase_mst_payload(pipe_ctx, 3236 + stream_update->mst_bw_update->mst_stream_bw); 3241 3237 else 3242 - link_reduce_mst_payload(pipe_ctx, stream_update->mst_bw_update->mst_stream_bw); 3238 + dc->link_srv->reduce_mst_payload(pipe_ctx, 3239 + stream_update->mst_bw_update->mst_stream_bw); 3243 3240 } 3244 3241 3245 3242 if (stream_update->pending_test_pattern) { ··· 3255 3248 3256 3249 if (stream_update->dpms_off) { 3257 3250 if (*stream_update->dpms_off) { 3258 - link_set_dpms_off(pipe_ctx); 3251 + dc->link_srv->set_dpms_off(pipe_ctx); 3259 3252 /* for dpms, keep acquired resources*/ 3260 3253 if (pipe_ctx->stream_res.audio && !dc->debug.az_endpoint_mute_only) 3261 3254 pipe_ctx->stream_res.audio->funcs->az_disable(pipe_ctx->stream_res.audio); ··· 3265 3258 } else { 3266 3259 if (get_seamless_boot_stream_count(context) == 0) 3267 3260 dc->hwss.prepare_bandwidth(dc, dc->current_state); 3268 - link_set_dpms_on(dc->current_state, pipe_ctx); 3261 + dc->link_srv->set_dpms_on(dc->current_state, pipe_ctx); 3269 3262 } 3270 3263 } 3271 3264 ··· 4329 4322 uint32_t i; 4330 4323 4331 4324 for (i = 0; i < dc->link_count; i++) 4332 - link_resume(dc->links[i]); 4325 + dc->link_srv->resume(dc->links[i]); 4333 4326 } 4334 4327 4335 4328 bool dc_is_dmcu_initialized(struct dc *dc)
+7 -6
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
··· 2213 2213 del_pipe->stream_res.stream_enc, 2214 2214 false); 2215 2215 2216 - if (link_is_dp_128b_132b_signal(del_pipe)) { 2216 + if (dc->link_srv->dp_is_128b_132b_signal(del_pipe)) { 2217 2217 update_hpo_dp_stream_engine_usage( 2218 2218 &new_ctx->res_ctx, dc->res_pool, 2219 2219 del_pipe->stream_res.hpo_dp_stream_enc, ··· 2513 2513 * and link settings 2514 2514 */ 2515 2515 if (dc_is_dp_signal(stream->signal)) { 2516 - if (!link_decide_link_settings(stream, &pipe_ctx->link_config.dp_link_settings)) 2516 + if (!dc->link_srv->dp_decide_link_settings(stream, &pipe_ctx->link_config.dp_link_settings)) 2517 2517 return DC_FAIL_DP_LINK_BANDWIDTH; 2518 - if (link_dp_get_encoding_format(&pipe_ctx->link_config.dp_link_settings) == DP_128b_132b_ENCODING) { 2518 + if (dc->link_srv->dp_get_encoding_format( 2519 + &pipe_ctx->link_config.dp_link_settings) == DP_128b_132b_ENCODING) { 2519 2520 pipe_ctx->stream_res.hpo_dp_stream_enc = 2520 2521 find_first_free_match_hpo_dp_stream_enc_for_link( 2521 2522 &context->res_ctx, pool, stream); ··· 3686 3685 /* TODO: validate audio ASIC caps, encoder */ 3687 3686 3688 3687 if (res == DC_OK) 3689 - res = link_validate_mode_timing(stream, 3688 + res = dc->link_srv->validate_mode_timing(stream, 3690 3689 link, 3691 3690 &stream->timing); 3692 3691 ··· 3813 3812 3814 3813 memset(link_res, 0, sizeof(*link_res)); 3815 3814 3816 - if (link_dp_get_encoding_format(link_settings) == DP_128b_132b_ENCODING) { 3815 + if (dc->link_srv->dp_get_encoding_format(link_settings) == DP_128b_132b_ENCODING) { 3817 3816 link_res->hpo_dp_link_enc = get_temp_hpo_dp_link_enc(res_ctx, 3818 3817 dc->res_pool, link); 3819 3818 if (!link_res->hpo_dp_link_enc) ··· 4047 4046 struct dc_state *context, 4048 4047 struct pipe_ctx *pipe_ctx) 4049 4048 { 4050 - if (link_dp_get_encoding_format(&pipe_ctx->link_config.dp_link_settings) == DP_128b_132b_ENCODING) { 4049 + if (dc->link_srv->dp_get_encoding_format(&pipe_ctx->link_config.dp_link_settings) == DP_128b_132b_ENCODING) { 4051 4050 if (pipe_ctx->stream_res.hpo_dp_stream_enc == NULL) { 4052 4051 pipe_ctx->stream_res.hpo_dp_stream_enc = 4053 4052 find_first_free_match_hpo_dp_stream_enc_for_link(
+6 -7
drivers/gpu/drm/amd/display/dc/dc.h
··· 889 889 890 890 uint8_t link_count; 891 891 struct dc_link *links[MAX_PIPES * 2]; 892 - const struct link_service *link_srv; 892 + struct link_service *link_srv; 893 893 894 894 struct dc_state *current_state; 895 895 struct resource_pool *res_pool; ··· 1370 1370 1371 1371 uint32_t dc_get_opp_for_plane(struct dc *dc, struct dc_plane_state *plane); 1372 1372 1373 + /* The function returns minimum bandwidth required to drive a given timing 1374 + * return - minimum required timing bandwidth in kbps. 1375 + */ 1376 + uint32_t dc_bandwidth_in_kbps_from_timing(const struct dc_crtc_timing *timing); 1377 + 1373 1378 /* Link Interfaces */ 1374 1379 /* 1375 1380 * A link contains one or more sinks and their connected status. ··· 1728 1723 uint32_t dc_link_bandwidth_kbps( 1729 1724 const struct dc_link *link, 1730 1725 const struct dc_link_settings *link_setting); 1731 - 1732 - /* The function returns minimum bandwidth required to drive a given timing 1733 - * return - minimum required timing bandwidth in kbps. 1734 - */ 1735 - uint32_t dc_bandwidth_in_kbps_from_timing( 1736 - const struct dc_crtc_timing *timing); 1737 1726 1738 1727 /* The function takes a snapshot of current link resource allocation state 1739 1728 * @dc: pointer to dc of the dm calling this
+30 -30
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
··· 741 741 742 742 /* obtain HPD */ 743 743 /* TODO what to do with this? */ 744 - hpd = link_get_hpd_gpio(ctx->dc_bios, connector, ctx->gpio_service); 744 + hpd = ctx->dc->link_srv->get_hpd_gpio(ctx->dc_bios, connector, ctx->gpio_service); 745 745 746 746 if (!hpd) { 747 747 BREAK_TO_DEBUGGER(); ··· 809 809 div64_u64(dm_get_elapse_time_in_ns( 810 810 ctx, 811 811 current_ts, 812 - link_dp_trace_get_edp_poweroff_timestamp(link)), 1000000); 812 + ctx->dc->link_srv->dp_trace_get_edp_poweroff_timestamp(link)), 1000000); 813 813 unsigned long long time_since_edp_poweron_ms = 814 814 div64_u64(dm_get_elapse_time_in_ns( 815 815 ctx, 816 816 current_ts, 817 - link_dp_trace_get_edp_poweron_timestamp(link)), 1000000); 817 + ctx->dc->link_srv->dp_trace_get_edp_poweron_timestamp(link)), 1000000); 818 818 DC_LOG_HW_RESUME_S3( 819 819 "%s: transition: power_up=%d current_ts=%llu edp_poweroff=%llu edp_poweron=%llu time_since_edp_poweroff_ms=%llu time_since_edp_poweron_ms=%llu", 820 820 __func__, 821 821 power_up, 822 822 current_ts, 823 - link_dp_trace_get_edp_poweroff_timestamp(link), 824 - link_dp_trace_get_edp_poweron_timestamp(link), 823 + ctx->dc->link_srv->dp_trace_get_edp_poweroff_timestamp(link), 824 + ctx->dc->link_srv->dp_trace_get_edp_poweron_timestamp(link), 825 825 time_since_edp_poweroff_ms, 826 826 time_since_edp_poweron_ms); 827 827 ··· 836 836 link->panel_config.pps.extra_t12_ms; 837 837 838 838 /* Adjust remaining_min_edp_poweroff_time_ms if this is not the first time. */ 839 - if (link_dp_trace_get_edp_poweroff_timestamp(link) != 0) { 839 + if (ctx->dc->link_srv->dp_trace_get_edp_poweroff_timestamp(link) != 0) { 840 840 if (time_since_edp_poweroff_ms < remaining_min_edp_poweroff_time_ms) 841 841 remaining_min_edp_poweroff_time_ms = 842 842 remaining_min_edp_poweroff_time_ms - time_since_edp_poweroff_ms; ··· 896 896 __func__, (power_up ? "On":"Off"), 897 897 bp_result); 898 898 899 - link_dp_trace_set_edp_power_timestamp(link, power_up); 899 + ctx->dc->link_srv->dp_trace_set_edp_power_timestamp(link, power_up); 900 900 901 901 DC_LOG_HW_RESUME_S3( 902 902 "%s: updated values: edp_poweroff=%llu edp_poweron=%llu\n", 903 903 __func__, 904 - link_dp_trace_get_edp_poweroff_timestamp(link), 905 - link_dp_trace_get_edp_poweron_timestamp(link)); 904 + ctx->dc->link_srv->dp_trace_get_edp_poweroff_timestamp(link), 905 + ctx->dc->link_srv->dp_trace_get_edp_poweron_timestamp(link)); 906 906 907 907 if (bp_result != BP_RESULT_OK) 908 908 DC_LOG_ERROR( ··· 930 930 return; 931 931 932 932 if (!link->panel_cntl->funcs->is_panel_powered_on(link->panel_cntl) && 933 - link_dp_trace_get_edp_poweroff_timestamp(link) != 0) { 933 + ctx->dc->link_srv->dp_trace_get_edp_poweroff_timestamp(link) != 0) { 934 934 unsigned int t12_duration = 500; // Default T12 as per spec 935 935 unsigned long long current_ts = dm_get_timestamp(ctx); 936 936 unsigned long long time_since_edp_poweroff_ms = 937 937 div64_u64(dm_get_elapse_time_in_ns( 938 938 ctx, 939 939 current_ts, 940 - link_dp_trace_get_edp_poweroff_timestamp(link)), 1000000); 940 + ctx->dc->link_srv->dp_trace_get_edp_poweroff_timestamp(link)), 1000000); 941 941 942 942 t12_duration += link->panel_config.pps.extra_t12_ms; // Add extra T12 943 943 ··· 1018 1018 * we shouldn't be doing power-sequencing, hence we can skip 1019 1019 * waiting for T7-ready. 1020 1020 */ 1021 - link_edp_receiver_ready_T7(link); 1021 + ctx->dc->link_srv->edp_receiver_ready_T7(link); 1022 1022 else 1023 1023 DC_LOG_DC("edp_receiver_ready_T7 skipped\n"); 1024 1024 } ··· 1049 1049 if (link->dpcd_sink_ext_caps.bits.oled || 1050 1050 link->dpcd_sink_ext_caps.bits.hdr_aux_backlight_control == 1 || 1051 1051 link->dpcd_sink_ext_caps.bits.sdr_aux_backlight_control == 1) 1052 - link_backlight_enable_aux(link, enable); 1052 + ctx->dc->link_srv->edp_backlight_enable_aux(link, enable); 1053 1053 1054 1054 /*edp 1.2*/ 1055 1055 if (cntl.action == TRANSMITTER_CONTROL_BACKLIGHT_OFF) { ··· 1061 1061 * we shouldn't be doing power-sequencing, hence we can skip 1062 1062 * waiting for T9-ready. 1063 1063 */ 1064 - link_edp_add_delay_for_T9(link); 1064 + ctx->dc->link_srv->edp_add_delay_for_T9(link); 1065 1065 else 1066 1066 DC_LOG_DC("edp_receiver_ready_T9 skipped\n"); 1067 1067 } ··· 1161 1161 pipe_ctx->stream_res.stream_enc); 1162 1162 } 1163 1163 1164 - if (link_is_dp_128b_132b_signal(pipe_ctx)) { 1164 + if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) { 1165 1165 pipe_ctx->stream_res.hpo_dp_stream_enc->funcs->stop_dp_info_packets( 1166 1166 pipe_ctx->stream_res.hpo_dp_stream_enc); 1167 1167 } else if (dc_is_dp_signal(pipe_ctx->stream->signal)) ··· 1172 1172 1173 1173 link_hwss->reset_stream_encoder(pipe_ctx); 1174 1174 1175 - if (link_is_dp_128b_132b_signal(pipe_ctx)) { 1175 + if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) { 1176 1176 dto_params.otg_inst = tg->inst; 1177 1177 dto_params.timing = &pipe_ctx->stream->timing; 1178 1178 dp_hpo_inst = pipe_ctx->stream_res.hpo_dp_stream_enc->inst; ··· 1181 1181 dccg->funcs->set_dpstreamclk(dccg, REFCLK, tg->inst, dp_hpo_inst); 1182 1182 } 1183 1183 1184 - if (link_is_dp_128b_132b_signal(pipe_ctx)) { 1184 + if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) { 1185 1185 /* TODO: This looks like a bug to me as we are disabling HPO IO when 1186 1186 * we are just disabling a single HPO stream. Shouldn't we disable HPO 1187 1187 * HW control only when HPOs for all streams are disabled? ··· 1223 1223 link->dc->hwss.set_abm_immediate_disable(pipe_ctx); 1224 1224 } 1225 1225 1226 - if (link_is_dp_128b_132b_signal(pipe_ctx)) { 1226 + if (link->dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) { 1227 1227 /* TODO - DP2.0 HW: Set ODM mode in dp hpo encoder here */ 1228 1228 pipe_ctx->stream_res.hpo_dp_stream_enc->funcs->dp_blank( 1229 1229 pipe_ctx->stream_res.hpo_dp_stream_enc); ··· 1245 1245 * we shouldn't be doing power-sequencing, hence we can skip 1246 1246 * waiting for T9-ready. 1247 1247 */ 1248 - link_edp_receiver_ready_T9(link); 1248 + link->dc->link_srv->edp_receiver_ready_T9(link); 1249 1249 } 1250 1250 } 1251 1251 } ··· 1428 1428 if (false == pipe_ctx->clock_source->funcs->program_pix_clk( 1429 1429 pipe_ctx->clock_source, 1430 1430 &pipe_ctx->stream_res.pix_clk_params, 1431 - link_dp_get_encoding_format(&pipe_ctx->link_config.dp_link_settings), 1431 + dc->link_srv->dp_get_encoding_format(&pipe_ctx->link_config.dp_link_settings), 1432 1432 &pipe_ctx->pll_settings)) { 1433 1433 BREAK_TO_DEBUGGER(); 1434 1434 return DC_ERROR_UNEXPECTED; ··· 1532 1532 * To do so, move calling function enable_stream_timing to only be done AFTER calling 1533 1533 * function core_link_enable_stream 1534 1534 */ 1535 - if (!(hws->wa.dp_hpo_and_otg_sequence && link_is_dp_128b_132b_signal(pipe_ctx))) 1535 + if (!(hws->wa.dp_hpo_and_otg_sequence && dc->link_srv->dp_is_128b_132b_signal(pipe_ctx))) 1536 1536 /* */ 1537 1537 /* Do not touch stream timing on seamless boot optimization. */ 1538 1538 if (!pipe_ctx->stream->apply_seamless_boot_optimization) ··· 1564 1564 pipe_ctx->stream_res.tg->inst); 1565 1565 1566 1566 if (dc_is_dp_signal(pipe_ctx->stream->signal)) 1567 - link_dp_source_sequence_trace(link, DPCD_SOURCE_SEQ_AFTER_CONNECT_DIG_FE_OTG); 1567 + dc->link_srv->dp_trace_source_sequence(link, DPCD_SOURCE_SEQ_AFTER_CONNECT_DIG_FE_OTG); 1568 1568 1569 1569 if (!stream->dpms_off) 1570 - link_set_dpms_on(context, pipe_ctx); 1570 + dc->link_srv->set_dpms_on(context, pipe_ctx); 1571 1571 1572 1572 /* DCN3.1 FPGA Workaround 1573 1573 * Need to enable HPO DP Stream Encoder before setting OTG master enable. 1574 1574 * To do so, move calling function enable_stream_timing to only be done AFTER calling 1575 1575 * function core_link_enable_stream 1576 1576 */ 1577 - if (hws->wa.dp_hpo_and_otg_sequence && link_is_dp_128b_132b_signal(pipe_ctx)) { 1577 + if (hws->wa.dp_hpo_and_otg_sequence && dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) { 1578 1578 if (!pipe_ctx->stream->apply_seamless_boot_optimization) 1579 1579 hws->funcs.enable_stream_timing(pipe_ctx, context, dc); 1580 1580 } ··· 1600 1600 for (i = 0; i < dc->link_count; i++) { 1601 1601 enum signal_type signal = dc->links[i]->connector_signal; 1602 1602 1603 - link_blank_dp_stream(dc->links[i], false); 1603 + dc->link_srv->blank_dp_stream(dc->links[i], false); 1604 1604 1605 1605 if (signal != SIGNAL_TYPE_EDP) 1606 1606 signal = SIGNAL_TYPE_NONE; ··· 2083 2083 * disabled already, no need to disable again. 2084 2084 */ 2085 2085 if (!pipe_ctx->stream || !pipe_ctx->stream->dpms_off) { 2086 - link_set_dpms_off(pipe_ctx_old); 2086 + dc->link_srv->set_dpms_off(pipe_ctx_old); 2087 2087 2088 2088 /* free acquired resources*/ 2089 2089 if (pipe_ctx_old->stream_res.audio) { ··· 3054 3054 pipes[i].clock_source->funcs->program_pix_clk( 3055 3055 pipes[i].clock_source, 3056 3056 &pipes[i].stream_res.pix_clk_params, 3057 - link_dp_get_encoding_format(link_settings), 3057 + dc->link_srv->dp_get_encoding_format(link_settings), 3058 3058 &pipes[i].pll_settings); 3059 3059 } 3060 3060 } 3061 3061 } 3062 3062 3063 - if (link_dp_get_encoding_format(link_settings) == DP_8b_10b_ENCODING) { 3063 + if (dc->link_srv->dp_get_encoding_format(link_settings) == DP_8b_10b_ENCODING) { 3064 3064 if (dc->clk_mgr->funcs->notify_link_rate_change) 3065 3065 dc->clk_mgr->funcs->notify_link_rate_change(dc->clk_mgr, link); 3066 3066 } ··· 3077 3077 if (dmcu != NULL && dmcu->funcs->unlock_phy) 3078 3078 dmcu->funcs->unlock_phy(dmcu); 3079 3079 3080 - link_dp_source_sequence_trace(link, DPCD_SOURCE_SEQ_AFTER_ENABLE_LINK_PHY); 3080 + dc->link_srv->dp_trace_source_sequence(link, DPCD_SOURCE_SEQ_AFTER_ENABLE_LINK_PHY); 3081 3081 } 3082 3082 3083 3083 void dce110_disable_link_output(struct dc_link *link, ··· 3102 3102 link->dc->hwss.edp_power_control(link, false); 3103 3103 else if (dmcu != NULL && dmcu->funcs->lock_phy) 3104 3104 dmcu->funcs->unlock_phy(dmcu); 3105 - link_dp_source_sequence_trace(link, DPCD_SOURCE_SEQ_AFTER_DISABLE_LINK_PHY); 3105 + dc->link_srv->dp_trace_source_sequence(link, DPCD_SOURCE_SEQ_AFTER_DISABLE_LINK_PHY); 3106 3106 } 3107 3107 3108 3108 static const struct hw_sequencer_funcs dce110_funcs = {
+3 -3
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
··· 919 919 if (false == pipe_ctx->clock_source->funcs->program_pix_clk( 920 920 pipe_ctx->clock_source, 921 921 &pipe_ctx->stream_res.pix_clk_params, 922 - link_dp_get_encoding_format(&pipe_ctx->link_config.dp_link_settings), 922 + dc->link_srv->dp_get_encoding_format(&pipe_ctx->link_config.dp_link_settings), 923 923 &pipe_ctx->pll_settings)) { 924 924 BREAK_TO_DEBUGGER(); 925 925 return DC_ERROR_UNEXPECTED; ··· 1017 1017 * VBIOS lit up eDP, so check link status too. 1018 1018 */ 1019 1019 if (!pipe_ctx->stream->dpms_off || link->link_status.link_active) 1020 - link_set_dpms_off(pipe_ctx); 1020 + dc->link_srv->set_dpms_off(pipe_ctx); 1021 1021 else if (pipe_ctx->stream_res.audio) 1022 1022 dc->hwss.disable_audio_stream(pipe_ctx); 1023 1023 ··· 1564 1564 } 1565 1565 1566 1566 /* we want to turn off all dp displays before doing detection */ 1567 - link_blank_all_dp_displays(dc); 1567 + dc->link_srv->blank_all_dp_displays(dc); 1568 1568 1569 1569 if (hws->funcs.enable_power_gating_plane) 1570 1570 hws->funcs.enable_power_gating_plane(dc->hwseq, true);
+4 -3
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c
··· 933 933 /* disable DP stream */ 934 934 REG_UPDATE(DP_VID_STREAM_CNTL, DP_VID_STREAM_ENABLE, 0); 935 935 936 - link_dp_source_sequence_trace(link, DPCD_SOURCE_SEQ_AFTER_DISABLE_DP_VID_STREAM); 936 + link->dc->link_srv->dp_trace_source_sequence(link, DPCD_SOURCE_SEQ_AFTER_DISABLE_DP_VID_STREAM); 937 937 938 938 /* the encoder stops sending the video stream 939 939 * at the start of the vertical blanking. ··· 952 952 953 953 REG_UPDATE(DP_STEER_FIFO, DP_STEER_FIFO_RESET, true); 954 954 955 - link_dp_source_sequence_trace(link, DPCD_SOURCE_SEQ_AFTER_FIFO_STEER_RESET); 955 + link->dc->link_srv->dp_trace_source_sequence(link, DPCD_SOURCE_SEQ_AFTER_FIFO_STEER_RESET); 956 956 } 957 957 958 958 /* output video stream to link encoder */ ··· 1025 1025 1026 1026 REG_UPDATE(DP_VID_STREAM_CNTL, DP_VID_STREAM_ENABLE, true); 1027 1027 1028 - link_dp_source_sequence_trace(link, DPCD_SOURCE_SEQ_AFTER_ENABLE_DP_VID_STREAM); 1028 + link->dc->link_srv->dp_trace_source_sequence(link, 1029 + DPCD_SOURCE_SEQ_AFTER_ENABLE_DP_VID_STREAM); 1029 1030 } 1030 1031 1031 1032 void enc1_stream_encoder_set_avmute(
+7 -7
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
··· 720 720 if (false == pipe_ctx->clock_source->funcs->program_pix_clk( 721 721 pipe_ctx->clock_source, 722 722 &pipe_ctx->stream_res.pix_clk_params, 723 - link_dp_get_encoding_format(&pipe_ctx->link_config.dp_link_settings), 723 + dc->link_srv->dp_get_encoding_format(&pipe_ctx->link_config.dp_link_settings), 724 724 &pipe_ctx->pll_settings)) { 725 725 BREAK_TO_DEBUGGER(); 726 726 return DC_ERROR_UNEXPECTED; ··· 2405 2405 2406 2406 params.link_settings.link_rate = link_settings->link_rate; 2407 2407 2408 - if (link_is_dp_128b_132b_signal(pipe_ctx)) { 2408 + if (link->dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) { 2409 2409 /* TODO - DP2.0 HW: Set ODM mode in dp hpo encoder here */ 2410 2410 pipe_ctx->stream_res.hpo_dp_stream_enc->funcs->dp_unblank( 2411 2411 pipe_ctx->stream_res.hpo_dp_stream_enc, ··· 2458 2458 * VBIOS lit up eDP, so check link status too. 2459 2459 */ 2460 2460 if (!pipe_ctx->stream->dpms_off || link->link_status.link_active) 2461 - link_set_dpms_off(pipe_ctx); 2461 + dc->link_srv->set_dpms_off(pipe_ctx); 2462 2462 else if (pipe_ctx->stream_res.audio) 2463 2463 dc->hwss.disable_audio_stream(pipe_ctx); 2464 2464 ··· 2478 2478 } 2479 2479 } 2480 2480 else if (pipe_ctx->stream_res.dsc) { 2481 - link_set_dsc_enable(pipe_ctx, false); 2481 + dc->link_srv->set_dsc_enable(pipe_ctx, false); 2482 2482 } 2483 2483 2484 2484 /* by upper caller loop, parent pipe: pipe0, will be reset last. ··· 2713 2713 unsigned int k1_div = PIXEL_RATE_DIV_NA; 2714 2714 unsigned int k2_div = PIXEL_RATE_DIV_NA; 2715 2715 2716 - if (link_is_dp_128b_132b_signal(pipe_ctx)) { 2716 + if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) { 2717 2717 if (dc->hwseq->funcs.setup_hpo_hw_control) 2718 2718 dc->hwseq->funcs.setup_hpo_hw_control(dc->hwseq, true); 2719 2719 } 2720 2720 2721 - if (link_is_dp_128b_132b_signal(pipe_ctx)) { 2721 + if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) { 2722 2722 dp_hpo_inst = pipe_ctx->stream_res.hpo_dp_stream_enc->inst; 2723 2723 dccg->funcs->set_dpstreamclk(dccg, DTBCLK0, tg->inst, dp_hpo_inst); 2724 2724 ··· 2752 2752 dc->hwss.update_info_frame(pipe_ctx); 2753 2753 2754 2754 if (dc_is_dp_signal(pipe_ctx->stream->signal)) 2755 - link_dp_source_sequence_trace(link, DPCD_SOURCE_SEQ_AFTER_UPDATE_INFO_FRAME); 2755 + dc->link_srv->dp_trace_source_sequence(link, DPCD_SOURCE_SEQ_AFTER_UPDATE_INFO_FRAME); 2756 2756 2757 2757 /* enable early control to avoid corruption on DP monitor*/ 2758 2758 active_total_with_borders =
+6 -3
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
··· 1211 1211 if (pool->base.pp_smu != NULL) 1212 1212 dcn20_pp_smu_destroy(&pool->base.pp_smu); 1213 1213 1214 - if (pool->base.oem_device != NULL) 1215 - link_destroy_ddc_service(&pool->base.oem_device); 1214 + if (pool->base.oem_device != NULL) { 1215 + struct dc *dc = pool->base.oem_device->ctx->dc; 1216 + 1217 + dc->link_srv->destroy_ddc_service(&pool->base.oem_device); 1218 + } 1216 1219 } 1217 1220 1218 1221 struct hubp *dcn20_hubp_create( ··· 2766 2763 ddc_init_data.id.id = dc->ctx->dc_bios->fw_info.oem_i2c_obj_id; 2767 2764 ddc_init_data.id.enum_id = 0; 2768 2765 ddc_init_data.id.type = OBJECT_TYPE_GENERIC; 2769 - pool->base.oem_device = link_create_ddc_service(&ddc_init_data); 2766 + pool->base.oem_device = dc->link_srv->create_ddc_service(&ddc_init_data); 2770 2767 } else { 2771 2768 pool->base.oem_device = NULL; 2772 2769 }
+2 -1
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.c
··· 546 546 547 547 REG_UPDATE(DP_VID_STREAM_CNTL, DP_VID_STREAM_ENABLE, true); 548 548 549 - link_dp_source_sequence_trace(link, DPCD_SOURCE_SEQ_AFTER_ENABLE_DP_VID_STREAM); 549 + link->dc->link_srv->dp_trace_source_sequence(link, 550 + DPCD_SOURCE_SEQ_AFTER_ENABLE_DP_VID_STREAM); 550 551 } 551 552 552 553 static void enc2_dp_set_odm_combine(
+2 -2
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c
··· 132 132 return; 133 133 134 134 pipe_ctx->stream->dpms_off = false; 135 - link_set_dpms_on(context, pipe_ctx); 136 - link_set_dpms_off(pipe_ctx); 135 + pipe_ctx->stream->ctx->dc->link_srv->set_dpms_on(context, pipe_ctx); 136 + pipe_ctx->stream->ctx->dc->link_srv->set_dpms_off(pipe_ctx); 137 137 pipe_ctx->stream->dpms_off = true; 138 138 } 139 139
+1 -1
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
··· 532 532 } 533 533 534 534 /* we want to turn off all dp displays before doing detection */ 535 - link_blank_all_dp_displays(dc); 535 + dc->link_srv->blank_all_dp_displays(dc); 536 536 537 537 if (hws->funcs.enable_power_gating_plane) 538 538 hws->funcs.enable_power_gating_plane(dc->hwseq, true);
+6 -3
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c
··· 1205 1205 if (pool->base.dccg != NULL) 1206 1206 dcn_dccg_destroy(&pool->base.dccg); 1207 1207 1208 - if (pool->base.oem_device != NULL) 1209 - link_destroy_ddc_service(&pool->base.oem_device); 1208 + if (pool->base.oem_device != NULL) { 1209 + struct dc *dc = pool->base.oem_device->ctx->dc; 1210 + 1211 + dc->link_srv->destroy_ddc_service(&pool->base.oem_device); 1212 + } 1210 1213 } 1211 1214 1212 1215 static struct hubp *dcn30_hubp_create( ··· 2593 2590 ddc_init_data.id.id = dc->ctx->dc_bios->fw_info.oem_i2c_obj_id; 2594 2591 ddc_init_data.id.enum_id = 0; 2595 2592 ddc_init_data.id.type = OBJECT_TYPE_GENERIC; 2596 - pool->base.oem_device = link_create_ddc_service(&ddc_init_data); 2593 + pool->base.oem_device = dc->link_srv->create_ddc_service(&ddc_init_data); 2597 2594 } else { 2598 2595 pool->base.oem_device = NULL; 2599 2596 }
+6 -3
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
··· 1125 1125 if (pool->dccg != NULL) 1126 1126 dcn_dccg_destroy(&pool->dccg); 1127 1127 1128 - if (pool->oem_device != NULL) 1129 - link_destroy_ddc_service(&pool->oem_device); 1128 + if (pool->oem_device != NULL) { 1129 + struct dc *dc = pool->oem_device->ctx->dc; 1130 + 1131 + dc->link_srv->destroy_ddc_service(&pool->oem_device); 1132 + } 1130 1133 } 1131 1134 1132 1135 static void dcn302_destroy_resource_pool(struct resource_pool **pool) ··· 1509 1506 ddc_init_data.id.id = dc->ctx->dc_bios->fw_info.oem_i2c_obj_id; 1510 1507 ddc_init_data.id.enum_id = 0; 1511 1508 ddc_init_data.id.type = OBJECT_TYPE_GENERIC; 1512 - pool->oem_device = link_create_ddc_service(&ddc_init_data); 1509 + pool->oem_device = dc->link_srv->create_ddc_service(&ddc_init_data); 1513 1510 } else { 1514 1511 pool->oem_device = NULL; 1515 1512 }
+6 -3
drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
··· 1051 1051 if (pool->dccg != NULL) 1052 1052 dcn_dccg_destroy(&pool->dccg); 1053 1053 1054 - if (pool->oem_device != NULL) 1055 - link_destroy_ddc_service(&pool->oem_device); 1054 + if (pool->oem_device != NULL) { 1055 + struct dc *dc = pool->oem_device->ctx->dc; 1056 + 1057 + dc->link_srv->destroy_ddc_service(&pool->oem_device); 1058 + } 1056 1059 } 1057 1060 1058 1061 static void dcn303_destroy_resource_pool(struct resource_pool **pool) ··· 1420 1417 ddc_init_data.id.id = dc->ctx->dc_bios->fw_info.oem_i2c_obj_id; 1421 1418 ddc_init_data.id.enum_id = 0; 1422 1419 ddc_init_data.id.type = OBJECT_TYPE_GENERIC; 1423 - pool->oem_device = link_create_ddc_service(&ddc_init_data); 1420 + pool->oem_device = dc->link_srv->create_ddc_service(&ddc_init_data); 1424 1421 } else { 1425 1422 pool->oem_device = NULL; 1426 1423 }
+5 -5
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c
··· 202 202 dmub_enable_outbox_notification(dc->ctx->dmub_srv); 203 203 204 204 /* we want to turn off all dp displays before doing detection */ 205 - link_blank_all_dp_displays(dc); 205 + dc->link_srv->blank_all_dp_displays(dc); 206 206 207 207 if (hws->funcs.enable_power_gating_plane) 208 208 hws->funcs.enable_power_gating_plane(dc->hwseq, true); ··· 230 230 } 231 231 232 232 if (num_opps > 1) { 233 - link_blank_all_edp_displays(dc); 233 + dc->link_srv->blank_all_edp_displays(dc); 234 234 break; 235 235 } 236 236 } ··· 414 414 pipe_ctx->stream_res.stream_enc->funcs->update_hdmi_info_packets( 415 415 pipe_ctx->stream_res.stream_enc, 416 416 &pipe_ctx->stream_res.encoder_info_frame); 417 - else if (link_is_dp_128b_132b_signal(pipe_ctx)) { 417 + else if (pipe_ctx->stream->ctx->dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) { 418 418 pipe_ctx->stream_res.hpo_dp_stream_enc->funcs->update_dp_info_packets( 419 419 pipe_ctx->stream_res.hpo_dp_stream_enc, 420 420 &pipe_ctx->stream_res.encoder_info_frame); ··· 565 565 * VBIOS lit up eDP, so check link status too. 566 566 */ 567 567 if (!pipe_ctx->stream->dpms_off || link->link_status.link_active) 568 - link_set_dpms_off(pipe_ctx); 568 + dc->link_srv->set_dpms_off(pipe_ctx); 569 569 else if (pipe_ctx->stream_res.audio) 570 570 dc->hwss.disable_audio_stream(pipe_ctx); 571 571 ··· 584 584 } 585 585 } 586 586 } else if (pipe_ctx->stream_res.dsc) { 587 - link_set_dsc_enable(pipe_ctx, false); 587 + dc->link_srv->set_dsc_enable(pipe_ctx, false); 588 588 } 589 589 590 590 pipe_ctx->stream = NULL;
+1 -1
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dio_stream_encoder.c
··· 372 372 */ 373 373 enc314_enable_fifo(enc); 374 374 375 - link_dp_source_sequence_trace(link, DPCD_SOURCE_SEQ_AFTER_ENABLE_DP_VID_STREAM); 375 + link->dc->link_srv->dp_trace_source_sequence(link, DPCD_SOURCE_SEQ_AFTER_ENABLE_DP_VID_STREAM); 376 376 } 377 377 378 378 /* Set DSC-related configuration.
+1 -1
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.c
··· 346 346 two_pix_per_container = optc2_is_two_pixels_per_containter(&stream->timing); 347 347 odm_combine_factor = get_odm_config(pipe_ctx, NULL); 348 348 349 - if (link_is_dp_128b_132b_signal(pipe_ctx)) { 349 + if (stream->ctx->dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) { 350 350 *k1_div = PIXEL_RATE_DIV_BY_1; 351 351 *k2_div = PIXEL_RATE_DIV_BY_1; 352 352 } else if (dc_is_hdmi_tmds_signal(pipe_ctx->stream->signal) || dc_is_dvi_signal(pipe_ctx->stream->signal)) {
+1 -1
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dio_stream_encoder.c
··· 371 371 372 372 REG_UPDATE(DP_VID_STREAM_CNTL, DP_VID_STREAM_ENABLE, true); 373 373 374 - link_dp_source_sequence_trace(link, DPCD_SOURCE_SEQ_AFTER_ENABLE_DP_VID_STREAM); 374 + link->dc->link_srv->dp_trace_source_sequence(link, DPCD_SOURCE_SEQ_AFTER_ENABLE_DP_VID_STREAM); 375 375 } 376 376 377 377 /* Set DSC-related configuration.
+7 -6
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
··· 801 801 hws->funcs.enable_power_gating_plane(dc->hwseq, true); 802 802 803 803 /* we want to turn off all dp displays before doing detection */ 804 - link_blank_all_dp_displays(dc); 804 + dc->link_srv->blank_all_dp_displays(dc); 805 805 806 806 /* If taking control over from VBIOS, we may want to optimize our first 807 807 * mode set, so we need to skip powering down pipes until we know which ··· 1102 1102 two_pix_per_container = optc2_is_two_pixels_per_containter(&stream->timing); 1103 1103 odm_combine_factor = get_odm_config(pipe_ctx, NULL); 1104 1104 1105 - if (link_is_dp_128b_132b_signal(pipe_ctx)) { 1105 + if (stream->ctx->dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) { 1106 1106 *k1_div = PIXEL_RATE_DIV_BY_1; 1107 1107 *k2_div = PIXEL_RATE_DIV_BY_1; 1108 1108 } else if (dc_is_hdmi_tmds_signal(stream->signal) || dc_is_dvi_signal(stream->signal)) { ··· 1166 1166 1167 1167 params.link_settings.link_rate = link_settings->link_rate; 1168 1168 1169 - if (link_is_dp_128b_132b_signal(pipe_ctx)) { 1169 + if (link->dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) { 1170 1170 /* TODO - DP2.0 HW: Set ODM mode in dp hpo encoder here */ 1171 1171 pipe_ctx->stream_res.hpo_dp_stream_enc->funcs->dp_unblank( 1172 1172 pipe_ctx->stream_res.hpo_dp_stream_enc, ··· 1193 1193 if (!is_h_timing_divisible_by_2(pipe_ctx->stream)) 1194 1194 return false; 1195 1195 1196 - if (dc_is_dp_signal(pipe_ctx->stream->signal) && !link_is_dp_128b_132b_signal(pipe_ctx) && 1196 + if (dc_is_dp_signal(pipe_ctx->stream->signal) && !dc->link_srv->dp_is_128b_132b_signal(pipe_ctx) && 1197 1197 dc->debug.enable_dp_dig_pixel_rate_div_policy) 1198 1198 return true; 1199 1199 return false; ··· 1227 1227 pipe_ctx->clock_source->funcs->program_pix_clk( 1228 1228 pipe_ctx->clock_source, 1229 1229 &pipe_ctx->stream_res.pix_clk_params, 1230 - link_dp_get_encoding_format(&pipe_ctx->link_config.dp_link_settings), 1230 + dc->link_srv->dp_get_encoding_format( 1231 + &pipe_ctx->link_config.dp_link_settings), 1231 1232 &pipe_ctx->pll_settings); 1232 1233 link->phy_state.symclk_state = SYMCLK_ON_TX_OFF; 1233 1234 break; ··· 1260 1259 else if (dmcu != NULL && dmcu->funcs->lock_phy) 1261 1260 dmcu->funcs->unlock_phy(dmcu); 1262 1261 1263 - link_dp_source_sequence_trace(link, DPCD_SOURCE_SEQ_AFTER_DISABLE_LINK_PHY); 1262 + dc->link_srv->dp_trace_source_sequence(link, DPCD_SOURCE_SEQ_AFTER_DISABLE_LINK_PHY); 1264 1263 1265 1264 apply_symclk_on_tx_off_wa(link); 1266 1265 }
+6 -3
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
··· 1505 1505 if (pool->base.dccg != NULL) 1506 1506 dcn_dccg_destroy(&pool->base.dccg); 1507 1507 1508 - if (pool->base.oem_device != NULL) 1509 - link_destroy_ddc_service(&pool->base.oem_device); 1508 + if (pool->base.oem_device != NULL) { 1509 + struct dc *dc = pool->base.oem_device->ctx->dc; 1510 + 1511 + dc->link_srv->destroy_ddc_service(&pool->base.oem_device); 1512 + } 1510 1513 } 1511 1514 1512 1515 ··· 2454 2451 ddc_init_data.id.id = dc->ctx->dc_bios->fw_info.oem_i2c_obj_id; 2455 2452 ddc_init_data.id.enum_id = 0; 2456 2453 ddc_init_data.id.type = OBJECT_TYPE_GENERIC; 2457 - pool->base.oem_device = link_create_ddc_service(&ddc_init_data); 2454 + pool->base.oem_device = dc->link_srv->create_ddc_service(&ddc_init_data); 2458 2455 } else { 2459 2456 pool->base.oem_device = NULL; 2460 2457 }
+6 -3
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c
··· 1490 1490 if (pool->base.dccg != NULL) 1491 1491 dcn_dccg_destroy(&pool->base.dccg); 1492 1492 1493 - if (pool->base.oem_device != NULL) 1494 - link_destroy_ddc_service(&pool->base.oem_device); 1493 + if (pool->base.oem_device != NULL) { 1494 + struct dc *dc = pool->base.oem_device->ctx->dc; 1495 + 1496 + dc->link_srv->destroy_ddc_service(&pool->base.oem_device); 1497 + } 1495 1498 } 1496 1499 1497 1500 ··· 1998 1995 ddc_init_data.id.id = dc->ctx->dc_bios->fw_info.oem_i2c_obj_id; 1999 1996 ddc_init_data.id.enum_id = 0; 2000 1997 ddc_init_data.id.type = OBJECT_TYPE_GENERIC; 2001 - pool->base.oem_device = link_create_ddc_service(&ddc_init_data); 1998 + pool->base.oem_device = dc->link_srv->create_ddc_service(&ddc_init_data); 2002 1999 } else { 2003 2000 pool->base.oem_device = NULL; 2004 2001 }
+2 -2
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
··· 938 938 for (i = 0; i < dc->res_pool->pipe_count; i++) { 939 939 if (!context->res_ctx.pipe_ctx[i].stream) 940 940 continue; 941 - if (link_is_dp_128b_132b_signal(&context->res_ctx.pipe_ctx[i])) 941 + if (dc->link_srv->dp_is_128b_132b_signal(&context->res_ctx.pipe_ctx[i])) 942 942 return true; 943 943 } 944 944 return false; ··· 1341 1341 case SIGNAL_TYPE_DISPLAY_PORT_MST: 1342 1342 case SIGNAL_TYPE_DISPLAY_PORT: 1343 1343 pipes[pipe_cnt].dout.output_type = dm_dp; 1344 - if (link_is_dp_128b_132b_signal(&res_ctx->pipe_ctx[i])) 1344 + if (dc->link_srv->dp_is_128b_132b_signal(&res_ctx->pipe_ctx[i])) 1345 1345 pipes[pipe_cnt].dout.output_type = dm_dp2p0; 1346 1346 break; 1347 1347 case SIGNAL_TYPE_EDP:
+1 -1
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
··· 1270 1270 for (i = 0; i < dc->res_pool->pipe_count; i++) { 1271 1271 if (!context->res_ctx.pipe_ctx[i].stream) 1272 1272 continue; 1273 - if (link_is_dp_128b_132b_signal(&context->res_ctx.pipe_ctx[i])) 1273 + if (dc->link_srv->dp_is_128b_132b_signal(&context->res_ctx.pipe_ctx[i])) 1274 1274 return true; 1275 1275 } 1276 1276 return false;
+53
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
··· 47 47 #define MIN(X, Y) ((X) < (Y) ? (X) : (Y)) 48 48 #endif 49 49 50 + uint32_t dc_bandwidth_in_kbps_from_timing( 51 + const struct dc_crtc_timing *timing) 52 + { 53 + uint32_t bits_per_channel = 0; 54 + uint32_t kbps; 55 + 56 + if (timing->flags.DSC) 57 + return dc_dsc_stream_bandwidth_in_kbps(timing, 58 + timing->dsc_cfg.bits_per_pixel, 59 + timing->dsc_cfg.num_slices_h, 60 + timing->dsc_cfg.is_dp); 61 + 62 + switch (timing->display_color_depth) { 63 + case COLOR_DEPTH_666: 64 + bits_per_channel = 6; 65 + break; 66 + case COLOR_DEPTH_888: 67 + bits_per_channel = 8; 68 + break; 69 + case COLOR_DEPTH_101010: 70 + bits_per_channel = 10; 71 + break; 72 + case COLOR_DEPTH_121212: 73 + bits_per_channel = 12; 74 + break; 75 + case COLOR_DEPTH_141414: 76 + bits_per_channel = 14; 77 + break; 78 + case COLOR_DEPTH_161616: 79 + bits_per_channel = 16; 80 + break; 81 + default: 82 + ASSERT(bits_per_channel != 0); 83 + bits_per_channel = 8; 84 + break; 85 + } 86 + 87 + kbps = timing->pix_clk_100hz / 10; 88 + kbps *= bits_per_channel; 89 + 90 + if (timing->flags.Y_ONLY != 1) { 91 + /*Only YOnly make reduce bandwidth by 1/3 compares to RGB*/ 92 + kbps *= 3; 93 + if (timing->pixel_encoding == PIXEL_ENCODING_YCBCR420) 94 + kbps /= 2; 95 + else if (timing->pixel_encoding == PIXEL_ENCODING_YCBCR422) 96 + kbps = kbps * 2 / 3; 97 + } 98 + 99 + return kbps; 100 + } 101 + 102 + 50 103 /* Forward Declerations */ 51 104 static bool decide_dsc_bandwidth_range( 52 105 const uint32_t min_bpp_x16,
+184 -130
drivers/gpu/drm/amd/display/dc/inc/link.h
··· 28 28 29 29 /* FILE POLICY AND INTENDED USAGE: 30 30 * 31 - * This header declares link functions exposed to dc. All functions must use 32 - * function pointers. This header is strictly private in dc and should never be 33 - * included by DM. If DM needs to call a new link function, it needs to be 34 - * translated by dc_link_exports.c. 31 + * This header defines link component function interfaces aka link_service. 32 + * link_service provides the only entry point to link functions with function 33 + * pointer style. This header is strictly private in dc and should never be 34 + * included by DM because it exposes too much dc detail including all dc 35 + * private types defined in core_types.h. Otherwise it will break DM - DC 36 + * encapsulation and turn DM into a maintenance nightmare. 37 + * 38 + * The following shows a link component relation map. 39 + * 40 + * DM to DC: 41 + * DM includes dc.h 42 + * dc_link_exports.c or other dc files implement dc.h 43 + * 44 + * DC to Link: 45 + * dc_link_exports.c or other dc files include link.h 46 + * link_factory.c implements link.h 47 + * 48 + * Link sub-component to Link sub-component: 49 + * link_factory.c includes --> link_xxx.h 50 + * link_xxx.c implements link_xxx.h 51 + 52 + * As you can see if you ever need to add a new dc link function and call it on 53 + * DM/dc side, it is very difficult because you will need layers of translation. 54 + * The most appropriate approach to implement new requirements on DM/dc side is 55 + * to extend or generalize the functionality of existing link function 56 + * interfaces so minimal modification is needed outside link component to 57 + * achieve your new requirements. This approach reduces or even eliminates the 58 + * effort needed outside link component to support a new link feature. This also 59 + * reduces code discrepancy among DMs to support the same link feature. If we 60 + * test full code path on one version of DM, and there is no feature specific 61 + * modification required on other DMs, then we can have higher confidence that 62 + * the feature will run on other DMs and produce the same result. The following 63 + * are some good examples to start with: 64 + * 65 + * - detect_link --> to add new link detection or capability retrieval routines 66 + * 67 + * - validate_mode_timing --> to add new timing validation conditions 68 + * 69 + * - set_dpms_on/set_dpms_off --> to include new link enablement sequences 70 + * 71 + * If you must add new link functions, you will need to: 72 + * 1. declare the function pointer here under the suitable commented category. 73 + * 2. Implement your function in the suitable link_xxx.c file. 74 + * 3. Assign the function to link_service in link_factory.c 75 + * 4. NEVER include link_xxx.h headers outside link component. 76 + * 5. NEVER include link.h on DM side. 35 77 */ 36 78 #include "core_types.h" 79 + 80 + struct link_service *link_create_link_service(void); 81 + void link_destroy_link_service(struct link_service **link_srv); 37 82 38 83 struct link_init_data { 39 84 const struct dc *dc; ··· 89 44 bool is_dpia_link; 90 45 }; 91 46 47 + struct ddc_service_init_data { 48 + struct graphics_object_id id; 49 + struct dc_context *ctx; 50 + struct dc_link *link; 51 + bool is_dpia_link; 52 + }; 53 + 92 54 struct link_service { 93 - /* Detection */ 55 + /************************** Factory ***********************************/ 56 + struct dc_link *(*create_link)( 57 + const struct link_init_data *init_params); 58 + void (*destroy_link)(struct dc_link **link); 59 + 60 + 61 + /************************** Detection *********************************/ 62 + bool (*detect_link)(struct dc_link *link, enum dc_detect_reason reason); 63 + bool (*detect_connection_type)(struct dc_link *link, 64 + enum dc_connection_type *type); 94 65 struct dc_sink *(*add_remote_sink)( 95 66 struct dc_link *link, 96 67 const uint8_t *edid, ··· 114 53 struct dc_sink_init_data *init_data); 115 54 void (*remove_remote_sink)(struct dc_link *link, struct dc_sink *sink); 116 55 bool (*get_hpd_state)(struct dc_link *link); 56 + struct gpio *(*get_hpd_gpio)(struct dc_bios *dcb, 57 + struct graphics_object_id link_id, 58 + struct gpio_service *gpio_service); 117 59 void (*enable_hpd)(const struct dc_link *link); 118 60 void (*disable_hpd)(const struct dc_link *link); 119 61 void (*enable_hpd_filter)(struct dc_link *link, bool enable); 62 + bool (*reset_cur_dp_mst_topology)(struct dc_link *link); 63 + const struct dc_link_status *(*get_status)(const struct dc_link *link); 64 + bool (*is_hdcp1x_supported)(struct dc_link *link, 65 + enum signal_type signal); 66 + bool (*is_hdcp2x_supported)(struct dc_link *link, 67 + enum signal_type signal); 68 + void (*clear_dprx_states)(struct dc_link *link); 120 69 121 - /* DDC */ 70 + 71 + /*************************** Resource *********************************/ 72 + void (*get_cur_res_map)(const struct dc *dc, uint32_t *map); 73 + void (*restore_res_map)(const struct dc *dc, uint32_t *map); 74 + void (*get_cur_link_res)(const struct dc_link *link, 75 + struct link_resource *link_res); 76 + 77 + 78 + /*************************** Validation *******************************/ 79 + enum dc_status (*validate_mode_timing)( 80 + const struct dc_stream_state *stream, 81 + struct dc_link *link, 82 + const struct dc_crtc_timing *timing); 83 + uint32_t (*dp_link_bandwidth_kbps)( 84 + const struct dc_link *link, 85 + const struct dc_link_settings *link_settings); 86 + 87 + 88 + /*************************** DPMS *************************************/ 89 + void (*set_dpms_on)(struct dc_state *state, struct pipe_ctx *pipe_ctx); 90 + void (*set_dpms_off)(struct pipe_ctx *pipe_ctx); 91 + void (*resume)(struct dc_link *link); 92 + void (*blank_all_dp_displays)(struct dc *dc); 93 + void (*blank_all_edp_displays)(struct dc *dc); 94 + void (*blank_dp_stream)(struct dc_link *link, bool hw_init); 95 + enum dc_status (*increase_mst_payload)( 96 + struct pipe_ctx *pipe_ctx, uint32_t req_pbn); 97 + enum dc_status (*reduce_mst_payload)( 98 + struct pipe_ctx *pipe_ctx, uint32_t req_pbn); 99 + void (*set_dsc_on_stream)(struct pipe_ctx *pipe_ctx, bool enable); 100 + bool (*set_dsc_enable)(struct pipe_ctx *pipe_ctx, bool enable); 101 + bool (*update_dsc_config)(struct pipe_ctx *pipe_ctx); 102 + 103 + 104 + /*************************** DDC **************************************/ 105 + struct ddc_service *(*create_ddc_service)( 106 + struct ddc_service_init_data *ddc_init_data); 107 + void (*destroy_ddc_service)(struct ddc_service **ddc); 108 + bool (*query_ddc_data)( 109 + struct ddc_service *ddc, 110 + uint32_t address, 111 + uint8_t *write_buf, 112 + uint32_t write_size, 113 + uint8_t *read_buf, 114 + uint32_t read_size); 122 115 int (*aux_transfer_raw)(struct ddc_service *ddc, 123 116 struct aux_payload *payload, 124 117 enum aux_return_code_type *operation_result); 118 + bool (*aux_transfer_with_retries_no_mutex)(struct ddc_service *ddc, 119 + struct aux_payload *payload); 120 + bool (*is_in_aux_transaction_mode)(struct ddc_service *ddc); 121 + uint32_t (*get_aux_defer_delay)(struct ddc_service *ddc); 125 122 126 - /* DP Capability */ 123 + 124 + /*************************** DP Capability ****************************/ 127 125 bool (*dp_is_sink_present)(struct dc_link *link); 128 126 bool (*dp_is_fec_supported)(const struct dc_link *link); 127 + bool (*dp_is_128b_132b_signal)(struct pipe_ctx *pipe_ctx); 129 128 bool (*dp_get_max_link_enc_cap)(const struct dc_link *link, 130 129 struct dc_link_settings *max_link_enc_cap); 131 130 const struct dc_link_settings *(*dp_get_verified_link_cap)( 132 131 const struct dc_link *link); 132 + enum dp_link_encoding (*dp_get_encoding_format)( 133 + const struct dc_link_settings *link_settings); 133 134 bool (*dp_should_enable_fec)(const struct dc_link *link); 134 - enum dp_link_encoding (*mst_decide_link_encoding_format)(const struct dc_link *link); 135 + bool (*dp_decide_link_settings)( 136 + struct dc_stream_state *stream, 137 + struct dc_link_settings *link_setting); 138 + enum dp_link_encoding (*mst_decide_link_encoding_format)( 139 + const struct dc_link *link); 135 140 bool (*edp_decide_link_settings)(struct dc_link *link, 136 141 struct dc_link_settings *link_setting, uint32_t req_bw); 137 142 uint32_t (*bw_kbps_from_raw_frl_link_rate_data)(uint8_t bw); ··· 205 78 enum lttpr_mode (*dp_decide_lttpr_mode)(struct dc_link *link, 206 79 struct dc_link_settings *link_setting); 207 80 208 - /* DP DPIA/PHY */ 209 - int (*dpia_handle_usb4_bandwidth_allocation_for_link)(struct dc_link *link, int peak_bw); 210 - void (*dpia_handle_bw_alloc_response)(struct dc_link *link, uint8_t bw, uint8_t result); 81 + 82 + /*************************** DP DPIA/PHY ******************************/ 83 + int (*dpia_handle_usb4_bandwidth_allocation_for_link)( 84 + struct dc_link *link, int peak_bw); 85 + void (*dpia_handle_bw_alloc_response)( 86 + struct dc_link *link, uint8_t bw, uint8_t result); 87 + void (*dp_set_drive_settings)( 88 + struct dc_link *link, 89 + const struct link_resource *link_res, 90 + struct link_training_settings *lt_settings); 211 91 void (*dpcd_write_rx_power_ctrl)(struct dc_link *link, bool on); 212 92 213 - /* DP IRQ Handler */ 93 + 94 + /*************************** DP IRQ Handler ***************************/ 214 95 bool (*dp_parse_link_loss_status)( 215 96 struct dc_link *link, 216 97 union hpd_irq_data *hpd_irq_dpcd_data); ··· 228 93 struct dc_link *link, 229 94 union hpd_irq_data *irq_data); 230 95 bool (*dp_handle_hpd_rx_irq)(struct dc_link *link, 231 - union hpd_irq_data *out_hpd_irq_dpcd_data, bool *out_link_loss, 96 + union hpd_irq_data *out_hpd_irq_dpcd_data, 97 + bool *out_link_loss, 232 98 bool defer_handling, bool *has_left_work); 233 99 234 - /* eDP Panel Control */ 235 - void (*edp_panel_backlight_power_on)(struct dc_link *link, bool wait_for_hpd); 100 + 101 + /*************************** eDP Panel Control ************************/ 102 + void (*edp_panel_backlight_power_on)( 103 + struct dc_link *link, bool wait_for_hpd); 236 104 int (*edp_get_backlight_level)(const struct dc_link *link); 237 105 bool (*edp_get_backlight_level_nits)(struct dc_link *link, 238 106 uint32_t *backlight_millinits_avg, ··· 248 110 uint32_t backlight_millinits, 249 111 uint32_t transition_time_in_ms); 250 112 int (*edp_get_target_backlight_pwm)(const struct dc_link *link); 251 - bool (*edp_get_psr_state)(const struct dc_link *link, enum dc_psr_state *state); 252 - bool (*edp_set_psr_allow_active)(struct dc_link *link, const bool *allow_active, 253 - bool wait, bool force_static, const unsigned int *power_opts); 113 + bool (*edp_get_psr_state)( 114 + const struct dc_link *link, enum dc_psr_state *state); 115 + bool (*edp_set_psr_allow_active)( 116 + struct dc_link *link, 117 + const bool *allow_active, 118 + bool wait, 119 + bool force_static, 120 + const unsigned int *power_opts); 254 121 bool (*edp_setup_psr)(struct dc_link *link, 255 122 const struct dc_stream_state *stream, 256 123 struct psr_config *psr_config, 257 124 struct psr_context *psr_context); 125 + bool (*edp_set_sink_vtotal_in_psr_active)( 126 + const struct dc_link *link, 127 + uint16_t psr_vtotal_idle, 128 + uint16_t psr_vtotal_su); 129 + void (*edp_get_psr_residency)( 130 + const struct dc_link *link, uint32_t *residency); 258 131 bool (*edp_wait_for_t12)(struct dc_link *link); 132 + bool (*edp_is_ilr_optimization_required)(struct dc_link *link, 133 + struct dc_crtc_timing *crtc_timing); 134 + bool (*edp_backlight_enable_aux)(struct dc_link *link, bool enable); 135 + void (*edp_add_delay_for_T9)(struct dc_link *link); 136 + bool (*edp_receiver_ready_T9)(struct dc_link *link); 137 + bool (*edp_receiver_ready_T7)(struct dc_link *link); 138 + bool (*edp_power_alpm_dpcd_enable)(struct dc_link *link, bool enable); 259 139 260 - /* DP CTS */ 140 + 141 + /*************************** DP CTS ************************************/ 261 142 void (*dp_handle_automated_test)(struct dc_link *link); 262 143 bool (*dp_set_test_pattern)( 263 144 struct dc_link *link, ··· 294 137 struct dc_link *link, 295 138 bool skip_immediate_retrain); 296 139 297 - /* DP Trace */ 140 + 141 + /*************************** DP Trace *********************************/ 298 142 bool (*dp_trace_is_initialized)(struct dc_link *link); 299 143 void (*dp_trace_set_is_logged_flag)(struct dc_link *link, 300 144 bool in_detection, ··· 306 148 const struct dp_trace_lt_counts *(*dp_trace_get_lt_counts)( 307 149 struct dc_link *link, bool in_detection); 308 150 unsigned int (*dp_trace_get_link_loss_count)(struct dc_link *link); 151 + void (*dp_trace_set_edp_power_timestamp)(struct dc_link *link, 152 + bool power_up); 153 + uint64_t (*dp_trace_get_edp_poweron_timestamp)(struct dc_link *link); 154 + uint64_t (*dp_trace_get_edp_poweroff_timestamp)(struct dc_link *link); 155 + void (*dp_trace_source_sequence)( 156 + struct dc_link *link, uint8_t dp_test_mode); 309 157 }; 310 - 311 - struct dc_link *link_create(const struct link_init_data *init_params); 312 - void link_destroy(struct dc_link **link); 313 - const struct link_service *link_get_link_service(void); 314 - 315 - // TODO - convert any function declarations below to function pointers 316 - struct gpio *link_get_hpd_gpio(struct dc_bios *dcb, 317 - struct graphics_object_id link_id, 318 - struct gpio_service *gpio_service); 319 - 320 - struct ddc_service_init_data { 321 - struct graphics_object_id id; 322 - struct dc_context *ctx; 323 - struct dc_link *link; 324 - bool is_dpia_link; 325 - }; 326 - 327 - struct ddc_service *link_create_ddc_service( 328 - struct ddc_service_init_data *ddc_init_data); 329 - 330 - void link_destroy_ddc_service(struct ddc_service **ddc); 331 - 332 - bool link_is_in_aux_transaction_mode(struct ddc_service *ddc); 333 - 334 - bool link_query_ddc_data( 335 - struct ddc_service *ddc, 336 - uint32_t address, 337 - uint8_t *write_buf, 338 - uint32_t write_size, 339 - uint8_t *read_buf, 340 - uint32_t read_size); 341 - 342 - 343 - /* Attempt to submit an aux payload, retrying on timeouts, defers, and busy 344 - * states as outlined in the DP spec. Returns true if the request was 345 - * successful. 346 - * 347 - * NOTE: The function requires explicit mutex on DM side in order to prevent 348 - * potential race condition. DC components should call the dpcd read/write 349 - * function in dm_helpers in order to access dpcd safely 350 - */ 351 - bool link_aux_transfer_with_retries_no_mutex(struct ddc_service *ddc, 352 - struct aux_payload *payload); 353 - 354 - uint32_t link_get_aux_defer_delay(struct ddc_service *ddc); 355 - 356 - bool link_is_dp_128b_132b_signal(struct pipe_ctx *pipe_ctx); 357 - 358 - enum dp_link_encoding link_dp_get_encoding_format( 359 - const struct dc_link_settings *link_settings); 360 - 361 - bool link_decide_link_settings( 362 - struct dc_stream_state *stream, 363 - struct dc_link_settings *link_setting); 364 - 365 - void link_dp_trace_set_edp_power_timestamp(struct dc_link *link, 366 - bool power_up); 367 - uint64_t link_dp_trace_get_edp_poweron_timestamp(struct dc_link *link); 368 - uint64_t link_dp_trace_get_edp_poweroff_timestamp(struct dc_link *link); 369 - 370 - bool link_is_edp_ilr_optimization_required(struct dc_link *link, 371 - struct dc_crtc_timing *crtc_timing); 372 - 373 - bool link_backlight_enable_aux(struct dc_link *link, bool enable); 374 - void link_edp_add_delay_for_T9(struct dc_link *link); 375 - bool link_edp_receiver_ready_T9(struct dc_link *link); 376 - bool link_edp_receiver_ready_T7(struct dc_link *link); 377 - bool link_power_alpm_dpcd_enable(struct dc_link *link, bool enable); 378 - bool link_set_sink_vtotal_in_psr_active(const struct dc_link *link, 379 - uint16_t psr_vtotal_idle, uint16_t psr_vtotal_su); 380 - void link_get_psr_residency(const struct dc_link *link, uint32_t *residency); 381 - enum dc_status link_increase_mst_payload(struct pipe_ctx *pipe_ctx, uint32_t req_pbn); 382 - enum dc_status link_reduce_mst_payload(struct pipe_ctx *pipe_ctx, uint32_t req_pbn); 383 - void link_blank_all_dp_displays(struct dc *dc); 384 - void link_blank_all_edp_displays(struct dc *dc); 385 - void link_blank_dp_stream(struct dc_link *link, bool hw_init); 386 - void link_resume(struct dc_link *link); 387 - void link_set_dpms_on( 388 - struct dc_state *state, 389 - struct pipe_ctx *pipe_ctx); 390 - void link_set_dpms_off(struct pipe_ctx *pipe_ctx); 391 - void link_dp_source_sequence_trace(struct dc_link *link, uint8_t dp_test_mode); 392 - void link_set_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable); 393 - bool link_set_dsc_enable(struct pipe_ctx *pipe_ctx, bool enable); 394 - bool link_update_dsc_config(struct pipe_ctx *pipe_ctx); 395 - enum dc_status link_validate_mode_timing( 396 - const struct dc_stream_state *stream, 397 - struct dc_link *link, 398 - const struct dc_crtc_timing *timing); 399 - bool link_detect(struct dc_link *link, enum dc_detect_reason reason); 400 - bool link_detect_connection_type(struct dc_link *link, 401 - enum dc_connection_type *type); 402 - const struct dc_link_status *link_get_status(const struct dc_link *link); 403 - /* return true if the connected receiver supports the hdcp version */ 404 - bool link_is_hdcp14(struct dc_link *link, enum signal_type signal); 405 - bool link_is_hdcp22(struct dc_link *link, enum signal_type signal); 406 - void link_clear_dprx_states(struct dc_link *link); 407 - bool link_reset_cur_dp_mst_topology(struct dc_link *link); 408 - uint32_t dp_link_bandwidth_kbps( 409 - const struct dc_link *link, 410 - const struct dc_link_settings *link_settings); 411 - uint32_t link_timing_bandwidth_kbps(const struct dc_crtc_timing *timing); 412 - void link_get_cur_res_map(const struct dc *dc, uint32_t *map); 413 - void link_restore_res_map(const struct dc *dc, uint32_t *map); 414 - void link_get_cur_link_res(const struct dc_link *link, 415 - struct link_resource *link_res); 416 - void dp_set_drive_settings( 417 - struct dc_link *link, 418 - const struct link_resource *link_res, 419 - struct link_training_settings *lt_settings); 420 158 #endif /* __DC_LINK_HPD_H__ */