DC Patches Apr 3rd, 2023
cover DC Patches Apr 3rd, 2023
This DC patchset brings improvements in multiple areas. In summary, we highlight:
- FW Release 0.0.161.0
- Improvements on FPO/FAMS
- Correction to DML calculation
- Fix to multiple clock related issues
---
Alvin Lee (3):
drm/amd/display: Clear FAMS flag if FAMS doesn't reduce vlevel drm/amd/display: Add FPO + VActive support drm/amd/display: On clock init, maintain DISPCLK freq
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.161.0
Aric Cyr (1):
drm/amd/display: 3.2.230
Charlene Liu (1):
drm/amd/display: add dscclk instance offset check
Hamza Mahfooz (1):
drm/amd/display: prep work for root clock optimization enablement for
DCN314
Michael Strauss (1):
drm/amd/display: Improve robustness of FIXED_VS link training at DP1
rates
Paul Hsieh (1):
drm/amd/display: Correct DML calculation to follow HW SPEC
Zhikai Zhai (1):
drm/amd/display: add scaler control for dcn32
.../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 18 + drivers/gpu/drm/amd/display/dc/dc.h | 6 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 20 + .../gpu/drm/amd/display/dc/dcn20/dcn20_dccg.h | 8 + .../gpu/drm/amd/display/dc/dcn31/dcn31_dccg.c | 18 + .../drm/amd/display/dc/dcn31/dcn31_resource.c | 2 + .../drm/amd/display/dc/dcn314/dcn314_dccg.c | 28 +- .../drm/amd/display/dc/dcn314/dcn314_dccg.h | 10 + .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 26 +- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 3 + .../drm/amd/display/dc/dcn32/dcn32_resource.h | 4 + .../display/dc/dcn32/dcn32_resource_helpers.c | 156 ++++++++ .../amd/display/dc/dcn321/dcn321_resource.c | 3 + .../dc/dml/dcn30/display_mode_vba_30.c | 2 +- .../dc/dml/dcn31/display_mode_vba_31.c | 2 +- .../dc/dml/dcn314/display_mode_vba_314.c | 2 +- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 85 +++- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.h | 4 + .../dc/dml/dcn32/display_mode_vba_32.c | 2 +- .../gpu/drm/amd/display/dc/inc/hw/clk_mgr.h | 3 + .../gpu/drm/amd/display/dc/link/link_dpms.c | 8 +- .../dc/link/protocols/link_dp_training.c | 5 +- .../link_dp_training_fixed_vs_pe_retimer.c | 378 +++++++++++++++++- .../link_dp_training_fixed_vs_pe_retimer.h | 5 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 28 +- 25 files changed, 807 insertions(+), 19 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/10 drm/amd/display: Clear FAMS flag if FAMS doesn't reduce vlevel
From: Alvin Lee <[email protected]>
[Description]
- If we find that applying FAMS doesn't reduce the voltage level, we will not use it
- Ensure to clear the stream flags indicating FAMS if we hit this case
--- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +4 -0
@@ -2002,6 +2002,10 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context,* voltage level) */ context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching = false; +for (i =0 ; i < context->stream_count; i++) { +if (context->streams[i]) + context->streams[i]->fpo_in_use = false; + } context->bw_ctx.dml.soc.fclk_change_latency_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A ].dml_input.fclk_change_latency_us;dcn32_internal_validate_bw (dc, context, pipes, &pipe_cnt, &vlevel, false); }
Signature · 1 line
2.34.1
PATCH 2/10 drm/amd/display: add scaler control for dcn32
In reply to Qingqing ZhuoFrom: Zhikai Zhai <[email protected]>
[WHY]
It will introduce the extra warnning log on some asic that doesn't register
[HOW]
Add the register on dcn32
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.h +1 -0
@@ -472,6 +472,7 @@ double dcn32_determine_max_vratio_prefetch(struct dc *dc, struct dc_state *conteSRI_ARR (OTG_H_BLANK ,DSCL , id),SRI_ARR (OTG_V_BLANK ,DSCL , id), \SRI_ARR (SCL_MODE ,DSCL , id),SRI_ARR (LB_DATA_FORMAT ,DSCL , id), \SRI_ARR (LB_MEMORY_CTRL ,DSCL , id),SRI_ARR (DSCL_AUTOCAL ,DSCL , id), \ +SRI_ARR (DSCL_CONTROL ,DSCL , id), \SRI_ARR (SCL_TAP_CONTROL ,DSCL , id), \SRI_ARR (SCL_COEF_RAM_TAP_SELECT ,DSCL , id), \ SRI_ARR(SCL_COEF_RAM_TAP_DATA, DSCL, id), \
Signature · 1 line
2.34.1
PATCH 3/10 drm/amd/display: prep work for root clock optimization enablement for DCN314
In reply to Qingqing ZhuoFrom: Hamza Mahfooz <[email protected]>
To enable root clock optimizations, we need a number of register writes and need to account for the difference in DPSTREAMCLK between DCN31 and DCN314. To prevent issues, add a number of register writes to DCCG_MASK_SH_LIST_DCN314_COMMON(), and define dccg314_init() which is mostly in alignment with dccg31_init() but accounts for the new DPSTREAMCLK sequence.
--- .../drm/amd/display/dc/dcn314/dcn314_dccg.c | 28 ++++++++++++++++++- .../drm/amd/display/dc/dcn314/dcn314_dccg.h | 6 ++++ 2 files changed, 33 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c +27 -1
@@ -274,6 +274,32 @@ static void dccg314_set_dpstreamclk( } } +void dccg314_init (struct dccg *dccg) +{ +int otg_inst; + +/* Set HPO stream encoder to use refclk to avoid case where PHY is +* disabled and SYMCLK32 for HPO SE is sourced from PHYD32CLK which +* will cause DCN to hang. +*/ +for (otg_inst =0 ; otg_inst <4 ; otg_inst++) +dccg31_disable_symclk32_se (dccg, otg_inst); + +if (dccg->ctx->dc->debug.root_clock_optimization.bits.symclk32_le) +for (otg_inst =0 ; otg_inst <2 ; otg_inst++) +dccg31_disable_symclk32_le (dccg, otg_inst); + +if (dccg->ctx->dc->debug.root_clock_optimization.bits.dpstream) +for (otg_inst =0 ; otg_inst <4 ; otg_inst++) +dccg314_set_dpstreamclk (dccg,REFCLK , otg_inst, + otg_inst); + +if (dccg->ctx->dc->debug.root_clock_optimization.bits.physymclk) +for (otg_inst =0 ; otg_inst <5 ; otg_inst++) +dccg31_set_physymclk (dccg, otg_inst, +PHYSYMCLK_FORCE_SRC_SYMCLK , false); +} + static void dccg314_set_valid_pixel_rate( struct dccg *dccg, int ref_dtbclk_khz,
@@ -315,7 +341,7 @@ static const struct dccg_funcs dccg314_funcs = { .update_dpp_dto = dccg31_update_dpp_dto, .dpp_root_clock_control = dccg314_dpp_root_clock_control, .get_dccg_ref_freq = dccg31_get_dccg_ref_freq, - .dccg_init = dccg31_init, + .dccg_init = dccg314_init, .set_dpstreamclk = dccg314_set_dpstreamclk, .enable_symclk32_se = dccg31_enable_symclk32_se, .disable_symclk32_se = dccg31_disable_symclk32_se,
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.h +6 -0
@@ -155,6 +155,12 @@DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_ROOT_SE3_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_ROOT_LE0_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_ROOT_LE1_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_SE0_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_SE1_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_SE2_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_SE3_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_LE0_GATE_DISABLE , mask_sh),\ +DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_LE1_GATE_DISABLE , mask_sh),\DCCG_SF (HDMISTREAMCLK0_DTO_PARAM ,HDMISTREAMCLK0_DTO_PHASE , mask_sh),\DCCG_SF (HDMISTREAMCLK0_DTO_PARAM ,HDMISTREAMCLK0_DTO_MODULO , mask_sh)
Signature · 1 line
2.34.1
PATCH 4/10 drm/amd/display: Correct DML calculation to follow HW SPEC
In reply to Qingqing ZhuoFrom: Paul Hsieh <[email protected]>
[Why]
In 2560x1600@240p eDP panel, driver use lowest voltage level to play 1080p video cause underflow. According to HW SPEC, the senario should use high voltage level.
[How]
ChromaPre value is zero when bandwidth validation. Correct ChromaPre calculation.
--- drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c | 2 +- drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c | 2 +- .../gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c | 2 +- drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c +1 -1
@@ -4864,7 +4864,7 @@ void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l v->DETBufferSizeCThisState[k], &v->UrgentBurstFactorCursorPre[k], &v->UrgentBurstFactorLumaPre[k], - &v->UrgentBurstFactorChroma[k], + &v->UrgentBurstFactorChromaPre[k], &v->NoUrgentLatencyHidingPre[k]); }
drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c +1 -1
@@ -5191,7 +5191,7 @@ void dml31_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l v->DETBufferSizeCThisState[k], &v->UrgentBurstFactorCursorPre[k], &v->UrgentBurstFactorLumaPre[k], - &v->UrgentBurstFactorChroma[k], + &v->UrgentBurstFactorChromaPre[k], &v->NotUrgentLatencyHidingPre[k]); }
drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c +1 -1
@@ -5288,7 +5288,7 @@ void dml314_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_ v->DETBufferSizeCThisState[k], &v->UrgentBurstFactorCursorPre[k], &v->UrgentBurstFactorLumaPre[k], - &v->UrgentBurstFactorChroma[k], + &v->UrgentBurstFactorChromaPre[k], &v->NotUrgentLatencyHidingPre[k]); }
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c +1 -1
@@ -3355,7 +3355,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l/* Output */ &mode_lib->vba.UrgentBurstFactorCursorPre[k], &mode_lib->vba.UrgentBurstFactorLumaPre[k], - &mode_lib->vba.UrgentBurstFactorChroma[k], + &mode_lib->vba.UrgentBurstFactorChromaPre[k], &mode_lib->vba.NotUrgentLatencyHidingPre[k]); }
Signature · 1 line
2.34.1
PATCH 5/10 drm/amd/display: Add FPO + VActive support
In reply to Qingqing ZhuoFrom: Alvin Lee <[email protected]>
[Description]
- When determining FPO support, include FPO + VActive support
- Support FPO + VActive if one display meets regular requirements for FPO and the second display is able to switch in VACTIVE with a given amount of margin
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 + drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 20 +++ .../drm/amd/display/dc/dcn32/dcn32_resource.c | 2 + .../drm/amd/display/dc/dcn32/dcn32_resource.h | 3 + .../display/dc/dcn32/dcn32_resource_helpers.c | 156 ++++++++++++++++++ .../amd/display/dc/dcn321/dcn321_resource.c | 2 + .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 81 ++++++++- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.h | 4 + 8 files changed, 267 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
@@ -875,6 +875,8 @@ struct dc_debug_options {bool override_dispclk_programming;bool disable_fpo_optimizations;bool support_eDP1_5; +uint32_t fpo_vactive_margin_us; +bool disable_fpo_vactive; };struct gpu_info_soc_bounding_box_v1_0 ;
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +20 -0
@@ -327,6 +327,7 @@ bool dc_dmub_srv_p_state_delegate(struct dc *dc, bool should_manage_pstate, struint i =0 , k =0 ;int ramp_up_num_steps =1 ;// TODO: Ramp is currently disabled. Reenable it. uint8_t visual_confirm_enabled; +int pipe_idx =0 ;if (dc ==NULL )return false;
@@ -339,6 +340,25 @@ bool dc_dmub_srv_p_state_delegate(struct dc *dc, bool should_manage_pstate, stru cmd.fw_assisted_mclk_switch.config_data.fams_enabled = should_manage_pstate; cmd.fw_assisted_mclk_switch.config_data.visual_confirm_enabled = visual_confirm_enabled; +if (should_manage_pstate) { +for (i =0 , pipe_idx =0 ; i < dc->res_pool->pipe_count; i++) { +struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; + +if (!pipe->stream) +continue ; + +/* If FAMS is being used to support P-State and there is a stream +* that does not use FAMS, we are in an FPO + VActive scenario. +* Assign vactive stretch margin in this case. +*/ +if (!pipe->stream->fpo_in_use) { + cmd.fw_assisted_mclk_switch.config_data.vactive_stretch_margin_us = dc->debug.fpo_vactive_margin_us; +break ; + } + pipe_idx++; + } + } +for (i =0 , k =0 ; context && i < dc->res_pool->pipe_count; i++) {struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +2 -0
@@ -726,6 +726,8 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_unbounded_requesting = false, .override_dispclk_programming = true, .disable_fpo_optimizations = false, + .fpo_vactive_margin_us = 2000, // 2000us + .disable_fpo_vactive = true, };static const struct dc_debug_options debug_defaults_diags = {
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.h +3 -0
@@ -39,6 +39,7 @@#define DCN3_2_MBLK_HEIGHT_8BPE 64#define DCN3_2_VMIN_DISPCLK_HZ 717000000#define DCN3_2_DCFCLK_DS_INIT_KHZ 10000 // Choose 10Mhz for init DCFCLK DS freq +#define DCN3_2_MIN_ACTIVE_SWITCH_MARGIN_FPO_US 100 // Only allow FPO + Vactive if active margin >= 100#define TO_DCN32_RES_POOL (pool)\ container_of(pool, struct dcn32_resource_pool, base)
@@ -146,6 +147,8 @@ void dcn32_restore_mall_state(struct dc *dc,struct dc_state *context, struct mall_temp_config *temp_config); +struct dc_stream_state *dcn32_can_support_mclk_switch_using_fw_based_vblank_stretch (struct dc *dc,const struct dc_state *context); +bool dcn32_allow_subvp_with_active_margin (struct pipe_ctx *pipe);unsigned int dcn32_calc_num_avail_chans_for_mall (struct dc *dc,int num_chans);
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +156 -0
165 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +2 -0
@@ -724,6 +724,8 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_unbounded_requesting = false, .override_dispclk_programming = true, .disable_fpo_optimizations = false, + .fpo_vactive_margin_us = 2000, // 2000us + .disable_fpo_vactive = true, };static const struct dc_debug_options debug_defaults_diags = {
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +78 -3
102 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h +4 -0
@@ -76,4 +76,8 @@ void dcn32_patch_dpm_table(struct clk_bw_params *bw_params);void dcn32_zero_pipe_dcc_fraction (display_e2e_pipe_params_st *pipes,int pipe_cnt); +void dcn32_assign_fpo_vactive_candidate (struct dc *dc,const struct dc_state *context,struct dc_stream_state **fpo_candidate_stream); + +bool dcn32_find_vactive_pipe (struct dc *dc,const struct dc_state *context,uint32_t vactive_margin_req); +#endif
Signature · 1 line
2.34.1
PATCH 6/10 drm/amd/display: On clock init, maintain DISPCLK freq
In reply to Qingqing ZhuoFrom: Alvin Lee <[email protected]>
[Description]
- On init if a display is connected, we need to maintain the DISPCLK frequency
- Even though DPG_EN=1, the display still requires the correct timing or it could cause audio corruption (if DISPCLK freq is reduced)
- Read the current DISPCLK freq and request the same value to ensure the timing is valid and unchanged
- However, add option to do a full pipe power down (including link) which will also avoid audio related issues
- Disabled for the time being on dcn32
--- .../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 18 +++++++++++++ drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 26 +++++++++++++++---- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 1 + .../amd/display/dc/dcn321/dcn321_resource.c | 1 + .../gpu/drm/amd/display/dc/inc/hw/clk_mgr.h | 3 +++ 6 files changed, 45 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c +18 -0
@@ -399,6 +399,23 @@ static void dcn32_update_clocks_update_dentist( } +static int dcn32_get_dispclk_from_dentist (struct clk_mgr *clk_mgr_base) +{ +struct clk_mgr_internal *clk_mgr =TO_CLK_MGR_INTERNAL (clk_mgr_base); +uint32_t dispclk_wdivider; +int disp_divider; + +REG_GET (DENTIST_DISPCLK_CNTL ,DENTIST_DISPCLK_WDIVIDER , &dispclk_wdivider); + disp_divider =dentist_get_divider_from_did (dispclk_wdivider); + +/* Return DISPCLK freq in Khz */ +if (disp_divider) +return (DENTIST_DIVIDER_RANGE_SCALE_FACTOR * clk_mgr->base.dentist_vco_freq_khz) / disp_divider; + +return 0 ; +} + +static void dcn32_update_clocks (struct clk_mgr *clk_mgr_base,struct dc_state *context,bool safe_to_lower)
@@ -852,6 +869,7 @@ static struct clk_mgr_funcs dcn32_funcs = { .are_clock_states_equal = dcn32_are_clock_states_equal, .enable_pme_wa = dcn32_enable_pme_wa, .is_smu_present = dcn32_is_smu_present, + .get_dispclk_from_dentist = dcn32_get_dispclk_from_dentist, }; void dcn32_clk_mgr_construct(
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -877,6 +877,7 @@ struct dc_debug_options {bool support_eDP1_5;uint32_t fpo_vactive_margin_us;bool disable_fpo_vactive; +bool disable_boot_optimizations; };struct gpu_info_soc_bounding_box_v1_0 ;
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +21 -5
@@ -721,10 +721,19 @@ static void dcn32_initialize_min_clocks(struct dc *dc) clocks->socclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0 ].socclk_mhz *1000 ; clocks->dramclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0 ].memclk_mhz *1000 ; clocks->dppclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0 ].dppclk_mhz *1000 ; - clocks->dispclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0 ].dispclk_mhz *1000 ; - clocks->ref_dtbclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0 ].dtbclk_mhz *1000 ; - clocks->fclk_p_state_change_support = true; - clocks->p_state_change_support = true; +if (dc->debug.disable_boot_optimizations) { + clocks->dispclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0 ].dispclk_mhz *1000 ; + }else { +/* Even though DPG_EN = 1 for the connected display, it still requires the +* correct timing so we cannot set DISPCLK to min freq or it could cause +* audio corruption. Read current DISPCLK from DENTIST and request the same +* freq to ensure that the timing is valid and unchanged. +*/ + clocks->dispclk_khz = dc->clk_mgr->funcs->get_dispclk_from_dentist (dc->clk_mgr); + clocks->ref_dtbclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0 ].dtbclk_mhz *1000 ; + clocks->fclk_p_state_change_support = true; + clocks->p_state_change_support = true; + } dc->clk_mgr->funcs->update_clocks( dc->clk_mgr,
@@ -823,7 +832,14 @@ void dcn32_init_hw(struct dc *dc)* everything down. */ if (dcb->funcs->is_accelerated_mode (dcb) || !dc->config.seamless_boot_edp_requested) { - hws->funcs.init_pipes (dc, dc->current_state); +/* Disable boot optimizations means power down everything including PHY, DIG, +* and OTG (i.e. the boot is not optimized because we do a full power down). +*/ +if (dc->hwss.enable_accelerated_mode && dc->debug.disable_boot_optimizations) + dc->hwss.enable_accelerated_mode (dc, dc->current_state); +else + hws->funcs.init_pipes (dc, dc->current_state); +if (dc->res_pool->hubbub->funcs->allow_self_refresh_control) dc->res_pool->hubbub->funcs->allow_self_refresh_control (dc->res_pool->hubbub, !dc->res_pool->hubbub->ctx->dc->debug.disable_stutter);
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1 -0
@@ -728,6 +728,7 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_fpo_optimizations = false, .fpo_vactive_margin_us = 2000, // 2000us .disable_fpo_vactive = true, + .disable_boot_optimizations = false, };static const struct dc_debug_options debug_defaults_diags = {
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +1 -0
@@ -726,6 +726,7 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_fpo_optimizations = false, .fpo_vactive_margin_us = 2000, // 2000us .disable_fpo_vactive = true, + .disable_boot_optimizations = false, };static const struct dc_debug_options debug_defaults_diags = {
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h +3 -0
@@ -293,6 +293,9 @@ struct clk_mgr_funcs {/* Get SMU present */ bool (*is_smu_present)(struct clk_mgr *clk_mgr); + +int (*get_dispclk_from_dentist)(struct clk_mgr *clk_mgr_base); + };struct clk_mgr {
Signature · 1 line
2.34.1
PATCH 7/10 drm/amd/display: add dscclk instance offset check
In reply to Qingqing ZhuoFrom: Charlene Liu <[email protected]>
[why]
based on dscclk instance offset check conditiona program dscclk
--- .../gpu/drm/amd/display/dc/dcn20/dcn20_dccg.h | 8 ++++++++ .../gpu/drm/amd/display/dc/dcn31/dcn31_dccg.c | 18 ++++++++++++++++++ .../drm/amd/display/dc/dcn314/dcn314_dccg.h | 4 ++++ 3 files changed, 30 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dccg.h +8 -0
@@ -205,6 +205,11 @@type PHYDSYMCLK_GATE_DISABLE ; \type PHYESYMCLK_GATE_DISABLE ; +#define DCCG314_REG_FIELD_LIST (type) \ + type DSCCLK3_DTO_PHASE;\ + type DSCCLK3_DTO_MODULO;\ + type DSCCLK3_DTO_ENABLE; +#define DCCG32_REG_FIELD_LIST (type) \ type DPSTREAMCLK0_EN;\ type DPSTREAMCLK1_EN;\
@@ -237,6 +242,7 @@ struct dccg_shift { DCCG_REG_FIELD_LIST(uint8_t) DCCG3_REG_FIELD_LIST(uint8_t) DCCG31_REG_FIELD_LIST(uint8_t) + DCCG314_REG_FIELD_LIST(uint8_t) DCCG32_REG_FIELD_LIST(uint8_t) };
@@ -244,6 +250,7 @@ struct dccg_mask { DCCG_REG_FIELD_LIST(uint32_t) DCCG3_REG_FIELD_LIST(uint32_t) DCCG31_REG_FIELD_LIST(uint32_t) + DCCG314_REG_FIELD_LIST(uint32_t) DCCG32_REG_FIELD_LIST(uint32_t) };
@@ -273,6 +280,7 @@ struct dccg_registers {uint32_t DSCCLK0_DTO_PARAM ;uint32_t DSCCLK1_DTO_PARAM ;uint32_t DSCCLK2_DTO_PARAM ; +uint32_t DSCCLK3_DTO_PARAM ;uint32_t DPSTREAMCLK_ROOT_GATE_DISABLE ;uint32_t DPSTREAMCLK_GATE_DISABLE ;uint32_t DCCG_GATE_DISABLE_CNTL ;
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dccg.c +18 -0
@@ -360,6 +360,15 @@ void dccg31_disable_dscclk(struct dccg *dccg, int inst)DSCCLK2_DTO_PHASE ,0 , DSCCLK2_DTO_MODULO, 1);break ; +case 3 : +if (REG (DSCCLK3_DTO_PARAM )) { +REG_UPDATE (DSCCLK_DTO_CTRL , +DSCCLK3_DTO_ENABLE ,1 ); +REG_UPDATE_2 (DSCCLK3_DTO_PARAM , +DSCCLK3_DTO_PHASE ,0 , +DSCCLK3_DTO_MODULO ,1 ); + } +break ;default :BREAK_TO_DEBUGGER ();return ;
@@ -395,6 +404,15 @@ void dccg31_enable_dscclk(struct dccg *dccg, int inst)REG_UPDATE (DSCCLK_DTO_CTRL ,DSCCLK2_DTO_ENABLE ,0 );break ; +case 3 : +if (REG (DSCCLK3_DTO_PARAM )) { +REG_UPDATE (DSCCLK_DTO_CTRL , +DSCCLK3_DTO_ENABLE ,0 ); +REG_UPDATE_2 (DSCCLK3_DTO_PARAM , +DSCCLK3_DTO_PHASE ,0 , +DSCCLK3_DTO_MODULO ,0 ); + } +break ;default :BREAK_TO_DEBUGGER ();return ;
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.h +4 -0
@@ -68,6 +68,7 @@SR (DSCCLK0_DTO_PARAM ),\SR (DSCCLK1_DTO_PARAM ),\SR (DSCCLK2_DTO_PARAM ),\ +SR (DSCCLK3_DTO_PARAM ),\SR (DSCCLK_DTO_CTRL ),\SR (DCCG_GATE_DISABLE_CNTL2 ),\ SR(DCCG_GATE_DISABLE_CNTL3),\
@@ -149,6 +150,8 @@DCCG_SF (DSCCLK1_DTO_PARAM ,DSCCLK1_DTO_MODULO , mask_sh),\DCCG_SF (DSCCLK2_DTO_PARAM ,DSCCLK2_DTO_PHASE , mask_sh),\DCCG_SF (DSCCLK2_DTO_PARAM ,DSCCLK2_DTO_MODULO , mask_sh),\ +DCCG_SF (DSCCLK3_DTO_PARAM ,DSCCLK3_DTO_PHASE , mask_sh),\ +DCCG_SF (DSCCLK3_DTO_PARAM ,DSCCLK3_DTO_MODULO , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_ROOT_SE0_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL3 ,SYMCLK32_ROOT_SE1_GATE_DISABLE , mask_sh),\ DCCG_SF(DCCG_GATE_DISABLE_CNTL3, SYMCLK32_ROOT_SE2_GATE_DISABLE, mask_sh),\
@@ -184,6 +187,7 @@DCCG_SF (DSCCLK_DTO_CTRL ,DSCCLK0_DTO_ENABLE , mask_sh),\DCCG_SF (DSCCLK_DTO_CTRL ,DSCCLK1_DTO_ENABLE , mask_sh),\DCCG_SF (DSCCLK_DTO_CTRL ,DSCCLK2_DTO_ENABLE , mask_sh),\ +DCCG_SF (DSCCLK_DTO_CTRL ,DSCCLK3_DTO_ENABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYASYMCLK_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYBSYMCLK_GATE_DISABLE , mask_sh),\ DCCG_SF(DCCG_GATE_DISABLE_CNTL2, PHYCSYMCLK_GATE_DISABLE, mask_sh),\
Signature · 1 line
2.34.1
PATCH 8/10 drm/amd/display: Improve robustness of FIXED_VS link training at DP1 rates
In reply to Qingqing ZhuoFrom: Michael Strauss <[email protected]>
[WHY]
New sequence for transparent mode DP1.x link training was provided by LTTPR vendor
[HOW]
Implement new FIXED_VS sequence, increase LT retry count to minimize any potential intermittent lightup failures
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../drm/amd/display/dc/dcn31/dcn31_resource.c | 2 + .../gpu/drm/amd/display/dc/link/link_dpms.c | 8 +- .../dc/link/protocols/link_dp_training.c | 5 +- .../link_dp_training_fixed_vs_pe_retimer.c | 378 +++++++++++++++++- .../link_dp_training_fixed_vs_pe_retimer.h | 5 + 6 files changed, 396 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -405,6 +405,7 @@ struct dc_config {bool force_bios_enable_lttpr;uint8_t force_bios_fixed_vs;int sdpif_request_limit_words_per_umc; +bool use_old_fixed_vs_sequence;bool disable_subvp_drr; };
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c +2 -0
@@ -1965,6 +1965,8 @@ static bool dcn31_resource_construct( dc->caps.color.mpc.ogam_rom_caps.hlg =0 ; dc->caps.color.mpc.ocsc =1 ; + dc->config.use_old_fixed_vs_sequence = true; +/* Use pipe context based otg sync logic */ dc->config.use_pipe_ctx_sync_logic = true;
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +7 -1
@@ -2035,6 +2035,12 @@ static enum dc_status enable_link_dp(struct dc_state *state,uint32_t post_oui_delay =30 ;// 30ms /* Reduce link bandwidth between failed link training attempts. */ bool do_fallback = false; +int lt_attempts =LINK_TRAINING_ATTEMPTS ; + +// Increase retry count if attempting DP1.x on FIXED_VS link +if ((link->chip_caps &EXT_DISPLAY_PATH_CAPS__DP_FIXED_VS_EN ) && +link_dp_get_encoding_format (link_settings) == DP_8b_10b_ENCODING) + lt_attempts =10 ;// check for seamless boot for (i =0 ; i < state->stream_count; i++) {
@@ -2099,7 +2105,7 @@ static enum dc_status enable_link_dp(struct dc_state *state,if (perform_link_training_with_retries (link_settings, skip_video_pattern, -LINK_TRAINING_ATTEMPTS , + lt_attempts, pipe_ctx, pipe_ctx->stream->signal, do_fallback)) {
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c +4 -1
@@ -1496,7 +1496,10 @@ enum link_training_result dp_perform_link_training(* Non-LT AUX transactions inside training mode. */ if ((link->chip_caps &EXT_DISPLAY_PATH_CAPS__DP_FIXED_VS_EN ) && encoding == DP_8b_10b_ENCODING) - status =dp_perform_fixed_vs_pe_training_sequence (link, link_res, <_settings); +if (link->dc->config.use_old_fixed_vs_sequence) + status =dp_perform_fixed_vs_pe_training_sequence_legacy (link, link_res, <_settings); +else + status =dp_perform_fixed_vs_pe_training_sequence (link, link_res, <_settings);else if (encoding == DP_8b_10b_ENCODING) status =dp_perform_8b_10b_link_training (link, link_res, <_settings);else if (encoding == DP_128b_132b_ENCODING)
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_fixed_vs_pe_retimer.c +377 -1
387 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_fixed_vs_pe_retimer.h +5 -0
@@ -28,6 +28,11 @@#define __DC_LINK_DP_FIXED_VS_PE_RETIMER_H__#include "link_dp_training.h" +enum link_training_result dp_perform_fixed_vs_pe_training_sequence_legacy ( +struct dc_link *link, +const struct link_resource *link_res, +struct link_training_settings *lt_settings); + enum link_training_result dp_perform_fixed_vs_pe_training_sequence( struct dc_link *link, const struct link_resource *link_res,
Signature · 1 line
2.34.1
PATCH 9/10 drm/amd/display: [FW Promotion] Release 0.0.161.0
In reply to Qingqing ZhuoFrom: Anthony Koo <[email protected]>
- Add command to idle opt.
- Rename d3 entry event and add idle trigger param on notify event.
- Add bit to fw boot status to notify status when hardware is powered up.
--- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +26 -2
@@ -362,7 +362,7 @@ union dmub_fw_boot_status { uint32_t defer_load : 1; /**< 1 if VBIOS data is deferred programmed */ uint32_t reserved : 1; uint32_t detection_required: 1; /**< if detection need to be triggered by driver */ - + uint32_t hw_power_init_done: 1; /**< 1 if hw power init is completed */ } bits;/**< status bits */ uint32_t all;/**< 32-bit access to status bits */ };
@@ -377,6 +377,7 @@ enum dmub_fw_boot_status_bit {DMUB_FW_BOOT_STATUS_BIT_RESTORE_REQUIRED = (1 <<3 ),/**< 1 if driver should call restore */ DMUB_FW_BOOT_STATUS_BIT_DEFERRED_LOADED = (1 <<4 ),/**< 1 if VBIOS data is deferred programmed */ DMUB_FW_BOOT_STATUS_BIT_DETECTION_REQUIRED = (1 <<6 ),/**< 1 if detection need to be triggered by driver*/ + DMUB_FW_BOOT_STATUS_BIT_HW_POWER_INIT_DONE = (1 << 7), /**< 1 if hw power init is completed */ };/* Register bit definition for SCRATCH5 */
@@ -1104,7 +1105,12 @@ enum dmub_cmd_idle_opt_type {/** * DCN hardware save. */ - DMUB_CMD__IDLE_OPT_DCN_SAVE_INIT = 1 +DMUB_CMD__IDLE_OPT_DCN_SAVE_INIT =1 , + +/** +* DCN hardware notify idle. +*/ + DMUB_CMD__IDLE_OPT_DCN_NOTIFY_IDLE = 2 };/**
@@ -1114,6 +1120,24 @@ struct dmub_rb_cmd_idle_opt_dcn_restore {struct dmub_cmd_header header;/**< header */ }; +/** +* struct dmub_dcn_notify_idle_cntl_data - Data passed to FW in a DMUB_CMD__IDLE_OPT_DCN_NOTIFY_IDLE command. +*/ +struct dmub_dcn_notify_idle_cntl_data { +uint8_t driver_idle; +uint8_t d3_entry; +uint8_t trigger; +uint8_t pad[1 ]; +}; + +/** +* struct dmub_rb_cmd_idle_opt_dcn_notify_idle - Data passed to FW in a DMUB_CMD__IDLE_OPT_DCN_NOTIFY_IDLE command. +*/ +struct dmub_rb_cmd_idle_opt_dcn_notify_idle { +struct dmub_cmd_header header;/**< header */ +struct dmub_dcn_notify_idle_cntl_data cntl_data; +}; +/** * struct dmub_clocks - Clock update notification. */
Signature · 1 line
2.34.1
PATCH 10/10 drm/amd/display: 3.2.230
In reply to Qingqing ZhuoFrom: Aric Cyr <[email protected]>
This DC version brings along:
- FW Release 0.0.161.0
- Improvements on FPO/FAMS
- Correction to DML calculation
- Fix to multiple clock related issues
--- 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
@@ -45,7 +45,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.229" +#define DC_VER "3.2.230"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.34.1
[Public]
Hi all,
This week this patchset was tested on the following systems:
Lenovo Thinkpad T14s Gen2, with AMD Ryzen 5 5650U
Lenovo Thinkpad T13s Gen4 with AMD Ryzen 5 6600U
Reference AMD RX6800
These systems were tested on the following display types:
eDP, (1080p 60hz [5650U]) (1920x1200 60hz [6600U]) (2560x1600 120hz[6600U]) VGA and DVI (1680x1050 60HZ [DP to VGA/DVI, USB-C to DVI/VGA]) DP/HDMI/USB-C (1440p 170hz, 4k 60hz, 4k 144hz [Includes USB-C to DP/HDMI adapters])
MST tested with Startech MST14DP123DP and 2x 4k 60Hz displays
DSC tested with Cable Matters 101075 (DP to 3x DP), and 201375 (USB-C to 3x DP) with 3x 4k60 displays HP Hook G2 with 1 and 2 4k60 Displays
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to):
Changing display configurations and settings
Benchmark testing
Feature testing (Freesync, etc.)
Automated testing includes (but is not limited to):
Script testing (scripts to automate some of the manual checks) IGT testing
The patchset consists of the amd-staging-drm-next branch (Head commit - 705a9d96f697 drm/amd/display: Promote DAL to 3.2.229) with new patches added on top of it. This branch is used for both Ubuntu and Chrome OS testing (ChromeOS on a bi-weekly basis).
Tested on Ubuntu 22.04.2
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
Facebook | Twitter | amd.com
-----Original Message-----
From: Zhuo, Qingqing (Lillian) <[email protected]>
Sent: March 30, 2023 4:57 AM
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]>; 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/10] DC Patches Apr 3rd, 2023
This DC patchset brings improvements in multiple areas. In summary, we highlight:
- FW Release 0.0.161.0
- Improvements on FPO/FAMS
- Correction to DML calculation
- Fix to multiple clock related issues
---
Alvin Lee (3):
drm/amd/display: Clear FAMS flag if FAMS doesn't reduce vlevel drm/amd/display: Add FPO + VActive support drm/amd/display: On clock init, maintain DISPCLK freq
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.161.0
Aric Cyr (1):
drm/amd/display: 3.2.230
Charlene Liu (1):
drm/amd/display: add dscclk instance offset check
Hamza Mahfooz (1):
drm/amd/display: prep work for root clock optimization enablement for
DCN314
Michael Strauss (1):
drm/amd/display: Improve robustness of FIXED_VS link training at DP1
rates
Paul Hsieh (1):
drm/amd/display: Correct DML calculation to follow HW SPEC
Zhikai Zhai (1):
drm/amd/display: add scaler control for dcn32
.../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 18 + drivers/gpu/drm/amd/display/dc/dc.h | 6 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 20 + .../gpu/drm/amd/display/dc/dcn20/dcn20_dccg.h | 8 + .../gpu/drm/amd/display/dc/dcn31/dcn31_dccg.c | 18 + .../drm/amd/display/dc/dcn31/dcn31_resource.c | 2 + .../drm/amd/display/dc/dcn314/dcn314_dccg.c | 28 +- .../drm/amd/display/dc/dcn314/dcn314_dccg.h | 10 + .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 26 +- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 3 + .../drm/amd/display/dc/dcn32/dcn32_resource.h | 4 + .../display/dc/dcn32/dcn32_resource_helpers.c | 156 ++++++++ .../amd/display/dc/dcn321/dcn321_resource.c | 3 + .../dc/dml/dcn30/display_mode_vba_30.c | 2 +- .../dc/dml/dcn31/display_mode_vba_31.c | 2 +- .../dc/dml/dcn314/display_mode_vba_314.c | 2 +- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 85 +++- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.h | 4 + .../dc/dml/dcn32/display_mode_vba_32.c | 2 +- .../gpu/drm/amd/display/dc/inc/hw/clk_mgr.h | 3 + .../gpu/drm/amd/display/dc/link/link_dpms.c | 8 +- .../dc/link/protocols/link_dp_training.c | 5 +- .../link_dp_training_fixed_vs_pe_retimer.c | 378 +++++++++++++++++- .../link_dp_training_fixed_vs_pe_retimer.h | 5 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 28 +- 25 files changed, 807 insertions(+), 19 deletions(-)
Signature · 1 line
2.34.1