drm/amdgpu/display: fix mixed declarations and code in dp_set_hw_test_pattern
Subsystems (3)
Alex Deucher
maintainerPATCH 1/8 drm/amdgpu/display: fix mixed declarations and code in dp_set_hw_test_pattern
Trivial.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +3 -1
@@ -372,6 +372,9 @@ void dp_set_hw_test_pattern( {struct encoder_set_dp_phy_pattern_param pattern_param = {0 };struct link_encoder *encoder; +#if defined(CONFIG_DRM_AMD_DC_DCN ) +enum dp_link_encoding link_encoding_format =dp_get_link_encoding_format (&link->cur_link_settings); +#endif /* Access link encoder based on whether it is statically * or dynamically assigned to a link.
@@ -388,7 +391,6 @@ void dp_set_hw_test_pattern( pattern_param.dp_panel_mode =dp_get_panel_mode (link);#if defined(CONFIG_DRM_AMD_DC_DCN ) -enum dp_link_encoding link_encoding_format =dp_get_link_encoding_format (&link->cur_link_settings);switch (link_encoding_format) {case DP_128b_132b_ENCODING: link->hpo_dp_link_enc->funcs->set_link_test_pattern(
Signature · 1 line
2.31.1
Alex Deucher
maintainerPATCH 2/8 drm/amdgpu/display: fix unhandled cases in get_phyd32clk_src()
Fixes an unhandled cases warning and defaults to a more logical return value.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +2 -3
@@ -730,10 +730,9 @@ static enum phyd32clk_clock_source get_phyd32clk_src(struct dc_link *link)return PHYD32CLKD ;case TRANSMITTER_UNIPHY_E :return PHYD32CLKE ; +default : +return PHYD32CLKA ; } - -//BREAK_TO_DEBUGGER(); -return TRANSMITTER_UNIPHY_A ; }void enable_dp_hpo_output (struct dc_link *link,const struct dc_link_settings *link_settings)
Signature · 1 line
2.31.1
Alex Deucher
maintainerPATCH 3/8 drm/amdgpu/display: handle all cases in decide_cr_training_pattern
In reply to Alex DeucherWe need a default case to handle the additional enum values. While here drop the need for a local variable.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +3 -8
@@ -257,20 +257,15 @@ static void dpcd_set_training_pattern(static enum dc_dp_training_pattern decide_cr_training_pattern (const struct dc_link_settings *link_settings) { -enum dc_dp_training_pattern pattern =DP_TRAINING_PATTERN_SEQUENCE_1 ; -switch (dp_get_link_encoding_format (link_settings)) {case DP_8b_10b_ENCODING: - pattern =DP_TRAINING_PATTERN_SEQUENCE_1 ; -break ; +default : +return DP_TRAINING_PATTERN_SEQUENCE_1 ;#if defined(CONFIG_DRM_AMD_DC_DCN )case DP_128b_132b_ENCODING: - pattern = DP_128b_132b_TPS1; -break ; +return DP_128b_132b_TPS1;#endif } - -return pattern; } static enum dc_dp_training_pattern decide_eq_training_pattern(struct dc_link *link,
Signature · 1 line
2.31.1
Alex Deucher
maintainerPATCH 4/8 drm/amdgpu/display: drop unused variable.
In reply to Alex DeucherTrivial.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -3
@@ -186,9 +186,6 @@ static bool create_links(int i;int connectors_num;struct dc_bios *bios = dc->ctx->dc_bios; -#if defined(CONFIG_DRM_AMD_DC_DCN ) -int dp_hpo_link_count =0 ; -#endif dc->link_count =0 ;
Signature · 1 line
2.31.1
Alex Deucher
maintainerPATCH 5/8 drm/amdgpu/display: fix mixed declarations and code in dc_link_dp.c
In reply to Alex DeucherTrivial.
--- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +9 -9
@@ -2643,6 +2643,9 @@ bool dc_link_dp_get_max_link_enc_cap(const struct dc_link *link, struct dc_link_static struct dc_link_settings get_max_link_cap (struct dc_link *link) {struct dc_link_settings max_link_cap = {0 }; +#if defined(CONFIG_DRM_AMD_DC_DCN ) +enum dc_link_rate lttpr_max_link_rate; +#endif /* get max link encoder capability */ link->link_enc->funcs->get_max_link_cap (link->link_enc, &max_link_cap);
@@ -2672,7 +2675,7 @@ static struct dc_link_settings get_max_link_cap(struct dc_link *link) max_link_cap.lane_count = link->dpcd_caps.lttpr_caps.max_lane_count;#if defined(CONFIG_DRM_AMD_DC_DCN ) -enum dc_link_rate lttpr_max_link_rate =get_lttpr_max_link_rate (link); + lttpr_max_link_rate =get_lttpr_max_link_rate (link);if (lttpr_max_link_rate < max_link_cap.link_rate) max_link_cap.link_rate = lttpr_max_link_rate;
@@ -4412,6 +4415,7 @@ bool dp_retrieve_lttpr_cap(struct dc_link *link) {#if defined(CONFIG_DRM_AMD_DC_DCN )uint8_t lttpr_dpcd_data[8 ]; +bool allow_lttpr_non_transparent_mode =0 ;#else uint8_t lttpr_dpcd_data[6 ];#endif
@@ -4423,8 +4427,6 @@ bool dp_retrieve_lttpr_cap(struct dc_link *link)memset (lttpr_dpcd_data,'\0' ,sizeof (lttpr_dpcd_data));#if defined(CONFIG_DRM_AMD_DC_DCN ) -bool allow_lttpr_non_transparent_mode =0 ; -if ((link->dc->config.allow_lttpr_non_transparent_mode.bits.DP2_0 && link->dpcd_caps.channel_coding_cap.bits.DP_128b_132b_SUPPORTED)) { allow_lttpr_non_transparent_mode =1 ;
@@ -5926,13 +5928,12 @@ static void get_lane_status( union lane_align_status_updated *status_updated) {unsigned int lane; +uint8_t dpcd_buf[3 ] = {0 };if (status ==NULL || status_updated ==NULL ) {return ; } -uint8_t dpcd_buf[3 ] = {0 }; - core_link_read_dpcd( link, DP_LANE0_1_STATUS,
@@ -5957,6 +5958,9 @@ bool dpcd_write_128b_132b_sst_payload_allocation_table(bool result = false;uint8_t req_slot_count =0 ;struct fixed31_32 avg_time_slots_per_mtp = {0 }; +union payload_table_update_status update_status = {0 }; +const uint32_t max_retries =30 ; +uint32_t retries =0 ;if (allocate) { avg_time_slots_per_mtp =calculate_sst_avg_time_slots_per_mtp (stream, link);
@@ -5965,8 +5969,6 @@ bool dpcd_write_128b_132b_sst_payload_allocation_table(/// Leave req_slot_count = 0 if allocate is false. } -union payload_table_update_status update_status = {0 }; -/// Write DPCD 2C0 = 1 to start updating update_status.bits.VC_PAYLOAD_TABLE_UPDATED =1 ; core_link_write_dpcd(
@@ -5999,8 +6001,6 @@ bool dpcd_write_128b_132b_sst_payload_allocation_table(/// Poll till DPCD 2C0 read 1 /// Try for at least 150ms (30 retries, with 5ms delay after each attempt) -const uint32_t max_retries =30 ; -uint32_t retries =0 ;while (retries < max_retries) { if (core_link_read_dpcd(
Signature · 1 line
2.31.1
Alex Deucher
maintainerPATCH 6/8 drm/amdgpu/display: remove unused function dp2_update_mst_stream_alloc_table
In reply to Alex DeucherTrivial.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 52 ------------------- 1 file changed, 52 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -52
@@ -3181,58 +3181,6 @@ static void update_mst_stream_alloc_table( work_table[i]; }#if defined(CONFIG_DRM_AMD_DC_DCN ) -/* TODO: Temp function for Diags FPGA */ -static void dp2_update_mst_stream_alloc_table ( -struct dc_link *link, -struct stream_encoder *dio_stream_enc, -struct hpo_dp_stream_encoder *hpo_dp_stream_enc, -const struct dp_mst_stream_allocation_table *proposed_table) -{ -struct link_mst_stream_allocation work_table[MAX_CONTROLLER_NUM ] = { - {0 } }; -struct link_mst_stream_allocation *dc_alloc; - -int i; -int j; - -/* if DRM proposed_table has more than one new payload */ -ASSERT (proposed_table->stream_count - - link->mst_stream_alloc_table.stream_count <2 ); - -/* copy proposed_table to link, add stream encoder */ -for (i =0 ; i < proposed_table->stream_count; i++) { - -for (j =0 ; j < link->mst_stream_alloc_table.stream_count; j++) { - dc_alloc = - &link->mst_stream_alloc_table.stream_allocations[j]; - -if (dc_alloc->vcp_id == - proposed_table->stream_allocations[i].vcp_id) { - - work_table[i] = *dc_alloc; -break ;/* exit j loop */ - } - } - -/* new vcp_id */ -if (j == link->mst_stream_alloc_table.stream_count) { - work_table[i].vcp_id = - proposed_table->stream_allocations[i].vcp_id; - work_table[i].slot_count = - proposed_table->stream_allocations[i].slot_count; - work_table[i].stream_enc = dio_stream_enc; - work_table[i].hpo_dp_stream_enc = hpo_dp_stream_enc; - } - } - -/* update link->mst_stream_alloc_table with work_table */ - link->mst_stream_alloc_table.stream_count = - proposed_table->stream_count; -for (i =0 ; i <MAX_CONTROLLER_NUM ; i++) - link->mst_stream_alloc_table.stream_allocations[i] = - work_table[i]; -} -/* * Payload allocation/deallocation for SST introduced in DP2.0 */
Signature · 1 line
2.31.1
Alex Deucher
maintainerPATCH 7/8 drm/amdgpu/display: remove unused variables in dcn31_hpo_dp_link_enc_update_stream_allocation_table
In reply to Alex DeucherTrivial.
--- .../gpu/drm/amd/display/dc/dcn31/dcn31_hpo_dp_link_encoder.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hpo_dp_link_encoder.c +0 -4
@@ -282,12 +282,8 @@ void dcn31_hpo_dp_link_enc_update_stream_allocation_table( const struct link_mst_stream_allocation_table *table) {struct dcn31_hpo_dp_link_encoder *enc3 =DCN3_1_HPO_DP_LINK_ENC_FROM_HPO_LINK_ENC (enc); -uint32_t value0 =0 ; -uint32_t value1 =0 ; -uint32_t value2 =0 ;uint32_t slots =0 ;uint32_t src =0 ; -uint32_t retries =0 ;/* --- Set MSE Stream Attribute - * Setup VC Payload Table on Tx Side,
Signature · 1 line
2.31.1
Alex Deucher
maintainerPATCH 8/8 drm/amdgpu/display: remove unused variable in dcn31_hpo_dp_stream_enc_mute_control
In reply to Alex DeucherTrivial.
--- .../gpu/drm/amd/display/dc/dcn31/dcn31_hpo_dp_stream_encoder.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hpo_dp_stream_encoder.c +0 -2
@@ -603,8 +603,6 @@ static void dcn31_hpo_dp_stream_enc_mute_control(struct hpo_dp_stream_encoder *enc, bool mute) { -struct dcn31_hpo_dp_stream_encoder *enc3 =DCN3_1_HPO_DP_STREAM_ENC_FROM_HPO_STREAM_ENC (enc); - ASSERT(enc->apg); enc->apg->funcs->audio_mute_control (enc->apg, mute); }
Signature · 1 line
2.31.1
Re: [PATCH 8/8] drm/amdgpu/display: remove unused variable in dcn31_hpo_dp_stream_enc_mute_control
Patches 1, 3, 5-8 are
For some reason I didn't seem to get patches 2 and 4.
Harry
Quoted 22 lines · Alex Deucher
Trivial.
Fixes c0c9c87bcc5f ("drm/amd/display: Add DP 2.0 HPO Stream Encoder")Signed-off-by Alex Deucher <[email protected]>--- .../gpu/drm/amd/display/dc/dcn31/dcn31_hpo_dp_stream_encoder.c | 2 -- 1 file changed, 2 deletions(-)drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hpo_dp_stream_encoder.c +0
-2@@ -603,8 +603,6 @@ static void dcn31_hpo_dp_stream_enc_mute_control(struct hpo_dp_stream_encoder *enc, bool mute) { -struct dcn31_hpo_dp_stream_encoder *enc3 =DCN3_1_HPO_DP_STREAM_ENC_FROM_HPO_STREAM_ENC (enc); - ASSERT(enc->apg); enc->apg->funcs->audio_mute_control (enc->apg, mute); }