DC Patches for 12 Feb 2024
cover DC Patches for 12 Feb 2024
Summary:
* Revert some changes related to pixel encoding and clocks that cause corruption
* IPS hang fix and FGCG enable by default for DCN35
* PSR-SU/Replay fixes
* Plane clip size change treated as medium update
* Fix for checking link alignment done during link training.
* HDMI compliance test fixes and other improvements
----------------------------
Aric Cyr (1):
drm/amd/display: 3.2.272
Charlene Liu (2):
drm/amd/display: enable fgcg by default
drm/amd/display: allow psr-su/replay for z8
Gabe Teeger (1):
Revert "drm/amd/display: Send DTBCLK disable message on first commit"
George Shen (1):
Revert "drm/amd/display: Add left edge pixel for YCbCr422/420 + ODM
pipe split"
Martin Tsai (1):
drm/amd/display: should support dmub hw lock on Replay
Michael Strauss (1):
drm/amd/display: Update FIXED_VS Retimer HWSS Test Pattern Sequences
Nicholas Kazlauskas (2):
drm/amd/display: Add shared firmware state for DMUB IPS handshake drm/amd/display: Increase ips2_eval delay for DCN35
Roman Li (1):
drm/amd/display: Fix array-index-out-of-bounds in dcn35_clkmgr
Sohaib Nadeem (2):
Revert "drm/amd/display: increased min_dcfclk_mhz and min_fclk_mhz" drm/amd/display: fixed integer types and null check locations
Tom Chung (1):
drm/amd/display: Preserve original aspect ratio in create stream
Wenjing Liu (1):
drm/amd/display: treat plane clip size change as MED update type
Zhikai Zhai (1):
drm/amd/display: Add align done check
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +- .../drm/amd/display/dc/bios/bios_parser2.c | 16 ++- .../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 16 ++- .../amd/display/dc/clk_mgr/dcn35/dcn35_smu.c | 12 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 11 +- .../gpu/drm/amd/display/dc/core/dc_resource.c | 37 ------ drivers/gpu/drm/amd/display/dc/dc.h | 15 ++- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 83 +++++++------ .../drm/amd/display/dc/dce/dmub_hw_lock_mgr.c | 4 + .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 +- .../drm/amd/display/dc/dml/dcn35/dcn35_fpu.c | 8 +- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 9 +- .../gpu/drm/amd/display/dc/inc/core_types.h | 2 - drivers/gpu/drm/amd/display/dc/inc/resource.h | 4 - .../display/dc/link/accessories/link_dp_cts.c | 27 ++-- .../hwss/link_hwss_dio_fixed_vs_pe_retimer.c | 16 +-- .../link_hwss_hpo_fixed_vs_pe_retimer_dp.c | 51 ++++---- .../drm/amd/display/dc/link/link_validation.c | 2 +- .../display/dc/link/protocols/link_dp_phy.c | 6 +- .../dc/link/protocols/link_dp_training.c | 5 +- .../dc/resource/dcn35/dcn35_resource.c | 5 +- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 6 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 115 ++++++++++++++++++ .../gpu/drm/amd/display/dmub/src/dmub_dcn20.c | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn20.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn30.c | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn30.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn31.c | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn31.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn32.c | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn32.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn35.c | 12 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn35.h | 8 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 13 +- .../amd/display/include/link_service_types.h | 9 ++ 35 files changed, 336 insertions(+), 187 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/15 drm/amd/display: Add align done check
From: Zhikai Zhai <[email protected]>
[WHY]
We Double-check link status if training successful, but miss the lane align status.
[HOW]
Add the lane align status check
--- .../gpu/drm/amd/display/dc/link/protocols/link_dp_training.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c +4 -1
@@ -517,6 +517,7 @@ enum link_training_result dp_check_link_loss_status( {enum link_training_result status =LINK_TRAINING_SUCCESS ;union lane_status lane_status; +union lane_align_status_updated dpcd_lane_status_updated;uint8_t dpcd_buf[6 ] = {0 };uint32_t lane;
@@ -532,10 +533,12 @@ enum link_training_result dp_check_link_loss_status(* check lanes status */ lane_status.raw =dp_get_nibble_at_index (&dpcd_buf[2 ], lane); + dpcd_lane_status_updated.raw = dpcd_buf[4 ];if (!lane_status.bits.CHANNEL_EQ_DONE_0 || !lane_status.bits.CR_DONE_0 || - !lane_status.bits.SYMBOL_LOCKED_0) { + !lane_status.bits.SYMBOL_LOCKED_0 || + !dp_is_interlane_aligned (dpcd_lane_status_updated)) {/* if one of the channel equalization, clock * recovery or symbol lock is dropped * consider it as (link has been
Signature · 1 line
2.43.0
PATCH 2/15 Revert "drm/amd/display: increased min_dcfclk_mhz and min_fclk_mhz"
In reply to Aurabindo PillaiFrom: Sohaib Nadeem <[email protected]>
[why]:
This reverts commit 5abbfa320b88da6034fd4121fa68c2b0e15e97ac.
The commit caused corruption when running some applications in fullscreen
--- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +1 -1
@@ -2760,7 +2760,7 @@ static int build_synthetic_soc_states(bool disable_dc_mode_overwrite, struct clkstruct _vcs_dpi_voltage_scaling_st entry = {0 };struct clk_limit_table_entry max_clk_data = {0 }; -unsigned int min_dcfclk_mhz =399 , min_fclk_mhz =599 ; +unsigned int min_dcfclk_mhz =199 , min_fclk_mhz =299 ;static const unsigned int num_dcfclk_stas =5 ;unsigned int dcfclk_sta_targets[DC__VOLTAGE_STATES ] = {199 ,615 ,906 ,1324 ,1564 };
Signature · 1 line
2.43.0
PATCH 3/15 drm/amd/display: Preserve original aspect ratio in create stream
In reply to Aurabindo PillaiFrom: Tom Chung <[email protected]>
[Why]
The original picture aspect ratio in mode struct may have chance be overwritten with wrong aspect ratio data in create_stream_for_sink(). It will create a different VIC output and cause HDMI compliance test failed.
[How]
Preserve the original picture aspect ratio data during create the stream.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -0
@@ -6228,7 +6228,9 @@ create_stream_for_sink(struct drm_connector *connector,if (recalculate_timing) { freesync_mode =get_highest_refresh_rate_mode (aconnector, false);drm_mode_copy (&saved_mode, &mode); + saved_mode.picture_aspect_ratio = mode.picture_aspect_ratio;drm_mode_copy (&mode, freesync_mode); + mode.picture_aspect_ratio = saved_mode.picture_aspect_ratio; }else {decide_crtc_timing_for_drm_display_mode ( &mode, preferred_mode, scale);
Signature · 1 line
2.43.0
PATCH 4/15 Revert "drm/amd/display: Send DTBCLK disable message on first commit"
In reply to Aurabindo PillaiFrom: Gabe Teeger <[email protected]>
This reverts commit 3fda240dc2f6a4a9a3965b80cfb83d0ddfbf489c.
System hang observed, this commit is thought to be the regression point.
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c +0 -1
@@ -414,7 +414,6 @@ static void init_clk_states(struct clk_mgr *clk_mgr)uint32_t ref_dtbclk = clk_mgr->clks.ref_dtbclk_khz;memset (&(clk_mgr->clks),0 ,sizeof (struct dc_clocks )); - clk_mgr->clks.dtbclk_en = true; 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;
Signature · 1 line
2.43.0
PATCH 5/15 drm/amd/display: treat plane clip size change as MED update type
In reply to Aurabindo PillaiFrom: Wenjing Liu <[email protected]>
[why]
When clip size is changed recout and viewport size would require an update. When the update is clip size only current driver fails to program the update into hardware.
[how]
Set a new clip_size_change flag when it is detected and set MED update type and reprogram scaling params in next program pipe.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 7 ++++++- drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +6 -1
@@ -2454,6 +2454,10 @@ static enum surface_update_type get_scaling_info_update_type(/* Changing clip size of a large surface may result in MPC slice count change */ update_flags->bits.bandwidth_change =1 ; +if (u->scaling_info->clip_rect.width != u->surface->clip_rect.width || + u->scaling_info->clip_rect.height != u->surface->clip_rect.height) + update_flags->bits.clip_size_change =1 ; +if (u->scaling_info->src_rect.x != u->surface->src_rect.x || u->scaling_info->src_rect.y != u->surface->src_rect.y || u->scaling_info->clip_rect.x != u->surface->clip_rect.x
@@ -2467,7 +2471,8 @@ static enum surface_update_type get_scaling_info_update_type( || update_flags->bits.scaling_change)return UPDATE_TYPE_FULL ; -if (update_flags->bits.position_change) +if (update_flags->bits.position_change || + update_flags->bits.clip_size_change)return UPDATE_TYPE_MED ;return UPDATE_TYPE_FAST ;
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -1252,6 +1252,7 @@ union surface_update_flags { uint32_t rotation_change:1; uint32_t swizzle_change:1; uint32_t scaling_change:1; + uint32_t clip_size_change: 1; uint32_t position_change:1; uint32_t in_transfer_func_change:1; uint32_t input_csc_change:1;
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +2 -0
@@ -1740,6 +1740,7 @@ static void dcn20_update_dchubp_dpp(if (pipe_ctx->update_flags.bits.scaler || plane_state->update_flags.bits.scaling_change || plane_state->update_flags.bits.position_change || + plane_state->update_flags.bits.clip_size_change || plane_state->update_flags.bits.per_pixel_alpha_change || pipe_ctx->stream->update_flags.bits.scaling) { pipe_ctx->plane_res.scl_data.lb_params.alpha_en = pipe_ctx->plane_state->per_pixel_alpha;
@@ -1752,6 +1753,7 @@ static void dcn20_update_dchubp_dpp(if (pipe_ctx->update_flags.bits.viewport || (context == dc->current_state && plane_state->update_flags.bits.position_change) || (context == dc->current_state && plane_state->update_flags.bits.scaling_change) || + (context == dc->current_state && plane_state->update_flags.bits.clip_size_change) || (context == dc->current_state && pipe_ctx->stream->update_flags.bits.scaling)) { hubp->funcs->mem_program_viewport(
Signature · 1 line
2.43.0
PATCH 6/15 drm/amd/display: enable fgcg by default
In reply to Aurabindo PillaiFrom: Charlene Liu <[email protected]>
[why]
sw has most of the fgcg enabled which is the same as HW default. but driver disabled some due to enable flag not initialized.
comparing HW state, we still need to enable dpp and dio.
--- drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +2 -1
@@ -1907,7 +1907,8 @@ static bool dcn35_resource_construct(if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) dc->debug = debug_defaults_drv; - +/*HW default is to have all the FGCG enabled, SW no need to program them*/ + dc->debug.enable_fine_grain_clock_gating.u32All =0xFFFF ;// Init the vm_helper if (dc->vm_helper)vm_helper_init (dc->vm_helper,16 );
Signature · 1 line
2.43.0
PATCH 7/15 drm/amd/display: Update FIXED_VS Retimer HWSS Test Pattern Sequences
In reply to Aurabindo PillaiFrom: Michael Strauss <[email protected]>
[WHY]
Need to fix some broken logic and sequencing in initial commit
[HOW]
Fix logic handling override deprogramming when exiting SQ128.
Don't exit early from dp_set_hw_lane_settings for DP2/FIXED_VS case.
Move LTTPR 128b/132b check out of requires_hwss and check during runtime, as LTTPR caps are not populated on initial call.
Add pending_test_pattern to link state to allow HWSS to set FFE overrides on retimer TX and/or skip setting APU TX FFE depending on requested pattern.
Use updated clock source for SQ128 override sequence.
Skip HW FFE preset programming when performing test pattern overrides.
--- drivers/gpu/drm/amd/display/dc/dc.h | 12 +++++ .../display/dc/link/accessories/link_dp_cts.c | 27 +++------- .../hwss/link_hwss_dio_fixed_vs_pe_retimer.c | 16 +++--- .../link_hwss_hpo_fixed_vs_pe_retimer_dp.c | 51 +++++++++---------- .../display/dc/link/protocols/link_dp_phy.c | 6 ++- .../amd/display/include/link_service_types.h | 9 ++++ 6 files changed, 65 insertions(+), 56 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +12 -0
@@ -1572,7 +1572,19 @@ struct dc_link {enum engine_id dpia_preferred_eng_id;bool test_pattern_enabled; +/* Pending/Current test pattern are only used to perform and track +* FIXED_VS retimer test pattern/lane adjustment override state. +* Pending allows link HWSS to differentiate PHY vs non-PHY pattern, +* to perform specific lane adjust overrides before setting certain +* PHY test patterns. In cases when lane adjust and set test pattern +* calls are not performed atomically (i.e. performing link training), +* pending_test_pattern will be invalid or contain a non-PHY test pattern +* and current_test_pattern will contain required context for any future +* set pattern/set lane adjust to transition between override state(s). +* */ enum dp_test_pattern current_test_pattern; +enum dp_test_pattern pending_test_pattern; +union compliance_test_state compliance_test_state;void *priv;
drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_cts.c +8 -19
@@ -61,22 +61,6 @@ static enum dc_link_rate get_link_rate_from_test_link_rate(uint8_t test_rate) } } -static bool is_dp_phy_sqaure_pattern (enum dp_test_pattern test_pattern) -{ -return (DP_TEST_PATTERN_SQUARE_BEGIN <= test_pattern && - test_pattern <=DP_TEST_PATTERN_SQUARE_END ); -} - -static bool is_dp_phy_pattern (enum dp_test_pattern test_pattern) -{ -if ((DP_TEST_PATTERN_PHY_PATTERN_BEGIN <= test_pattern && - test_pattern <=DP_TEST_PATTERN_PHY_PATTERN_END ) || - test_pattern ==DP_TEST_PATTERN_VIDEO_MODE ) -return true; -else -return false; -} -static void dp_retrain_link_dp_test (struct dc_link *link,struct dc_link_settings *link_setting,bool skip_video_pattern)
@@ -361,7 +345,7 @@ static void dp_test_send_phy_test_pattern(struct dc_link *link) test_pattern_size); } -if (is_dp_phy_sqaure_pattern (test_pattern)) { +if (IS_DP_PHY_SQUARE_PATTERN (test_pattern)) { test_pattern_size =1 ;// Square pattern data is 1 byte (DP spec) core_link_read_dpcd( link,
@@ -623,6 +607,8 @@ bool dp_set_test_pattern(if (pipe_ctx ==NULL )return false; + link->pending_test_pattern = test_pattern; +/* Reset CRTC Test Pattern if it is currently running and request is VideoMode */ if (link->test_pattern_enabled && test_pattern ==DP_TEST_PATTERN_VIDEO_MODE ) {
@@ -643,12 +629,13 @@ bool dp_set_test_pattern(/* Reset Test Pattern state */ link->test_pattern_enabled = false; link->current_test_pattern = test_pattern; + link->pending_test_pattern =DP_TEST_PATTERN_UNSUPPORTED ;return true; }/* Check for PHY Test Patterns */ -if (is_dp_phy_pattern (test_pattern)) { +if (IS_DP_PHY_PATTERN (test_pattern)) {/* Set DPCD Lane Settings before running test pattern */ if (p_link_settings !=NULL ) { if ((link->chip_caps & EXT_DISPLAY_PATH_CAPS__DP_FIXED_VS_EN) &&
@@ -681,6 +668,7 @@ bool dp_set_test_pattern(/* Set Test Pattern state */ link->test_pattern_enabled = true; link->current_test_pattern = test_pattern; + link->pending_test_pattern =DP_TEST_PATTERN_UNSUPPORTED ;if (p_link_settings !=NULL )dpcd_set_link_settings (link, p_link_settings);
@@ -756,7 +744,7 @@ bool dp_set_test_pattern(return false;if (link->dpcd_caps.dpcd_rev.raw >=DPCD_REV_12 ) { -if (is_dp_phy_sqaure_pattern (test_pattern)) +if (IS_DP_PHY_SQUARE_PATTERN (test_pattern)) core_link_write_dpcd(link, DP_LINK_SQUARE_PATTERN, p_custom_pattern,
@@ -884,6 +872,7 @@ bool dp_set_test_pattern(/* Set Test Pattern state */ link->test_pattern_enabled = true; link->current_test_pattern = test_pattern; + link->pending_test_pattern =DP_TEST_PATTERN_UNSUPPORTED ; }return true;
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio_fixed_vs_pe_retimer.c +6 -10
@@ -80,21 +80,23 @@ static bool set_dio_fixed_vs_pe_retimer_dp_link_test_pattern_override(struct dc_const uint8_t vendor_lttpr_write_data_pg0[4 ] = {0x1 ,0x11 ,0x0 ,0x0 };const uint8_t vendor_lttpr_exit_manual_automation_0[4 ] = {0x1 ,0x11 ,0x0 ,0x06 }; +if (!link->dpcd_caps.lttpr_caps.main_link_channel_coding.bits.DP_128b_132b_SUPPORTED) +return false;if (tp_params ==NULL )return false; -if (link->current_test_pattern >=DP_TEST_PATTERN_SQUARE_BEGIN && - link->current_test_pattern <=DP_TEST_PATTERN_SQUARE_END ) { +if (IS_DP_PHY_SQUARE_PATTERN (link->current_test_pattern))// Deprogram overrides from previous test pattern dp_dio_fixed_vs_pe_retimer_exit_manual_automation (link); - }switch (tp_params->dp_phy_pattern) {case DP_TEST_PATTERN_80BIT_CUSTOM :if (tp_params->custom_pattern_size ==0 ||memcmp (tp_params->custom_pattern, pltpat_custom, tp_params->custom_pattern_size) !=0 )return false; + hw_tp_params.custom_pattern = tp_params->custom_pattern; + hw_tp_params.custom_pattern_size = tp_params->custom_pattern_size;break ;case DP_TEST_PATTERN_D102 :break ;
@@ -185,13 +187,7 @@ static const struct link_hwss dio_fixed_vs_pe_retimer_link_hwss = {bool requires_fixed_vs_pe_retimer_dio_link_hwss (const struct dc_link *link) { -if (!(link->chip_caps &EXT_DISPLAY_PATH_CAPS__DP_FIXED_VS_EN )) -return false; - -if (!link->dpcd_caps.lttpr_caps.main_link_channel_coding.bits.DP_128b_132b_SUPPORTED) -return false; - -return true; +return (link->chip_caps &EXT_DISPLAY_PATH_CAPS__DP_FIXED_VS_EN ); }const struct link_hwss *get_dio_fixed_vs_pe_retimer_link_hwss (void )
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_hpo_fixed_vs_pe_retimer_dp.c +25 -26
93 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c +5 -1
@@ -37,6 +37,7 @@#include "clk_mgr.h" #include "resource.h" #include "link_enc_cfg.h" +#include "atomfirmware.h" #define DC_LOGGER \ link->ctx->logger
@@ -100,8 +101,11 @@ void dp_set_hw_lane_settings( {const struct link_hwss *link_hwss =get_link_hwss (link, link_res); +// Don't return here if using FIXED_VS link HWSS and encoding is 128b/132b if ((link_settings->lttpr_mode ==LTTPR_MODE_NON_TRANSPARENT ) && - !is_immediate_downstream (link, offset)) + !is_immediate_downstream (link, offset) && + (!(link->chip_caps &EXT_DISPLAY_PATH_CAPS__DP_FIXED_VS_EN ) || +link_dp_get_encoding_format (&link_settings->link_settings) == DP_8b_10b_ENCODING))return ;if (link_hwss->ext.set_dp_lane_settings)
drivers/gpu/drm/amd/display/include/link_service_types.h +9 -0
@@ -169,6 +169,15 @@ enum dp_test_pattern {DP_TEST_PATTERN_UNSUPPORTED }; +#define IS_DP_PHY_SQUARE_PATTERN (test_pattern)\ + (DP_TEST_PATTERN_SQUARE_BEGIN <= test_pattern &&\ + test_pattern <= DP_TEST_PATTERN_SQUARE_END) + +#define IS_DP_PHY_PATTERN (test_pattern)\ + ((DP_TEST_PATTERN_PHY_PATTERN_BEGIN <= test_pattern &&\ + test_pattern <= DP_TEST_PATTERN_PHY_PATTERN_END) ||\ + test_pattern == DP_TEST_PATTERN_VIDEO_MODE) +enum dp_test_pattern_color_space {DP_TEST_PATTERN_COLOR_SPACE_RGB ,DP_TEST_PATTERN_COLOR_SPACE_YCBCR601 ,
Signature · 1 line
2.43.0
PATCH 8/15 drm/amd/display: Fix array-index-out-of-bounds in dcn35_clkmgr
In reply to Aurabindo PillaiFrom: Roman Li <[email protected]>
[Why]
There is a potential memory access violation while iterating through array of dcn35 clks.
[How]
Limit iteration per array size.
--- .../amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c +11 -4
@@ -658,10 +658,13 @@ static void dcn35_clk_mgr_helper_populate_bw_params(struct clk_mgr_internal *clkstruct clk_limit_table_entry def_max = bw_params->clk_table.entries[bw_params->clk_table.num_entries -1 ];uint32_t max_fclk =0 , min_pstate =0 , max_dispclk =0 , max_dppclk =0 ;uint32_t max_pstate =0 , max_dram_speed_mts =0 , min_dram_speed_mts =0 ; +uint32_t num_memps, num_fclk, num_dcfclk;int i;/* Determine min/max p-state values. */ -for (i =0 ; i < clock_table->NumMemPstatesEnabled; i++) { + num_memps = (clock_table->NumMemPstatesEnabled >NUM_MEM_PSTATE_LEVELS ) ?NUM_MEM_PSTATE_LEVELS : + clock_table->NumMemPstatesEnabled; +for (i =0 ; i < num_memps; i++) {uint32_t dram_speed_mts =calc_dram_speed_mts (&clock_table->MemPstateTable[i]);if (is_valid_clock_value (dram_speed_mts) && dram_speed_mts > max_dram_speed_mts) {
@@ -673,7 +676,7 @@ static void dcn35_clk_mgr_helper_populate_bw_params(struct clk_mgr_internal *clk min_dram_speed_mts = max_dram_speed_mts; min_pstate = max_pstate; -for (i =0 ; i < clock_table->NumMemPstatesEnabled; i++) { +for (i =0 ; i < num_memps; i++) {uint32_t dram_speed_mts =calc_dram_speed_mts (&clock_table->MemPstateTable[i]);if (is_valid_clock_value (dram_speed_mts) && dram_speed_mts < min_dram_speed_mts) {
@@ -702,9 +705,13 @@ static void dcn35_clk_mgr_helper_populate_bw_params(struct clk_mgr_internal *clk/* Base the clock table on dcfclk, need at least one entry regardless of pmfw table */ ASSERT (clock_table->NumDcfClkLevelsEnabled >0 ); - max_fclk =find_max_clk_value (clock_table->FclkClocks_Freq, clock_table->NumFclkLevelsEnabled); + num_fclk = (clock_table->NumFclkLevelsEnabled >NUM_FCLK_DPM_LEVELS ) ?NUM_FCLK_DPM_LEVELS : + clock_table->NumFclkLevelsEnabled; + max_fclk =find_max_clk_value (clock_table->FclkClocks_Freq, num_fclk); -for (i =0 ; i < clock_table->NumDcfClkLevelsEnabled; i++) { + num_dcfclk = (clock_table->NumFclkLevelsEnabled >NUM_DCFCLK_DPM_LEVELS ) ?NUM_DCFCLK_DPM_LEVELS : + clock_table->NumDcfClkLevelsEnabled; +for (i =0 ; i < num_dcfclk; i++) {int j;/* First search defaults for the clocks we don't read using closest lower or equal default dcfclk */
Signature · 1 line
2.43.0
PATCH 9/15 drm/amd/display: fixed integer types and null check locations
In reply to Aurabindo PillaiFrom: Sohaib Nadeem <[email protected]>
[why]:
issues fixed:
- comparison with wider integer type in loop condition which can cause infinite loops
- pointer dereference before null check
--- .../gpu/drm/amd/display/dc/bios/bios_parser2.c | 16 ++++++++++------ .../drm/amd/display/dc/link/link_validation.c | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +10 -6
@@ -1850,19 +1850,21 @@ static enum bp_result get_firmware_info_v3_2(/* Vega12 */ smu_info_v3_2 = GET_IMAGE(struct atom_smu_info_v3_2,DATA_TABLES (smu_info)); -DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , smu_info_v3_2->gpuclk_ss_percentage);if (!smu_info_v3_2)return BP_RESULT_BADBIOSTABLE ; +DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , smu_info_v3_2->gpuclk_ss_percentage); + info->default_engine_clk = smu_info_v3_2->bootup_dcefclk_10khz *10 ; }else if (revision.minor ==3 ) {/* Vega20 */ smu_info_v3_3 = GET_IMAGE(struct atom_smu_info_v3_3,DATA_TABLES (smu_info)); -DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , smu_info_v3_3->gpuclk_ss_percentage);if (!smu_info_v3_3)return BP_RESULT_BADBIOSTABLE ; +DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , smu_info_v3_3->gpuclk_ss_percentage); + info->default_engine_clk = smu_info_v3_3->bootup_dcefclk_10khz *10 ; }
@@ -2422,10 +2424,11 @@ static enum bp_result get_integrated_info_v11( info_v11 = GET_IMAGE(struct atom_integrated_system_info_v1_11,DATA_TABLES (integratedsysteminfo)); -DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , info_v11->gpuclk_ss_percentage);if (info_v11 ==NULL )return BP_RESULT_BADBIOSTABLE ; +DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , info_v11->gpuclk_ss_percentage); + info->gpu_cap_info =le32_to_cpu (info_v11->gpucapinfo);/*
@@ -2637,11 +2640,12 @@ static enum bp_result get_integrated_info_v2_1( info_v2_1 = GET_IMAGE(struct atom_integrated_system_info_v2_1,DATA_TABLES (integratedsysteminfo)); -DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , info_v2_1->gpuclk_ss_percentage);if (info_v2_1 ==NULL )return BP_RESULT_BADBIOSTABLE ; +DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , info_v2_1->gpuclk_ss_percentage); + info->gpu_cap_info =le32_to_cpu (info_v2_1->gpucapinfo);/*
@@ -2799,11 +2803,11 @@ static enum bp_result get_integrated_info_v2_2( info_v2_2 = GET_IMAGE(struct atom_integrated_system_info_v2_2,DATA_TABLES (integratedsysteminfo)); -DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , info_v2_2->gpuclk_ss_percentage); -if (info_v2_2 ==NULL )return BP_RESULT_BADBIOSTABLE ; +DC_LOG_BIOS ("gpuclk_ss_percentage (unit of 0.001 percent): %d\n" , info_v2_2->gpuclk_ss_percentage); + info->gpu_cap_info =le32_to_cpu (info_v2_2->gpucapinfo);/*
drivers/gpu/drm/amd/display/dc/link/link_validation.c +1 -1
@@ -359,7 +359,7 @@ bool link_validate_dpia_bandwidth(const struct dc_stream_state *stream, const unstruct dc_link *dpia_link[MAX_DPIA_NUM ] = {0 };int num_dpias =0 ; -for (uint8_t i =0 ; i < num_streams; ++i) { +for (unsigned int i =0 ; i < num_streams; ++i) {if (stream[i].signal ==SIGNAL_TYPE_DISPLAY_PORT ) {/* new dpia sst stream, check whether it exceeds max dpia */ if (num_dpias >=MAX_DPIA_NUM )
Signature · 1 line
2.43.0
PATCH 10/15 drm/amd/display: Add shared firmware state for DMUB IPS handshake
In reply to Aurabindo PillaiFrom: Nicholas Kazlauskas <[email protected]>
[Why]
Read modify write hazards can occur when using a single shared scratch register between driver and firmware leading to driver accessing DCN in IPS2 and a system hang.
[How]
Add infrastructure for using REGION6 as a shared firmware state between driver and firmware. This region is uncachable.
Replace the existing get/set idle calls with reads/writes to the (volatile) shared firmware state blocks that a separated by at least a cache line between firmware and driver.
Remove the workarounds that required rewriting/checking read modify write hazards.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 83 +++++++------ drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 6 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 115 ++++++++++++++++++ .../gpu/drm/amd/display/dmub/src/dmub_dcn20.c | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn20.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn30.c | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn30.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn31.c | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn31.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn32.c | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn32.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn35.c | 12 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn35.h | 8 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 13 +- 15 files changed, 212 insertions(+), 52 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
@@ -2129,7 +2129,8 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev)DMUB_WINDOW_MEMORY_TYPE_FB ,//DMUB_WINDOW_4_MAILBOX DMUB_WINDOW_MEMORY_TYPE_FB ,//DMUB_WINDOW_5_TRACEBUFF DMUB_WINDOW_MEMORY_TYPE_FB ,//DMUB_WINDOW_6_FW_STATE - DMUB_WINDOW_MEMORY_TYPE_FB //DMUB_WINDOW_7_SCRATCH_MEM +DMUB_WINDOW_MEMORY_TYPE_FB ,//DMUB_WINDOW_7_SCRATCH_MEM + DMUB_WINDOW_MEMORY_TYPE_FB, //DMUB_WINDOW_SHARED_STATE };int r;
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +45 -38
136 lines not on this page · raw message
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +5 -1
@@ -125,6 +125,7 @@ enum dmub_window_id {DMUB_WINDOW_5_TRACEBUFF ,DMUB_WINDOW_6_FW_STATE ,DMUB_WINDOW_7_SCRATCH_MEM , +DMUB_WINDOW_SHARED_STATE , DMUB_WINDOW_TOTAL, };
@@ -368,7 +369,8 @@ struct dmub_srv_hw_funcs {const struct dmub_window *cw3, const struct dmub_window *cw4, const struct dmub_window *cw5, - const struct dmub_window *cw6); + const struct dmub_window *cw6, + const struct dmub_window *region6);void (*setup_mailbox)(struct dmub_srv *dmub,const struct dmub_region *inbox1);
@@ -461,6 +463,7 @@ struct dmub_srv_create_params {* @user_ctx: user provided context for the dmub_srv * @fw_version: the current firmware version, if any * @is_virtual: false if hardware support only +* @shared_state: dmub shared state between firmware and driver * @fw_state: dmub firmware state pointer */ struct dmub_srv {
@@ -469,6 +472,7 @@ struct dmub_srv {uint32_t fw_version;bool is_virtual;struct dmub_fb scratch_mem_fb; +volatile struct dmub_shared_state_feature_block *shared_state;volatile const struct dmub_fw_state *fw_state;/* private: internal use only */
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +115 -0
133 lines not on this page · raw message
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.c +2 -1
@@ -191,7 +191,8 @@ void dmub_dcn20_setup_windows(struct dmub_srv *dmub,const struct dmub_window *cw3, const struct dmub_window *cw4, const struct dmub_window *cw5, - const struct dmub_window *cw6) + const struct dmub_window *cw6, + const struct dmub_window *region6) { union dmub_addr offset;uint64_t fb_base, fb_offset;
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.h +2 -1
@@ -197,7 +197,8 @@ void dmub_dcn20_setup_windows(struct dmub_srv *dmub,const struct dmub_window *cw3, const struct dmub_window *cw4, const struct dmub_window *cw5, - const struct dmub_window *cw6); + const struct dmub_window *cw6, + const struct dmub_window *region6);void dmub_dcn20_setup_mailbox (struct dmub_srv *dmub,const struct dmub_region *inbox1);
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn30.c +2 -1
@@ -124,7 +124,8 @@ void dmub_dcn30_setup_windows(struct dmub_srv *dmub,const struct dmub_window *cw3, const struct dmub_window *cw4, const struct dmub_window *cw5, - const struct dmub_window *cw6) + const struct dmub_window *cw6, + const struct dmub_window *region6) { union dmub_addr offset;
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn30.h +2 -1
@@ -43,7 +43,8 @@ void dmub_dcn30_setup_windows(struct dmub_srv *dmub,const struct dmub_window *cw3, const struct dmub_window *cw4, const struct dmub_window *cw5, - const struct dmub_window *cw6); + const struct dmub_window *cw6, + const struct dmub_window *region6);#endif /* _DMUB_DCN30_H_ */
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c +2 -1
@@ -187,7 +187,8 @@ void dmub_dcn31_setup_windows(struct dmub_srv *dmub,const struct dmub_window *cw3, const struct dmub_window *cw4, const struct dmub_window *cw5, - const struct dmub_window *cw6) + const struct dmub_window *cw6, + const struct dmub_window *region6) { union dmub_addr offset;
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.h +2 -1
@@ -199,7 +199,8 @@ void dmub_dcn31_setup_windows(struct dmub_srv *dmub,const struct dmub_window *cw3, const struct dmub_window *cw4, const struct dmub_window *cw5, - const struct dmub_window *cw6); + const struct dmub_window *cw6, + const struct dmub_window *region6);void dmub_dcn31_setup_mailbox (struct dmub_srv *dmub,const struct dmub_region *inbox1);
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn32.c +2 -1
@@ -216,7 +216,8 @@ void dmub_dcn32_setup_windows(struct dmub_srv *dmub,const struct dmub_window *cw3, const struct dmub_window *cw4, const struct dmub_window *cw5, - const struct dmub_window *cw6) + const struct dmub_window *cw6, + const struct dmub_window *region6) { union dmub_addr offset;
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn32.h +2 -1
@@ -206,7 +206,8 @@ void dmub_dcn32_setup_windows(struct dmub_srv *dmub,const struct dmub_window *cw3, const struct dmub_window *cw4, const struct dmub_window *cw5, - const struct dmub_window *cw6); + const struct dmub_window *cw6, + const struct dmub_window *region6);void dmub_dcn32_setup_mailbox (struct dmub_srv *dmub,const struct dmub_region *inbox1);
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn35.c +11 -1
@@ -229,7 +229,8 @@ void dmub_dcn35_setup_windows(struct dmub_srv *dmub,const struct dmub_window *cw3, const struct dmub_window *cw4, const struct dmub_window *cw5, - const struct dmub_window *cw6) + const struct dmub_window *cw6, + const struct dmub_window *region6) { union dmub_addr offset;
@@ -275,6 +276,15 @@ void dmub_dcn35_setup_windows(struct dmub_srv *dmub,REG_SET_2 (DMCUB_REGION3_CW6_TOP_ADDRESS ,0 ,DMCUB_REGION3_CW6_TOP_ADDRESS , cw6->region.top,DMCUB_REGION3_CW6_ENABLE ,1 ); + + offset = region6->offset; + +REG_WRITE (DMCUB_REGION6_OFFSET , offset.u.low_part); +REG_WRITE (DMCUB_REGION6_OFFSET_HIGH , offset.u.high_part); +REG_SET_2 (DMCUB_REGION6_TOP_ADDRESS ,0 , +DMCUB_REGION6_TOP_ADDRESS , + region6->region.top - region6->region.base -1 , +DMCUB_REGION6_ENABLE ,1 ); } void dmub_dcn35_setup_mailbox(struct dmub_srv *dmub,
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn35.h +7 -1
@@ -89,6 +89,9 @@ struct dmub_srv; DMUB_SR(DMCUB_REGION5_OFFSET) \ DMUB_SR(DMCUB_REGION5_OFFSET_HIGH) \ DMUB_SR(DMCUB_REGION5_TOP_ADDRESS) \ + DMUB_SR(DMCUB_REGION6_OFFSET) \ + DMUB_SR(DMCUB_REGION6_OFFSET_HIGH) \ + DMUB_SR(DMCUB_REGION6_TOP_ADDRESS) \ DMUB_SR(DMCUB_SCRATCH0) \ DMUB_SR(DMCUB_SCRATCH1) \ DMUB_SR(DMCUB_SCRATCH2) \
@@ -154,6 +157,8 @@ struct dmub_srv; DMUB_SF(DMCUB_REGION4_TOP_ADDRESS, DMCUB_REGION4_ENABLE) \ DMUB_SF(DMCUB_REGION5_TOP_ADDRESS, DMCUB_REGION5_TOP_ADDRESS) \ DMUB_SF(DMCUB_REGION5_TOP_ADDRESS, DMCUB_REGION5_ENABLE) \ + DMUB_SF(DMCUB_REGION6_TOP_ADDRESS, DMCUB_REGION6_TOP_ADDRESS) \ + DMUB_SF(DMCUB_REGION6_TOP_ADDRESS, DMCUB_REGION6_ENABLE) \ DMUB_SF(CC_DC_PIPE_DIS, DC_DMCUB_ENABLE) \ DMUB_SF(MMHUBBUB_SOFT_RESET, DMUIF_SOFT_RESET) \DMUB_SF (DCN_VM_FB_LOCATION_BASE ,FB_BASE ) \
@@ -214,7 +219,8 @@ void dmub_dcn35_setup_windows(struct dmub_srv *dmub,const struct dmub_window *cw3, const struct dmub_window *cw4, const struct dmub_window *cw5, - const struct dmub_window *cw6); + const struct dmub_window *cw6, + const struct dmub_window *region6);void dmub_dcn35_setup_mailbox (struct dmub_srv *dmub,const struct dmub_region *inbox1);
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +11 -2
@@ -78,6 +78,7 @@#define DMUB_CW6_BASE (0x66000000)#define DMUB_REGION5_BASE (0xA0000000) +#define DMUB_REGION6_BASE (0xC0000000)static struct dmub_srv_dcn32_regs dmub_srv_dcn32_regs;static struct dmub_srv_dcn35_regs dmub_srv_dcn35_regs;
@@ -480,6 +481,7 @@ enum dmub_status window_sizes[DMUB_WINDOW_5_TRACEBUFF ] = trace_buffer_size; window_sizes[DMUB_WINDOW_6_FW_STATE ] = fw_state_size; window_sizes[DMUB_WINDOW_7_SCRATCH_MEM ] =DMUB_SCRATCH_MEM_SIZE ; + window_sizes[DMUB_WINDOW_SHARED_STATE ] =DMUB_FW_HEADER_SHARED_STATE_SIZE ; out->fb_size =dmub_srv_calc_regions_for_memory_type (params, out, window_sizes,DMUB_WINDOW_MEMORY_TYPE_FB );
@@ -565,9 +567,10 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub,struct dmub_fb *tracebuff_fb = params->fb[DMUB_WINDOW_5_TRACEBUFF ];struct dmub_fb *fw_state_fb = params->fb[DMUB_WINDOW_6_FW_STATE ];struct dmub_fb *scratch_mem_fb = params->fb[DMUB_WINDOW_7_SCRATCH_MEM ]; +struct dmub_fb *shared_state_fb = params->fb[DMUB_WINDOW_SHARED_STATE ];struct dmub_rb_init_params rb_params, outbox0_rb_params; -struct dmub_window cw0, cw1, cw2, cw3, cw4, cw5, cw6; +struct dmub_window cw0, cw1, cw2, cw3, cw4, cw5, cw6, region6;struct dmub_region inbox1, outbox1, outbox0;if (!dmub->sw_init)
@@ -652,10 +655,16 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub, dmub->fw_state = fw_state_fb->cpu_addr; + region6.offset.quad_part = shared_state_fb->gpu_addr; + region6.region.base =DMUB_CW6_BASE ; + region6.region.top = region6.region.base + shared_state_fb->size; + + dmub->shared_state = shared_state_fb->cpu_addr; + dmub->scratch_mem_fb = *scratch_mem_fb;if (dmub->hw_funcs.setup_windows) - dmub->hw_funcs.setup_windows (dmub, &cw2, &cw3, &cw4, &cw5, &cw6); + dmub->hw_funcs.setup_windows (dmub, &cw2, &cw3, &cw4, &cw5, &cw6, ®ion6);if (dmub->hw_funcs.setup_outbox0) dmub->hw_funcs.setup_outbox0 (dmub, &outbox0);
Signature · 1 line
2.43.0
PATCH 11/15 drm/amd/display: allow psr-su/replay for z8
In reply to Aurabindo PillaiFrom: Charlene Liu <[email protected]>
[why]
allow psr-su/replay for z8
--- .../gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_smu.c | 12 ++++++------ drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c | 8 ++++++-- 2 files changed, 12 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_smu.c +6 -6
@@ -361,32 +361,32 @@ void dcn35_smu_set_zstate_support(struct clk_mgr_internal *clk_mgr, enum dcn_zstcase DCN_ZSTATE_SUPPORT_ALLOW : msg_id = VBIOSSMC_MSG_AllowZstatesEntry; param = (1 <<10 ) | (1 <<9 ) | (1 <<8 ); -smu_print ("%s: SMC_MSG_AllowZstatesEntry msg = ALLOW, param = %d\n" , __func__, param); +smu_print ("%s: SMC_MSG_AllowZstatesEntry msg = ALLOW, param = 0x%x\n" , __func__, param);break ;case DCN_ZSTATE_SUPPORT_DISALLOW : msg_id = VBIOSSMC_MSG_AllowZstatesEntry; param =0 ; -smu_print ("%s: SMC_MSG_AllowZstatesEntry msg_id = DISALLOW, param = %d\n" , __func__, param); +smu_print ("%s: SMC_MSG_AllowZstatesEntry msg_id = DISALLOW, param = 0x%x\n" , __func__, param);break ;case DCN_ZSTATE_SUPPORT_ALLOW_Z10_ONLY : msg_id = VBIOSSMC_MSG_AllowZstatesEntry; param = (1 <<10 ); -smu_print ("%s: SMC_MSG_AllowZstatesEntry msg = ALLOW_Z10_ONLY, param = %d\n" , __func__, param); +smu_print ("%s: SMC_MSG_AllowZstatesEntry msg = ALLOW_Z10_ONLY, param = 0x%x\n" , __func__, param);break ;case DCN_ZSTATE_SUPPORT_ALLOW_Z8_Z10_ONLY : msg_id = VBIOSSMC_MSG_AllowZstatesEntry; param = (1 <<10 ) | (1 <<8 ); -smu_print ("%s: SMC_MSG_AllowZstatesEntry msg = ALLOW_Z8_Z10_ONLY, param = %d\n" , __func__, param); +smu_print ("%s: SMC_MSG_AllowZstatesEntry msg = ALLOW_Z8_Z10_ONLY, param = 0x%x\n" , __func__, param);break ;case DCN_ZSTATE_SUPPORT_ALLOW_Z8_ONLY : msg_id = VBIOSSMC_MSG_AllowZstatesEntry; param = (1 <<8 ); -smu_print ("%s: SMC_MSG_AllowZstatesEntry msg = ALLOW_Z8_ONLY, param = %d\n" , __func__, param); +smu_print ("%s: SMC_MSG_AllowZstatesEntry msg = ALLOW_Z8_ONLY, param = 0x%x\n" , __func__, param);break ;default ://DCN_ZSTATE_SUPPORT_UNKNOWN
@@ -400,7 +400,7 @@ void dcn35_smu_set_zstate_support(struct clk_mgr_internal *clk_mgr, enum dcn_zst clk_mgr, msg_id, param); -smu_print ("%s: msg_id = %d, param = 0x%x, return = %d\n" , __func__, msg_id, param, retv); +smu_print ("%s: msg_id = %d, param = 0x%x, return = 0x%x\n" , __func__, msg_id, param, retv); }int dcn35_smu_get_dprefclk (struct clk_mgr_internal *clk_mgr)
drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c +6 -2
@@ -588,7 +588,9 @@ void dcn35_decide_zstate_support(struct dc *dc, struct dc_state *context) }else if (context->stream_count ==1 && context->streams[0 ]->signal ==SIGNAL_TYPE_EDP ) {struct dc_link *link = context->streams[0 ]->sink->link;bool is_pwrseq0 = link && link->link_index ==0 ; -bool is_psr1 = link && link->psr_settings.psr_version ==DC_PSR_VERSION_1 && !link->panel_config.psr.disable_psr; +bool is_psr = (link && (link->psr_settings.psr_version ==DC_PSR_VERSION_1 || + link->psr_settings.psr_version ==DC_PSR_VERSION_SU_1 ) && !link->panel_config.psr.disable_psr); +bool is_replay = link && link->replay_settings.replay_feature_enabled;int minmum_z8_residency = dc->debug.minimum_z8_residency_time >0 ? dc->debug.minimum_z8_residency_time :1000 ;bool allow_z8 = context->bw_ctx.dml.vba.StutterPeriod > (double )minmum_z8_residency;
@@ -596,12 +598,14 @@ void dcn35_decide_zstate_support(struct dc *dc, struct dc_state *context) dc->debug.minimum_z10_residency_time >0 ? dc->debug.minimum_z10_residency_time :5000 ;bool allow_z10 = context->bw_ctx.dml.vba.StutterPeriod > (double )minmum_z10_residency; +/*for psr1/psr-su, we allow z8 and z10 based on latency, for replay with IPS enabled, it will enter ips2*/ if (is_pwrseq0 && allow_z10) support =DCN_ZSTATE_SUPPORT_ALLOW ; -else if (is_pwrseq0 && is_psr1) +else if (is_pwrseq0 && (is_psr || is_replay)) support = allow_z8 ?DCN_ZSTATE_SUPPORT_ALLOW_Z8_Z10_ONLY :DCN_ZSTATE_SUPPORT_ALLOW_Z10_ONLY ;else if (allow_z8) support =DCN_ZSTATE_SUPPORT_ALLOW_Z8_ONLY ; + } context->bw_ctx.bw.dcn.clk.zstate_support = support;
Signature · 1 line
2.43.0
PATCH 12/15 drm/amd/display: should support dmub hw lock on Replay
In reply to Aurabindo PillaiFrom: Martin Tsai <[email protected]>
[Why]
Without acquiring DMCUB hw lock, a race condition is caused with Panel Replay feature, which will trigger a hang. Indicate that a lock is necessary to prevent this when replay feature is enabled.
[How]
To allow dmub hw lock on Replay.
--- drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c +4 -0
@@ -65,5 +65,9 @@ bool should_use_dmub_lock(struct dc_link *link) {if (link->psr_settings.psr_version ==DC_PSR_VERSION_SU_1 )return true; + +if (link->replay_settings.replay_feature_enabled) +return true; +return false; }
Signature · 1 line
2.43.0
PATCH 13/15 drm/amd/display: Increase ips2_eval delay for DCN35
In reply to Aurabindo PillaiFrom: Nicholas Kazlauskas <[email protected]>
[Why]
New worst-case measurement observed at 1897us.
[How]
Increase to 2000us to cover the new worst case + margin.
--- drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +1 -1
@@ -781,7 +781,7 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_z10 = false, .ignore_pg = true, .psp_disabled_wa = true, - .ips2_eval_delay_us = 1650, + .ips2_eval_delay_us = 2000, .ips2_entry_delay_us = 800, .disable_dmub_reallow_idle = true, .static_screen_wait_frames = 2,
Signature · 1 line
2.43.0
PATCH 14/15 Revert "drm/amd/display: Add left edge pixel for YCbCr422/420 + ODM pipe split"
In reply to Aurabindo PillaiFrom: George Shen <[email protected]>
[Why/How]
A regression was identified with the change to add left edge pixel for YCbCr422/420 + ODM combine cases.
This reverts commit 8d09500a33f6a0e0df9cf17822fe51520d0df002
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 -- .../gpu/drm/amd/display/dc/core/dc_resource.c | 37 ------------------- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 7 +--- .../gpu/drm/amd/display/dc/inc/core_types.h | 2 - drivers/gpu/drm/amd/display/dc/inc/resource.h | 4 -- 5 files changed, 1 insertion(+), 53 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -4
@@ -3098,10 +3098,6 @@ static bool update_planes_and_stream_state(struct dc *dc,if (otg_master && otg_master->stream->test_pattern.type !=DP_TEST_PATTERN_VIDEO_MODE )resource_build_test_pattern_params (&context->res_ctx, otg_master); - -if (otg_master && (otg_master->stream->timing.pixel_encoding ==PIXEL_ENCODING_YCBCR422 || - otg_master->stream->timing.pixel_encoding ==PIXEL_ENCODING_YCBCR420 )) -resource_build_subsampling_params (&context->res_ctx, otg_master); } }
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0 -37
@@ -822,16 +822,6 @@ static struct rect calculate_odm_slice_in_timing_active(struct pipe_ctx *pipe_ct stream->timing.v_border_bottom + stream->timing.v_border_top; -/* Recout for ODM slices after the first slice need one extra left edge pixel -* for 3-tap chroma subsampling. -*/ -if (odm_slice_idx >0 && - (pipe_ctx->stream->timing.pixel_encoding ==PIXEL_ENCODING_YCBCR422 || - pipe_ctx->stream->timing.pixel_encoding ==PIXEL_ENCODING_YCBCR420 )) { - odm_rec.x -=1 ; - odm_rec.width +=1 ; - } -return odm_rec; }
@@ -1448,7 +1438,6 @@ void resource_build_test_pattern_params(struct resource_context *res_ctx,enum controller_dp_test_pattern controller_test_pattern;enum controller_dp_color_space controller_color_space;enum dc_color_depth color_depth = otg_master->stream->timing.display_color_depth; -enum dc_pixel_encoding pixel_encoding = otg_master->stream->timing.pixel_encoding;int h_active = otg_master->stream->timing.h_addressable + otg_master->stream->timing.h_border_left + otg_master->stream->timing.h_border_right;
@@ -1480,36 +1469,10 @@ void resource_build_test_pattern_params(struct resource_context *res_ctx,else params->width = last_odm_slice_width; -/* Extra left edge pixel is required for 3-tap chroma subsampling. */ -if (i !=0 && (pixel_encoding ==PIXEL_ENCODING_YCBCR422 || - pixel_encoding ==PIXEL_ENCODING_YCBCR420 )) { - params->offset -=1 ; - params->width +=1 ; - } - offset += odm_slice_width; } } -void resource_build_subsampling_params (struct resource_context *res_ctx, -struct pipe_ctx *otg_master) -{ -struct pipe_ctx *opp_heads[MAX_PIPES ]; -int odm_cnt =1 ; -int i; - - odm_cnt =resource_get_opp_heads_for_otg_master (otg_master, res_ctx, opp_heads); - -/* For ODM slices after the first slice, extra left edge pixel is required -* for 3-tap chroma subsampling. -*/ -if (otg_master->stream->timing.pixel_encoding ==PIXEL_ENCODING_YCBCR422 || - otg_master->stream->timing.pixel_encoding ==PIXEL_ENCODING_YCBCR420 ) { -for (i =0 ; i < odm_cnt; i++) - opp_heads[i]->stream_res.left_edge_extra_pixel = (i ==0 ) ? false : true; - } -} -bool resource_build_scaling_params (struct pipe_ctx *pipe_ctx) {const struct dc_plane_state *plane_state = pipe_ctx->plane_state;
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +1 -6
@@ -1573,8 +1573,7 @@ static void dcn20_detect_pipe_changes(struct dc_state *old_state,* makes this assumption at the moment with how hubp reset is matched to * same index mpcc reset. */ -if (old_pipe->stream_res.opp != new_pipe->stream_res.opp || - old_pipe->stream_res.left_edge_extra_pixel != new_pipe->stream_res.left_edge_extra_pixel) +if (old_pipe->stream_res.opp != new_pipe->stream_res.opp) new_pipe->update_flags.bits.opp_changed =1 ;if (old_pipe->stream_res.tg != new_pipe->stream_res.tg) new_pipe->update_flags.bits.tg_changed =1 ;
@@ -1962,10 +1961,6 @@ static void dcn20_program_pipe( pipe_ctx->stream_res.opp, &pipe_ctx->stream->bit_depth_params, &pipe_ctx->stream->clamping); - - pipe_ctx->stream_res.opp->funcs->opp_program_left_edge_extra_pixel ( - pipe_ctx->stream_res.opp, - pipe_ctx->stream_res.left_edge_extra_pixel); }/* Set ABM pipe after other pipe configurations done */
drivers/gpu/drm/amd/display/dc/inc/core_types.h +0 -2
@@ -333,8 +333,6 @@ struct stream_resource {uint8_t gsl_group;struct test_pattern_params test_pattern_params; - -bool left_edge_extra_pixel; };struct plane_resource {
drivers/gpu/drm/amd/display/dc/inc/resource.h +0 -4
@@ -107,10 +107,6 @@ void resource_build_test_pattern_params(struct resource_context *res_ctx, struct pipe_ctx *pipe_ctx); -void resource_build_subsampling_params ( -struct resource_context *res_ctx, -struct pipe_ctx *pipe_ctx); -bool resource_build_scaling_params (struct pipe_ctx *pipe_ctx); enum dc_status resource_build_scaling_params_for_context(
Signature · 1 line
2.43.0
PATCH 15/15 drm/amd/display: 3.2.272
In reply to Aurabindo PillaiFrom: Aric Cyr <[email protected]>
Summary:
* Revert some changes related to pixel encoding and clocks that cause corruption
* IPS hang fix and FGCG enable by default for DCN35
* PSR-SU/Replay fixes
* Plane clip size change treated as medium update
* Fix for checking link alignment done during link training.
* HDMI compliance test fixes and other improvements
--- 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.271" +#define DC_VER "3.2.272"#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 - f1e799c39016 drm/amdgpu: Avoid fetching VRAM vendor info) with new patches added on top of it.
Tested on Ubuntu 22.04.3, on Wayland and X11, using KDE Plasma and Gnome.
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com
public mailing list to update community on promotion details.
-----Original Message-----
From: Aurabindo Pillai <[email protected]>
Sent: Wednesday, February 7, 2024 3:51 PM
To: [email protected]
Cc: 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]>; Gutierrez, Agustin <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Wu, Hersen <[email protected]>; Zuo, Jerry <[email protected]>; Wheeler, Daniel <[email protected]>
Subject: [PATCH 00/15] DC Patches for 12 Feb 2024
Summary:
* Revert some changes related to pixel encoding and clocks that cause corruption
* IPS hang fix and FGCG enable by default for DCN35
* PSR-SU/Replay fixes
* Plane clip size change treated as medium update
* Fix for checking link alignment done during link training.
* HDMI compliance test fixes and other improvements
----------------------------
Aric Cyr (1):
drm/amd/display: 3.2.272
Charlene Liu (2):
drm/amd/display: enable fgcg by default
drm/amd/display: allow psr-su/replay for z8
Gabe Teeger (1):
Revert "drm/amd/display: Send DTBCLK disable message on first commit"
George Shen (1):
Revert "drm/amd/display: Add left edge pixel for YCbCr422/420 + ODM
pipe split"
Martin Tsai (1):
drm/amd/display: should support dmub hw lock on Replay
Michael Strauss (1):
drm/amd/display: Update FIXED_VS Retimer HWSS Test Pattern Sequences
Nicholas Kazlauskas (2):
drm/amd/display: Add shared firmware state for DMUB IPS handshake drm/amd/display: Increase ips2_eval delay for DCN35
Roman Li (1):
drm/amd/display: Fix array-index-out-of-bounds in dcn35_clkmgr
Sohaib Nadeem (2):
Revert "drm/amd/display: increased min_dcfclk_mhz and min_fclk_mhz" drm/amd/display: fixed integer types and null check locations
Tom Chung (1):
drm/amd/display: Preserve original aspect ratio in create stream
Wenjing Liu (1):
drm/amd/display: treat plane clip size change as MED update type
Zhikai Zhai (1):
drm/amd/display: Add align done check
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +- .../drm/amd/display/dc/bios/bios_parser2.c | 16 ++- .../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 16 ++- .../amd/display/dc/clk_mgr/dcn35/dcn35_smu.c | 12 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 11 +- .../gpu/drm/amd/display/dc/core/dc_resource.c | 37 ------ drivers/gpu/drm/amd/display/dc/dc.h | 15 ++- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 83 +++++++------ .../drm/amd/display/dc/dce/dmub_hw_lock_mgr.c | 4 + .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 +- .../drm/amd/display/dc/dml/dcn35/dcn35_fpu.c | 8 +- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 9 +- .../gpu/drm/amd/display/dc/inc/core_types.h | 2 - drivers/gpu/drm/amd/display/dc/inc/resource.h | 4 - .../display/dc/link/accessories/link_dp_cts.c | 27 ++-- .../hwss/link_hwss_dio_fixed_vs_pe_retimer.c | 16 +-- .../link_hwss_hpo_fixed_vs_pe_retimer_dp.c | 51 ++++---- .../drm/amd/display/dc/link/link_validation.c | 2 +- .../display/dc/link/protocols/link_dp_phy.c | 6 +- .../dc/link/protocols/link_dp_training.c | 5 +- .../dc/resource/dcn35/dcn35_resource.c | 5 +- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 6 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 115 ++++++++++++++++++ .../gpu/drm/amd/display/dmub/src/dmub_dcn20.c | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn20.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn30.c | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn30.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn31.c | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn31.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn32.c | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn32.h | 3 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn35.c | 12 +- .../gpu/drm/amd/display/dmub/src/dmub_dcn35.h | 8 +- .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 13 +- .../amd/display/include/link_service_types.h | 9 ++ 35 files changed, 336 insertions(+), 187 deletions(-)
--
2.43.0