[Why] Spaces before newline are not necessary. Inserting newlines in multi-line strings are harder to follow when tracing messages.
[How] Drop extra new lines and split multi-line messages into one print per line. Signed-off-by: Mario Limonciello (AMD) <[email protected]> --- .../gpu/drm/amd/display/dc/link/link_dpms.c | 114 +++++------------- 1 file changed, 29 insertions(+), 85 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c index 87f9ceebe26a4..595542f0e01bc 100644 --- a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c +++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c @@ -1330,6 +1330,28 @@ static void remove_stream_from_alloc_table( } } +static void print_mst_streams(struct dc_link *link) +{ + int i; + + DC_LOGGER_INIT(link->ctx->logger); + + DC_LOG_MST("%s stream_count: %d:\n", + __func__, + link->mst_stream_alloc_table.stream_count); + + for (i = 0; i < MAX_CONTROLLER_NUM; i++) { + DC_LOG_MST("stream_enc[%d]: %p\n", i, + (void *) link->mst_stream_alloc_table.stream_allocations[i].stream_enc); + DC_LOG_MST("stream[%d].hpo_dp_stream_enc: %p\n", i, + (void *) link->mst_stream_alloc_table.stream_allocations[i].hpo_dp_stream_enc); + DC_LOG_MST("stream[%d].vcp_id: %d\n", i, + link->mst_stream_alloc_table.stream_allocations[i].vcp_id); + DC_LOG_MST("stream[%d].slot_count: %d\n", i, + link->mst_stream_alloc_table.stream_allocations[i].slot_count); + } +} + static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx) { struct dc_stream_state *stream = pipe_ctx->stream; @@ -1372,9 +1394,7 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx) pipe_ctx->stream_res.hpo_dp_stream_enc, &proposed_table); else - DC_LOG_WARNING("Failed to update" - "MST allocation table for" - "pipe idx:%d\n", + DC_LOG_WARNING("Failed to update MST allocation table for idx %d\n", pipe_ctx->pipe_idx); } else { /* when link is no longer in mst mode (mst hub unplugged), @@ -1384,25 +1404,7 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx) pipe_ctx->stream_res.hpo_dp_stream_enc); } - DC_LOG_MST("%s" - "stream_count: %d: ", - __func__, - link->mst_stream_alloc_table.stream_count); - - for (i = 0; i < MAX_CONTROLLER_NUM; i++) { - DC_LOG_MST("stream_enc[%d]: %p " - "stream[%d].hpo_dp_stream_enc: %p " - "stream[%d].vcp_id: %d " - "stream[%d].slot_count: %d\n", - i, - (void *) link->mst_stream_alloc_table.stream_allocations[i].stream_enc, - i, - (void *) link->mst_stream_alloc_table.stream_allocations[i].hpo_dp_stream_enc, - i, - link->mst_stream_alloc_table.stream_allocations[i].vcp_id, - i, - link->mst_stream_alloc_table.stream_allocations[i].slot_count); - } + print_mst_streams(link); /* update mst stream allocation table hardware state */ if (link_hwss->ext.update_stream_allocation_table == NULL || @@ -1459,30 +1461,10 @@ static enum dc_status allocate_mst_payload(struct pipe_ctx *pipe_ctx) pipe_ctx->stream_res.hpo_dp_stream_enc, &proposed_table); else - DC_LOG_WARNING("Failed to update" - "MST allocation table for" - "pipe idx:%d\n", + DC_LOG_WARNING("Failed to update MST allocation table for idx %d\n", pipe_ctx->pipe_idx); - DC_LOG_MST("%s " - "stream_count: %d: \n ", - __func__, - link->mst_stream_alloc_table.stream_count); - - for (i = 0; i < MAX_CONTROLLER_NUM; i++) { - DC_LOG_MST("stream_enc[%d]: %p " - "stream[%d].hpo_dp_stream_enc: %p " - "stream[%d].vcp_id: %d " - "stream[%d].slot_count: %d\n", - i, - (void *) link->mst_stream_alloc_table.stream_allocations[i].stream_enc, - i, - (void *) link->mst_stream_alloc_table.stream_allocations[i].hpo_dp_stream_enc, - i, - link->mst_stream_alloc_table.stream_allocations[i].vcp_id, - i, - link->mst_stream_alloc_table.stream_allocations[i].slot_count); - } + print_mst_streams(link); ASSERT(proposed_table.stream_count > 0); @@ -1781,31 +1763,11 @@ enum dc_status link_reduce_mst_payload(struct pipe_ctx *pipe_ctx, uint32_t bw_in pipe_ctx->stream_res.hpo_dp_stream_enc, &proposed_table); } else { - DC_LOG_WARNING("Failed to update" - "MST allocation table for" - "pipe idx:%d\n", + DC_LOG_WARNING("Failed to update MST allocation table for idx %d\n", pipe_ctx->pipe_idx); } - DC_LOG_MST("%s " - "stream_count: %d: \n ", - __func__, - link->mst_stream_alloc_table.stream_count); - - for (i = 0; i < MAX_CONTROLLER_NUM; i++) { - DC_LOG_MST("stream_enc[%d]: %p " - "stream[%d].hpo_dp_stream_enc: %p " - "stream[%d].vcp_id: %d " - "stream[%d].slot_count: %d\n", - i, - (void *) link->mst_stream_alloc_table.stream_allocations[i].stream_enc, - i, - (void *) link->mst_stream_alloc_table.stream_allocations[i].hpo_dp_stream_enc, - i, - link->mst_stream_alloc_table.stream_allocations[i].vcp_id, - i, - link->mst_stream_alloc_table.stream_allocations[i].slot_count); - } + print_mst_streams(link); ASSERT(proposed_table.stream_count > 0); @@ -1854,25 +1816,7 @@ enum dc_status link_increase_mst_payload(struct pipe_ctx *pipe_ctx, uint32_t bw_ &proposed_table); } - DC_LOG_MST("%s " - "stream_count: %d: \n ", - __func__, - link->mst_stream_alloc_table.stream_count); - - for (i = 0; i < MAX_CONTROLLER_NUM; i++) { - DC_LOG_MST("stream_enc[%d]: %p " - "stream[%d].hpo_dp_stream_enc: %p " - "stream[%d].vcp_id: %d " - "stream[%d].slot_count: %d\n", - i, - (void *) link->mst_stream_alloc_table.stream_allocations[i].stream_enc, - i, - (void *) link->mst_stream_alloc_table.stream_allocations[i].hpo_dp_stream_enc, - i, - link->mst_stream_alloc_table.stream_allocations[i].vcp_id, - i, - link->mst_stream_alloc_table.stream_allocations[i].slot_count); - } + print_mst_streams(link); ASSERT(proposed_table.stream_count > 0); -- 2.43.0
