DC Patches Jan 04, 2024
cover DC Patches Jan 04, 2024
This DC patchset brings improvements in multiple areas. In summary, we have:
- Improve z8/z10 support
- Revert some of the VRR optimization
- Improve usb4 when using MST
Thanks
Siqueira
Aric Cyr (1):
drm/amd/display: 3.2.266
Charlene Liu (2):
drm/amd/display: allow z8/z10 from driver
drm/amd/display: Update z8 latency
Daniel Miess (1):
Revert "drm/amd/display: Fix conversions between bytes and KB"
George Shen (1):
drm/amd/display: Disconnect phantom pipe OPP from OPTC being disabled
Martin Leung (2):
drm/amd/display: revert "for FPO & SubVP/DRR config program vmin/max" drm/amd/display: revert "Optimize VRR updates to only necessary ones"
Martin Tsai (1):
drm/amd/display: To adjust dprefclk by down spread percentage
Meenakshikumar Somasundaram (1):
drm/amd/display: Dpia hpd status not in sync after S4
Peichen Huang (1):
drm/amd/display: Request usb4 bw for mst streams
.../dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 71 ++++++++++++++++++- .../dc/clk_mgr/dcn314/dcn314_clk_mgr.h | 11 +++ drivers/gpu/drm/amd/display/dc/core/dc.c | 14 ++-- .../gpu/drm/amd/display/dc/core/dc_resource.c | 14 ---- drivers/gpu/drm/amd/display/dc/dc.h | 3 +- drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 + drivers/gpu/drm/amd/display/dc/dc_types.h | 12 ++-- .../gpu/drm/amd/display/dc/dce/dce_audio.c | 2 +- .../drm/amd/display/dc/dce/dce_clock_source.c | 9 ++- .../display/dc/dcn32/dcn32_resource_helpers.c | 14 ++++ .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 11 ++- .../drm/amd/display/dc/dml/dcn35/dcn35_fpu.c | 6 +- .../amd/display/dc/dml2/display_mode_core.c | 18 ++--- .../drm/amd/display/dc/dml2/dml2_wrapper.c | 2 + .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 2 +- .../amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 2 +- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 45 ++---------- .../gpu/drm/amd/display/dc/inc/hw/clk_mgr.h | 1 + drivers/gpu/drm/amd/display/dc/inc/resource.h | 3 - .../gpu/drm/amd/display/dc/link/link_dpms.c | 42 ++++++++--- .../drm/amd/display/dc/link/link_validation.c | 60 +++++++++++++--- .../display/dc/link/protocols/link_dp_dpia.c | 36 ++++++---- .../dc/link/protocols/link_dp_dpia_bw.c | 59 +++++++++++---- .../dc/link/protocols/link_dp_dpia_bw.h | 9 +++ .../amd/display/dc/optc/dcn32/dcn32_optc.c | 19 +++-- .../amd/display/dc/optc/dcn35/dcn35_optc.c | 12 ++-- .../dc/resource/dcn32/dcn32_resource.c | 2 +- .../dc/resource/dcn32/dcn32_resource.h | 3 + .../dc/resource/dcn321/dcn321_resource.c | 2 +- .../gpu/drm/amd/display/include/audio_types.h | 2 +- 30 files changed, 334 insertions(+), 154 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/10 drm/amd/display: allow z8/z10 from driver
From: Charlene Liu <[email protected]>
Copy StutterPeriod from DML2 into DML1 StutterPeriod parameter.
--- drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c +2 -0
@@ -634,6 +634,8 @@ static bool dml2_validate_and_build_resource(const struct dc *in_dc, struct dc_sdml2_extract_watermark_set (&context->bw_ctx.bw.dcn.watermarks.b, &dml2->v20.dml_core_ctx);memcpy (&context->bw_ctx.bw.dcn.watermarks.c, &dml2->v20.g6_temp_read_watermark_set,sizeof (context->bw_ctx.bw.dcn.watermarks.c));dml2_extract_watermark_set (&context->bw_ctx.bw.dcn.watermarks.d, &dml2->v20.dml_core_ctx); +//copy for deciding zstate use + context->bw_ctx.dml.vba.StutterPeriod = context->bw_ctx.dml2->v20.dml_core_ctx.mp.StutterPeriod; }return result;
Signature · 1 line
2.43.0
PATCH 2/10 drm/amd/display: To adjust dprefclk by down spread percentage
In reply to Rodrigo SiqueiraFrom: Martin Tsai <[email protected]>
[Why]
Panels show corruption with high refresh rate timings when ssc is enabled.
[How]
Read down-spread percentage from lut to adjust dprefclk. Issues come from S0i3 with this commit has been fixed by SMU.
--- .../dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 71 ++++++++++++++++++- .../dc/clk_mgr/dcn314/dcn314_clk_mgr.h | 11 +++ .../gpu/drm/amd/display/dc/dce/dce_audio.c | 2 +- .../drm/amd/display/dc/dce/dce_clock_source.c | 9 ++- .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 2 +- .../gpu/drm/amd/display/dc/inc/hw/clk_mgr.h | 1 + .../gpu/drm/amd/display/include/audio_types.h | 2 +- 7 files changed, 93 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c +70 -1
@@ -87,6 +87,20 @@ static const struct IP_BASE CLK_BASE = { { { { 0x00016C00, 0x02401800, 0, 0, 0,#define CLK1_CLK_PLL_REQ__PllSpineDiv_MASK 0x0000F000L#define CLK1_CLK_PLL_REQ__FbMult_frac_MASK 0xFFFF0000L +#define regCLK1_CLK2_BYPASS_CNTL 0x029c +#define regCLK1_CLK2_BYPASS_CNTL_BASE_IDX 0 + +#define CLK1_CLK2_BYPASS_CNTL__CLK2_BYPASS_SEL__SHIFT 0x0 +#define CLK1_CLK2_BYPASS_CNTL__CLK2_BYPASS_DIV__SHIFT 0x10 +#define CLK1_CLK2_BYPASS_CNTL__CLK2_BYPASS_SEL_MASK 0x00000007L +#define CLK1_CLK2_BYPASS_CNTL__CLK2_BYPASS_DIV_MASK 0x000F0000L + +#define regCLK6_0_CLK6_spll_field_8 0x464b +#define regCLK6_0_CLK6_spll_field_8_BASE_IDX 0 + +#define CLK6_0_CLK6_spll_field_8__spll_ssc_en__SHIFT 0xd +#define CLK6_0_CLK6_spll_field_8__spll_ssc_en_MASK 0x00002000L +#define REG (reg_name) \ (CLK_BASE.instance[0].segment[reg ## reg_name ## _BASE_IDX] + reg ## reg_name)
@@ -160,6 +174,37 @@ static void dcn314_disable_otg_wa(struct clk_mgr *clk_mgr_base, struct dc_state } } +bool dcn314_is_spll_ssc_enabled (struct clk_mgr *clk_mgr_base) +{ +struct clk_mgr_internal *clk_mgr =TO_CLK_MGR_INTERNAL (clk_mgr_base); +uint32_t ssc_enable; + +REG_GET (CLK6_0_CLK6_spll_field_8, spll_ssc_en, &ssc_enable); + +return ssc_enable ==1 ; +} + +void dcn314_init_clocks (struct clk_mgr *clk_mgr) +{ +struct clk_mgr_internal *clk_mgr_int =TO_CLK_MGR_INTERNAL (clk_mgr); +uint32_t ref_dtbclk = clk_mgr->clks.ref_dtbclk_khz; + +memset (&(clk_mgr->clks),0 ,sizeof (struct dc_clocks )); +// Assumption is that boot state always supports pstate + clk_mgr->clks.ref_dtbclk_khz = ref_dtbclk;// restore ref_dtbclk + clk_mgr->clks.p_state_change_support = true; + clk_mgr->clks.prev_p_state_change_support = true; + clk_mgr->clks.pwr_state =DCN_PWR_STATE_UNKNOWN ; + clk_mgr->clks.zstate_support =DCN_ZSTATE_SUPPORT_UNKNOWN ; + +// to adjust dp_dto reference clock if ssc is enable otherwise to apply dprefclk +if (dcn314_is_spll_ssc_enabled (clk_mgr)) + clk_mgr->dp_dto_source_clock_in_khz = +dce_adjust_dp_ref_freq_for_ss (clk_mgr_int, clk_mgr->dprefclk_khz); +else + clk_mgr->dp_dto_source_clock_in_khz = clk_mgr->dprefclk_khz; +} +void dcn314_update_clocks (struct clk_mgr *clk_mgr_base,struct dc_state *context,bool safe_to_lower)
@@ -436,6 +481,11 @@ static DpmClocks314_t dummy_clocks;static struct dcn314_watermarks dummy_wms = {0 }; +static struct dcn314_ss_info_table ss_info_table = { + .ss_divider =1000 , + .ss_percentage = {0 ,0 ,375 ,375 ,375 } +}; +static void dcn314_build_watermark_ranges (struct clk_bw_params *bw_params,struct dcn314_watermarks *table) {int i, num_valid_sets;
@@ -708,13 +758,31 @@ static struct clk_mgr_funcs dcn314_funcs = { .get_dp_ref_clk_frequency = dce12_get_dp_ref_freq_khz, .get_dtb_ref_clk_frequency = dcn31_get_dtb_ref_freq_khz, .update_clocks = dcn314_update_clocks, - .init_clocks = dcn31_init_clocks, + .init_clocks = dcn314_init_clocks, .enable_pme_wa = dcn314_enable_pme_wa, .are_clock_states_equal = dcn314_are_clock_states_equal, .notify_wm_ranges = dcn314_notify_wm_ranges };extern struct clk_mgr_funcs dcn3_fpga_funcs; +static void dcn314_read_ss_info_from_lut (struct clk_mgr_internal *clk_mgr) +{ +uint32_t clock_source; +//uint32_t ssc_enable; + +REG_GET (CLK1_CLK2_BYPASS_CNTL ,CLK2_BYPASS_SEL , &clock_source); +//REG_GET(CLK6_0_CLK6_spll_field_8, spll_ssc_en, &ssc_enable); + +if (dcn314_is_spll_ssc_enabled (&clk_mgr->base) && (clock_source <ARRAY_SIZE (ss_info_table.ss_percentage))) { + clk_mgr->dprefclk_ss_percentage = ss_info_table.ss_percentage[clock_source]; + +if (clk_mgr->dprefclk_ss_percentage !=0 ) { + clk_mgr->ss_on_dprefclk = true; + clk_mgr->dprefclk_ss_divider = ss_info_table.ss_divider; + } + } +} + void dcn314_clk_mgr_construct( struct dc_context *ctx, struct clk_mgr_dcn314 *clk_mgr,
@@ -782,6 +850,7 @@ void dcn314_clk_mgr_construct( clk_mgr->base.base.dprefclk_khz =600000 ; clk_mgr->base.base.clks.ref_dtbclk_khz =600000 ;dce_clock_read_ss_info (&clk_mgr->base); +dcn314_read_ss_info_from_lut (&clk_mgr->base);/*if bios enabled SS, driver needs to adjust dtb clock, only enable with correct bios*/ clk_mgr->base.base.bw_params = &dcn314_bw_params;
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.h +11 -0
@@ -28,6 +28,8 @@#define __DCN314_CLK_MGR_H__#include "clk_mgr_internal.h" +#define DCN314_NUM_CLOCK_SOURCES 5 +struct dcn314_watermarks ;struct dcn314_smu_watermark_set {
@@ -40,9 +42,18 @@ struct clk_mgr_dcn314 {struct dcn314_smu_watermark_set smu_wm_set; }; +struct dcn314_ss_info_table { +uint32_t ss_divider; +uint32_t ss_percentage[DCN314_NUM_CLOCK_SOURCES ]; +}; +bool dcn314_are_clock_states_equal (struct dc_clocks *a,struct dc_clocks *b); +bool dcn314_is_spll_ssc_enabled (struct clk_mgr *clk_mgr_base); + +void dcn314_init_clocks (struct clk_mgr *clk_mgr); +void dcn314_update_clocks (struct clk_mgr *clk_mgr_base,struct dc_state *context,bool safe_to_lower);
drivers/gpu/drm/amd/display/dc/dce/dce_audio.c +1 -1
@@ -782,7 +782,7 @@ static void get_azalia_clock_info_dp(/*audio_dto_module = dpDtoSourceClockInkhz * 10,000; * [khz] ->[100Hz] */ azalia_clock_info->audio_dto_module = - pll_info->dp_dto_source_clock_in_khz *10 ; + pll_info->audio_dto_source_clock_in_khz *10 ; } void dce_aud_wall_dto_setup(
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +8 -1
@@ -975,6 +975,9 @@ static bool dcn31_program_pix_clk(look_up_in_video_optimized_rate_tlb (pix_clk_params->requested_pix_clk_100hz /10 );struct bp_pixel_clock_parameters bp_pc_params = {0 };enum transmitter_color_depth bp_pc_colour_depth =TRANSMITTER_COLOR_DEPTH_24 ; + +if (clock_source->ctx->dc->clk_mgr->dp_dto_source_clock_in_khz !=0 ) + dp_dto_ref_khz = clock_source->ctx->dc->clk_mgr->dp_dto_source_clock_in_khz;// For these signal types Driver to program DP_DTO without calling VBIOS Command table if (dc_is_dp_signal (pix_clk_params->signal_type) ||dc_is_virtual_signal (pix_clk_params->signal_type)) {if (e) {
@@ -1088,6 +1091,10 @@ static bool get_pixel_clk_frequency_100hz(struct dce110_clk_src *clk_src =TO_DCE110_CLK_SRC (clock_source);unsigned int clock_hz =0 ;unsigned int modulo_hz =0 ; +unsigned int dp_dto_ref_khz = clock_source->ctx->dc->clk_mgr->dprefclk_khz; + +if (clock_source->ctx->dc->clk_mgr->dp_dto_source_clock_in_khz !=0 ) + dp_dto_ref_khz = clock_source->ctx->dc->clk_mgr->dp_dto_source_clock_in_khz;if (clock_source->id ==CLOCK_SOURCE_ID_DP_DTO ) { clock_hz =REG_READ (PHASE [inst]);
@@ -1100,7 +1107,7 @@ static bool get_pixel_clk_frequency_100hz( modulo_hz =REG_READ (MODULO [inst]);if (modulo_hz) *pixel_clk_khz =div_u64 ((uint64_t )clock_hz* - clock_source->ctx->dc->clk_mgr->dprefclk_khz*10 , + dp_dto_ref_khz*10 , modulo_hz);else *pixel_clk_khz =0 ;
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +1 -1
@@ -1353,7 +1353,7 @@ static void build_audio_output(if (state->clk_mgr && (pipe_ctx->stream->signal ==SIGNAL_TYPE_DISPLAY_PORT || pipe_ctx->stream->signal ==SIGNAL_TYPE_DISPLAY_PORT_MST )) { - audio_output->pll_info.dp_dto_source_clock_in_khz = + audio_output->pll_info.audio_dto_source_clock_in_khz = state->clk_mgr->funcs->get_dp_ref_clk_frequency ( state->clk_mgr); }
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h +1 -0
@@ -333,6 +333,7 @@ struct clk_mgr {bool force_smu_not_present;bool dc_mode_softmax_enabled;int dprefclk_khz;// Used by program pixel clock in clock source funcs, need to figureout where this goes +int dp_dto_source_clock_in_khz;// Used to program DP DTO with ss adjustment on DCN314 int dentist_vco_freq_khz;struct clk_state_registers_and_bypass boot_snapshot;struct clk_bw_params *bw_params;
drivers/gpu/drm/amd/display/include/audio_types.h +1 -1
@@ -64,7 +64,7 @@ enum audio_dto_source {/* PLL information required for AZALIA DTO calculation */ struct audio_pll_info { -uint32_t dp_dto_source_clock_in_khz; +uint32_t audio_dto_source_clock_in_khz;uint32_t feed_back_divider;enum audio_dto_source dto_source;bool ss_enabled;
Signature · 1 line
2.43.0
PATCH 3/10 drm/amd/display: Disconnect phantom pipe OPP from OPTC being disabled
In reply to Rodrigo SiqueiraFrom: George Shen <[email protected]>
[Why]
If an OPP is used for a different OPTC without first being disconnected from the previous OPTC, unexpected behaviour can occur. This also applies to phantom pipes, which is what the current logic missed.
[How]
Disconnect OPPs from OPTC for phantom pipes before disabling OTG master.
Also move the disconnection to before the OTG master disable, since the register is double buffered.
--- .../amd/display/dc/optc/dcn32/dcn32_optc.c | 19 +++++++++++++------ .../amd/display/dc/optc/dcn35/dcn35_optc.c | 12 ++++++------ 2 files changed, 19 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/optc/dcn32/dcn32_optc.c +13 -6
@@ -166,12 +166,6 @@ static bool optc32_disable_crtc(struct timing_generator *optc) {struct optc *optc1 =DCN10TG_FROM_TG (optc); -/* disable otg request until end of the first line -* in the vertical blank region -*/ -REG_UPDATE (OTG_CONTROL , -OTG_MASTER_EN ,0 ); - REG_UPDATE_5(OPTC_DATA_SOURCE_SELECT, OPTC_SEG0_SRC_SEL, 0xf, OPTC_SEG1_SRC_SEL, 0xf,
@@ -179,6 +173,12 @@ static bool optc32_disable_crtc(struct timing_generator *optc)OPTC_SEG3_SRC_SEL ,0xf , OPTC_NUM_OF_INPUT_SEGMENT, 0); +/* disable otg request until end of the first line +* in the vertical blank region +*/ +REG_UPDATE (OTG_CONTROL , +OTG_MASTER_EN ,0 ); +REG_UPDATE (CONTROL ,VTG0_ENABLE ,0 );
@@ -205,6 +205,13 @@ static void optc32_disable_phantom_otg(struct timing_generator *optc) {struct optc *optc1 =DCN10TG_FROM_TG (optc); +REG_UPDATE_5 (OPTC_DATA_SOURCE_SELECT , +OPTC_SEG0_SRC_SEL ,0xf , +OPTC_SEG1_SRC_SEL ,0xf , +OPTC_SEG2_SRC_SEL ,0xf , +OPTC_SEG3_SRC_SEL ,0xf , +OPTC_NUM_OF_INPUT_SEGMENT ,0 ); +REG_UPDATE (OTG_CONTROL ,OTG_MASTER_EN ,0 ); }
drivers/gpu/drm/amd/display/dc/optc/dcn35/dcn35_optc.c +6 -6
@@ -138,12 +138,6 @@ static bool optc35_disable_crtc(struct timing_generator *optc) {struct optc *optc1 =DCN10TG_FROM_TG (optc); -/* disable otg request until end of the first line -* in the vertical blank region -*/ -REG_UPDATE (OTG_CONTROL , -OTG_MASTER_EN ,0 ); - REG_UPDATE_5(OPTC_DATA_SOURCE_SELECT, OPTC_SEG0_SRC_SEL, 0xf, OPTC_SEG1_SRC_SEL, 0xf,
@@ -151,6 +145,12 @@ static bool optc35_disable_crtc(struct timing_generator *optc)OPTC_SEG3_SRC_SEL ,0xf , OPTC_NUM_OF_INPUT_SEGMENT, 0); +/* disable otg request until end of the first line +* in the vertical blank region +*/ +REG_UPDATE (OTG_CONTROL , +OTG_MASTER_EN ,0 ); +REG_UPDATE (CONTROL ,VTG0_ENABLE ,0 );
Signature · 1 line
2.43.0
PATCH 4/10 drm/amd/display: revert "for FPO & SubVP/DRR config program vmin/max"
In reply to Rodrigo SiqueiraFrom: Martin Leung <[email protected]>
This reverts commit 4b70dc8c46fc6e89dd1ce90d5ab7b620b25374f0.
The original commit causes issues with certain features when DRR is disabled, need to revisit this change later after resolving issues with new DRR policy.
--- .../gpu/drm/amd/display/dc/core/dc_resource.c | 14 ------- .../display/dc/dcn32/dcn32_resource_helpers.c | 14 +++++++ .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 11 +++--- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 37 ------------------- drivers/gpu/drm/amd/display/dc/inc/resource.h | 3 -- .../dc/resource/dcn32/dcn32_resource.c | 2 +- .../dc/resource/dcn32/dcn32_resource.h | 3 ++ .../dc/resource/dcn321/dcn321_resource.c | 2 +- 8 files changed, 24 insertions(+), 62 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0 -14
@@ -4986,20 +4986,6 @@ enum dc_status update_dp_encoder_resources_for_test_harness(const struct dc *dc,return DC_OK ; } -bool resource_subvp_in_use (struct dc *dc, -struct dc_state *context) -{ -uint32_t i; - -for (i =0 ; i < dc->res_pool->pipe_count; i++) { -struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; - -if (dc_state_get_pipe_subvp_type (context, pipe) !=SUBVP_NONE ) -return true; - } -return false; -} -bool check_subvp_sw_cursor_fallback_req (const struct dc *dc,struct dc_stream_state *stream) {if (!dc->debug.disable_subvp_high_refresh &&is_subvp_high_refresh_candidate (stream))
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +14 -0
@@ -183,6 +183,20 @@ bool dcn32_all_pipes_have_stream_and_plane(struct dc *dc,return true; } +bool dcn32_subvp_in_use (struct dc *dc, +struct dc_state *context) +{ +uint32_t i; + +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; + +if (dc_state_get_pipe_subvp_type (context, pipe) !=SUBVP_NONE ) +return true; + } +return false; +} +bool dcn32_mpo_in_use (struct dc_state *context) {uint32_t i;
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +5 -6
@@ -33,7 +33,6 @@#include "dcn30/dcn30_resource.h" #include "link.h" #include "dc_state_priv.h" -#include "resource.h" #define DC_LOGGER_INIT (logger)
@@ -292,7 +291,7 @@ int dcn32_find_dummy_latency_index_for_fw_based_mclk_switch(struct dc *dc,/* for subvp + DRR case, if subvp pipes are still present we support pstate */ if (vba->DRAMClockChangeSupport[vlevel][vba->maxMpcComb] == dm_dram_clock_change_unsupported && -resource_subvp_in_use (dc, context)) +dcn32_subvp_in_use (dc, context)) vba->DRAMClockChangeSupport[vlevel][context->bw_ctx.dml.vba.maxMpcComb] = temp_clock_change_support; if (vlevel < context->bw_ctx.dml.vba.soc.num_states &&
@@ -2273,7 +2272,7 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context,unsigned int dummy_latency_index =0 ;int maxMpcComb = context->bw_ctx.dml.vba.maxMpcComb;unsigned int min_dram_speed_mts = context->bw_ctx.dml.vba.DRAMSpeed; -bool subvp_active =resource_subvp_in_use (dc, context); +bool subvp_in_use =dcn32_subvp_in_use (dc, context);unsigned int min_dram_speed_mts_margin;bool need_fclk_lat_as_dummy = false;bool is_subvp_p_drr = false;
@@ -2282,7 +2281,7 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context,dc_assert_fp_enabled ();/* need to find dummy latency index for subvp */ -if (subvp_active) { +if (subvp_in_use) {/* Override DRAMClockChangeSupport for SubVP + DRR case where the DRR cannot switch without stretching it's VBLANK */ if (!pstate_en) { context->bw_ctx.dml.vba.DRAMClockChangeSupport[vlevel][maxMpcComb] = dm_dram_clock_change_vblank_w_mall_sub_vp;
@@ -2468,7 +2467,7 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context, dc->clk_mgr->bw_params->clk_table.entries[min_dram_speed_mts_offset].memclk_mhz *16 ; } -if (!context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching && !subvp_active) { +if (!context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching && !subvp_in_use) {/* find largest table entry that is lower than dram speed, * but lower than DPM0 still uses DPM0 */
@@ -3528,7 +3527,7 @@ void dcn32_set_clock_limits(const struct _vcs_dpi_soc_bounding_box_st *soc_bb)void dcn32_override_min_req_memclk (struct dc *dc,struct dc_state *context) {// WA: restrict FPO and SubVP to use first non-strobe mode (DCN32 BW issue) -if ((context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching ||resource_subvp_in_use (dc, context)) && +if ((context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching ||dcn32_subvp_in_use (dc, context)) && dc->dml.soc.num_chans <=8 ) {int num_mclk_levels = dc->clk_mgr->bw_params->clk_table.num_entries_per_clk.num_memclk_levels;
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +0 -37
@@ -1882,42 +1882,6 @@ static void dcn20_program_pipe( } } -static void update_vmin_vmax_fams (struct dc *dc, -struct dc_state *context) -{ -uint32_t i; -struct drr_params params = {0 }; -bool subvp_in_use =resource_subvp_in_use (dc, context); - -for (i =0 ; i < dc->res_pool->pipe_count; i++) { -struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; - -if (resource_is_pipe_type (pipe,OTG_MASTER ) && - ((subvp_in_use &&dc_state_get_pipe_subvp_type (context, pipe) !=SUBVP_PHANTOM && - pipe->stream->allow_freesync) || (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching && pipe->stream->fpo_in_use))) { -if (!pipe->stream->vrr_active_variable && !pipe->stream->vrr_active_fixed) { -struct timing_generator *tg = context->res_ctx.pipe_ctx[i].stream_res.tg; - -/* DRR should be configured already if we're in active variable -* or active fixed, so only program if we're not in this state -*/ - params.vertical_total_min = pipe->stream->timing.v_total; - params.vertical_total_max = pipe->stream->timing.v_total; - tg->funcs->set_drr (tg, ¶ms); - } - }else { -if (resource_is_pipe_type (pipe,OTG_MASTER ) && - !pipe->stream->vrr_active_variable && - !pipe->stream->vrr_active_fixed) { -struct timing_generator *tg = context->res_ctx.pipe_ctx[i].stream_res.tg; - params.vertical_total_min =0 ; - params.vertical_total_max =0 ; - tg->funcs->set_drr (tg, ¶ms); - } - } - } -} -void dcn20_program_front_end_for_ctx (struct dc *dc,struct dc_state *context)
@@ -1994,7 +1958,6 @@ void dcn20_program_front_end_for_ctx( && context->res_ctx.pipe_ctx[i].stream) hws->funcs.blank_pixel_data(dc, &context->res_ctx.pipe_ctx[i], true); -update_vmin_vmax_fams (dc, context);/* Disconnect mpcc */ for (i =0 ; i < dc->res_pool->pipe_count; i++)
drivers/gpu/drm/amd/display/dc/inc/resource.h +0 -3
@@ -609,9 +609,6 @@ bool dc_resource_acquire_secondary_pipe_for_mpc_odm_legacy(struct pipe_ctx *sec_pipe, bool odm); -bool resource_subvp_in_use (struct dc *dc, -struct dc_state *context); -/* A test harness interface that modifies dp encoder resources in the given dc * state and bypasses the need to revalidate. The interface assumes that the * test harness interface is called with pre-validated link config stored in the
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +1 -1
@@ -1899,7 +1899,7 @@ int dcn32_populate_dml_pipes_from_context(static struct dc_cap_funcs cap_funcs = { .get_dcc_compression_cap = dcn20_get_dcc_compression_cap, - .get_subvp_en = resource_subvp_in_use, + .get_subvp_en = dcn32_subvp_in_use, }; void dcn32_calculate_wm_and_dlg(struct dc *dc, struct dc_state *context,
drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.h +3 -0
@@ -131,6 +131,9 @@ void dcn32_merge_pipes_for_subvp(struct dc *dc,bool dcn32_all_pipes_have_stream_and_plane (struct dc *dc,struct dc_state *context); +bool dcn32_subvp_in_use (struct dc *dc, +struct dc_state *context); +bool dcn32_mpo_in_use (struct dc_state *context);bool dcn32_any_surfaces_rotated (struct dc *dc,struct dc_state *context);
drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c +1 -1
@@ -1574,7 +1574,7 @@ static void dcn321_destroy_resource_pool(struct resource_pool **pool)static struct dc_cap_funcs cap_funcs = { .get_dcc_compression_cap = dcn20_get_dcc_compression_cap, - .get_subvp_en = resource_subvp_in_use, + .get_subvp_en = dcn32_subvp_in_use, };static void dcn321_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params)
Signature · 1 line
2.43.0
PATCH 5/10 drm/amd/display: revert "Optimize VRR updates to only necessary ones"
In reply to Rodrigo SiqueiraFrom: Martin Leung <[email protected]>
This reverts commit 64d446649677255bc6b4e1fc757d8b772b6166b1.
The original commit causes regression in corner case with HDMI at specific timings. reverting from staging to get the full suite to retest
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 14 +++++++++----- drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 ++ .../drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 2 +- .../drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 8 ++++---- 5 files changed, 17 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +9 -5
@@ -411,12 +411,9 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,* avoid conflicting with firmware updates. */ if (dc->ctx->dce_version >DCE_VERSION_MAX ) -if (dc->optimized_required) +if (dc->optimized_required || dc->wm_optimized_required)return false; -if (!memcmp (&stream->adjust, adjust,sizeof (*adjust))) -return true; - stream->adjust.v_total_max = adjust->v_total_max; stream->adjust.v_total_mid = adjust->v_total_mid; stream->adjust.v_total_mid_frame_num = adjust->v_total_mid_frame_num;
@@ -2230,6 +2227,7 @@ void dc_post_update_surfaces_to_stream(struct dc *dc) } dc->optimized_required = false; + dc->wm_optimized_required = false; } bool dc_set_generic_gpio_for_stereo(bool enable,
@@ -2652,6 +2650,8 @@ enum surface_update_type dc_check_update_surfaces_for_stream( }else if (memcmp (&dc->current_state->bw_ctx.bw.dcn.clk, &dc->clk_mgr->clks, offsetof(struct dc_clocks , prev_p_state_change_support)) !=0 ) { dc->optimized_required = true; } + + dc->optimized_required |= dc->wm_optimized_required; }return type;
@@ -2859,6 +2859,9 @@ static void copy_stream_update_to_stream(struct dc *dc,if (update->vrr_active_fixed) stream->vrr_active_fixed = *update->vrr_active_fixed; +if (update->crtc_timing_adjust) + stream->adjust = *update->crtc_timing_adjust; +if (update->dpms_off) stream->dpms_off = *update->dpms_off;
@@ -4288,7 +4291,8 @@ static bool full_update_required(struct dc *dc, stream_update->mst_bw_update || stream_update->func_shaper || stream_update->lut3d_func || - stream_update->pending_test_pattern)) + stream_update->pending_test_pattern || + stream_update->crtc_timing_adjust)) return true;if (stream) {
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -1036,6 +1036,7 @@ struct dc {/* Require to optimize clocks and bandwidth for added/removed planes */ bool optimized_required; +bool wm_optimized_required;bool idle_optimizations_allowed;bool enable_c20_dtm_b0;
drivers/gpu/drm/amd/display/dc/dc_stream.h +2 -0
@@ -139,6 +139,7 @@ union stream_update_flags { uint32_t wb_update:1; uint32_t dsc_changed : 1; uint32_t mst_bw : 1; + uint32_t crtc_timing_adjust : 1; uint32_t fams_changed : 1; } bits;
@@ -325,6 +326,7 @@ struct dc_stream_update {struct dc_3dlut *lut3d_func;struct test_pattern *pending_test_pattern; +struct dc_crtc_timing_adjust *crtc_timing_adjust; }; bool dc_is_stream_unchanged(
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +1 -1
@@ -3076,7 +3076,7 @@ void dcn10_prepare_bandwidth( context, false); - dc->optimized_required |= hubbub->funcs->program_watermarks (hubbub, + dc->wm_optimized_required = hubbub->funcs->program_watermarks (hubbub, &context->bw_ctx.bw.dcn.watermarks, dc->res_pool->ref_clocks.dchub_ref_clock_inKhz /1000 , true);
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +4 -4
@@ -2159,10 +2159,10 @@ void dcn20_prepare_bandwidth( }/* program dchubbub watermarks: -* For assigning optimized_required, use |= operator since we don't want +* For assigning wm_optimized_required, use |= operator since we don't want * to clear the value if the optimize has not happened yet */ - dc->optimized_required |= hubbub->funcs->program_watermarks (hubbub, + dc->wm_optimized_required |= hubbub->funcs->program_watermarks (hubbub, &context->bw_ctx.bw.dcn.watermarks, dc->res_pool->ref_clocks.dchub_ref_clock_inKhz /1000 , false);
@@ -2175,10 +2175,10 @@ void dcn20_prepare_bandwidth(if (hubbub->funcs->program_compbuf_size) {if (context->bw_ctx.dml.ip.min_comp_buffer_size_kbytes) { compbuf_size_kb = context->bw_ctx.dml.ip.min_comp_buffer_size_kbytes; - dc->optimized_required |= (compbuf_size_kb != dc->current_state->bw_ctx.dml.ip.min_comp_buffer_size_kbytes); + dc->wm_optimized_required |= (compbuf_size_kb != dc->current_state->bw_ctx.dml.ip.min_comp_buffer_size_kbytes); }else { compbuf_size_kb = context->bw_ctx.bw.dcn.compbuf_size_kb; - dc->optimized_required |= (compbuf_size_kb != dc->current_state->bw_ctx.bw.dcn.compbuf_size_kb); + dc->wm_optimized_required |= (compbuf_size_kb != dc->current_state->bw_ctx.bw.dcn.compbuf_size_kb); } hubbub->funcs->program_compbuf_size (hubbub, compbuf_size_kb, false);
Signature · 1 line
2.43.0
PATCH 6/10 drm/amd/display: Request usb4 bw for mst streams
In reply to Rodrigo SiqueiraFrom: Peichen Huang <[email protected]>
[WHY]
When usb4 bandwidth allocation mode is enabled, driver need to request bandwidth from connection manager. For mst link, the requested bandwidth should be big enough for all remote streams.
[HOW]
- If mst link, the requested bandwidth should be the sum of all mst streams bandwidth added with dp MTPH overhead.
- Allocate/deallcate usb4 bandwidth when setting dpms on/off.
- When doing display mode validation, driver also need to consider total bandwidth of all mst streams for mst link.
--- drivers/gpu/drm/amd/display/dc/dc_types.h | 12 ++-- .../gpu/drm/amd/display/dc/link/link_dpms.c | 42 ++++++++++--- .../drm/amd/display/dc/link/link_validation.c | 60 +++++++++++++++---- .../dc/link/protocols/link_dp_dpia_bw.c | 59 +++++++++++++----- .../dc/link/protocols/link_dp_dpia_bw.h | 9 +++ 5 files changed, 144 insertions(+), 38 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_types.h +7 -5
@@ -1140,23 +1140,25 @@ struct dc_panel_config { } ilr; }; +#define MAX_SINKS_PER_LINK 4 +/* * USB4 DPIA BW ALLOCATION STRUCTS */ struct dc_dpia_bw_alloc { -int sink_verified_bw;// The Verified BW that sink can allocated and use that has been verified already -int sink_allocated_bw;// The Actual Allocated BW that sink currently allocated -int sink_max_bw;// The Max BW that sink can require/support +int remote_sink_req_bw[MAX_SINKS_PER_LINK ];// BW requested by remote sinks +int link_verified_bw;// The Verified BW that link can allocated and use that has been verified already +int link_max_bw;// The Max BW that link can require/support +int allocated_bw;// The Actual Allocated BW for this DPIA int estimated_bw;// The estimated available BW for this DPIA int bw_granularity;// BW Granularity +int dp_overhead;// DP overhead in dp tunneling bool bw_alloc_enabled;// The BW Alloc Mode Support is turned ON for all 3: DP-Tx & Dpia & CM bool response_ready;// Response ready from the CM side uint8_t nrd_max_lane_count;// Non-reduced max lane count uint8_t nrd_max_link_rate;// Non-reduced max link rate }; -#define MAX_SINKS_PER_LINK 4 -enum dc_hpd_enable_select {HPD_EN_FOR_ALL_EDP =0 ,HPD_EN_FOR_PRIMARY_EDP_ONLY ,
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +34 -8
69 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/link/link_validation.c +49 -11
72 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c +45 -14
114 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.h +9 -0
@@ -99,4 +99,13 @@ void dpia_handle_bw_alloc_response(struct dc_link *link, uint8_t bw, uint8_t res*/ bool dpia_validate_usb4_bw (struct dc_link **link,int *bw_needed,const unsigned int num_dpias); +/* +* Obtain all the DP overheads in dp tunneling for the dpia link +* +* @link: pointer to the dc_link struct instance +* +* return: DP overheads in DP tunneling +*/ +int link_dp_dpia_get_dp_overhead_in_dp_tunneling (struct dc_link *link); +#endif /* DC_INC_LINK_DP_DPIA_BW_H_ */
Signature · 1 line
2.43.0
PATCH 7/10 Revert "drm/amd/display: Fix conversions between bytes and KB"
In reply to Rodrigo SiqueiraFrom: Daniel Miess <[email protected]>
This reverts commit 058d7bea47e9d9fd43dc0503b6403071c3429d91.
The previous commit causes failure to light up for 1080p eDP + 8k HDMI panel combo.
--- .../amd/display/dc/dml2/display_mode_core.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c +9 -9
@@ -6229,7 +6229,7 @@ static void set_calculate_prefetch_schedule_params(struct display_mode_lib_st *m CalculatePrefetchSchedule_params->GPUVMEnable = mode_lib->ms.cache_display_cfg.plane.GPUVMEnable; CalculatePrefetchSchedule_params->HostVMEnable = mode_lib->ms.cache_display_cfg.plane.HostVMEnable; CalculatePrefetchSchedule_params->HostVMMaxNonCachedPageTableLevels = mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels; - CalculatePrefetchSchedule_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes; + CalculatePrefetchSchedule_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 ; CalculatePrefetchSchedule_params->DynamicMetadataEnable = mode_lib->ms.cache_display_cfg.plane.DynamicMetadataEnable[k]; CalculatePrefetchSchedule_params->DynamicMetadataVMEnabled = mode_lib->ms.ip.dynamic_metadata_vm_enabled; CalculatePrefetchSchedule_params->DynamicMetadataLinesBeforeActiveRequired = mode_lib->ms.cache_display_cfg.plane.DynamicMetadataLinesBeforeActiveRequired[k];
@@ -6329,7 +6329,7 @@ static void dml_prefetch_check(struct display_mode_lib_st *mode_lib) mode_lib->ms.NoOfDPPThisState, mode_lib->ms.dpte_group_bytes, s->HostVMInefficiencyFactor, - mode_lib->ms.soc.hostvm_min_page_size_kbytes, + mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 , mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels); s->NextMaxVStartup = s->MaxVStartupAllPlanes[j];
@@ -6542,7 +6542,7 @@ static void dml_prefetch_check(struct display_mode_lib_st *mode_lib) mode_lib->ms.cache_display_cfg.plane.HostVMEnable, mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels, mode_lib->ms.cache_display_cfg.plane.GPUVMEnable, - mode_lib->ms.soc.hostvm_min_page_size_kbytes, + mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 , mode_lib->ms.PDEAndMetaPTEBytesPerFrame[j][k], mode_lib->ms.MetaRowBytes[j][k], mode_lib->ms.DPTEBytesPerRow[j][k],
@@ -7687,7 +7687,7 @@ dml_bool_t dml_core_mode_support(struct display_mode_lib_st *mode_lib) CalculateVMRowAndSwath_params->HostVMMaxNonCachedPageTableLevels = mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels; CalculateVMRowAndSwath_params->GPUVMMaxPageTableLevels = mode_lib->ms.cache_display_cfg.plane.GPUVMMaxPageTableLevels; CalculateVMRowAndSwath_params->GPUVMMinPageSizeKBytes = mode_lib->ms.cache_display_cfg.plane.GPUVMMinPageSizeKBytes; - CalculateVMRowAndSwath_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes; + CalculateVMRowAndSwath_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 ; CalculateVMRowAndSwath_params->PTEBufferModeOverrideEn = mode_lib->ms.cache_display_cfg.plane.PTEBufferModeOverrideEn; CalculateVMRowAndSwath_params->PTEBufferModeOverrideVal = mode_lib->ms.cache_display_cfg.plane.PTEBufferMode; CalculateVMRowAndSwath_params->PTEBufferSizeNotExceeded = mode_lib->ms.PTEBufferSizeNotExceededPerState;
@@ -7957,7 +7957,7 @@ dml_bool_t dml_core_mode_support(struct display_mode_lib_st *mode_lib) UseMinimumDCFCLK_params->GPUVMMaxPageTableLevels = mode_lib->ms.cache_display_cfg.plane.GPUVMMaxPageTableLevels; UseMinimumDCFCLK_params->HostVMEnable = mode_lib->ms.cache_display_cfg.plane.HostVMEnable; UseMinimumDCFCLK_params->NumberOfActiveSurfaces = mode_lib->ms.num_active_planes; - UseMinimumDCFCLK_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes; + UseMinimumDCFCLK_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 ; UseMinimumDCFCLK_params->HostVMMaxNonCachedPageTableLevels = mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels; UseMinimumDCFCLK_params->DynamicMetadataVMEnabled = mode_lib->ms.ip.dynamic_metadata_vm_enabled; UseMinimumDCFCLK_params->ImmediateFlipRequirement = s->ImmediateFlipRequiredFinal;
@@ -8699,7 +8699,7 @@ void dml_core_mode_programming(struct display_mode_lib_st *mode_lib, const struc CalculateVMRowAndSwath_params->HostVMMaxNonCachedPageTableLevels = mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels; CalculateVMRowAndSwath_params->GPUVMMaxPageTableLevels = mode_lib->ms.cache_display_cfg.plane.GPUVMMaxPageTableLevels; CalculateVMRowAndSwath_params->GPUVMMinPageSizeKBytes = mode_lib->ms.cache_display_cfg.plane.GPUVMMinPageSizeKBytes; - CalculateVMRowAndSwath_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes; + CalculateVMRowAndSwath_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 ; CalculateVMRowAndSwath_params->PTEBufferModeOverrideEn = mode_lib->ms.cache_display_cfg.plane.PTEBufferModeOverrideEn; CalculateVMRowAndSwath_params->PTEBufferModeOverrideVal = mode_lib->ms.cache_display_cfg.plane.PTEBufferMode; CalculateVMRowAndSwath_params->PTEBufferSizeNotExceeded = s->dummy_boolean_array[0 ];
@@ -8805,7 +8805,7 @@ void dml_core_mode_programming(struct display_mode_lib_st *mode_lib, const struc mode_lib->ms.cache_display_cfg.hw.DPPPerSurface, locals->dpte_group_bytes, s->HostVMInefficiencyFactor, - mode_lib->ms.soc.hostvm_min_page_size_kbytes, + mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 , mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels); locals->TCalc =24.0 / locals->DCFCLKDeepSleep;
@@ -8995,7 +8995,7 @@ void dml_core_mode_programming(struct display_mode_lib_st *mode_lib, const struc CalculatePrefetchSchedule_params->GPUVMEnable = mode_lib->ms.cache_display_cfg.plane.GPUVMEnable; CalculatePrefetchSchedule_params->HostVMEnable = mode_lib->ms.cache_display_cfg.plane.HostVMEnable; CalculatePrefetchSchedule_params->HostVMMaxNonCachedPageTableLevels = mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels; - CalculatePrefetchSchedule_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes; + CalculatePrefetchSchedule_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 ; CalculatePrefetchSchedule_params->DynamicMetadataEnable = mode_lib->ms.cache_display_cfg.plane.DynamicMetadataEnable[k]; CalculatePrefetchSchedule_params->DynamicMetadataVMEnabled = mode_lib->ms.ip.dynamic_metadata_vm_enabled; CalculatePrefetchSchedule_params->DynamicMetadataLinesBeforeActiveRequired = mode_lib->ms.cache_display_cfg.plane.DynamicMetadataLinesBeforeActiveRequired[k];
@@ -9240,7 +9240,7 @@ void dml_core_mode_programming(struct display_mode_lib_st *mode_lib, const struc mode_lib->ms.cache_display_cfg.plane.HostVMEnable, mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels, mode_lib->ms.cache_display_cfg.plane.GPUVMEnable, - mode_lib->ms.soc.hostvm_min_page_size_kbytes, + mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 , locals->PDEAndMetaPTEBytesFrame[k], locals->MetaRowByte[k], locals->PixelPTEBytesPerRow[k],
Signature · 1 line
2.43.0
PATCH 8/10 drm/amd/display: Update z8 latency
In reply to Rodrigo SiqueiraFrom: Charlene Liu <[email protected]>
Adjust z8 latency for performance.
--- drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c +3 -3
@@ -166,9 +166,9 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_5_soc = { .num_states = 5, .sr_exit_time_us = 14.0, .sr_enter_plus_exit_time_us = 16.0, - .sr_exit_z8_time_us = 525.0, - .sr_enter_plus_exit_z8_time_us = 715.0, - .fclk_change_latency_us = 20.0, + .sr_exit_z8_time_us = 210.0, + .sr_enter_plus_exit_z8_time_us = 320.0, + .fclk_change_latency_us = 24.0, .usr_retraining_latency_us = 2, .writeback_latency_us = 12.0,
Signature · 1 line
2.43.0
PATCH 9/10 drm/amd/display: Dpia hpd status not in sync after S4
In reply to Rodrigo SiqueiraFrom: Meenakshikumar Somasundaram <[email protected]>
[Why]
Dpia hpd status not in sync causing driver not enabling BW Alloc after S4.
[How]
Update hpd_status of the link when querying hpd state from dmub in dpia_query_hpd_status().
--- .../display/dc/link/protocols/link_dp_dpia.c | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia.c +22 -14
@@ -82,25 +82,33 @@ bool dpia_query_hpd_status(struct dc_link *link) {union dmub_rb_cmd cmd = {0 };struct dc_dmub_srv *dmub_srv = link->ctx->dmub_srv; -bool is_hpd_high = false;/* prepare QUERY_HPD command */ cmd.query_hpd.header.type =DMUB_CMD__QUERY_HPD_STATE ; cmd.query_hpd.data.instance = link->link_id.enum_id -ENUM_ID_1 ; cmd.query_hpd.data.ch_type =AUX_CHANNEL_DPIA ; -/* Return HPD status reported by DMUB if query successfully executed. */ -if (dc_wake_and_execute_dmub_cmd (dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ) && - cmd.query_hpd.data.status ==AUX_RET_SUCCESS ) - is_hpd_high = cmd.query_hpd.data.result; - -DC_LOG_DEBUG ("%s: link(%d) dpia(%d) cmd_status(%d) result(%d)\n" , - __func__, - link->link_index, - link->link_id.enum_id -ENUM_ID_1 , - cmd.query_hpd.data.status, - cmd.query_hpd.data.result); - -return is_hpd_high; +/* Query dpia hpd status from dmub */ +if (dc_wake_and_execute_dmub_cmd (dmub_srv->ctx, &cmd, +DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ) && + cmd.query_hpd.data.status ==AUX_RET_SUCCESS ) { +DC_LOG_DEBUG ("%s: for link(%d) dpia(%d) success, current_hpd_status(%d) new_hpd_status(%d)\n" , + __func__, + link->link_index, + link->link_id.enum_id -ENUM_ID_1 , + link->hpd_status, + cmd.query_hpd.data.result); + link->hpd_status = cmd.query_hpd.data.result; + }else { +DC_LOG_ERROR ("%s: for link(%d) dpia(%d) failed with status(%d), current_hpd_status(%d) new_hpd_status(0)\n" , + __func__, + link->link_index, + link->link_id.enum_id -ENUM_ID_1 , + cmd.query_hpd.data.status, + link->hpd_status); + link->hpd_status = false; + } + +return link->hpd_status; }
Signature · 1 line
2.43.0
PATCH 10/10 drm/amd/display: 3.2.266
In reply to Rodrigo SiqueiraFrom: Aric Cyr <[email protected]>
This version brings along following fixes:
- Improve z8/z10 support
- Revert some of the VRR optimization
- Improve usb4 when using MST
--- 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
@@ -51,7 +51,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.265" +#define DC_VER "3.2.266"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.43.0
[Public]
Hi all,
This week this patchset was tested on the following systems:
* Lenovo ThinkBook T13s Gen4 with AMD Ryzen 5 6600U
* MSI Gaming X Trio RX 6800
* Gigabyte Gaming OC RX 7900 XTX
These systems were tested on the following display/connection types:
* eDP, (1080p 60hz [5650U]) (1920x1200 60hz [6600U]) (2560x1600 120hz[6600U])
* VGA and DVI (1680x1050 60hz [DP to VGA/DVI, USB-C to VGA/DVI])
* DP/HDMI/USB-C (1440p 170hz, 4k 60hz, 4k 144hz, 4k 240hz [Includes USB-C to DP/HDMI adapters])
* Thunderbolt (LG Ultrafine 5k)
* MST (Startech MST14DP123DP [DP to 3x DP] and 2x 4k 60Hz displays)
* DSC (with Cable Matters 101075 [DP to 3x DP] with 3x 4k60 displays, and HP Hook G2 with 1 4k60 display)
* USB 4 (Kensington SD5700T and 1x 4k 60Hz display)
* PCON (Club3D CAC-1085 and 1x 4k 144Hz display [at 4k 120HZ, as that is the max the adapter supports])
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 - bf901afac5d5 drm/amdkfd: Fix type of 'dbg_flags' in 'struct kfd_process') with new patches added on top of it.
Tested on Ubuntu 22.04.3, on Wayland and X11, using KDE Plasma (Version 5.24.7) and Gnome (Version 42.9).
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com
-----Original Message-----
From: Siqueira, Rodrigo <[email protected]>
Sent: Thursday, January 4, 2024 10:51 AM
To: [email protected]
Cc: Wheeler, Daniel <[email protected]>; Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Wang, Chao-kai (Stylon) <[email protected]>; Chiu, Solomon <[email protected]>; Gutierrez, Agustin <[email protected]>; Zuo, Jerry <[email protected]>; Mahfooz, Hamza <[email protected]>
Subject: [PATCH 00/10] DC Patches Jan 04, 2024
This DC patchset brings improvements in multiple areas. In summary, we have:
- Improve z8/z10 support
- Revert some of the VRR optimization
- Improve usb4 when using MST
Thanks
Siqueira
Aric Cyr (1):
drm/amd/display: 3.2.266
Charlene Liu (2):
drm/amd/display: allow z8/z10 from driver
drm/amd/display: Update z8 latency
Daniel Miess (1):
Revert "drm/amd/display: Fix conversions between bytes and KB"
George Shen (1):
drm/amd/display: Disconnect phantom pipe OPP from OPTC being disabled
Martin Leung (2):
drm/amd/display: revert "for FPO & SubVP/DRR config program vmin/max" drm/amd/display: revert "Optimize VRR updates to only necessary ones"
Martin Tsai (1):
drm/amd/display: To adjust dprefclk by down spread percentage
Meenakshikumar Somasundaram (1):
drm/amd/display: Dpia hpd status not in sync after S4
Peichen Huang (1):
drm/amd/display: Request usb4 bw for mst streams
.../dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 71 ++++++++++++++++++- .../dc/clk_mgr/dcn314/dcn314_clk_mgr.h | 11 +++ drivers/gpu/drm/amd/display/dc/core/dc.c | 14 ++-- .../gpu/drm/amd/display/dc/core/dc_resource.c | 14 ---- drivers/gpu/drm/amd/display/dc/dc.h | 3 +- drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 + drivers/gpu/drm/amd/display/dc/dc_types.h | 12 ++-- .../gpu/drm/amd/display/dc/dce/dce_audio.c | 2 +- .../drm/amd/display/dc/dce/dce_clock_source.c | 9 ++- .../display/dc/dcn32/dcn32_resource_helpers.c | 14 ++++ .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 11 ++- .../drm/amd/display/dc/dml/dcn35/dcn35_fpu.c | 6 +- .../amd/display/dc/dml2/display_mode_core.c | 18 ++--- .../drm/amd/display/dc/dml2/dml2_wrapper.c | 2 + .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 2 +- .../amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 2 +- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 45 ++---------- .../gpu/drm/amd/display/dc/inc/hw/clk_mgr.h | 1 + drivers/gpu/drm/amd/display/dc/inc/resource.h | 3 - .../gpu/drm/amd/display/dc/link/link_dpms.c | 42 ++++++++--- .../drm/amd/display/dc/link/link_validation.c | 60 +++++++++++++--- .../display/dc/link/protocols/link_dp_dpia.c | 36 ++++++---- .../dc/link/protocols/link_dp_dpia_bw.c | 59 +++++++++++---- .../dc/link/protocols/link_dp_dpia_bw.h | 9 +++ .../amd/display/dc/optc/dcn32/dcn32_optc.c | 19 +++-- .../amd/display/dc/optc/dcn35/dcn35_optc.c | 12 ++-- .../dc/resource/dcn32/dcn32_resource.c | 2 +- .../dc/resource/dcn32/dcn32_resource.h | 3 + .../dc/resource/dcn321/dcn321_resource.c | 2 +- .../gpu/drm/amd/display/include/audio_types.h | 2 +- 30 files changed, 334 insertions(+), 154 deletions(-)
--
2.43.0