DC Patches December 17, 2021
cover DC Patches December 17, 2021
This DC patchset brings improvements in multiple areas. In summary, we highlight:
- Fixes and improvements in the LTTPR code
- Improve z-state
- Fix null pointer check
- Improve communication with s0i2
- Update multiple-display split policy
- Add missing registers
Thanks
Siqueira
Alvin Lee (1):
drm/amd/display: Fix check for null function ptr
Angus Wang (1):
drm/amd/display: Changed pipe split policy to allow for multi-display
pipe split
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.98
Aric Cyr (1):
drm/amd/display: 3.2.167
Charlene Liu (1):
drm/amd/display: fix B0 TMDS deepcolor no dislay issue
George Shen (2):
drm/amd/display: Limit max link cap with LTTPR caps drm/amd/display: Remove CR AUX RD Interval limit for LTTPR
Lai, Derek (1):
drm/amd/display: Added power down for DCN10
Martin Leung (1):
drm/amd/display: Undo ODM combine
Nicholas Kazlauskas (3):
drm/amd/display: Block z-states when stutter period exceeds criteria drm/amd/display: Send s0i2_rdy in stream_count == 0 optimization drm/amd/display: Set optimize_pwr_state for DCN31
Shen, George (1):
drm/amd/display: Refactor vendor specific link training sequence
Wenjing Liu (5):
drm/amd/display: define link res and make it accessible to all link
interfaces
drm/amd/display: populate link res in both detection and validation drm/amd/display: access hpo dp link encoder only through link resource drm/amd/display: support dynamic HPO DP link encoder allocation drm/amd/display: get and restore link res map
Wesley Chalmers (1):
drm/amd/display: Add reg defs for DCN303
.../display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 1 + drivers/gpu/drm/amd/display/dc/core/dc.c | 18 - .../gpu/drm/amd/display/dc/core/dc_debug.c | 2 + drivers/gpu/drm/amd/display/dc/core/dc_link.c | 234 +++++--- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 501 +++++++++++++++--- .../drm/amd/display/dc/core/dc_link_dpia.c | 48 +- .../drm/amd/display/dc/core/dc_link_hwss.c | 63 ++- .../gpu/drm/amd/display/dc/core/dc_resource.c | 199 ++++--- drivers/gpu/drm/amd/display/dc/dc.h | 3 +- drivers/gpu/drm/amd/display/dc/dc_link.h | 15 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 14 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_init.c | 1 + .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 2 +- .../drm/amd/display/dc/dcn20/dcn20_resource.c | 5 +- .../amd/display/dc/dcn201/dcn201_resource.c | 2 +- .../drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- .../drm/amd/display/dc/dcn30/dcn30_resource.c | 13 +- .../amd/display/dc/dcn301/dcn301_resource.c | 2 +- .../amd/display/dc/dcn302/dcn302_resource.c | 2 +- .../drm/amd/display/dc/dcn303/dcn303_dccg.h | 20 +- .../amd/display/dc/dcn303/dcn303_resource.c | 2 +- .../dc/dcn31/dcn31_hpo_dp_link_encoder.c | 6 +- .../dc/dcn31/dcn31_hpo_dp_link_encoder.h | 3 +- .../gpu/drm/amd/display/dc/dcn31/dcn31_init.c | 1 + .../drm/amd/display/dc/dcn31/dcn31_resource.c | 27 +- .../drm/amd/display/dc/dcn31/dcn31_resource.h | 31 ++ .../gpu/drm/amd/display/dc/dml/dml_wrapper.c | 2 +- .../gpu/drm/amd/display/dc/inc/core_status.h | 2 + .../gpu/drm/amd/display/dc/inc/core_types.h | 17 + .../gpu/drm/amd/display/dc/inc/dc_link_dp.h | 15 +- .../gpu/drm/amd/display/dc/inc/dc_link_dpia.h | 5 +- .../drm/amd/display/dc/inc/hw/link_encoder.h | 3 +- .../gpu/drm/amd/display/dc/inc/link_hwss.h | 10 +- drivers/gpu/drm/amd/display/dc/inc/resource.h | 6 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 4 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 4 +- 36 files changed, 964 insertions(+), 321 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/19 drm/amd/display: fix B0 TMDS deepcolor no dislay issue
From: Charlene Liu <[email protected]>
[why]
B0 PHY C map to F, D map to G driver use logic instance, dmub does the remap. Driver still need use the right PHY instance to access right HW.
[how]
use phyical instance when program PHY register.
[note]
could move resync_control programming to dmub next.
--- .../drm/amd/display/dc/dcn31/dcn31_resource.c | 25 +++++++++++++-- .../drm/amd/display/dc/dcn31/dcn31_resource.h | 31 +++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c +23 -2
@@ -355,6 +355,14 @@ static const struct dce110_clk_src_regs clk_src_regs[] = {clk_src_regs (3 ,D ),clk_src_regs (4 ,E ) }; +/*pll_id being rempped in dmub, in driver it is logical instance*/ +static const struct dce110_clk_src_regs clk_src_regs_b0[] = { +clk_src_regs (0 ,A ), +clk_src_regs (1 ,B ), +clk_src_regs (2 ,F ), +clk_src_regs (3 ,G ), +clk_src_regs (4 ,E ) +};static const struct dce110_clk_src_shift cs_shift = { CS_COMMON_MASK_SH_LIST_DCN2_0(__SHIFT)
@@ -2288,14 +2296,27 @@ static bool dcn31_resource_construct(dcn30_clock_source_create (ctx, ctx->dc_bios,CLOCK_SOURCE_COMBO_PHY_PLL1 , &clk_src_regs[1 ], false); - pool->base.clock_sources[DCN31_CLK_SRC_PLL2 ] = +/*move phypllx_pixclk_resync to dmub next*/ +if (dc->ctx->asic_id.hw_internal_rev ==YELLOW_CARP_B0 ) { + pool->base.clock_sources[DCN31_CLK_SRC_PLL2 ] = +dcn30_clock_source_create (ctx, ctx->dc_bios, +CLOCK_SOURCE_COMBO_PHY_PLL2 , + &clk_src_regs_b0[2 ], false); + pool->base.clock_sources[DCN31_CLK_SRC_PLL3 ] = +dcn30_clock_source_create (ctx, ctx->dc_bios, +CLOCK_SOURCE_COMBO_PHY_PLL3 , + &clk_src_regs_b0[3 ], false); + }else { + pool->base.clock_sources[DCN31_CLK_SRC_PLL2 ] =dcn30_clock_source_create (ctx, ctx->dc_bios,CLOCK_SOURCE_COMBO_PHY_PLL2 , &clk_src_regs[2 ], false); - pool->base.clock_sources[DCN31_CLK_SRC_PLL3 ] = + pool->base.clock_sources[DCN31_CLK_SRC_PLL3 ] =dcn30_clock_source_create (ctx, ctx->dc_bios,CLOCK_SOURCE_COMBO_PHY_PLL3 , &clk_src_regs[3 ], false); + } + pool->base.clock_sources[DCN31_CLK_SRC_PLL4 ] = dcn30_clock_source_create(ctx, ctx->dc_bios, CLOCK_SOURCE_COMBO_PHY_PLL4,
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.h +31 -0
@@ -49,4 +49,35 @@ struct resource_pool *dcn31_create_resource_pool(const struct dc_init_data *init_data, struct dc *dc); +/*temp: B0 specific before switch to dcn313 headers*/ +#ifndef regPHYPLLF_PIXCLK_RESYNC_CNTL +#define regPHYPLLF_PIXCLK_RESYNC_CNTL 0x007e +#define regPHYPLLF_PIXCLK_RESYNC_CNTL_BASE_IDX 1 +#define regPHYPLLG_PIXCLK_RESYNC_CNTL 0x005f +#define regPHYPLLG_PIXCLK_RESYNC_CNTL_BASE_IDX 1 + +//PHYPLLF_PIXCLK_RESYNC_CNTL +#define PHYPLLF_PIXCLK_RESYNC_CNTL__PHYPLLF_PIXCLK_RESYNC_ENABLE__SHIFT 0x0 +#define PHYPLLF_PIXCLK_RESYNC_CNTL__PHYPLLF_DEEP_COLOR_DTO_ENABLE_STATUS__SHIFT 0x1 +#define PHYPLLF_PIXCLK_RESYNC_CNTL__PHYPLLF_DCCG_DEEP_COLOR_CNTL__SHIFT 0x4 +#define PHYPLLF_PIXCLK_RESYNC_CNTL__PHYPLLF_PIXCLK_ENABLE__SHIFT 0x8 +#define PHYPLLF_PIXCLK_RESYNC_CNTL__PHYPLLF_PIXCLK_DOUBLE_RATE_ENABLE__SHIFT 0x9 +#define PHYPLLF_PIXCLK_RESYNC_CNTL__PHYPLLF_PIXCLK_RESYNC_ENABLE_MASK 0x00000001L +#define PHYPLLF_PIXCLK_RESYNC_CNTL__PHYPLLF_DEEP_COLOR_DTO_ENABLE_STATUS_MASK 0x00000002L +#define PHYPLLF_PIXCLK_RESYNC_CNTL__PHYPLLF_DCCG_DEEP_COLOR_CNTL_MASK 0x00000030L +#define PHYPLLF_PIXCLK_RESYNC_CNTL__PHYPLLF_PIXCLK_ENABLE_MASK 0x00000100L +#define PHYPLLF_PIXCLK_RESYNC_CNTL__PHYPLLF_PIXCLK_DOUBLE_RATE_ENABLE_MASK 0x00000200L + +//PHYPLLG_PIXCLK_RESYNC_CNTL +#define PHYPLLG_PIXCLK_RESYNC_CNTL__PHYPLLG_PIXCLK_RESYNC_ENABLE__SHIFT 0x0 +#define PHYPLLG_PIXCLK_RESYNC_CNTL__PHYPLLG_DEEP_COLOR_DTO_ENABLE_STATUS__SHIFT 0x1 +#define PHYPLLG_PIXCLK_RESYNC_CNTL__PHYPLLG_DCCG_DEEP_COLOR_CNTL__SHIFT 0x4 +#define PHYPLLG_PIXCLK_RESYNC_CNTL__PHYPLLG_PIXCLK_ENABLE__SHIFT 0x8 +#define PHYPLLG_PIXCLK_RESYNC_CNTL__PHYPLLG_PIXCLK_DOUBLE_RATE_ENABLE__SHIFT 0x9 +#define PHYPLLG_PIXCLK_RESYNC_CNTL__PHYPLLG_PIXCLK_RESYNC_ENABLE_MASK 0x00000001L +#define PHYPLLG_PIXCLK_RESYNC_CNTL__PHYPLLG_DEEP_COLOR_DTO_ENABLE_STATUS_MASK 0x00000002L +#define PHYPLLG_PIXCLK_RESYNC_CNTL__PHYPLLG_DCCG_DEEP_COLOR_CNTL_MASK 0x00000030L +#define PHYPLLG_PIXCLK_RESYNC_CNTL__PHYPLLG_PIXCLK_ENABLE_MASK 0x00000100L +#define PHYPLLG_PIXCLK_RESYNC_CNTL__PHYPLLG_PIXCLK_DOUBLE_RATE_ENABLE_MASK 0x00000200L +#endif #endif /* _DCN31_RESOURCE_H_ */
Signature · 1 line
2.25.1
PATCH 2/19 drm/amd/display: Limit max link cap with LTTPR caps
In reply to Rodrigo SiqueiraFrom: George Shen <[email protected]>
[Why]
Max link rate should be limited to the maximum link rate support by any LTTPR that are connected, including when operating in transparent mode.
[How]
Include transparent mode when factoring in LTTPR max supported link rate.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +1 -1
@@ -2873,7 +2873,7 @@ static struct dc_link_settings get_max_link_cap(struct dc_link *link)* account for lttpr repeaters cap * notes: repeaters do not snoop in the DPRX Capabilities addresses (3.6.3). */ -if (link->lttpr_mode ==LTTPR_MODE_NON_TRANSPARENT ) { +if (link->lttpr_mode !=LTTPR_MODE_NON_LTTPR ) {if (link->dpcd_caps.lttpr_caps.max_lane_count < max_link_cap.lane_count) max_link_cap.lane_count = link->dpcd_caps.lttpr_caps.max_lane_count;
Signature · 1 line
2.25.1
PATCH 3/19 drm/amd/display: Refactor vendor specific link training sequence
In reply to Rodrigo SiqueiraFrom: "Shen, George" <[email protected]>
[Why]
Current implementation is not scalable and retrofits the existing standard link training code for purposes outside of its original design.
[How]
Refactor vendor specific link training sequence into its own separate function to be called instead of the standard link training function.
--- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 338 +++++++++++++++++- 1 file changed, 337 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +337 -1
@@ -2427,6 +2427,338 @@ static enum link_training_result dp_perform_128b_132b_link_training( }#endif +static enum link_training_result dc_link_dp_perform_fixed_vs_pe_training_sequence ( +struct dc_link *link, +struct link_training_settings *lt_settings) +{ +const uint8_t vendor_lttpr_write_data_reset[4 ] = {0x1 ,0x50 ,0x63 ,0xFF }; +const uint8_t offset =dp_convert_to_count ( + link->dpcd_caps.lttpr_caps.phy_repeater_cnt); +const uint8_t vendor_lttpr_write_data_intercept_en[4 ] = {0x1 ,0x55 ,0x63 ,0x0 }; +const uint8_t vendor_lttpr_write_data_intercept_dis[4 ] = {0x1 ,0x55 ,0x63 ,0x68 }; +uint8_t vendor_lttpr_write_data_vs[4 ] = {0x1 ,0x51 ,0x63 ,0x0 }; +uint8_t vendor_lttpr_write_data_pe[4 ] = {0x1 ,0x52 ,0x63 ,0x0 }; +uint32_t vendor_lttpr_write_address =0xF004F ; +enum link_training_result status =LINK_TRAINING_SUCCESS ; +uint8_t lane =0 ; +union down_spread_ctrl downspread = {0 }; +union lane_count_set lane_count_set = {0 }; +uint8_t toggle_rate; +uint8_t rate; + +/* Only 8b/10b is supported */ +ASSERT (dp_get_link_encoding_format (<_settings->link_settings) == + DP_8b_10b_ENCODING); + +if (offset !=0xFF ) { + vendor_lttpr_write_address += + ((DP_REPEATER_CONFIGURATION_AND_STATUS_SIZE ) * (offset -1 )); + } + +/* Vendor specific: Reset lane settings */ +core_link_write_dpcd ( + link, + vendor_lttpr_write_address, + &vendor_lttpr_write_data_reset[0 ], +sizeof (vendor_lttpr_write_data_reset)); +core_link_write_dpcd ( + link, + vendor_lttpr_write_address, + &vendor_lttpr_write_data_vs[0 ], +sizeof (vendor_lttpr_write_data_vs)); +core_link_write_dpcd ( + link, + vendor_lttpr_write_address, + &vendor_lttpr_write_data_pe[0 ], +sizeof (vendor_lttpr_write_data_pe)); + +/* Vendor specific: Enable intercept */ +core_link_write_dpcd ( + link, + vendor_lttpr_write_address, + &vendor_lttpr_write_data_intercept_en[0 ], +sizeof (vendor_lttpr_write_data_intercept_en)); + +/* 1. set link rate, lane count and spread. */ + + downspread.raw = (uint8_t )(lt_settings->link_settings.link_spread); + + lane_count_set.bits.LANE_COUNT_SET = + lt_settings->link_settings.lane_count; + + lane_count_set.bits.ENHANCED_FRAMING = lt_settings->enhanced_framing; + lane_count_set.bits.POST_LT_ADJ_REQ_GRANTED =0 ; + + +if (lt_settings->pattern_for_eq <DP_TRAINING_PATTERN_SEQUENCE_4 ) { + lane_count_set.bits.POST_LT_ADJ_REQ_GRANTED = + link->dpcd_caps.max_ln_count.bits.POST_LT_ADJ_REQ_SUPPORTED; + } + +core_link_write_dpcd (link,DP_DOWNSPREAD_CTRL , + &downspread.raw,sizeof (downspread)); + +core_link_write_dpcd (link,DP_LANE_COUNT_SET , + &lane_count_set.raw,1 ); + +#if defined(CONFIG_DRM_AMD_DC_DCN ) + rate =get_dpcd_link_rate (<_settings->link_settings); +#else + rate = (uint8_t ) (lt_settings->link_settings.link_rate); +#endif + +/* Vendor specific: Toggle link rate */ + toggle_rate = (rate ==0x6 ) ?0xA :0x6 ; + +if (link->vendor_specific_lttpr_link_rate_wa == rate) { +core_link_write_dpcd ( + link, +DP_LINK_BW_SET , + &toggle_rate, +1 ); + } + + link->vendor_specific_lttpr_link_rate_wa = rate; + +core_link_write_dpcd (link,DP_LINK_BW_SET , &rate,1 ); + +DC_LOG_HW_LINK_TRAINING ("%s\n %x rate = %x\n %x lane = %x framing = %x\n %x spread = %x\n" , + __func__, +DP_LINK_BW_SET , + lt_settings->link_settings.link_rate, +DP_LANE_COUNT_SET , + lt_settings->link_settings.lane_count, + lt_settings->enhanced_framing, +DP_DOWNSPREAD_CTRL , + lt_settings->link_settings.link_spread); + +/* 2. Perform link training */ + +/* Perform Clock Recovery Sequence */ +if (status ==LINK_TRAINING_SUCCESS ) { +uint32_t retries_cr; +uint32_t retry_count; +uint32_t wait_time_microsec; +enum dc_lane_count lane_count = lt_settings->link_settings.lane_count; +union lane_status dpcd_lane_status[LANE_COUNT_DP_MAX ]; +union lane_align_status_updated dpcd_lane_status_updated; +union lane_adjust dpcd_lane_adjust[LANE_COUNT_DP_MAX ] = {0 }; + + retries_cr =0 ; + retry_count =0 ; + +while ((retries_cr <LINK_TRAINING_MAX_RETRY_COUNT ) && + (retry_count <LINK_TRAINING_MAX_CR_RETRY )) { + +memset (&dpcd_lane_status,'\0' ,sizeof (dpcd_lane_status)); +memset (&dpcd_lane_status_updated,'\0' , +sizeof (dpcd_lane_status_updated)); + +/* 1. call HWSS to set lane settings */ +dp_set_hw_lane_settings ( + link, + lt_settings, +0 ); + +/* 2. update DPCD of the receiver */ +if (!retry_count) { +/* EPR #361076 - write as a 5-byte burst, +* but only for the 1-st iteration. +*/ +dpcd_set_lt_pattern_and_lane_settings ( + link, + lt_settings, + lt_settings->pattern_for_cr, +0 ); +/* Vendor specific: Disable intercept */ +core_link_write_dpcd ( + link, + vendor_lttpr_write_address, + &vendor_lttpr_write_data_intercept_dis[0 ], +sizeof (vendor_lttpr_write_data_intercept_dis)); + }else { + vendor_lttpr_write_data_vs[3 ] =0 ; + vendor_lttpr_write_data_pe[3 ] =0 ; + +for (lane =0 ; lane < lane_count; lane++) { + vendor_lttpr_write_data_vs[3 ] |= + lt_settings->dpcd_lane_settings[lane].bits.VOLTAGE_SWING_SET << (2 * lane); + vendor_lttpr_write_data_pe[3 ] |= + lt_settings->dpcd_lane_settings[lane].bits.PRE_EMPHASIS_SET << (2 * lane); + } + +/* Vendor specific: Update VS and PE to DPRX requested value */ +core_link_write_dpcd ( + link, + vendor_lttpr_write_address, + &vendor_lttpr_write_data_vs[0 ], +sizeof (vendor_lttpr_write_data_vs)); +core_link_write_dpcd ( + link, + vendor_lttpr_write_address, + &vendor_lttpr_write_data_pe[0 ], +sizeof (vendor_lttpr_write_data_pe)); + +dpcd_set_lane_settings ( + link, + lt_settings, +0 ); + } + +/* 3. wait receiver to lock-on*/ + wait_time_microsec = lt_settings->cr_pattern_time; + +dp_wait_for_training_aux_rd_interval ( + link, + wait_time_microsec); + +/* 4. Read lane status and requested drive +* settings as set by the sink +*/ +dp_get_lane_status_and_lane_adjust ( + link, + lt_settings, + dpcd_lane_status, + &dpcd_lane_status_updated, + dpcd_lane_adjust, +0 ); + +/* 5. check CR done*/ +if (dp_is_cr_done (lane_count, dpcd_lane_status)) { + status =LINK_TRAINING_SUCCESS ; +break ; + } + +/* 6. max VS reached*/ +if (dp_is_max_vs_reached (lt_settings)) +break ; + +/* 7. same lane settings */ +/* Note: settings are the same for all lanes, +* so comparing first lane is sufficient +*/ +if (lt_settings->dpcd_lane_settings[0 ].bits.VOLTAGE_SWING_SET == + dpcd_lane_adjust[0 ].bits.VOLTAGE_SWING_LANE) + retries_cr++; +else + retries_cr =0 ; + +/* 8. update VS/PE/PC2 in lt_settings*/ +dp_decide_lane_settings (lt_settings, dpcd_lane_adjust, + lt_settings->hw_lane_settings, lt_settings->dpcd_lane_settings); + retry_count++; + } + +if (retry_count >=LINK_TRAINING_MAX_CR_RETRY ) { +ASSERT (0 ); +DC_LOG_ERROR ("%s: Link Training Error, could not get CR after %d tries. Possibly voltage swing issue" , + __func__, +LINK_TRAINING_MAX_CR_RETRY ); + + } + + status =dp_get_cr_failure (lane_count, dpcd_lane_status); + } + +/* Perform Channel EQ Sequence */ +if (status ==LINK_TRAINING_SUCCESS ) { +enum dc_dp_training_pattern tr_pattern; +uint32_t retries_ch_eq; +uint32_t wait_time_microsec; +enum dc_lane_count lane_count = lt_settings->link_settings.lane_count; +union lane_align_status_updated dpcd_lane_status_updated = {0 }; +union lane_status dpcd_lane_status[LANE_COUNT_DP_MAX ] = {0 }; +union lane_adjust dpcd_lane_adjust[LANE_COUNT_DP_MAX ] = {0 }; + +/* Note: also check that TPS4 is a supported feature*/ + tr_pattern = lt_settings->pattern_for_eq; + +dp_set_hw_training_pattern (link, tr_pattern,0 ); + + status =LINK_TRAINING_EQ_FAIL_EQ ; + +for (retries_ch_eq =0 ; retries_ch_eq <=LINK_TRAINING_MAX_RETRY_COUNT ; + retries_ch_eq++) { + +dp_set_hw_lane_settings (link, lt_settings,0 ); + + vendor_lttpr_write_data_vs[3 ] =0 ; + vendor_lttpr_write_data_pe[3 ] =0 ; + +for (lane =0 ; lane < lane_count; lane++) { + vendor_lttpr_write_data_vs[3 ] |= + lt_settings->dpcd_lane_settings[lane].bits.VOLTAGE_SWING_SET << (2 * lane); + vendor_lttpr_write_data_pe[3 ] |= + lt_settings->dpcd_lane_settings[lane].bits.PRE_EMPHASIS_SET << (2 * lane); + } + +/* Vendor specific: Update VS and PE to DPRX requested value */ +core_link_write_dpcd ( + link, + vendor_lttpr_write_address, + &vendor_lttpr_write_data_vs[0 ], +sizeof (vendor_lttpr_write_data_vs)); +core_link_write_dpcd ( + link, + vendor_lttpr_write_address, + &vendor_lttpr_write_data_pe[0 ], +sizeof (vendor_lttpr_write_data_pe)); + +/* 2. update DPCD*/ +if (!retries_ch_eq) +/* EPR #361076 - write as a 5-byte burst, +* but only for the 1-st iteration +*/ + +dpcd_set_lt_pattern_and_lane_settings ( + link, + lt_settings, + tr_pattern,0 ); +else +dpcd_set_lane_settings (link, lt_settings,0 ); + +/* 3. wait for receiver to lock-on*/ + wait_time_microsec = lt_settings->eq_pattern_time; + +dp_wait_for_training_aux_rd_interval ( + link, + wait_time_microsec); + +/* 4. Read lane status and requested +* drive settings as set by the sink +*/ +dp_get_lane_status_and_lane_adjust ( + link, + lt_settings, + dpcd_lane_status, + &dpcd_lane_status_updated, + dpcd_lane_adjust, +0 ); + +/* 5. check CR done*/ +if (!dp_is_cr_done (lane_count, dpcd_lane_status)) { + status =LINK_TRAINING_EQ_FAIL_CR ; +break ; + } + +/* 6. check CHEQ done*/ +if (dp_is_ch_eq_done (lane_count, dpcd_lane_status) && +dp_is_symbol_locked (lane_count, dpcd_lane_status) && +dp_is_interlane_aligned (dpcd_lane_status_updated)) { + status =LINK_TRAINING_SUCCESS ; +break ; + } + +/* 7. update VS/PE/PC2 in lt_settings*/ +dp_decide_lane_settings (lt_settings, dpcd_lane_adjust, + lt_settings->hw_lane_settings, lt_settings->dpcd_lane_settings); + } + } + +return status; +} + + enum link_training_result dc_link_dp_perform_link_training( struct dc_link *link, const struct dc_link_settings *link_settings,
@@ -2466,7 +2798,11 @@ enum link_training_result dc_link_dp_perform_link_training(* Per DP specs starting from here, DPTX device shall not issue * Non-LT AUX transactions inside training mode. */ -if (encoding == DP_8b_10b_ENCODING) +if (!link->dc->debug.apply_vendor_specific_lttpr_wa && + (link->chip_caps &EXT_DISPLAY_PATH_CAPS__DP_FIXED_VS_EN ) && + link->lttpr_mode ==LTTPR_MODE_TRANSPARENT ) + status =dc_link_dp_perform_fixed_vs_pe_training_sequence (link, <_settings); +else if (encoding == DP_8b_10b_ENCODING) status =dp_perform_8b_10b_link_training (link, <_settings);#if defined(CONFIG_DRM_AMD_DC_DCN ) else if (encoding == DP_128b_132b_ENCODING)
Signature · 1 line
2.25.1
PATCH 4/19 drm/amd/display: Block z-states when stutter period exceeds criteria
In reply to Rodrigo SiqueiraFrom: Nicholas Kazlauskas <[email protected]>
[Why]
Stutter period won't be less than 5000.0, but if PSR is enabled then we can potentially enter Z9 when MPO is enabled.
SMU will try to enter Z9 too early in these cases (before PSR is enabled) and we'll see underflow.
[How]
Block z-states (z9, z10) until we can add a new interface to SMU to signal when we can support z10 but not z9.
We can revert this once the interface change is in.
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1 -2
@@ -3093,8 +3093,7 @@ static enum dcn_zstate_support_state decide_zstate_support(struct dc *dc, strucelse if (context->stream_count ==1 && context->streams[0 ]->signal ==SIGNAL_TYPE_EDP ) {struct dc_link *link = context->streams[0 ]->sink->link; -if ((link->link_index ==0 && link->psr_settings.psr_feature_enabled) - || context->bw_ctx.dml.vba.StutterPeriod >5000.0 ) +if (link->link_index ==0 && context->bw_ctx.dml.vba.StutterPeriod >5000.0 )return DCN_ZSTATE_SUPPORT_ALLOW ;else return DCN_ZSTATE_SUPPORT_DISALLOW ;
Signature · 1 line
2.25.1
PATCH 5/19 drm/amd/display: Added power down for DCN10
In reply to Rodrigo SiqueiraFrom: "Lai, Derek" <[email protected]>
[Why]
The change of setting a timer callback on boot for 10 seconds is still working, just lacked power down for DCN10.
[How]
Added power down for DCN10.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_init.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_init.c +1 -0
@@ -78,6 +78,7 @@ static const struct hw_sequencer_funcs dcn10_funcs = { .get_clock = dcn10_get_clock, .get_vupdate_offset_from_vsync = dcn10_get_vupdate_offset_from_vsync, .calc_vupdate_position = dcn10_calc_vupdate_position, + .power_down = dce110_power_down, .set_backlight_level = dce110_set_backlight_level, .set_abm_immediate_disable = dce110_set_abm_immediate_disable, .set_pipe = dce110_set_pipe,
Signature · 1 line
2.25.1
PATCH 6/19 drm/amd/display: Fix check for null function ptr
In reply to Rodrigo SiqueiraFrom: Alvin Lee <[email protected]>
[Why]
Bug fix for null function ptr (should check for NULL instead of not NULL)
[How]
Fix if condition
--- drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +2 -2
@@ -852,7 +852,7 @@ bool dmub_srv_should_detect(struct dmub_srv *dmub)enum dmub_status dmub_srv_clear_inbox0_ack (struct dmub_srv *dmub) { -if (!dmub->hw_init || dmub->hw_funcs.clear_inbox0_ack_register) +if (!dmub->hw_init || !dmub->hw_funcs.clear_inbox0_ack_register)return DMUB_STATUS_INVALID ; dmub->hw_funcs.clear_inbox0_ack_register (dmub);
@@ -878,7 +878,7 @@ enum dmub_status dmub_srv_wait_for_inbox0_ack(struct dmub_srv *dmub, uint32_t tienum dmub_status dmub_srv_send_inbox0_cmd (struct dmub_srv *dmub,union dmub_inbox0_data_register data) { -if (!dmub->hw_init || dmub->hw_funcs.send_inbox0_cmd) +if (!dmub->hw_init || !dmub->hw_funcs.send_inbox0_cmd)return DMUB_STATUS_INVALID ; dmub->hw_funcs.send_inbox0_cmd (dmub, data);
Signature · 1 line
2.25.1
PATCH 7/19 drm/amd/display: Send s0i2_rdy in stream_count == 0 optimization
In reply to Rodrigo SiqueiraFrom: Nicholas Kazlauskas <[email protected]>
[Why]
Otherwise SMU won't mark Display as idle when trying to perform s2idle.
[How]
Mark the bit in the dcn31 codepath, doesn't apply to older ASIC.
It needed to be split from phy refclk off to prevent entering s2idle when PSR was engaged but driver was not ready.
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c +1 -0
@@ -158,6 +158,7 @@ void dcn31_update_clocks(struct clk_mgr *clk_mgr_base,union display_idle_optimization_u idle_info = {0 }; idle_info.idle_info.df_request_disabled =1 ; idle_info.idle_info.phy_ref_clk_off =1 ; + idle_info.idle_info.s0i2_rdy =1 ;dcn31_smu_set_display_idle_optimization (clk_mgr, idle_info.data);/* update power state */ clk_mgr_base->clks.pwr_state =DCN_PWR_STATE_LOW_POWER ;
Signature · 1 line
2.25.1
PATCH 8/19 drm/amd/display: Remove CR AUX RD Interval limit for LTTPR
In reply to Rodrigo SiqueiraFrom: George Shen <[email protected]>
[Why]
DP spec specifies that DPRX shall use the read interval in the TRAINING_AUX_RD_INTERVAL_PHY_REPEATER LTTPR DPCD register. This register's bit definition is the same as the AUX read interval register for DPRX.
[How}
Remove logic which forces AUX read interval to 100us for repeaters when in LTTPR non-transparent mode.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +0 -3
@@ -1544,9 +1544,6 @@ static enum link_training_result perform_clock_recovery_sequence(/* 3. wait receiver to lock-on*/ wait_time_microsec = lt_settings->cr_pattern_time; -if (link->lttpr_mode ==LTTPR_MODE_NON_TRANSPARENT ) - wait_time_microsec =TRAINING_AUX_RD_INTERVAL ; -if (link->dc->debug.apply_vendor_specific_lttpr_wa && (link->chip_caps &EXT_DISPLAY_PATH_CAPS__DP_FIXED_VS_EN )) { wait_time_microsec =16000 ;
Signature · 1 line
2.25.1
PATCH 9/19 drm/amd/display: Set optimize_pwr_state for DCN31
In reply to Rodrigo SiqueiraFrom: Nicholas Kazlauskas <[email protected]>
[Why]
We'll exit optimized power state to do link detection but we won't enter back into the optimized power state.
This could potentially block s2idle entry depending on the sequencing, but it also means we're losing some power during the transition period.
[How]
Hook up the handler like DCN21. It was also missed like the exit_optimized_pwr_state callback.
--- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_init.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_init.c +1 -0
@@ -103,6 +103,7 @@ static const struct hw_sequencer_funcs dcn31_funcs = { .z10_restore = dcn31_z10_restore, .z10_save_init = dcn31_z10_save_init, .set_disp_pattern_generator = dcn30_set_disp_pattern_generator, + .optimize_pwr_state = dcn21_optimize_pwr_state, .exit_optimized_pwr_state = dcn21_exit_optimized_pwr_state, .update_visual_confirm_color = dcn20_update_visual_confirm_color, };
Signature · 1 line
2.25.1
PATCH 10/19 drm/amd/display: Changed pipe split policy to allow for multi-display pipe split
In reply to Rodrigo SiqueiraFrom: Angus Wang <[email protected]>
[WHY]
Current implementation of pipe split policy prevents pipe split with multiple displays connected, which caused the MCLK speed to be stuck at max
[HOW]
Changed the pipe split policies so that pipe split is allowed for multi-display configurations
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1 -1
@@ -1069,7 +1069,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE, .vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c +1 -1
@@ -603,7 +603,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE, .vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +1 -1
@@ -873,7 +873,7 @@ static const struct dc_debug_options debug_defaults_drv = { .clock_trace = true, .disable_pplib_clock_request = true, .min_disp_clk_khz = 100000, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE, .vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +1 -1
@@ -840,7 +840,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE, .vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c +1 -1
@@ -686,7 +686,7 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_clock_gate = true, .disable_pplib_clock_request = true, .disable_pplib_wm_range = true, - .pipe_split_policy = MPC_SPLIT_AVOID, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE, .vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c +1 -1
@@ -211,7 +211,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE, .vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c +1 -1
@@ -193,7 +193,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE, .vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c +1 -1
@@ -1003,7 +1003,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = false, - .pipe_split_policy = MPC_SPLIT_AVOID, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE, .vsr_support = true,
Signature · 1 line
2.25.1
Re: [PATCH 10/19] drm/amd/display: Changed pipe split policy to allow for multi-display pipe split
[AMD Official Use Only]
Maybe add Bug links for:
https://gitlab.freedesktop.org/drm/amd/-/issues/1522
https://gitlab.freedesktop.org/drm/amd/-/issues/1709
https://gitlab.freedesktop.org/drm/amd/-/issues/1655
https://gitlab.freedesktop.org/drm/amd/-/issues/1403
________________________________
From: amd-gfx <[email protected]> on behalf of Rodrigo Siqueira <[email protected]>
Sent: Friday, December 17, 2021 4:23 PM
To: [email protected] <[email protected]>
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Cyr, Aric <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Pillai, Aurabindo <[email protected]>; Wang, Angus <[email protected]>; Lin, Wayne <[email protected]>; Lipski, Mikita <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: [PATCH 10/19] drm/amd/display: Changed pipe split policy to allow for multi-display pipe split
From: Angus Wang <[email protected]>
[WHY]
Current implementation of pipe split policy prevents pipe split with multiple displays connected, which caused the MCLK speed to be stuck at max
[HOW]
Changed the pipe split policies so that pipe split is allowed for multi-display configurations
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1 -1
@@ -1069,7 +1069,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE, .vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c +1 -1
@@ -603,7 +603,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE, .vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +1 -1
@@ -873,7 +873,7 @@ static const struct dc_debug_options debug_defaults_drv = { .clock_trace = true, .disable_pplib_clock_request = true, .min_disp_clk_khz = 100000, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE, .vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +1 -1
@@ -840,7 +840,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE, .vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c +1 -1
@@ -686,7 +686,7 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_clock_gate = true, .disable_pplib_clock_request = true, .disable_pplib_wm_range = true, - .pipe_split_policy = MPC_SPLIT_AVOID, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE, .vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c +1 -1
@@ -211,7 +211,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE, .vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c +1 -1
@@ -193,7 +193,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE, .vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c +1 -1
@@ -1003,7 +1003,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = false, - .pipe_split_policy = MPC_SPLIT_AVOID, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE, .vsr_support = true,
--
2.25.1
Re: [PATCH 10/19] drm/amd/display: Changed pipe split policy to allow for multi-display pipe split
Quoted 8 lines · Alexander
[AMD Official Use Only]
Maybe add Bug links for:
https://gitlab.freedesktop.org/drm/amd/-/issues/1522 <https://gitlab.freedesktop.org/drm/amd/-/issues/1522>
https://gitlab.freedesktop.org/drm/amd/-/issues/1709 <https://gitlab.freedesktop.org/drm/amd/-/issues/1709>
https://gitlab.freedesktop.org/drm/amd/-/issues/1655 <https://gitlab.freedesktop.org/drm/amd/-/issues/1655>
https://gitlab.freedesktop.org/drm/amd/-/issues/1403 <https://gitlab.freedesktop.org/drm/amd/-/issues/1403>
Sure, I'll update the commit message before apply this patch.
Thanks.
Quoted 149 lines
------------------------------------------------------------------------
*From:* amd-gfx <[email protected]> on behalf of Rodrigo Siqueira <[email protected]>
*Sent:* Friday, December 17, 2021 4:23 PM
*To:* [email protected] <[email protected]>
*Cc:* Wang, Chao-kai (Stylon) <[email protected]>; Cyr, Aric <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Pillai, Aurabindo <[email protected]>; Wang, Angus <[email protected]>; Lin, Wayne <[email protected]>; Lipski, Mikita <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]> *Subject:* [PATCH 10/19] drm/amd/display: Changed pipe split policy to allow for multi-display pipe split
From: Angus Wang <[email protected]>[WHY]
Current implementation of pipe split policy prevents pipe split with multiple displays connected, which caused the MCLK speed to be stuck at max[HOW]
Changed the pipe split policies so that pipe split is allowed for multi-display configurationsReviewed-by Aric Cyr <[email protected]>Acked-by Rodrigo Siqueira <[email protected]>Signed-off-by Angus Wang <[email protected]>--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1
-1@@ -1069,7 +1069,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c +1
-1@@ -603,7 +603,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +1
-1@@ -873,7 +873,7 @@ static const struct dc_debug_options debug_defaults_drv = { .clock_trace = true, .disable_pplib_clock_request = true, .min_disp_clk_khz = 100000, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +1
-1@@ -840,7 +840,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c +1
-1@@ -686,7 +686,7 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_clock_gate = true, .disable_pplib_clock_request = true, .disable_pplib_wm_range = true, - .pipe_split_policy = MPC_SPLIT_AVOID, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c +1
-1@@ -211,7 +211,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c +1
-1@@ -193,7 +193,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c +1
-1@@ -1003,7 +1003,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = false, - .pipe_split_policy = MPC_SPLIT_AVOID, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
Signature · 1 line
2.25.1
Re: [PATCH 10/19] drm/amd/display: Changed pipe split policy to allow for multi-display pipe split
Quoted 17 lines · Rodrigo Siqueira Jordao
Quoted 12 lines · Alexander
[AMD Official Use Only]
Maybe add Bug links for:
https://gitlab.freedesktop.org/drm/amd/-/issues/1522
<https://gitlab.freedesktop.org/drm/amd/-/issues/1522>
https://gitlab.freedesktop.org/drm/amd/-/issues/1709
<https://gitlab.freedesktop.org/drm/amd/-/issues/1709>
https://gitlab.freedesktop.org/drm/amd/-/issues/1655
<https://gitlab.freedesktop.org/drm/amd/-/issues/1655>
https://gitlab.freedesktop.org/drm/amd/-/issues/1403
<https://gitlab.freedesktop.org/drm/amd/-/issues/1403>
Quoted 47 lines
Sure, I'll update the commit message before apply this patch.
Thanks.
Quoted 43 lines
------------------------------------------------------------------------
*From:* amd-gfx <[email protected]> on behalf of Rodrigo Siqueira <[email protected]>
*Sent:* Friday, December 17, 2021 4:23 PM
*To:* [email protected] <[email protected]> *Cc:* Wang, Chao-kai (Stylon) <[email protected]>; Cyr, Aric <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Pillai, Aurabindo <[email protected]>; Wang, Angus <[email protected]>; Lin, Wayne <[email protected]>; Lipski, Mikita <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
*Subject:* [PATCH 10/19] drm/amd/display: Changed pipe split policy to allow for multi-display pipe split
From: Angus Wang <[email protected]>[WHY]
Current implementation of pipe split policy prevents pipe split with multiple displays connected, which caused the MCLK speed to be stuck at max[HOW]
Changed the pipe split policies so that pipe split is allowed for multi-display configurationsReviewed-by Aric Cyr <[email protected]>Acked-by Rodrigo Siqueira <[email protected]>Signed-off-by Angus Wang <[email protected]>--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 2 +-
Also, it looks like dcn10_resource.c was missed. Was that intentional?
Alex
Quoted 126 lines
Quoted 125 lines
8 files changed, 8 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1
-1@@ -1069,7 +1069,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c +1
-1@@ -603,7 +603,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +1
-1@@ -873,7 +873,7 @@ static const struct dc_debug_options debug_defaults_drv = { .clock_trace = true, .disable_pplib_clock_request = true, .min_disp_clk_khz = 100000, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +1
-1@@ -840,7 +840,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c +1
-1@@ -686,7 +686,7 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_clock_gate = true, .disable_pplib_clock_request = true, .disable_pplib_wm_range = true, - .pipe_split_policy = MPC_SPLIT_AVOID, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c +1
-1@@ -211,7 +211,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c +1
-1@@ -193,7 +193,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c +1
-1@@ -1003,7 +1003,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = false, - .pipe_split_policy = MPC_SPLIT_AVOID, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
--
2.25.1
Re: [PATCH 10/19] drm/amd/display: Changed pipe split policy to allow for multi-display pipe split
Quoted 68 lines · Alex Deucher
Quoted 17 lines · Rodrigo Siqueira Jordao
Quoted 12 lines · Alexander
[AMD Official Use Only]
Maybe add Bug links for:
https://gitlab.freedesktop.org/drm/amd/-/issues/1522
<https://gitlab.freedesktop.org/drm/amd/-/issues/1522>
https://gitlab.freedesktop.org/drm/amd/-/issues/1709
<https://gitlab.freedesktop.org/drm/amd/-/issues/1709>
https://gitlab.freedesktop.org/drm/amd/-/issues/1655
<https://gitlab.freedesktop.org/drm/amd/-/issues/1655>
https://gitlab.freedesktop.org/drm/amd/-/issues/1403
<https://gitlab.freedesktop.org/drm/amd/-/issues/1403>Quoted 47 lines
Sure, I'll update the commit message before apply this patch.
Thanks.
Quoted 43 lines
------------------------------------------------------------------------
*From:* amd-gfx <[email protected]> on behalf of Rodrigo Siqueira <[email protected]>
*Sent:* Friday, December 17, 2021 4:23 PM
*To:* [email protected] <[email protected]> *Cc:* Wang, Chao-kai (Stylon) <[email protected]>; Cyr, Aric <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Pillai, Aurabindo <[email protected]>; Wang, Angus <[email protected]>; Lin, Wayne <[email protected]>; Lipski, Mikita <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
*Subject:* [PATCH 10/19] drm/amd/display: Changed pipe split policy to allow for multi-display pipe split
From: Angus Wang <[email protected]>[WHY]
Current implementation of pipe split policy prevents pipe split with multiple displays connected, which caused the MCLK speed to be stuck at max[HOW]
Changed the pipe split policies so that pipe split is allowed for multi-display configurationsReviewed-by Aric Cyr <[email protected]>Acked-by Rodrigo Siqueira <[email protected]>Signed-off-by Angus Wang <[email protected]>--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 2 +-
Quoted 1 line
Also, it looks like
dcn10_resource.cwas missed. Was that intentional?
Ping on this. Changing dcn10_resource.c as well fixes:
https://gitlab.freedesktop.org/drm/amd/-/issues/1522
Alex
Quoted 130 lines
Alex
Quoted 126 lines
Quoted 125 lines
8 files changed, 8 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1
-1@@ -1069,7 +1069,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c +1
-1@@ -603,7 +603,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +1
-1@@ -873,7 +873,7 @@ static const struct dc_debug_options debug_defaults_drv = { .clock_trace = true, .disable_pplib_clock_request = true, .min_disp_clk_khz = 100000, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +1
-1@@ -840,7 +840,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c +1
-1@@ -686,7 +686,7 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_clock_gate = true, .disable_pplib_clock_request = true, .disable_pplib_wm_range = true, - .pipe_split_policy = MPC_SPLIT_AVOID, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c +1
-1@@ -211,7 +211,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c +1
-1@@ -193,7 +193,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = true, - .pipe_split_policy = MPC_SPLIT_AVOID_MULT_DISP, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c +1
-1@@ -1003,7 +1003,7 @@ static const struct dc_debug_options debug_defaults_drv = { .timing_trace = false, .clock_trace = true, .disable_pplib_clock_request = false, - .pipe_split_policy = MPC_SPLIT_AVOID, + .pipe_split_policy = MPC_SPLIT_DYNAMIC, .force_single_disp_pipe_split = false, .disable_dcc = DCC_ENABLE,.vsr_support = true,
--
2.25.1
PATCH 11/19 drm/amd/display: Add reg defs for DCN303
In reply to Rodrigo SiqueiraFrom: Wesley Chalmers <[email protected]>
[WHY]
These registers are currently missing from the DCN303 header files
--- .../drm/amd/display/dc/dcn303/dcn303_dccg.h | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn303/dcn303_dccg.h +18 -2
@@ -15,7 +15,11 @@SR (DPPCLK_DTO_CTRL ),\DCCG_SRII (DTO_PARAM ,DPPCLK ,0 ),\DCCG_SRII (DTO_PARAM ,DPPCLK ,1 ),\ - SR(REFCLK_CNTL) +SR (REFCLK_CNTL ),\ +SR (DISPCLK_FREQ_CHANGE_CNTL ),\ +DCCG_SRII (PIXEL_RATE_CNTL ,OTG ,0 ),\ + DCCG_SRII(PIXEL_RATE_CNTL, OTG, 1) + #define DCCG_MASK_SH_LIST_DCN3_03(mask_sh) \ DCCG_SFI(DPPCLK_DTO_CTRL, DTO_ENABLE, DPPCLK, 0, mask_sh),\
@@ -25,6 +29,18 @@DCCG_SF (DPPCLK0_DTO_PARAM ,DPPCLK0_DTO_PHASE , mask_sh),\DCCG_SF (DPPCLK0_DTO_PARAM ,DPPCLK0_DTO_MODULO , mask_sh),\DCCG_SF (REFCLK_CNTL ,REFCLK_CLOCK_EN , mask_sh),\ - DCCG_SF(REFCLK_CNTL, REFCLK_SRC_SEL, mask_sh) +DCCG_SF (REFCLK_CNTL ,REFCLK_SRC_SEL , mask_sh),\ +DCCG_SF (DISPCLK_FREQ_CHANGE_CNTL ,DISPCLK_STEP_DELAY , mask_sh),\ +DCCG_SF (DISPCLK_FREQ_CHANGE_CNTL ,DISPCLK_STEP_SIZE , mask_sh),\ +DCCG_SF (DISPCLK_FREQ_CHANGE_CNTL ,DISPCLK_FREQ_RAMP_DONE , mask_sh),\ +DCCG_SF (DISPCLK_FREQ_CHANGE_CNTL ,DISPCLK_MAX_ERRDET_CYCLES , mask_sh),\ +DCCG_SF (DISPCLK_FREQ_CHANGE_CNTL ,DCCG_FIFO_ERRDET_RESET , mask_sh),\ +DCCG_SF (DISPCLK_FREQ_CHANGE_CNTL ,DCCG_FIFO_ERRDET_STATE , mask_sh),\ +DCCG_SF (DISPCLK_FREQ_CHANGE_CNTL ,DCCG_FIFO_ERRDET_OVR_EN , mask_sh),\ +DCCG_SF (DISPCLK_FREQ_CHANGE_CNTL ,DISPCLK_CHG_FWD_CORR_DISABLE , mask_sh),\ +DCCG_SFII (OTG ,PIXEL_RATE_CNTL ,OTG ,ADD_PIXEL ,0 , mask_sh),\ +DCCG_SFII (OTG ,PIXEL_RATE_CNTL ,OTG ,ADD_PIXEL ,1 , mask_sh),\ +DCCG_SFII (OTG ,PIXEL_RATE_CNTL ,OTG ,DROP_PIXEL ,0 , mask_sh),\ +DCCG_SFII (OTG ,PIXEL_RATE_CNTL ,OTG ,DROP_PIXEL ,1 , mask_sh) #endif //__DCN303_DCCG_H__
Signature · 1 line
2.25.1
PATCH 12/19 drm/amd/display: Undo ODM combine
In reply to Rodrigo SiqueiraFrom: Martin Leung <[email protected]>
Undo ODM Combine regression causing causing pipe allocation issues.
--- .../gpu/drm/amd/display/dc/core/dc_resource.c | 81 +++++-------------- .../drm/amd/display/dc/dcn30/dcn30_resource.c | 11 --- 2 files changed, 21 insertions(+), 71 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +21 -60
@@ -734,10 +734,6 @@ static void calculate_split_count_and_index(struct pipe_ctx *pipe_ctx, int *spli (*split_idx)++; split_pipe = split_pipe->top_pipe; } - -/* MPO window on right side of ODM split */ -if (split_pipe && split_pipe->prev_odm_pipe && !pipe_ctx->prev_odm_pipe) - (*split_idx)++; }else {/*Get odm split index*/ struct pipe_ctx *split_pipe = pipe_ctx->prev_odm_pipe;
@@ -784,11 +780,7 @@ static void calculate_recout(struct pipe_ctx *pipe_ctx)/* * Only the leftmost ODM pipe should be offset by a nonzero distance */ -if (pipe_ctx->top_pipe && pipe_ctx->top_pipe->prev_odm_pipe && !pipe_ctx->prev_odm_pipe) { -/* MPO window on right side of ODM split */ - data->recout.x = stream->dst.x + (surf_clip.x - stream->dst.width/2 ) * - stream->dst.width / stream->src.width; - }else if (!pipe_ctx->prev_odm_pipe || split_idx == split_count) { +if (!pipe_ctx->prev_odm_pipe || split_idx == split_count) { data->recout.x = stream->dst.x;if (stream->src.x < surf_clip.x) data->recout.x += (surf_clip.x - stream->src.x) * stream->dst.width
@@ -986,8 +978,6 @@ static void calculate_inits_and_viewports(struct pipe_ctx *pipe_ctx) * stream->dst.height / stream->src.height;if (pipe_ctx->prev_odm_pipe && split_idx) ro_lb = data->h_active * split_idx - recout_full_x; -else if (pipe_ctx->top_pipe && pipe_ctx->top_pipe->prev_odm_pipe) - ro_lb = data->h_active * split_idx - recout_full_x + data->recout.x;else ro_lb = data->recout.x - recout_full_x; ro_tb = data->recout.y - recout_full_y;
@@ -1086,9 +1076,6 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx) timing->v_border_top + timing->v_border_bottom;if (pipe_ctx->next_odm_pipe || pipe_ctx->prev_odm_pipe) pipe_ctx->plane_res.scl_data.h_active /=get_num_odm_splits (pipe_ctx) +1 ; -/* ODM + windows MPO, where window is on either right or left ODM half */ -else if (pipe_ctx->top_pipe && (pipe_ctx->top_pipe->next_odm_pipe || pipe_ctx->top_pipe->prev_odm_pipe)) - pipe_ctx->plane_res.scl_data.h_active /=get_num_odm_splits (pipe_ctx->top_pipe) +1 ;/* depends on h_active */ calculate_recout (pipe_ctx);
@@ -1097,6 +1084,11 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)/* depends on scaling ratios and recout, does not calculate offset yet */ calculate_viewport_size (pipe_ctx); +/* Stopgap for validation of ODM + MPO on one side of screen case */ +if (pipe_ctx->plane_res.scl_data.viewport.height <1 || + pipe_ctx->plane_res.scl_data.viewport.width <1 ) +return false; +/* * LB calculations depend on vp size, h/v_active and scaling ratios * Setting line buffer pixel depth to 24bpp yields banding
@@ -1445,54 +1437,23 @@ bool dc_add_plane_to_context(if (head_pipe != free_pipe) { tail_pipe =resource_get_tail_pipe (&context->res_ctx, head_pipe);ASSERT (tail_pipe); - -/* ODM + window MPO, where MPO window is on right half only */ -if (free_pipe->plane_state && - (free_pipe->plane_state->clip_rect.x >= free_pipe->stream->src.width/2 ) && - tail_pipe->next_odm_pipe) { - free_pipe->stream_res.tg = tail_pipe->next_odm_pipe->stream_res.tg; - free_pipe->stream_res.abm = tail_pipe->next_odm_pipe->stream_res.abm; - free_pipe->stream_res.opp = tail_pipe->next_odm_pipe->stream_res.opp; - free_pipe->stream_res.stream_enc = tail_pipe->next_odm_pipe->stream_res.stream_enc; - free_pipe->stream_res.audio = tail_pipe->next_odm_pipe->stream_res.audio; - free_pipe->clock_source = tail_pipe->next_odm_pipe->clock_source; - - free_pipe->top_pipe = tail_pipe->next_odm_pipe; - tail_pipe->next_odm_pipe->bottom_pipe = free_pipe; - }else { - free_pipe->stream_res.tg = tail_pipe->stream_res.tg; - free_pipe->stream_res.abm = tail_pipe->stream_res.abm; - free_pipe->stream_res.opp = tail_pipe->stream_res.opp; - free_pipe->stream_res.stream_enc = tail_pipe->stream_res.stream_enc; - free_pipe->stream_res.audio = tail_pipe->stream_res.audio; - free_pipe->clock_source = tail_pipe->clock_source; - - free_pipe->top_pipe = tail_pipe; - tail_pipe->bottom_pipe = free_pipe; - -if (!free_pipe->next_odm_pipe && tail_pipe->next_odm_pipe && tail_pipe->next_odm_pipe->bottom_pipe) { - free_pipe->next_odm_pipe = tail_pipe->next_odm_pipe->bottom_pipe; - tail_pipe->next_odm_pipe->bottom_pipe->prev_odm_pipe = free_pipe; - } -if (!free_pipe->prev_odm_pipe && tail_pipe->prev_odm_pipe && tail_pipe->prev_odm_pipe->bottom_pipe) { - free_pipe->prev_odm_pipe = tail_pipe->prev_odm_pipe->bottom_pipe; - tail_pipe->prev_odm_pipe->bottom_pipe->next_odm_pipe = free_pipe; - } + free_pipe->stream_res.tg = tail_pipe->stream_res.tg; + free_pipe->stream_res.abm = tail_pipe->stream_res.abm; + free_pipe->stream_res.opp = tail_pipe->stream_res.opp; + free_pipe->stream_res.stream_enc = tail_pipe->stream_res.stream_enc; + free_pipe->stream_res.audio = tail_pipe->stream_res.audio; + free_pipe->clock_source = tail_pipe->clock_source; + free_pipe->top_pipe = tail_pipe; + tail_pipe->bottom_pipe = free_pipe; +if (!free_pipe->next_odm_pipe && tail_pipe->next_odm_pipe && tail_pipe->next_odm_pipe->bottom_pipe) { + free_pipe->next_odm_pipe = tail_pipe->next_odm_pipe->bottom_pipe; + tail_pipe->next_odm_pipe->bottom_pipe->prev_odm_pipe = free_pipe; + } +if (!free_pipe->prev_odm_pipe && tail_pipe->prev_odm_pipe && tail_pipe->prev_odm_pipe->bottom_pipe) { + free_pipe->prev_odm_pipe = tail_pipe->prev_odm_pipe->bottom_pipe; + tail_pipe->prev_odm_pipe->bottom_pipe->next_odm_pipe = free_pipe; } } - -/* ODM + window MPO, where MPO window is on left half only */ -if (free_pipe->plane_state && - (free_pipe->plane_state->clip_rect.x + free_pipe->plane_state->clip_rect.width <= - free_pipe->stream->src.x + free_pipe->stream->src.width/2 )) { -break ; - } -/* ODM + window MPO, where MPO window is on right half only */ -if (free_pipe->plane_state && - (free_pipe->plane_state->clip_rect.x >= free_pipe->stream->src.width/2 )) { -break ; - } - head_pipe = head_pipe->next_odm_pipe; }/* assign new surfaces*/
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +0 -11
@@ -1761,17 +1761,6 @@ static bool dcn30_split_stream_for_mpc_or_odm(int pipe_idx = sec_pipe->pipe_idx;const struct resource_pool *pool = dc->res_pool; -if (pri_pipe->plane_state) { -/* ODM + window MPO, where MPO window is on left half only */ -if (pri_pipe->plane_state->clip_rect.x + pri_pipe->plane_state->clip_rect.width <= - pri_pipe->stream->src.x + pri_pipe->stream->src.width/2 ) -return true; - -/* ODM + window MPO, where MPO window is on right half only */ -if (pri_pipe->plane_state->clip_rect.x >= pri_pipe->stream->src.width/2 ) -return true; - } - *sec_pipe = *pri_pipe; sec_pipe->pipe_idx = pipe_idx;
Signature · 1 line
2.25.1
PATCH 13/19 drm/amd/display: [FW Promotion] Release 0.0.98
In reply to Rodrigo SiqueiraFrom: Anthony Koo <[email protected]>
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +2 -2
@@ -47,10 +47,10 @@/* Firmware versioning. */ #ifdef DMUB_EXPOSE_VERSION -#define DMUB_FW_VERSION_GIT_HASH 0xc99a4517 +#define DMUB_FW_VERSION_GIT_HASH 0xbaf06b95#define DMUB_FW_VERSION_MAJOR 0#define DMUB_FW_VERSION_MINOR 0 -#define DMUB_FW_VERSION_REVISION 97 +#define DMUB_FW_VERSION_REVISION 98#define DMUB_FW_VERSION_TEST 0#define DMUB_FW_VERSION_VBIOS 0#define DMUB_FW_VERSION_HOTFIX 0
Signature · 1 line
2.25.1
PATCH 14/19 drm/amd/display: 3.2.167
In reply to Rodrigo SiqueiraFrom: Aric Cyr <[email protected]>
This version brings along the following:
- Fixes and improvements in the LTTPR code
- Improve z-state
- Fix null pointer check
- Improve communication with s0i2
- Update multiple-display split policy
- Add missing registers
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -47,7 +47,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.166" +#define DC_VER "3.2.167"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.25.1
PATCH 15/19 drm/amd/display: define link res and make it accessible to all link interfaces
In reply to Rodrigo SiqueiraFrom: Wenjing Liu <[email protected]>
[why]
There will be a series of re-arch changes in Link Resource Management. They are more and more muxable link resource objects and the resource is insufficient for a one to one allocation to all links created. Therefore a link resource sharing logic is required to determine which link should use certain link resource.
This commit is the first one in this series that starts by defining a link resource struct, this struct will be available to all interfaces that need to perform link programming sequence.
In later commits, we will granduately decouple link resource objects out of dc link. So instead of access a link resource from dc link. Current link's resource can be accessible through pipe_ctx->link_res during commit, or by calling dc_link_get_cur_link_res function with current link passed in after commit.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 69 +++++--- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 152 +++++++++++------- .../drm/amd/display/dc/core/dc_link_dpia.c | 48 ++++-- .../drm/amd/display/dc/core/dc_link_hwss.c | 30 ++-- drivers/gpu/drm/amd/display/dc/dc_link.h | 8 + .../gpu/drm/amd/display/dc/inc/core_types.h | 6 + .../gpu/drm/amd/display/dc/inc/dc_link_dp.h | 15 +- .../gpu/drm/amd/display/dc/inc/dc_link_dpia.h | 5 +- .../gpu/drm/amd/display/dc/inc/link_hwss.h | 10 +- 9 files changed, 229 insertions(+), 114 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +50 -19
@@ -986,7 +986,7 @@ static bool dc_link_detect_helper(struct dc_link *link,* empty which leads to allocate_mst_payload() has "0" * pbn_per_slot value leading to exception on dc_fixpt_div() */ -dp_verify_mst_link_cap (link); +dp_verify_mst_link_cap (link,NULL );/* * This call will initiate MST topology discovery. Which
@@ -1150,6 +1150,7 @@ static bool dc_link_detect_helper(struct dc_link *link,// verify link cap for SST non-seamless boot if (!perform_dp_seamless_boot)dp_verify_link_cap_with_retries (link, +NULL , &link->reported_link_cap,LINK_TRAINING_MAX_VERIFY_RETRY ); }else {
@@ -2503,7 +2504,8 @@ static void write_i2c_redriver_setting(DC_LOG_DEBUG ("Set redriver failed" ); } -static void disable_link (struct dc_link *link,enum signal_type signal) +static void disable_link (struct dc_link *link,const struct link_resource *link_res, +enum signal_type signal) {/* * TODO: implement call for dp_set_hw_test_pattern
@@ -2522,20 +2524,20 @@ static void disable_link(struct dc_link *link, enum signal_type signal)struct dc_link_settings link_settings = link->cur_link_settings;#endif if (dc_is_dp_sst_signal (signal)) -dp_disable_link_phy (link, signal); +dp_disable_link_phy (link, link_res, signal);else -dp_disable_link_phy_mst (link, signal); +dp_disable_link_phy_mst (link, link_res, signal);if (dc_is_dp_sst_signal (signal) || link->mst_stream_alloc_table.stream_count ==0 ) {#if defined(CONFIG_DRM_AMD_DC_DCN )if (dp_get_link_encoding_format (&link_settings) == DP_8b_10b_ENCODING) {dp_set_fec_enable (link, false); -dp_set_fec_ready (link, false); +dp_set_fec_ready (link, link_res, false); }#else dp_set_fec_enable (link, false); -dp_set_fec_ready (link, false); +dp_set_fec_ready (link, link_res, false);#endif } }else {
@@ -2646,7 +2648,7 @@ static enum dc_status enable_link(* new link settings. */ if (link->link_status.link_active) { -disable_link (link, pipe_ctx->stream->signal); +disable_link (link, &pipe_ctx->link_res, pipe_ctx->stream->signal); }switch (pipe_ctx->stream->signal) {
@@ -4109,7 +4111,7 @@ static void fpga_dp_hpo_enable_link_and_stream(struct dc_state *state, struct pi stream->link->cur_link_settings = link_settings;/* Enable clock, Configure lane count, and Enable Link Encoder*/ -enable_dp_hpo_output (stream->link, &stream->link->cur_link_settings); +enable_dp_hpo_output (stream->link, &pipe_ctx->link_res, &stream->link->cur_link_settings);#ifdef DIAGS_BUILD /* Workaround for FPGA HPO capture DP link data:
@@ -4353,7 +4355,8 @@ void core_link_enable_stream(if (status !=DC_FAIL_DP_LINK_TRAINING || pipe_ctx->stream->signal ==SIGNAL_TYPE_DISPLAY_PORT_MST ) {if (false == stream->link->link_status.link_active) -disable_link (stream->link, pipe_ctx->stream->signal); +disable_link (stream->link, &pipe_ctx->link_res, + pipe_ctx->stream->signal);BREAK_TO_DEBUGGER ();return ; }
@@ -4502,14 +4505,14 @@ void core_link_disable_stream(struct pipe_ctx *pipe_ctx)* state machine. * In DP2 or MST mode, our encoder will stay video active */ -disable_link (pipe_ctx->stream->link, pipe_ctx->stream->signal); +disable_link (pipe_ctx->stream->link, &pipe_ctx->link_res, pipe_ctx->stream->signal); dc->hwss.disable_stream(pipe_ctx); }else { dc->hwss.disable_stream (pipe_ctx); -disable_link (pipe_ctx->stream->link, pipe_ctx->stream->signal); +disable_link (pipe_ctx->stream->link, &pipe_ctx->link_res, pipe_ctx->stream->signal); }#else -disable_link (pipe_ctx->stream->link, pipe_ctx->stream->signal); +disable_link (pipe_ctx->stream->link, &pipe_ctx->link_res, pipe_ctx->stream->signal); dc->hwss.disable_stream (pipe_ctx);#endif
@@ -4592,16 +4595,22 @@ void dc_link_set_drive_settings(struct dc *dc, {int i; +struct pipe_ctx *pipe =NULL ; +const struct link_resource *link_res; -for (i =0 ; i < dc->link_count; i++) { -if (dc->links[i] == link) -break ; - } + link_res =dc_link_get_cur_link_res (link); -if (i >= dc->link_count) +for (i =0 ; i <MAX_PIPES ; i++) { + pipe = &dc->current_state->res_ctx.pipe_ctx[i]; +if (pipe->stream && pipe->stream->link) { +if (pipe->stream->link == link) +break ; + } + } +if (pipe && link_res) +dc_link_dp_set_drive_settings (pipe->stream->link, link_res, lt_settings); +else ASSERT_CRITICAL (false); - -dc_link_dp_set_drive_settings (dc->links[i], lt_settings); } void dc_link_set_preferred_link_settings(struct dc *dc,
@@ -4793,6 +4802,9 @@ void dc_link_overwrite_extended_receiver_cap(bool dc_link_is_fec_supported (const struct dc_link *link) { +/* TODO - use asic cap instead of link_enc->features +* we no longer know which link enc to use for this link before commit +*/ struct link_encoder *link_enc =NULL ;/* Links supporting dynamically assigned link encoder will be assigned next
@@ -4887,3 +4899,22 @@ uint32_t dc_bandwidth_in_kbps_from_timing(return kbps; } + +const struct link_resource *dc_link_get_cur_link_res (const struct dc_link *link) +{ +int i; +struct pipe_ctx *pipe =NULL ; +const struct link_resource *link_res =NULL ; + +for (i =0 ; i <MAX_PIPES ; i++) { + pipe = &link->dc->current_state->res_ctx.pipe_ctx[i]; +if (pipe->stream && pipe->stream->link && pipe->top_pipe ==NULL ) { +if (pipe->stream->link == link) { + link_res = &pipe->link_res; +break ; + } + } + } + +return link_res; +}
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +91 -61
585 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/core/dc_link_dpia.c +32 -16
132 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +20 -10
@@ -71,6 +71,7 @@ void dp_source_sequence_trace(struct dc_link *link, uint8_t dp_test_mode)void dp_enable_link_phy (struct dc_link *link, +const struct link_resource *link_res,enum signal_type signal,enum clock_source_id clock_source,const struct dc_link_settings *link_settings)
@@ -135,7 +136,7 @@ void dp_enable_link_phy(#if defined(CONFIG_DRM_AMD_DC_DCN )if (dp_get_link_encoding_format (link_settings) == DP_128b_132b_ENCODING) { -enable_dp_hpo_output (link, link_settings); +enable_dp_hpo_output (link, link_res, link_settings); }else if (dp_get_link_encoding_format (link_settings) == DP_8b_10b_ENCODING) {if (dc_is_dp_sst_signal (signal)) { link_enc->funcs->enable_dp_output(
@@ -236,7 +237,8 @@ bool edp_receiver_ready_T7(struct dc_link *link)return result; } -void dp_disable_link_phy (struct dc_link *link,enum signal_type signal) +void dp_disable_link_phy (struct dc_link *link,const struct link_resource *link_res, +enum signal_type signal) {struct dc *dc = link->ctx->dc;struct dmcu *dmcu = dc->res_pool->dmcu;
@@ -260,7 +262,7 @@ void dp_disable_link_phy(struct dc_link *link, enum signal_type signal) link->dc->hwss.edp_backlight_control (link, false);#if defined(CONFIG_DRM_AMD_DC_DCN )if (dp_get_link_encoding_format (&link->cur_link_settings) == DP_128b_132b_ENCODING) -disable_dp_hpo_output (link, signal); +disable_dp_hpo_output (link, link_res, signal);else link_enc->funcs->disable_output (link_enc, signal);#else
@@ -274,7 +276,7 @@ void dp_disable_link_phy(struct dc_link *link, enum signal_type signal)#if defined(CONFIG_DRM_AMD_DC_DCN )if (dp_get_link_encoding_format (&link->cur_link_settings) == DP_128b_132b_ENCODING && hpo_link_enc) -disable_dp_hpo_output (link, signal); +disable_dp_hpo_output (link, link_res, signal);else link_enc->funcs->disable_output (link_enc, signal);#else
@@ -294,13 +296,14 @@ void dp_disable_link_phy(struct dc_link *link, enum signal_type signal) dc->clk_mgr->funcs->notify_link_rate_change (dc->clk_mgr, link); } -void dp_disable_link_phy_mst (struct dc_link *link,enum signal_type signal) +void dp_disable_link_phy_mst (struct dc_link *link,const struct link_resource *link_res, +enum signal_type signal) {/* MST disable link only when no stream use the link */ if (link->mst_stream_alloc_table.stream_count >0 )return ; -dp_disable_link_phy (link, signal); +dp_disable_link_phy (link, link_res, signal);/* set the sink to SST mode after disabling the link */ dp_enable_mst_on_sink (link, false);
@@ -308,6 +311,7 @@ void dp_disable_link_phy_mst(struct dc_link *link, enum signal_type signal)bool dp_set_hw_training_pattern (struct dc_link *link, +const struct link_resource *link_res,enum dc_dp_training_pattern pattern,uint32_t offset) {
@@ -338,7 +342,7 @@ bool dp_set_hw_training_pattern(break ; } -dp_set_hw_test_pattern (link, test_pattern,NULL ,0 ); +dp_set_hw_test_pattern (link, link_res, test_pattern,NULL ,0 );return true; }
@@ -349,6 +353,7 @@ bool dp_set_hw_training_pattern(#endif void dp_set_hw_lane_settings (struct dc_link *link, +const struct link_resource *link_res,const struct link_training_settings *link_settings,uint32_t offset) {
@@ -379,6 +384,7 @@ void dp_set_hw_lane_settings(void dp_set_hw_test_pattern (struct dc_link *link, +const struct link_resource *link_res,enum dp_test_pattern test_pattern,uint8_t *custom_pattern,uint32_t custom_pattern_size)
@@ -446,7 +452,7 @@ void dp_retrain_link_dp_test(struct dc_link *link, pipes[i].stream_res.stream_enc);/* disable any test pattern that might be active */ -dp_set_hw_test_pattern (link, +dp_set_hw_test_pattern (link, &pipes[i].link_res,DP_TEST_PATTERN_VIDEO_MODE ,NULL ,0 );dp_receiver_power_ctrl (link, false);
@@ -763,7 +769,9 @@ static enum phyd32clk_clock_source get_phyd32clk_src(struct dc_link *link) } } -void enable_dp_hpo_output (struct dc_link *link,const struct dc_link_settings *link_settings) +void enable_dp_hpo_output (struct dc_link *link, +const struct link_resource *link_res, +const struct dc_link_settings *link_settings) {const struct dc *dc = link->dc;enum phyd32clk_clock_source phyd32clk;
@@ -814,7 +822,9 @@ void enable_dp_hpo_output(struct dc_link *link, const struct dc_link_settings *l } } -void disable_dp_hpo_output (struct dc_link *link,enum signal_type signal) +void disable_dp_hpo_output (struct dc_link *link, +const struct link_resource *link_res, +enum signal_type signal) {const struct dc *dc = link->dc;
drivers/gpu/drm/amd/display/dc/dc_link.h +8 -0
@@ -30,6 +30,8 @@#include "dc_types.h" #include "grph_object_defs.h" +struct link_resource ; +enum dc_link_fec_state { dc_link_fec_not_ready, dc_link_fec_ready,
@@ -359,14 +361,17 @@ void dc_link_remove_remote_sink(void dc_link_dp_set_drive_settings (struct dc_link *link, +const struct link_resource *link_res,struct link_training_settings *lt_settings);bool dc_link_dp_perform_link_training_skip_aux (struct dc_link *link, +const struct link_resource *link_res,const struct dc_link_settings *link_setting);enum link_training_result dc_link_dp_perform_link_training (struct dc_link *link, +const struct link_resource *link_res,const struct dc_link_settings *link_settings,bool skip_video_pattern);
@@ -374,6 +379,7 @@ bool dc_link_dp_sync_lt_begin(struct dc_link *link);enum link_training_result dc_link_dp_sync_lt_attempt (struct dc_link *link, +const struct link_resource *link_res,struct dc_link_settings *link_setting,struct dc_link_training_overrides *lt_settings);
@@ -454,4 +460,6 @@ bool dc_link_should_enable_fec(const struct dc_link *link);uint32_t dc_link_bw_kbps_from_raw_frl_link_rate_data (uint8_t bw);enum dp_link_encoding dc_link_dp_mst_decide_link_encoding_format (const struct dc_link *link);#endif + +const struct link_resource *dc_link_get_cur_link_res (const struct dc_link *link);#endif /* DC_LINK_H_ */
drivers/gpu/drm/amd/display/dc/inc/core_types.h +6 -0
@@ -334,6 +334,11 @@ struct plane_resource {struct dcn_fe_bandwidth bw; }; +/* all mappable hardware resources used to enable a link */ +struct link_resource { +void *dummy; +}; + union pipe_update_flags { struct { uint32_t enable : 1;
@@ -361,6 +366,7 @@ struct pipe_ctx {struct plane_resource plane_res;struct stream_resource stream_res; +struct link_resource link_res;struct clock_source *clock_source;
drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h +11 -4
@@ -56,16 +56,19 @@ enum {bool dp_verify_link_cap (struct dc_link *link, +const struct link_resource *link_res,struct dc_link_settings *known_limit_link_setting,int *fail_count);bool dp_verify_link_cap_with_retries (struct dc_link *link, +const struct link_resource *link_res,struct dc_link_settings *known_limit_link_setting,int attempts);bool dp_verify_mst_link_cap ( -struct dc_link *link); +struct dc_link *link, +const struct link_resource *link_res); bool dp_validate_mode_timing( struct dc_link *link,
@@ -168,7 +171,7 @@ uint8_t dc_dp_initialize_scrambling_data_symbols(struct dc_link *link, enum dc_dp_training_pattern pattern); -enum dc_status dp_set_fec_ready (struct dc_link *link,bool ready); +enum dc_status dp_set_fec_ready (struct dc_link *link,const struct link_resource *link_res,bool ready);void dp_set_fec_enable (struct dc_link *link,bool enable);struct link_encoder *dp_get_link_enc (struct dc_link *link);bool dp_set_dsc_enable (struct pipe_ctx *pipe_ctx,bool enable);
@@ -211,8 +214,12 @@ bool dpcd_poll_for_allocation_change_trigger(struct dc_link *link);struct fixed31_32 calculate_sst_avg_time_slots_per_mtp (const struct dc_stream_state *stream,const struct dc_link *link); -void enable_dp_hpo_output (struct dc_link *link,const struct dc_link_settings *link_settings); -void disable_dp_hpo_output (struct dc_link *link,enum signal_type signal); +void enable_dp_hpo_output (struct dc_link *link, +const struct link_resource *link_res, +const struct dc_link_settings *link_settings); +void disable_dp_hpo_output (struct dc_link *link, +const struct link_resource *link_res, +enum signal_type signal);void setup_dp_hpo_stream (struct pipe_ctx *pipe_ctx,bool enable);bool is_dp_128b_132b_signal (struct pipe_ctx *pipe_ctx);void reset_dp_hpo_stream_encoders_for_link (struct dc_link *link);
drivers/gpu/drm/amd/display/dc/inc/dc_link_dpia.h +3 -2
@@ -91,8 +91,9 @@ enum dc_status dpcd_get_tunneling_device_data(struct dc_link *link);* DPIA equivalent of dc_link_dp_perfrorm_link_training. * Aborts link training upon detection of sink unplug. */ -enum link_training_result -dc_link_dpia_perform_link_training (struct dc_link *link, +enum link_training_result dc_link_dpia_perform_link_training ( +struct dc_link *link, +const struct link_resource *link_res,const struct dc_link_settings *link_setting,bool skip_video_pattern);
drivers/gpu/drm/amd/display/dc/inc/link_hwss.h +8 -2
@@ -32,6 +32,7 @@ struct gpio *get_hpd_gpio(struct dc_bios *dcb,void dp_enable_link_phy (struct dc_link *link, +const struct link_resource *link_res,enum signal_type signal,enum clock_source_id clock_source,const struct dc_link_settings *link_settings);
@@ -42,22 +43,27 @@ void edp_add_delay_for_T9(struct dc_link *link);bool edp_receiver_ready_T9 (struct dc_link *link);bool edp_receiver_ready_T7 (struct dc_link *link); -void dp_disable_link_phy (struct dc_link *link,enum signal_type signal); +void dp_disable_link_phy (struct dc_link *link,const struct link_resource *link_res, +enum signal_type signal); -void dp_disable_link_phy_mst (struct dc_link *link,enum signal_type signal); +void dp_disable_link_phy_mst (struct dc_link *link,const struct link_resource *link_res, +enum signal_type signal);bool dp_set_hw_training_pattern (struct dc_link *link, +const struct link_resource *link_res,enum dc_dp_training_pattern pattern,uint32_t offset);void dp_set_hw_lane_settings (struct dc_link *link, +const struct link_resource *link_res,const struct link_training_settings *link_settings,uint32_t offset);void dp_set_hw_test_pattern (struct dc_link *link, +const struct link_resource *link_res,enum dp_test_pattern test_pattern,uint8_t *custom_pattern,uint32_t custom_pattern_size);
Signature · 1 line
2.25.1
PATCH 16/19 drm/amd/display: populate link res in both detection and validation
In reply to Rodrigo SiqueiraFrom: Wenjing Liu <[email protected]>
[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
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 9 ++++++--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 1 + drivers/gpu/drm/amd/display/dc/inc/core_types.h | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +6 -3
@@ -881,6 +881,7 @@ static bool dc_link_detect_helper(struct dc_link *link,enum dc_connection_type pre_connection_type = dc_connection_none;bool perform_dp_seamless_boot = false;const uint32_t post_oui_delay =30 ;// 30ms +struct link_resource link_res = {0 };DC_LOGGER_INIT (link->ctx->logger);
@@ -974,8 +975,10 @@ static bool dc_link_detect_helper(struct dc_link *link, }#if defined(CONFIG_DRM_AMD_DC_DCN ) -if (dp_get_link_encoding_format (&link->reported_link_cap) == DP_128b_132b_ENCODING) +if (dp_get_link_encoding_format (&link->reported_link_cap) == DP_128b_132b_ENCODING) {add_dp_hpo_link_encoder_to_link (link); + link_res.hpo_dp_link_enc = link->hpo_dp_link_enc; + }#endif if (link->type == dc_connection_mst_branch) {
@@ -986,7 +989,7 @@ static bool dc_link_detect_helper(struct dc_link *link,* empty which leads to allocate_mst_payload() has "0" * pbn_per_slot value leading to exception on dc_fixpt_div() */ -dp_verify_mst_link_cap (link,NULL ); +dp_verify_mst_link_cap (link, &link_res);/* * This call will initiate MST topology discovery. Which
@@ -1150,7 +1153,7 @@ static bool dc_link_detect_helper(struct dc_link *link,// verify link cap for SST non-seamless boot if (!perform_dp_seamless_boot)dp_verify_link_cap_with_retries (link, -NULL , + &link_res, &link->reported_link_cap,LINK_TRAINING_MAX_VERIFY_RETRY ); }else {
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -0
@@ -2161,6 +2161,7 @@ enum dc_status resource_map_pool_resources( &context->res_ctx, pool, pipe_ctx->stream_res.hpo_dp_stream_enc, true); + pipe_ctx->link_res.hpo_dp_link_enc = stream->link->hpo_dp_link_enc; } }#endif
drivers/gpu/drm/amd/display/dc/inc/core_types.h +4 -0
@@ -336,7 +336,11 @@ struct plane_resource {/* all mappable hardware resources used to enable a link */ struct link_resource { +#if defined(CONFIG_DRM_AMD_DC_DCN ) +struct hpo_dp_link_encoder *hpo_dp_link_enc; +#else void *dummy; +#endif };union pipe_update_flags {
Signature · 1 line
2.25.1
PATCH 17/19 drm/amd/display: access hpo dp link encoder only through link resource
In reply to Rodrigo SiqueiraFrom: Wenjing Liu <[email protected]>
[why]
Update all accesses to use hpo dp link encoder through link resource only.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 22 +++++++------- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 12 +++++--- .../drm/amd/display/dc/core/dc_link_hwss.c | 30 +++++++++---------- drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 14 +++------ .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 2 +- .../gpu/drm/amd/display/dc/dml/dml_wrapper.c | 2 +- 7 files changed, 40 insertions(+), 43 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +10 -12
@@ -3426,7 +3426,7 @@ static enum dc_status dc_link_update_sst_payload(struct pipe_ctx *pipe_ctx, {struct dc_stream_state *stream = pipe_ctx->stream;struct dc_link *link = stream->link; -struct hpo_dp_link_encoder *hpo_dp_link_encoder = link->hpo_dp_link_enc; +struct hpo_dp_link_encoder *hpo_dp_link_encoder = pipe_ctx->link_res.hpo_dp_link_enc;struct hpo_dp_stream_encoder *hpo_dp_stream_encoder = pipe_ctx->stream_res.hpo_dp_stream_enc;struct link_mst_stream_allocation_table proposed_table = {0 };struct fixed31_32 avg_time_slots_per_mtp;
@@ -3508,7 +3508,7 @@ enum dc_status dc_link_allocate_mst_payload(struct pipe_ctx *pipe_ctx)struct link_encoder *link_encoder =NULL ;struct stream_encoder *stream_encoder = pipe_ctx->stream_res.stream_enc;#if defined(CONFIG_DRM_AMD_DC_DCN ) -struct hpo_dp_link_encoder *hpo_dp_link_encoder = link->hpo_dp_link_enc; +struct hpo_dp_link_encoder *hpo_dp_link_encoder = pipe_ctx->link_res.hpo_dp_link_enc;struct hpo_dp_stream_encoder *hpo_dp_stream_encoder = pipe_ctx->stream_res.hpo_dp_stream_enc;#endif struct dp_mst_stream_allocation_table proposed_table = {0 };
@@ -3838,7 +3838,7 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)struct link_encoder *link_encoder =NULL ;struct stream_encoder *stream_encoder = pipe_ctx->stream_res.stream_enc;#if defined(CONFIG_DRM_AMD_DC_DCN ) -struct hpo_dp_link_encoder *hpo_dp_link_encoder = link->hpo_dp_link_enc; +struct hpo_dp_link_encoder *hpo_dp_link_encoder = pipe_ctx->link_res.hpo_dp_link_enc;struct hpo_dp_stream_encoder *hpo_dp_stream_encoder = pipe_ctx->stream_res.hpo_dp_stream_enc;#endif struct dp_mst_stream_allocation_table proposed_table = {0 };
@@ -4164,12 +4164,12 @@ static void fpga_dp_hpo_enable_link_and_stream(struct dc_state *state, struct pi proposed_table.stream_allocations[0 ].hpo_dp_stream_enc = pipe_ctx->stream_res.hpo_dp_stream_enc; } - stream->link->hpo_dp_link_enc->funcs->update_stream_allocation_table ( - stream->link->hpo_dp_link_enc, + pipe_ctx->link_res.hpo_dp_link_enc->funcs->update_stream_allocation_table ( + pipe_ctx->link_res.hpo_dp_link_enc, &proposed_table); - stream->link->hpo_dp_link_enc->funcs->set_throttled_vcp_size ( - stream->link->hpo_dp_link_enc, + pipe_ctx->link_res.hpo_dp_link_enc->funcs->set_throttled_vcp_size ( + pipe_ctx->link_res.hpo_dp_link_enc, pipe_ctx->stream_res.hpo_dp_stream_enc->inst, avg_time_slots_per_mtp);
@@ -4674,11 +4674,9 @@ void dc_link_set_preferred_training_settings(struct dc *dc,if (link_setting !=NULL ) { link->preferred_link_setting = *link_setting;#if defined(CONFIG_DRM_AMD_DC_DCN ) -if (dp_get_link_encoding_format (link_setting) == - DP_128b_132b_ENCODING && !link->hpo_dp_link_enc) { -if (!add_dp_hpo_link_encoder_to_link (link)) -memset (&link->preferred_link_setting,0 ,sizeof (link->preferred_link_setting)); - } +if (dp_get_link_encoding_format (link_setting) == DP_128b_132b_ENCODING) +/* TODO: add dc update for acquiring link res */ + skip_immediate_retrain = true;#endif }else { link->preferred_link_setting.lane_count =LANE_COUNT_UNKNOWN ;
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +8 -4
@@ -3211,9 +3211,11 @@ static struct dc_link_settings get_max_link_cap(struct dc_link *link,if (link_enc) link_enc->funcs->get_max_link_cap (link_enc, &max_link_cap);#if defined(CONFIG_DRM_AMD_DC_DCN ) -if (max_link_cap.link_rate >=LINK_RATE_UHBR10 && - !link->hpo_dp_link_enc) - max_link_cap.link_rate =LINK_RATE_HIGH3 ; +if (max_link_cap.link_rate >=LINK_RATE_UHBR10 ) { +if (!link_res->hpo_dp_link_enc || + link->dc->debug.disable_uhbr) + max_link_cap.link_rate =LINK_RATE_HIGH3 ; + }#endif /* Lower link settings based on sink's link cap */
@@ -7016,8 +7018,10 @@ struct fixed31_32 calculate_sst_avg_time_slots_per_mtp(bool is_dp_128b_132b_signal (struct pipe_ctx *pipe_ctx) { +/* If this assert is hit then we have a link encoder dynamic management issue */ +ASSERT (pipe_ctx->stream_res.hpo_dp_stream_enc ? pipe_ctx->link_res.hpo_dp_link_enc !=NULL : true);return (pipe_ctx->stream_res.hpo_dp_stream_enc && - pipe_ctx->stream->link->hpo_dp_link_enc && + pipe_ctx->link_res.hpo_dp_link_enc &&dc_is_dp_signal (pipe_ctx->stream->signal)); }#endif
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +15 -15
@@ -243,7 +243,7 @@ void dp_disable_link_phy(struct dc_link *link, const struct link_resource *link_struct dc *dc = link->ctx->dc;struct dmcu *dmcu = dc->res_pool->dmcu;#if defined(CONFIG_DRM_AMD_DC_DCN ) -struct hpo_dp_link_encoder *hpo_link_enc = link->hpo_dp_link_enc; +struct hpo_dp_link_encoder *hpo_link_enc = link_res->hpo_dp_link_enc;#endif struct link_encoder *link_enc;
@@ -366,8 +366,8 @@ void dp_set_hw_lane_settings(#if defined(CONFIG_DRM_AMD_DC_DCN )if (dp_get_link_encoding_format (&link_settings->link_settings) == DP_128b_132b_ENCODING) { - link->hpo_dp_link_enc->funcs->set_ffe ( - link->hpo_dp_link_enc, + link_res->hpo_dp_link_enc->funcs->set_ffe ( + link_res->hpo_dp_link_enc, &link_settings->link_settings, link_settings->lane_settings[0 ].FFE_PRESET.raw); } else if (dp_get_link_encoding_format(&link_settings->link_settings)
@@ -412,8 +412,8 @@ void dp_set_hw_test_pattern(#if defined(CONFIG_DRM_AMD_DC_DCN )switch (link_encoding_format) {case DP_128b_132b_ENCODING: - link->hpo_dp_link_enc->funcs->set_link_test_pattern ( - link->hpo_dp_link_enc, &pattern_param); + link_res->hpo_dp_link_enc->funcs->set_link_test_pattern ( + link_res->hpo_dp_link_enc, &pattern_param);break ;case DP_8b_10b_ENCODING:ASSERT (encoder);
@@ -797,8 +797,8 @@ void enable_dp_hpo_output(struct dc_link *link, } }else {/* DP2.0 HW: call transmitter control to enable PHY */ - link->hpo_dp_link_enc->funcs->enable_link_phy ( - link->hpo_dp_link_enc, + link_res->hpo_dp_link_enc->funcs->enable_link_phy ( + link_res->hpo_dp_link_enc, link_settings, link->link_enc->transmitter); }
@@ -814,11 +814,11 @@ void enable_dp_hpo_output(struct dc_link *link, phyd32clk =get_phyd32clk_src (link); dc->res_pool->dccg->funcs->enable_symclk32_le ( dc->res_pool->dccg, - link->hpo_dp_link_enc->inst, + link_res->hpo_dp_link_enc->inst, phyd32clk); - link->hpo_dp_link_enc->funcs->link_enable ( - link->hpo_dp_link_enc, - link_settings->lane_count); + link_res->hpo_dp_link_enc->funcs->link_enable ( + link_res->hpo_dp_link_enc, + link_settings->lane_count); } }
@@ -828,12 +828,12 @@ void disable_dp_hpo_output(struct dc_link *link, {const struct dc *dc = link->dc; - link->hpo_dp_link_enc->funcs->link_disable (link->hpo_dp_link_enc); + link_res->hpo_dp_link_enc->funcs->link_disable (link_res->hpo_dp_link_enc);if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { dc->res_pool->dccg->funcs->disable_symclk32_le ( dc->res_pool->dccg, - link->hpo_dp_link_enc->inst); + link_res->hpo_dp_link_enc->inst); dc->res_pool->dccg->funcs->set_physymclk( dc->res_pool->dccg,
@@ -844,8 +844,8 @@ void disable_dp_hpo_output(struct dc_link *link,dm_set_phyd32clk (dc->ctx,0 ); }else {/* DP2.0 HW: call transmitter control to disable PHY */ - link->hpo_dp_link_enc->funcs->disable_link_phy ( - link->hpo_dp_link_enc, + link_res->hpo_dp_link_enc->funcs->disable_link_phy ( + link_res->hpo_dp_link_enc, signal); } }
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -691,6 +691,7 @@ struct dc_debug_options {/* TODO - remove once tested */ bool legacy_dp2_lt;bool set_mst_en_for_sst; +bool disable_uhbr;bool force_dp2_lt_fallback_method;#endif union mem_low_power_enable_options enable_mem_low_power;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +4 -10
@@ -468,8 +468,6 @@ void dcn10_log_hw_state(struct dc *dc,log_mpc_crc (dc, log_ctx); { -int hpo_dp_link_enc_count =0 ; -if (pool->hpo_dp_stream_enc_count >0 ) {DTN_INFO ("DP HPO S_ENC: Enabled OTG Format Depth Vid SDP Compressed Link\n" );for (i =0 ; i < pool->hpo_dp_stream_enc_count; i++) {
@@ -500,18 +498,14 @@ void dcn10_log_hw_state(struct dc *dc, }/* log DP HPO L_ENC section if any hpo_dp_link_enc exists */ -for (i =0 ; i < dc->link_count; i++) -if (dc->links[i]->hpo_dp_link_enc) - hpo_dp_link_enc_count++; - -if (hpo_dp_link_enc_count) { +if (pool->hpo_dp_link_enc_count) {DTN_INFO ("DP HPO L_ENC: Enabled Mode Lanes Stream Slots VC Rate X VC Rate Y\n" ); -for (i =0 ; i < dc->link_count; i++) { -struct hpo_dp_link_encoder *hpo_dp_link_enc = dc->links[i]->hpo_dp_link_enc; +for (i =0 ; i < pool->hpo_dp_link_enc_count; i++) { +struct hpo_dp_link_encoder *hpo_dp_link_enc = pool->hpo_dp_link_enc[i];struct hpo_dp_link_enc_state hpo_dp_le_state = {0 }; -if (hpo_dp_link_enc && hpo_dp_link_enc->funcs->read_state) { +if (hpo_dp_link_enc->funcs->read_state) { hpo_dp_link_enc->funcs->read_state (hpo_dp_link_enc, &hpo_dp_le_state); DTN_INFO("[%d]: %d %6s %d %d %d %d %d\n", hpo_dp_link_enc->inst,
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +1 -1
@@ -2414,7 +2414,7 @@ void dcn20_enable_stream(struct pipe_ctx *pipe_ctx) pipe_ctx->stream_res.hpo_dp_stream_enc->funcs->map_stream_to_link ( pipe_ctx->stream_res.hpo_dp_stream_enc, pipe_ctx->stream_res.hpo_dp_stream_enc->inst, - link->hpo_dp_link_enc->inst); + pipe_ctx->link_res.hpo_dp_link_enc->inst); }if (!is_dp_128b_132b_signal (pipe_ctx) && link_enc)
drivers/gpu/drm/amd/display/dc/dml/dml_wrapper.c +1 -1
@@ -1274,7 +1274,7 @@ static void dcn20_adjust_adaptive_sync_v_startup(static bool is_dp_128b_132b_signal (struct pipe_ctx *pipe_ctx) {return (pipe_ctx->stream_res.hpo_dp_stream_enc && - pipe_ctx->stream->link->hpo_dp_link_enc && + pipe_ctx->link_res.hpo_dp_link_enc &&dc_is_dp_signal (pipe_ctx->stream->signal)); }
Signature · 1 line
2.25.1
PATCH 18/19 drm/amd/display: support dynamic HPO DP link encoder allocation
In reply to Rodrigo SiqueiraFrom: Wenjing Liu <[email protected]>
[why]
When there are more DP2.0 RXs connected than the number HPO DP link encoders we have, we need to dynamically allocate HPO DP link encoder to the port that needs it.
[how]
Only allocate HPO DP link encoder when it is needed.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 18 --- .../gpu/drm/amd/display/dc/core/dc_debug.c | 2 + drivers/gpu/drm/amd/display/dc/core/dc_link.c | 43 ++----- .../drm/amd/display/dc/core/dc_link_hwss.c | 3 +- .../gpu/drm/amd/display/dc/core/dc_resource.c | 119 ++++++++++++++++-- drivers/gpu/drm/amd/display/dc/dc_link.h | 3 - .../dc/dcn31/dcn31_hpo_dp_link_encoder.c | 6 +- .../dc/dcn31/dcn31_hpo_dp_link_encoder.h | 3 +- .../gpu/drm/amd/display/dc/inc/core_status.h | 2 + .../gpu/drm/amd/display/dc/inc/core_types.h | 2 + .../drm/amd/display/dc/inc/hw/link_encoder.h | 3 +- drivers/gpu/drm/amd/display/dc/inc/resource.h | 6 +- 12 files changed, 134 insertions(+), 76 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -18
@@ -274,24 +274,6 @@ static bool create_links( goto failed_alloc; } -#if defined(CONFIG_DRM_AMD_DC_DCN ) -if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) && - dc->caps.dp_hpo && - link->dc->res_pool->res_cap->num_hpo_dp_link_encoder >0 ) { -/* FPGA case - Allocate HPO DP link encoder */ -if (i < link->dc->res_pool->res_cap->num_hpo_dp_link_encoder) { - link->hpo_dp_link_enc = link->dc->res_pool->hpo_dp_link_enc[i]; - -if (link->hpo_dp_link_enc ==NULL ) { -BREAK_TO_DEBUGGER (); - goto failed_alloc; - } - link->hpo_dp_link_enc->hpd_source = link->link_enc->hpd_source; - link->hpo_dp_link_enc->transmitter = link->link_enc->transmitter; - } - } -#endif - link->link_status.dpcd_caps = &link->dpcd_caps; enc_init.ctx = dc->ctx;
drivers/gpu/drm/amd/display/dc/core/dc_debug.c +2 -0
@@ -422,6 +422,8 @@ char *dc_status_to_str(enum dc_status status)return "The operation is not supported." ;case DC_UNSUPPORTED_VALUE :return "The value specified is not supported." ; +case DC_NO_LINK_ENC_RESOURCE : +return "No link encoder resource" ;case DC_ERROR_UNEXPECTED :return "Unexpected error" ; }
drivers/gpu/drm/amd/display/dc/core/dc_link.c +7 -36
67 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +2 -1
@@ -800,7 +800,8 @@ void enable_dp_hpo_output(struct dc_link *link, link_res->hpo_dp_link_enc->funcs->enable_link_phy ( link_res->hpo_dp_link_enc, link_settings, - link->link_enc->transmitter); + link->link_enc->transmitter, + link->link_enc->hpd_source); }/* DCCG muxing and DTBCLK DTO */
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +106 -13
153 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dc_link.h +0 -3
@@ -162,9 +162,6 @@ struct dc_link {struct panel_cntl *panel_cntl;struct link_encoder *link_enc; -#if defined(CONFIG_DRM_AMD_DC_DCN ) -struct hpo_dp_link_encoder *hpo_dp_link_enc; -#endif struct graphics_object_id link_id;/* Endpoint type distinguishes display endpoints which do not have entries * in the BIOS connector table from those that do. Helps when tracking link
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hpo_dp_link_encoder.c +5 -1
@@ -499,7 +499,8 @@ static enum bp_result link_transmitter_control(void dcn31_hpo_dp_link_enc_enable_dp_output (struct hpo_dp_link_encoder *enc,const struct dc_link_settings *link_settings, -enum transmitter transmitter) +enum transmitter transmitter, +enum hpd_source_id hpd_source) {struct dcn31_hpo_dp_link_encoder *enc3 =DCN3_1_HPO_DP_LINK_ENC_FROM_HPO_LINK_ENC (enc);struct bp_transmitter_control cntl = {0 };
@@ -508,6 +509,9 @@ void dcn31_hpo_dp_link_enc_enable_dp_output(/* Set the transmitter */ enc3->base.transmitter = transmitter; +/* Set the hpd source */ + enc3->base.hpd_source = hpd_source; +/* Enable the PHY */ cntl.action =TRANSMITTER_CONTROL_ENABLE ; cntl.engine_id =ENGINE_ID_UNKNOWN ;
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hpo_dp_link_encoder.h +2 -1
@@ -184,7 +184,8 @@ void hpo_dp_link_encoder31_construct(struct dcn31_hpo_dp_link_encoder *enc31,void dcn31_hpo_dp_link_enc_enable_dp_output (struct hpo_dp_link_encoder *enc,const struct dc_link_settings *link_settings, -enum transmitter transmitter); +enum transmitter transmitter, +enum hpd_source_id hpd_source); void dcn31_hpo_dp_link_enc_disable_output( struct hpo_dp_link_encoder *enc,
drivers/gpu/drm/amd/display/dc/inc/core_status.h +2 -0
@@ -53,6 +53,8 @@ enum dc_status {DC_NOT_SUPPORTED =24 ,DC_UNSUPPORTED_VALUE =25 , +DC_NO_LINK_ENC_RESOURCE =26 , + DC_ERROR_UNEXPECTED = -1 };
drivers/gpu/drm/amd/display/dc/inc/core_types.h +2 -0
@@ -422,6 +422,8 @@ struct resource_context {struct link_enc_cfg_context link_enc_cfg_ctx;#if defined(CONFIG_DRM_AMD_DC_DCN )bool is_hpo_dp_stream_enc_acquired[MAX_HPO_DP2_ENCODERS ]; +unsigned int hpo_dp_link_enc_to_link_idx[MAX_HPO_DP2_LINK_ENCODERS ]; +int hpo_dp_link_enc_ref_cnts[MAX_HPO_DP2_LINK_ENCODERS ];#endif #if defined(CONFIG_DRM_AMD_DC_DCN )bool is_mpc_3dlut_acquired[MAX_PIPES ];
drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h +2 -1
@@ -268,7 +268,8 @@ struct hpo_dp_link_encoder_funcs {void (*enable_link_phy)(struct hpo_dp_link_encoder *enc,const struct dc_link_settings *link_settings, -enum transmitter transmitter); +enum transmitter transmitter, +enum hpd_source_id hpd_source);void (*disable_link_phy)(struct hpo_dp_link_encoder *link_enc,enum signal_type signal);
drivers/gpu/drm/amd/display/dc/inc/resource.h +4 -2
@@ -206,8 +206,10 @@ int get_num_mpc_splits(struct pipe_ctx *pipe);int get_num_odm_splits (struct pipe_ctx *pipe);#if defined(CONFIG_DRM_AMD_DC_DCN ) -struct hpo_dp_link_encoder *resource_get_unused_hpo_dp_link_encoder ( -const struct resource_pool *pool); +struct hpo_dp_link_encoder *resource_get_hpo_dp_link_enc_for_det_lt ( +const struct resource_context *res_ctx, +const struct resource_pool *pool, +const struct dc_link *link);#endif void reset_syncd_pipes_from_disabled_pipes(struct dc *dc,
Signature · 1 line
2.25.1
PATCH 19/19 drm/amd/display: get and restore link res map
In reply to Rodrigo SiqueiraFrom: Wenjing Liu <[email protected]>
[why]
When reboot the link res map should be persisted. So during boot up, driver will look at the map to determine which link should take priority to use certain link res. This is to ensure that link res remains unshuffled after a reboot.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 103 ++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc_link.h | 4 + .../gpu/drm/amd/display/dc/inc/core_types.h | 5 + 3 files changed, 112 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +103 -0
@@ -4890,3 +4890,106 @@ const struct link_resource *dc_link_get_cur_link_res(const struct dc_link *link)return link_res; } + +/** +* dc_get_cur_link_res_map() - take a snapshot of current link resource allocation state +* @dc: pointer to dc of the dm calling this +* @map: a dc link resource snapshot defined internally to dc. +* +* DM needs to capture a snapshot of current link resource allocation mapping +* and store it in its persistent storage. +* +* Some of the link resource is using first come first serve policy. +* The allocation mapping depends on original hotplug order. This information +* is lost after driver is loaded next time. The snapshot is used in order to +* restore link resource to its previous state so user will get consistent +* link capability allocation across reboot. +* +* Return: none (void function) +* +*/ +void dc_get_cur_link_res_map (const struct dc *dc,uint32_t *map) +{ +#if defined(CONFIG_DRM_AMD_DC_DCN ) +struct dc_link *link; +uint8_t i; +uint32_t hpo_dp_recycle_map =0 ; + + *map =0 ; + +if (dc->caps.dp_hpo) { +for (i =0 ; i < dc->caps.max_links; i++) { + link = dc->links[i]; +if (link->link_status.link_active && +dp_get_link_encoding_format (&link->reported_link_cap) == DP_128b_132b_ENCODING && +dp_get_link_encoding_format (&link->cur_link_settings) != DP_128b_132b_ENCODING) +/* hpo dp link encoder is considered as recycled, when RX reports 128b/132b encoding capability +* but current link doesn't use it. +*/ + hpo_dp_recycle_map |= (1 << i); + } + *map |= (hpo_dp_recycle_map <<LINK_RES_HPO_DP_REC_MAP__SHIFT ); + } +#endif +} + +/** +* dc_restore_link_res_map() - restore link resource allocation state from a snapshot +* @dc: pointer to dc of the dm calling this +* @map: a dc link resource snapshot defined internally to dc. +* +* DM needs to call this function after initial link detection on boot and +* before first commit streams to restore link resource allocation state +* from previous boot session. +* +* Some of the link resource is using first come first serve policy. +* The allocation mapping depends on original hotplug order. This information +* is lost after driver is loaded next time. The snapshot is used in order to +* restore link resource to its previous state so user will get consistent +* link capability allocation across reboot. +* +* Return: none (void function) +* +*/ +void dc_restore_link_res_map (const struct dc *dc,uint32_t *map) +{ +#if defined(CONFIG_DRM_AMD_DC_DCN ) +struct dc_link *link; +uint8_t i; +unsigned int available_hpo_dp_count; +uint32_t hpo_dp_recycle_map = (*map &LINK_RES_HPO_DP_REC_MAP__MASK ) + >>LINK_RES_HPO_DP_REC_MAP__SHIFT ; + +if (dc->caps.dp_hpo) { + available_hpo_dp_count = dc->res_pool->hpo_dp_link_enc_count; +/* remove excess 128b/132b encoding support for not recycled links */ +for (i =0 ; i < dc->caps.max_links; i++) { +if ((hpo_dp_recycle_map & (1 << i)) ==0 ) { + link = dc->links[i]; +if (link->type != dc_connection_none && +dp_get_link_encoding_format (&link->verified_link_cap) == DP_128b_132b_ENCODING) { +if (available_hpo_dp_count >0 ) + available_hpo_dp_count--; +else +/* remove 128b/132b encoding capability by limiting verified link rate to HBR3 */ + link->verified_link_cap.link_rate =LINK_RATE_HIGH3 ; + } + } + } +/* remove excess 128b/132b encoding support for recycled links */ +for (i =0 ; i < dc->caps.max_links; i++) { +if ((hpo_dp_recycle_map & (1 << i)) !=0 ) { + link = dc->links[i]; +if (link->type != dc_connection_none && +dp_get_link_encoding_format (&link->verified_link_cap) == DP_128b_132b_ENCODING) { +if (available_hpo_dp_count >0 ) + available_hpo_dp_count--; +else +/* remove 128b/132b encoding capability by limiting verified link rate to HBR3 */ + link->verified_link_cap.link_rate =LINK_RATE_HIGH3 ; + } + } + } + } +#endif +}
drivers/gpu/drm/amd/display/dc/dc_link.h +4 -0
@@ -459,4 +459,8 @@ enum dp_link_encoding dc_link_dp_mst_decide_link_encoding_format(const struct dc#endif const struct link_resource *dc_link_get_cur_link_res (const struct dc_link *link); +/* take a snapshot of current link resource allocation state */ +void dc_get_cur_link_res_map (const struct dc *dc,uint32_t *map); +/* restore link resource allocation state from a snapshot */ +void dc_restore_link_res_map (const struct dc *dc,uint32_t *map);#endif /* DC_LINK_H_ */
drivers/gpu/drm/amd/display/dc/inc/core_types.h +5 -0
@@ -334,6 +334,11 @@ struct plane_resource {struct dcn_fe_bandwidth bw; }; +#if defined(CONFIG_DRM_AMD_DC_DCN ) +#define LINK_RES_HPO_DP_REC_MAP__MASK 0xFFFF +#define LINK_RES_HPO_DP_REC_MAP__SHIFT 0 +#endif +/* all mappable hardware resources used to enable a link */ struct link_resource {#if defined(CONFIG_DRM_AMD_DC_DCN )
Signature · 1 line
2.25.1
[AMD Official Use Only]
Hi all,
This week this patchset was tested on the following systems:
Lenovo Thinkpad T14s Gen2 with AMD Ryzen 5 5650U, with the following display types: eDP 1080p 60hz, 4k 60hz (via USB-C to DP/HDMI), 1440p 144hz (via USB-C to DP/HDMI), 1680*1050 60hz (via USB-C to DP and then DP to DVI/VGA)
Sapphire Pulse RX5700XT with the following display types:
4k 60hz (via DP/HDMI), 1440p 144hz (via DP/HDMI), 1680*1050 60hz (via DP to DVI/VGA)
Reference AMD RX6800 with the following display types:
4k 60hz (via DP/HDMI and USB-C to DP/HDMI), 1440p 144hz (via USB-C to DP/HDMI and USB-C to DP/HDMI), 1680*1050 60hz (via DP to DVI/VGA)
Included testing using a Startech DP 1.4 MST hub at 2x 4k 60hz, and 3x 1080p 60hz on all systems. Also tested DSC via USB-C to DP DSC Hub with 3x 4k 60hz on Ryzen 9 5900h and Ryzen 5 4500u.
Tested on Ubuntu 20.04.3 with Kernel Version 5.13
Thank you,
Dan Wheeler
Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
Facebook | Twitter | amd.com
-----Original Message-----
From: Siqueira, Rodrigo <[email protected]>
Sent: December 17, 2021 4:24 PM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Lipski, Mikita <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Wang, Chao-kai (Stylon) <[email protected]>; Chiu, Solomon <[email protected]>; Kotarac, Pavle <[email protected]>; Gutierrez, Agustin <[email protected]>; Wheeler, Daniel <[email protected]>
Subject: [PATCH 00/19] DC Patches December 17, 2021
This DC patchset brings improvements in multiple areas. In summary, we highlight:
- Fixes and improvements in the LTTPR code
- Improve z-state
- Fix null pointer check
- Improve communication with s0i2
- Update multiple-display split policy
- Add missing registers
Thanks
Siqueira
Alvin Lee (1):
drm/amd/display: Fix check for null function ptr
Angus Wang (1):
drm/amd/display: Changed pipe split policy to allow for multi-display
pipe split
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.98
Aric Cyr (1):
drm/amd/display: 3.2.167
Charlene Liu (1):
drm/amd/display: fix B0 TMDS deepcolor no dislay issue
George Shen (2):
drm/amd/display: Limit max link cap with LTTPR caps drm/amd/display: Remove CR AUX RD Interval limit for LTTPR
Lai, Derek (1):
drm/amd/display: Added power down for DCN10
Martin Leung (1):
drm/amd/display: Undo ODM combine
Nicholas Kazlauskas (3):
drm/amd/display: Block z-states when stutter period exceeds criteria drm/amd/display: Send s0i2_rdy in stream_count == 0 optimization drm/amd/display: Set optimize_pwr_state for DCN31
Shen, George (1):
drm/amd/display: Refactor vendor specific link training sequence
Wenjing Liu (5):
drm/amd/display: define link res and make it accessible to all link
interfaces
drm/amd/display: populate link res in both detection and validation drm/amd/display: access hpo dp link encoder only through link resource drm/amd/display: support dynamic HPO DP link encoder allocation drm/amd/display: get and restore link res map
Wesley Chalmers (1):
drm/amd/display: Add reg defs for DCN303
.../display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 1 + drivers/gpu/drm/amd/display/dc/core/dc.c | 18 - .../gpu/drm/amd/display/dc/core/dc_debug.c | 2 + drivers/gpu/drm/amd/display/dc/core/dc_link.c | 234 +++++--- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 501 +++++++++++++++--- .../drm/amd/display/dc/core/dc_link_dpia.c | 48 +- .../drm/amd/display/dc/core/dc_link_hwss.c | 63 ++- .../gpu/drm/amd/display/dc/core/dc_resource.c | 199 ++++--- drivers/gpu/drm/amd/display/dc/dc.h | 3 +- drivers/gpu/drm/amd/display/dc/dc_link.h | 15 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 14 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_init.c | 1 + .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 2 +- .../drm/amd/display/dc/dcn20/dcn20_resource.c | 5 +- .../amd/display/dc/dcn201/dcn201_resource.c | 2 +- .../drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- .../drm/amd/display/dc/dcn30/dcn30_resource.c | 13 +- .../amd/display/dc/dcn301/dcn301_resource.c | 2 +- .../amd/display/dc/dcn302/dcn302_resource.c | 2 +- .../drm/amd/display/dc/dcn303/dcn303_dccg.h | 20 +- .../amd/display/dc/dcn303/dcn303_resource.c | 2 +- .../dc/dcn31/dcn31_hpo_dp_link_encoder.c | 6 +- .../dc/dcn31/dcn31_hpo_dp_link_encoder.h | 3 +- .../gpu/drm/amd/display/dc/dcn31/dcn31_init.c | 1 + .../drm/amd/display/dc/dcn31/dcn31_resource.c | 27 +- .../drm/amd/display/dc/dcn31/dcn31_resource.h | 31 ++ .../gpu/drm/amd/display/dc/dml/dml_wrapper.c | 2 +- .../gpu/drm/amd/display/dc/inc/core_status.h | 2 + .../gpu/drm/amd/display/dc/inc/core_types.h | 17 + .../gpu/drm/amd/display/dc/inc/dc_link_dp.h | 15 +- .../gpu/drm/amd/display/dc/inc/dc_link_dpia.h | 5 +- .../drm/amd/display/dc/inc/hw/link_encoder.h | 3 +- .../gpu/drm/amd/display/dc/inc/link_hwss.h | 10 +- drivers/gpu/drm/amd/display/dc/inc/resource.h | 6 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 4 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 4 +- 36 files changed, 964 insertions(+), 321 deletions(-)
--
2.25.1