diff options
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/link/link_validation.c')
| -rw-r--r-- | drivers/gpu/drm/amd/display/dc/link/link_validation.c | 61 |
1 files changed, 2 insertions, 59 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/link/link_validation.c b/drivers/gpu/drm/amd/display/dc/link/link_validation.c index 5b88a1c48dac..aecaf37eee35 100644 --- a/drivers/gpu/drm/amd/display/dc/link/link_validation.c +++ b/drivers/gpu/drm/amd/display/dc/link/link_validation.c @@ -367,65 +367,6 @@ enum dc_status link_validate_mode_timing( return DC_OK; } -/* - * This function calculates the bandwidth required for the stream timing - * and aggregates the stream bandwidth for the respective dpia link - * - * @stream: pointer to the dc_stream_state struct instance - * @num_streams: number of streams to be validated - * - * return: true if validation is succeeded - */ -bool link_validate_dpia_bandwidth(const struct dc_stream_state *stream, const unsigned int num_streams) -{ - int bw_needed[MAX_DPIA_NUM] = {0}; - struct dc_link *dpia_link[MAX_DPIA_NUM] = {0}; - int num_dpias = 0; - - for (unsigned int i = 0; i < num_streams; ++i) { - if (stream[i].signal == SIGNAL_TYPE_DISPLAY_PORT) { - /* new dpia sst stream, check whether it exceeds max dpia */ - if (num_dpias >= MAX_DPIA_NUM) - return false; - - dpia_link[num_dpias] = stream[i].link; - bw_needed[num_dpias] = dc_bandwidth_in_kbps_from_timing(&stream[i].timing, - dc_link_get_highest_encoding_format(dpia_link[num_dpias])); - num_dpias++; - } else if (stream[i].signal == SIGNAL_TYPE_DISPLAY_PORT_MST) { - uint8_t j = 0; - /* check whether its a known dpia link */ - for (; j < num_dpias; ++j) { - if (dpia_link[j] == stream[i].link) - break; - } - - if (j == num_dpias) { - /* new dpia mst stream, check whether it exceeds max dpia */ - if (num_dpias >= MAX_DPIA_NUM) - return false; - else { - dpia_link[j] = stream[i].link; - num_dpias++; - } - } - - bw_needed[j] += dc_bandwidth_in_kbps_from_timing(&stream[i].timing, - dc_link_get_highest_encoding_format(dpia_link[j])); - } - } - - /* Include dp overheads */ - for (uint8_t i = 0; i < num_dpias; ++i) { - int dp_overhead = 0; - - dp_overhead = link_dpia_get_dp_mst_overhead(dpia_link[i]); - bw_needed[i] += dp_overhead; - } - - return dpia_validate_usb4_bw(dpia_link, bw_needed, num_dpias); -} - static const struct dc_tunnel_settings *get_dp_tunnel_settings(const struct dc_state *context, const struct dc_stream_state *stream) { @@ -454,6 +395,7 @@ enum dc_status link_validate_dp_tunnel_bandwidth(const struct dc *dc, const stru uint8_t link_count = 0; enum dc_status result = DC_OK; + // Iterate through streams in the new context for (uint8_t i = 0; (i < MAX_PIPES && i < new_ctx->stream_count); i++) { const struct dc_stream_state *stream = new_ctx->streams[i]; const struct dc_link *link; @@ -477,6 +419,7 @@ enum dc_status link_validate_dp_tunnel_bandwidth(const struct dc *dc, const stru timing_bw = dp_get_timing_bandwidth_kbps(&stream->timing, link); + // Find an existing entry for this 'link' in 'dpia_link_sets' for (uint8_t j = 0; j < MAX_DPIA_NUM; j++) { bool is_new_slot = false; |
