DC Patches June 06, 2022
cover DC Patches June 06, 2022
This DC patchset brings improvements in multiple areas. In summary, we have:
* DP fixes
* Reduced frame size in the bouding boxes of a number of ASICs.
* Exiting idle optimizations
* General cleanup
* Power management optimizations
* HF-VSIF support
* VTEM support
* FVA timing improvements
Ahmad Othman (2):
drm/amd/display: Add support for HF-VSIF
drm/amd/display: Adding VTEM to dc
Aric Cyr (1):
drm/amd/display: 3.2.190
Charlene Liu (1):
drm/amd/display: FVA timing adjustment
Felipe (2):
drm/amd/display: Firmware assisted MCLK switch and FS drm/amd/display: Pass vrr mode to dcn
Hamza Mahfooz (1):
drm/amd/display: fix build when CONFIG_DRM_AMD_DC_DCN is not defined
Harry VanZyllDeJong (1):
drm/amd/display: Disables dynamic memory clock switching in games
Ian Chen (1):
drm/amd/display: DAL ACR, dc part, fix missing dcn30
Joshua Aberback (1):
drm/amd/display: Blank for uclk OC in dm instead of dc
Lee, Alvin (1):
drm/amd/display: Add debug option for exiting idle optimizations on
cursor updates
Martin Leung (1):
drm/amd/display: Add null check to dc_submit_i2c_oem
Nicholas Kazlauskas (1):
drm/amd/display: Copy hfvsif_infopacket when stream update
Oliver Logush (1):
drm/amd/display: Drop unused privacy_mask setters and getters
Qingqing Zhuo (1):
drm/amd/display: update topology_update_input_v3 struct
Rodrigo Siqueira (4):
drm/amd/display: Reduce frame size in the bouding box for DCN20 drm/amd/display: Reduce frame size in the bouding box for DCN301 drm/amd/display: Reduce frame size in the bouding box for DCN31/316 drm/amd/display: Reduce frame size in the bouding box for DCN21
Samson Tam (1):
drm/amd/display: Fix comments
Shah, Dharati (1):
drm/amd/display: Fix monitor flash issue
Wenjing Liu (1):
drm/amd/display: lower lane count first when CR done partially fails
in EQ
hersen wu (1):
drm/amd/display: dsc validate fail not pass to atomic check
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +- .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 2 + .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 43 ++++++++---- .../display/amdgpu_dm/amdgpu_dm_mst_types.h | 2 +- .../display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c | 23 ++++--- .../dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c | 11 ++- drivers/gpu/drm/amd/display/dc/core/dc.c | 66 +++++++++--------- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 8 ++- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 13 ++-- .../gpu/drm/amd/display/dc/core/dc_resource.c | 27 +++++++- .../gpu/drm/amd/display/dc/core/dc_stream.c | 5 +- drivers/gpu/drm/amd/display/dc/dc.h | 13 ++-- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 2 + drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 5 +- drivers/gpu/drm/amd/display/dc/dc_stream.h | 9 ++- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 1 - .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 1 + .../display/dc/dcn10/dcn10_stream_encoder.c | 8 ++- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 1 - .../display/dc/dcn20/dcn20_stream_encoder.c | 1 + .../dc/dcn30/dcn30_dio_stream_encoder.c | 1 + .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 28 +++++--- .../drm/amd/display/dc/dcn30/dcn30_hwseq.h | 11 ++- .../gpu/drm/amd/display/dc/dcn30/dcn30_init.c | 2 +- .../gpu/drm/amd/display/dc/dcn30/dcn30_optc.c | 1 + .../drm/amd/display/dc/dcn30/dcn30_resource.c | 1 + .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 67 +++++++++---------- .../amd/display/dc/dml/dcn301/dcn301_fpu.c | 30 ++++----- .../drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 64 ++++++++---------- .../dc/gpio/dcn20/hw_translate_dcn20.c | 17 +++-- .../dc/gpio/dcn21/hw_translate_dcn21.c | 17 +++-- .../dc/gpio/dcn30/hw_translate_dcn30.c | 19 +++--- drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h | 6 -- .../amd/display/dc/inc/hw/stream_encoder.h | 1 + .../amd/display/dc/inc/hw_sequencer_private.h | 1 + .../amd/display/include/link_service_types.h | 2 + .../amd/display/modules/freesync/freesync.c | 5 ++ .../display/modules/hdcp/hdcp2_transition.c | 2 +- .../drm/amd/display/modules/hdcp/hdcp_psp.c | 4 ++ .../drm/amd/display/modules/hdcp/hdcp_psp.h | 11 +++ .../amd/display/modules/inc/mod_freesync.h | 3 + 41 files changed, 326 insertions(+), 214 deletions(-)
Signature · 1 line
2.36.1
PATCH 1/23 drm/amd/display: fix build when CONFIG_DRM_AMD_DC_DCN is not defined
Fixes:drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c: In function ‘dc_remove_stream_from_ctx’:drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:2010:3: error: implicit declaration of function ‘remove_hpo_dp_link_enc_from_ctx’; did you mean ‘add_hpo_dp_link_enc_to_ctx’? [-Werror=implicit-function-declaration]
2010 | remove_hpo_dp_link_enc_from_ctx(&new_ctx->res_ctx, del_pipe, del_pipe->stream);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| add_hpo_dp_link_enc_to_ctx--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -0
@@ -2007,7 +2007,9 @@ enum dc_status dc_remove_stream_from_ctx( &new_ctx->res_ctx, dc->res_pool, del_pipe->stream_res.hpo_dp_stream_enc, false); +#if defined(CONFIG_DRM_AMD_DC_DCN )remove_hpo_dp_link_enc_from_ctx (&new_ctx->res_ctx, del_pipe, del_pipe->stream); +#endif }if (del_pipe->stream_res.audio)
Signature · 1 line
2.36.1
PATCH 2/23 drm/amd/display: lower lane count first when CR done partially fails in EQ
In reply to Hamza MahfoozFrom: Wenjing Liu <[email protected]>
[why]
According to DP specs, in EQ DONE phase of link training, we should lower lane count when at least one CR DONE bit is set to 1, while lower link rate when all CR DONE bits are 0s. However in our code, we will treat both cases as latter. This is not exactly correct based on the specs expectation.
[how]
Check lane0 CR DONE bit when it is still set but CR DONE fails, we treat it as a partial CR DONE failure in EQ DONE phase, we will follow the same fallback flow as when ED DONE fails in EQ DONE phase.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 13 +++++++------ .../drm/amd/display/include/link_service_types.h | 2 ++ 2 files changed, 9 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +7 -6
@@ -1326,7 +1326,9 @@ static enum link_training_result perform_channel_equalization_sequence(/* 5. check CR done*/ if (!dp_is_cr_done (lane_count, dpcd_lane_status)) -return LINK_TRAINING_EQ_FAIL_CR ; +return dpcd_lane_status[0 ].bits.CR_DONE_0 ? +LINK_TRAINING_EQ_FAIL_CR_PARTIAL : +LINK_TRAINING_EQ_FAIL_CR ;/* 6. check CHEQ done*/ if (dp_is_ch_eq_done(lane_count, dpcd_lane_status) &&
@@ -1882,6 +1884,9 @@ static void print_status_message(case LINK_TRAINING_EQ_FAIL_CR : lt_result ="CR failed in EQ" ;break ; +case LINK_TRAINING_EQ_FAIL_CR_PARTIAL : + lt_result ="CR failed in EQ partially" ; +break ;case LINK_TRAINING_EQ_FAIL_EQ : lt_result ="EQ failed" ;break ;
@@ -3612,11 +3617,6 @@ static bool decide_fallback_link_setting( struct dc_link_settings *cur, enum link_training_result training_result) { -if (!cur) -return false; -if (!max) -return false; - if (dp_get_link_encoding_format(max) == DP_128b_132b_ENCODING || link->dc->debug.force_dp2_lt_fallback_method) return decide_fallback_link_setting_max_bw_policy(link, max, cur,
@@ -3646,6 +3646,7 @@ static bool decide_fallback_link_setting(break ; }case LINK_TRAINING_EQ_FAIL_EQ : +case LINK_TRAINING_EQ_FAIL_CR_PARTIAL : {if (!reached_minimum_lane_count (cur->lane_count)) { cur->lane_count =reduce_lane_count (cur->lane_count);
drivers/gpu/drm/amd/display/include/link_service_types.h +2 -0
@@ -67,6 +67,8 @@ enum link_training_result {LINK_TRAINING_CR_FAIL_LANE23 ,/* CR DONE bit is cleared during EQ step */ LINK_TRAINING_EQ_FAIL_CR , +/* CR DONE bit is cleared but LANE0_CR_DONE is set during EQ step */ +LINK_TRAINING_EQ_FAIL_CR_PARTIAL ,/* other failure during EQ step */ LINK_TRAINING_EQ_FAIL_EQ , LINK_TRAINING_LQA_FAIL,
Signature · 1 line
2.36.1
PATCH 3/23 drm/amd/display: Fix monitor flash issue
In reply to Hamza MahfoozFrom: "Shah, Dharati" <[email protected]>
[Why & How]
For a some specific monitors, when connected on boot or hot plug, monitor flash for 1/2 seconds can happen during first HDCP query operation. Ading some delay in the init sequence for these monitors fixes the issue, so it is implemented as monitor specific patch.
--- drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_transition.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_transition.c +1 -1
@@ -524,7 +524,7 @@ enum mod_hdcp_status mod_hdcp_hdcp2_dp_transition(struct mod_hdcp *hdcp,set_watchdog_in_ms (hdcp,3000 , output);set_state_id (hdcp, output,D2_A6_WAIT_FOR_RX_ID_LIST ); }else { -callback_in_ms (0 , output); +callback_in_ms (1 , output);set_state_id (hdcp, output,D2_SEND_CONTENT_STREAM_TYPE ); }break ;
Signature · 1 line
2.36.1
PATCH 4/23 drm/amd/display: Reduce frame size in the bouding box for DCN20
In reply to Hamza MahfoozFrom: Rodrigo Siqueira <[email protected]>
GCC throw warnings for the function dcn20_update_bounding_box due to its frame size that looks like this:
error: the frame size of 1936 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
This commit fixes this issue by eliminating an intermediary variable that creates a large array.
--- .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +18 -20
@@ -1456,21 +1456,20 @@ void dcn20_calculate_wm(void dcn20_update_bounding_box (struct dc *dc,struct _vcs_dpi_soc_bounding_box_st *bb,struct pp_smu_nv_clock_table *max_clocks,unsigned int *uclk_states,unsigned int num_states) { -struct _vcs_dpi_voltage_scaling_st calculated_states[DC__VOLTAGE_STATES ]; -int i;int num_calculated_states =0 ;int min_dcfclk =0 ; +int i;dc_assert_fp_enabled ();if (num_states ==0 )return ; -memset (calculated_states,0 ,sizeof (calculated_states)); +memset (bb->clock_limits,0 ,sizeof (bb->clock_limits)); -if (dc->bb_overrides.min_dcfclk_mhz >0 ) +if (dc->bb_overrides.min_dcfclk_mhz >0 ) { min_dcfclk = dc->bb_overrides.min_dcfclk_mhz; -else { + }else {if (ASICREV_IS_NAVI12_P (dc->ctx->asic_id.hw_internal_rev)) min_dcfclk =310 ;else
@@ -1481,36 +1480,35 @@ void dcn20_update_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_sfor (i =0 ; i < num_states; i++) {int min_fclk_required_by_uclk; - calculated_states[i].state = i; - calculated_states[i].dram_speed_mts = uclk_states[i] *16 /1000 ; + bb->clock_limits[i].state = i; + bb->clock_limits[i].dram_speed_mts = uclk_states[i] *16 /1000 ;// FCLK:UCLK ratio is 1.08 min_fclk_required_by_uclk =div_u64 (((unsigned long long )uclk_states[i]) *1080 ,1000000 ); - calculated_states[i].fabricclk_mhz = (min_fclk_required_by_uclk < min_dcfclk) ? + bb->clock_limits[i].fabricclk_mhz = (min_fclk_required_by_uclk < min_dcfclk) ? min_dcfclk : min_fclk_required_by_uclk; - calculated_states[i].socclk_mhz = (calculated_states[i].fabricclk_mhz > max_clocks->socClockInKhz /1000 ) ? - max_clocks->socClockInKhz /1000 : calculated_states[i].fabricclk_mhz; + bb->clock_limits[i].socclk_mhz = (bb->clock_limits[i].fabricclk_mhz > max_clocks->socClockInKhz /1000 ) ? + max_clocks->socClockInKhz /1000 : bb->clock_limits[i].fabricclk_mhz; - calculated_states[i].dcfclk_mhz = (calculated_states[i].fabricclk_mhz > max_clocks->dcfClockInKhz /1000 ) ? - max_clocks->dcfClockInKhz /1000 : calculated_states[i].fabricclk_mhz; + bb->clock_limits[i].dcfclk_mhz = (bb->clock_limits[i].fabricclk_mhz > max_clocks->dcfClockInKhz /1000 ) ? + max_clocks->dcfClockInKhz /1000 : bb->clock_limits[i].fabricclk_mhz; - calculated_states[i].dispclk_mhz = max_clocks->displayClockInKhz /1000 ; - calculated_states[i].dppclk_mhz = max_clocks->displayClockInKhz /1000 ; - calculated_states[i].dscclk_mhz = max_clocks->displayClockInKhz / (1000 *3 ); + bb->clock_limits[i].dispclk_mhz = max_clocks->displayClockInKhz /1000 ; + bb->clock_limits[i].dppclk_mhz = max_clocks->displayClockInKhz /1000 ; + bb->clock_limits[i].dscclk_mhz = max_clocks->displayClockInKhz / (1000 *3 ); - calculated_states[i].phyclk_mhz = max_clocks->phyClockInKhz /1000 ; + bb->clock_limits[i].phyclk_mhz = max_clocks->phyClockInKhz /1000 ; num_calculated_states++; } - calculated_states[num_calculated_states -1 ].socclk_mhz = max_clocks->socClockInKhz /1000 ; - calculated_states[num_calculated_states -1 ].fabricclk_mhz = max_clocks->socClockInKhz /1000 ; - calculated_states[num_calculated_states -1 ].dcfclk_mhz = max_clocks->dcfClockInKhz /1000 ; + bb->clock_limits[num_calculated_states -1 ].socclk_mhz = max_clocks->socClockInKhz /1000 ; + bb->clock_limits[num_calculated_states -1 ].fabricclk_mhz = max_clocks->socClockInKhz /1000 ; + bb->clock_limits[num_calculated_states -1 ].dcfclk_mhz = max_clocks->dcfClockInKhz /1000 ; -memcpy (bb->clock_limits, calculated_states,sizeof (bb->clock_limits)); bb->num_states = num_calculated_states;// Duplicate the last state, DML always an extra state identical to max state to work
Signature · 1 line
2.36.1
PATCH 5/23 drm/amd/display: Reduce frame size in the bouding box for DCN301
In reply to Hamza MahfoozFrom: Rodrigo Siqueira <[email protected]>
GCC throw warnings for the function dcn301_fpu_update_bw_bounding_box due to its frame size that looks like this:
error: the frame size of 1936 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
For fixing this issue I dropped an intermadiate variable.
--- .../amd/display/dc/dml/dcn301/dcn301_fpu.c | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.c +13 -17
@@ -249,7 +249,6 @@ void dcn301_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param {struct dcn301_resource_pool *pool =TO_DCN301_RES_POOL (dc->res_pool);struct clk_limit_table *clk_table = &bw_params->clk_table; -struct _vcs_dpi_voltage_scaling_st clock_limits[DC__VOLTAGE_STATES ];unsigned int i, closest_clk_lvl;int j;
@@ -271,24 +270,21 @@ void dcn301_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param } } - clock_limits[i].state = i; - clock_limits[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz; - clock_limits[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz; - clock_limits[i].socclk_mhz = clk_table->entries[i].socclk_mhz; - clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz *2 ; - - clock_limits[i].dispclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].dispclk_mhz; - clock_limits[i].dppclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].dppclk_mhz; - clock_limits[i].dram_bw_per_chan_gbps = dcn3_01_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps; - clock_limits[i].dscclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].dscclk_mhz; - clock_limits[i].dtbclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].dtbclk_mhz; - clock_limits[i].phyclk_d18_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz; - clock_limits[i].phyclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].phyclk_mhz; + dcn3_01_soc.clock_limits[i].state = i; + dcn3_01_soc.clock_limits[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz; + dcn3_01_soc.clock_limits[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz; + dcn3_01_soc.clock_limits[i].socclk_mhz = clk_table->entries[i].socclk_mhz; + dcn3_01_soc.clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz *2 ; + + dcn3_01_soc.clock_limits[i].dispclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].dispclk_mhz; + dcn3_01_soc.clock_limits[i].dppclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].dppclk_mhz; + dcn3_01_soc.clock_limits[i].dram_bw_per_chan_gbps = dcn3_01_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps; + dcn3_01_soc.clock_limits[i].dscclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].dscclk_mhz; + dcn3_01_soc.clock_limits[i].dtbclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].dtbclk_mhz; + dcn3_01_soc.clock_limits[i].phyclk_d18_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz; + dcn3_01_soc.clock_limits[i].phyclk_mhz = dcn3_01_soc.clock_limits[closest_clk_lvl].phyclk_mhz; } -for (i =0 ; i < clk_table->num_entries; i++) - dcn3_01_soc.clock_limits[i] = clock_limits[i]; -if (clk_table->num_entries) { dcn3_01_soc.num_states = clk_table->num_entries;/* duplicate last level */
Signature · 1 line
2.36.1
PATCH 6/23 drm/amd/display: Reduce frame size in the bouding box for DCN31/316
In reply to Hamza MahfoozFrom: Rodrigo Siqueira <[email protected]>
GCC throw warnings for the function dcn31_update_bw_bounding_box and dcn316_update_bw_bounding_box due to its frame size that looks like this:
error: the frame size of 1936 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
For fixing this issue I dropped an intermadiate variable.
--- .../drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 64 +++++++++---------- 1 file changed, 29 insertions(+), 35 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c +29 -35
@@ -575,7 +575,6 @@ void dcn31_calculate_wm_and_dlg_fp(void dcn31_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params) {struct clk_limit_table *clk_table = &bw_params->clk_table; -struct _vcs_dpi_voltage_scaling_st clock_limits[DC__VOLTAGE_STATES ];unsigned int i, closest_clk_lvl;int j;
@@ -608,29 +607,27 @@ void dcn31_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params } } - clock_limits[i].state = i; + dcn3_1_soc.clock_limits[i].state = i;/* Clocks dependent on voltage level. */ - clock_limits[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz; - clock_limits[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz; - clock_limits[i].socclk_mhz = clk_table->entries[i].socclk_mhz; - clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz *2 * clk_table->entries[i].wck_ratio; + dcn3_1_soc.clock_limits[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz; + dcn3_1_soc.clock_limits[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz; + dcn3_1_soc.clock_limits[i].socclk_mhz = clk_table->entries[i].socclk_mhz; + dcn3_1_soc.clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz *2 * clk_table->entries[i].wck_ratio;/* Clocks independent of voltage level. */ - clock_limits[i].dispclk_mhz = max_dispclk_mhz ? max_dispclk_mhz : + dcn3_1_soc.clock_limits[i].dispclk_mhz = max_dispclk_mhz ? max_dispclk_mhz : dcn3_1_soc.clock_limits[closest_clk_lvl].dispclk_mhz; - clock_limits[i].dppclk_mhz = max_dppclk_mhz ? max_dppclk_mhz : + dcn3_1_soc.clock_limits[i].dppclk_mhz = max_dppclk_mhz ? max_dppclk_mhz : dcn3_1_soc.clock_limits[closest_clk_lvl].dppclk_mhz; - clock_limits[i].dram_bw_per_chan_gbps = dcn3_1_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps; - clock_limits[i].dscclk_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].dscclk_mhz; - clock_limits[i].dtbclk_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].dtbclk_mhz; - clock_limits[i].phyclk_d18_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz; - clock_limits[i].phyclk_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].phyclk_mhz; + dcn3_1_soc.clock_limits[i].dram_bw_per_chan_gbps = dcn3_1_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps; + dcn3_1_soc.clock_limits[i].dscclk_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].dscclk_mhz; + dcn3_1_soc.clock_limits[i].dtbclk_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].dtbclk_mhz; + dcn3_1_soc.clock_limits[i].phyclk_d18_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz; + dcn3_1_soc.clock_limits[i].phyclk_mhz = dcn3_1_soc.clock_limits[closest_clk_lvl].phyclk_mhz; } -for (i =0 ; i < clk_table->num_entries; i++) - dcn3_1_soc.clock_limits[i] = clock_limits[i];if (clk_table->num_entries) { dcn3_1_soc.num_states = clk_table->num_entries; }
@@ -702,7 +699,6 @@ void dcn315_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_paramvoid dcn316_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params) {struct clk_limit_table *clk_table = &bw_params->clk_table; -struct _vcs_dpi_voltage_scaling_st clock_limits[DC__VOLTAGE_STATES ];unsigned int i, closest_clk_lvl;int max_dispclk_mhz =0 , max_dppclk_mhz =0 ;int j;
@@ -740,34 +736,32 @@ void dcn316_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param closest_clk_lvl = dcn3_16_soc.num_states -1 ; } - clock_limits[i].state = i; + dcn3_16_soc.clock_limits[i].state = i;/* Clocks dependent on voltage level. */ - clock_limits[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz; -if (clk_table->num_entries ==1 && - clock_limits[i].dcfclk_mhz < dcn3_16_soc.clock_limits[closest_clk_lvl].dcfclk_mhz) { -/*SMU fix not released yet*/ - clock_limits[i].dcfclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].dcfclk_mhz; - } - clock_limits[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz; - clock_limits[i].socclk_mhz = clk_table->entries[i].socclk_mhz; - clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz *2 * clk_table->entries[i].wck_ratio; + dcn3_16_soc.clock_limits[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz; +// if (clk_table->num_entries == 1 && +// clock_limits[i].dcfclk_mhz < dcn3_16_soc.clock_limits[closest_clk_lvl].dcfclk_mhz) { +// /*SMU fix not released yet*/ +// clock_limits[i].dcfclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].dcfclk_mhz; +// } + dcn3_16_soc.clock_limits[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz; + dcn3_16_soc.clock_limits[i].socclk_mhz = clk_table->entries[i].socclk_mhz; + dcn3_16_soc.clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz *2 * clk_table->entries[i].wck_ratio;/* Clocks independent of voltage level. */ - clock_limits[i].dispclk_mhz = max_dispclk_mhz ? max_dispclk_mhz : + dcn3_16_soc.clock_limits[i].dispclk_mhz = max_dispclk_mhz ? max_dispclk_mhz : dcn3_16_soc.clock_limits[closest_clk_lvl].dispclk_mhz; - clock_limits[i].dppclk_mhz = max_dppclk_mhz ? max_dppclk_mhz : + dcn3_16_soc.clock_limits[i].dppclk_mhz = max_dppclk_mhz ? max_dppclk_mhz : dcn3_16_soc.clock_limits[closest_clk_lvl].dppclk_mhz; - clock_limits[i].dram_bw_per_chan_gbps = dcn3_16_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps; - clock_limits[i].dscclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].dscclk_mhz; - clock_limits[i].dtbclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].dtbclk_mhz; - clock_limits[i].phyclk_d18_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz; - clock_limits[i].phyclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].phyclk_mhz; + dcn3_16_soc.clock_limits[i].dram_bw_per_chan_gbps = dcn3_16_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps; + dcn3_16_soc.clock_limits[i].dscclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].dscclk_mhz; + dcn3_16_soc.clock_limits[i].dtbclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].dtbclk_mhz; + dcn3_16_soc.clock_limits[i].phyclk_d18_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz; + dcn3_16_soc.clock_limits[i].phyclk_mhz = dcn3_16_soc.clock_limits[closest_clk_lvl].phyclk_mhz; } -for (i =0 ; i < clk_table->num_entries; i++) - dcn3_16_soc.clock_limits[i] = clock_limits[i];if (clk_table->num_entries) { dcn3_16_soc.num_states = clk_table->num_entries; }
Signature · 1 line
2.36.1
PATCH 7/23 drm/amd/display: Reduce frame size in the bouding box for DCN21
In reply to Hamza MahfoozFrom: Rodrigo Siqueira <[email protected]>
GCC throw warnings for the function dcn21_update_bw_bounding_box and dcn316_update_bw_bounding_box due to its frame size that looks like this:
error: the frame size of 1936 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
For fixing this issue I dropped an intermadiate variable.
--- .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +13 -16
@@ -2004,7 +2004,6 @@ void dcn21_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params {struct dcn21_resource_pool *pool =TO_DCN21_RES_POOL (dc->res_pool);struct clk_limit_table *clk_table = &bw_params->clk_table; -struct _vcs_dpi_voltage_scaling_st clock_limits[DC__VOLTAGE_STATES ];unsigned int i, closest_clk_lvl =0 , k =0 ;int j;
@@ -2017,7 +2016,7 @@ void dcn21_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_paramsASSERT (clk_table->num_entries);/* Copy dcn2_1_soc.clock_limits to clock_limits to avoid copying over null states later */ for (i =0 ; i < dcn2_1_soc.num_states +1 ; i++) { - clock_limits[i] = dcn2_1_soc.clock_limits[i]; + dcn2_1_soc.clock_limits[i] = dcn2_1_soc.clock_limits[i]; }for (i =0 ; i < clk_table->num_entries; i++) {
@@ -2033,24 +2032,22 @@ void dcn21_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_paramsif (i ==1 ) k++; - clock_limits[k].state = k; - clock_limits[k].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz; - clock_limits[k].fabricclk_mhz = clk_table->entries[i].fclk_mhz; - clock_limits[k].socclk_mhz = clk_table->entries[i].socclk_mhz; - clock_limits[k].dram_speed_mts = clk_table->entries[i].memclk_mhz *2 ; + dcn2_1_soc.clock_limits[k].state = k; + dcn2_1_soc.clock_limits[k].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz; + dcn2_1_soc.clock_limits[k].fabricclk_mhz = clk_table->entries[i].fclk_mhz; + dcn2_1_soc.clock_limits[k].socclk_mhz = clk_table->entries[i].socclk_mhz; + dcn2_1_soc.clock_limits[k].dram_speed_mts = clk_table->entries[i].memclk_mhz *2 ; - clock_limits[k].dispclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dispclk_mhz; - clock_limits[k].dppclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dppclk_mhz; - clock_limits[k].dram_bw_per_chan_gbps = dcn2_1_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps; - clock_limits[k].dscclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dscclk_mhz; - clock_limits[k].dtbclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dtbclk_mhz; - clock_limits[k].phyclk_d18_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz; - clock_limits[k].phyclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].phyclk_mhz; + dcn2_1_soc.clock_limits[k].dispclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dispclk_mhz; + dcn2_1_soc.clock_limits[k].dppclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dppclk_mhz; + dcn2_1_soc.clock_limits[k].dram_bw_per_chan_gbps = dcn2_1_soc.clock_limits[closest_clk_lvl].dram_bw_per_chan_gbps; + dcn2_1_soc.clock_limits[k].dscclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dscclk_mhz; + dcn2_1_soc.clock_limits[k].dtbclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].dtbclk_mhz; + dcn2_1_soc.clock_limits[k].phyclk_d18_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].phyclk_d18_mhz; + dcn2_1_soc.clock_limits[k].phyclk_mhz = dcn2_1_soc.clock_limits[closest_clk_lvl].phyclk_mhz; k++; } -for (i =0 ; i < clk_table->num_entries +1 ; i++) - dcn2_1_soc.clock_limits[i] = clock_limits[i];if (clk_table->num_entries) { dcn2_1_soc.num_states = clk_table->num_entries +1 ;/* fill in min DF PState */
Signature · 1 line
2.36.1
PATCH 8/23 drm/amd/display: dsc validate fail not pass to atomic check
In reply to Hamza MahfoozFrom: hersen wu <[email protected]>
[Why] when 4k@144hz dp connect to dp1.4 dsc mst hub, requested bandwidth exceeds caps of dsc hub. but dsc bw valid functions, increase_dsc_bpp, try_disable_dsc, pre_validate_dsc, compute_mst_dsc_configs_for_state, do not return false to atomic check. this cause user mode initiate mode set to kernel, then cause kernel assert, system hang.
[How] dsc bandwidth valid functions return pass or fail to atomic check.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 43 +++++++++++++------ .../display/amdgpu_dm/amdgpu_dm_mst_types.h | 2 +- 3 files changed, 35 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -1
@@ -11209,7 +11209,10 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, } } } -pre_validate_dsc (state, &dm_state, vars); +if (!pre_validate_dsc (state, &dm_state, vars)) { + ret = -EINVAL ; + goto fail; + } }#endif for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) {
@@ -11455,6 +11458,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,#if defined(CONFIG_DRM_AMD_DC_DCN )if (!compute_mst_dsc_configs_for_state (state, dm_state->context, vars)) {DRM_DEBUG_DRIVER ("compute_mst_dsc_configs_for_state() failed\n" ); + ret = -EINVAL ; goto fail; }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +29 -14
145 lines not on this page · raw message
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h +1 -1
@@ -59,7 +59,7 @@ bool compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,bool needs_dsc_aux_workaround (struct dc_link *link); -void pre_validate_dsc (struct drm_atomic_state *state, +bool pre_validate_dsc (struct drm_atomic_state *state,struct dm_atomic_state **dm_state_ptr,struct dsc_mst_fairness_vars *vars);
Signature · 1 line
2.36.1
PATCH 9/23 drm/amd/display: Add debug option for exiting idle optimizations on cursor updates
In reply to Hamza MahfoozFrom: "Lee, Alvin" <[email protected]>
[Description]
- Have option to exit idle opt on cursor updates
for debug and optimizations purposes
--- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 5 +++-- drivers/gpu/drm/amd/display/dc/dc.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +3 -2
@@ -389,7 +389,7 @@ bool dc_stream_set_cursor_position(struct dc_stream_state *stream, const struct dc_cursor_position *position) { - struct dc *dc; + struct dc *dc = stream->ctx->dc;bool reset_idle_optimizations = false;if (NULL == stream) {
@@ -406,7 +406,8 @@ bool dc_stream_set_cursor_position(dc_z10_restore (dc);/* disable idle optimizations if enabling cursor */ -if (dc->idle_optimizations_allowed && !stream->cursor_position.enable && position->enable) { +if (dc->idle_optimizations_allowed && (!stream->cursor_position.enable || dc->debug.exit_idle_opt_for_cursor_updates) + && position->enable) {dc_allow_idle_optimizations (dc, false); reset_idle_optimizations = true; }
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -748,6 +748,7 @@ struct dc_debug_options {uint8_t psr_power_use_phy_fsm;enum dml_hostvm_override_opts dml_hostvm_override;bool use_legacy_soc_bb_mechanism; +bool exit_idle_opt_for_cursor_updates; };struct gpu_info_soc_bounding_box_v1_0 ;
Signature · 1 line
2.36.1
PATCH 10/23 drm/amd/display: update topology_update_input_v3 struct
In reply to Hamza MahfoozFrom: Qingqing Zhuo <[email protected]>
[Why]
DIO parameters were missing in topology_update_intput_v3 struct.
[How]
Add DIO parameters in v3 struct and update in functions perspectively.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 2 ++ drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c | 4 ++++ drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.h | 11 +++++++++++ 3 files changed, 17 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +2 -0
@@ -476,6 +476,7 @@ static void update_config(void *handle, struct cp_psp_stream_config *config) link->ddc_line = aconnector->dc_link->ddc_hw_inst +1 ; display->stream_enc_idx = config->stream_enc_idx; link->link_enc_idx = config->link_enc_idx; + link->dio_output_id = config->dio_output_idx; link->phy_idx = config->phy_idx;if (sink) link_is_hdcp14 =dc_link_is_hdcp14 (aconnector->dc_link, sink->sink_signal);
@@ -483,6 +484,7 @@ static void update_config(void *handle, struct cp_psp_stream_config *config) link->dp.rev = aconnector->dc_link->dpcd_caps.dpcd_rev.raw; link->dp.assr_enabled = config->assr_enabled; link->dp.mst_enabled = config->mst_enabled; + link->dp.usb4_enabled = config->usb4_enabled; display->adjust.disable =MOD_HDCP_DISPLAY_DISABLE_AUTHENTICATION ; link->adjust.auth_delay =3 ; link->adjust.hdcp1.disable =0 ;
drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c +4 -0
@@ -202,6 +202,10 @@ static enum mod_hdcp_status add_display_to_topology_v3( dtm_cmd->dtm_status =TA_DTM_STATUS__GENERIC_FAILURE ; dtm_cmd->dtm_in_message.topology_update_v3.phy_id = link->phy_idx; dtm_cmd->dtm_in_message.topology_update_v3.link_hdcp_cap = link->hdcp_supported_informational; + dtm_cmd->dtm_in_message.topology_update_v3.dio_output_type = link->dp.usb4_enabled ? +TA_DTM_DIO_OUTPUT_TYPE__DPIA : +TA_DTM_DIO_OUTPUT_TYPE__DIRECT ; + dtm_cmd->dtm_in_message.topology_update_v3.dio_output_id = link->dio_output_id;psp_dtm_invoke (psp, dtm_cmd->cmd_id);mutex_unlock (&psp->dtm_context.mutex);
drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.h +11 -0
@@ -94,6 +94,15 @@ enum ta_dtm_encoder_type {TA_DTM_ENCODER_TYPE__DIG =0x10 }; +/* @enum ta_dtm_dio_output_type +* This enum defines software value for dio_output_type +*/ +typedef enum { +TA_DTM_DIO_OUTPUT_TYPE__INVALID , +TA_DTM_DIO_OUTPUT_TYPE__DIRECT , +TA_DTM_DIO_OUTPUT_TYPE__DPIA +}ta_dtm_dio_output_type ; +struct ta_dtm_topology_update_input_v3 {/* display handle is unique across the driver and is used to identify a display */ /* for all security interfaces which reference displays such as HDCP */
@@ -111,6 +120,8 @@ struct ta_dtm_topology_update_input_v3 {enum ta_dtm_encoder_type encoder_type;uint32_t phy_id;uint32_t link_hdcp_cap; +ta_dtm_dio_output_type dio_output_type; +uint32_t dio_output_id; };struct ta_dtm_topology_assr_enable {
Signature · 1 line
2.36.1
PATCH 11/23 drm/amd/display: 3.2.190
In reply to Hamza MahfoozFrom: Aric Cyr <[email protected]>
This version brings along the following:
- DP fixes
- Reduced frame size in the bouding boxes of a number of ASICs.
- Exiting idle optimizations on mouse updates
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -47,7 +47,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.189" +#define DC_VER "3.2.190"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.36.1
PATCH 12/23 drm/amd/display: Drop unused privacy_mask setters and getters
In reply to Hamza MahfoozFrom: Oliver Logush <[email protected]>
[Why and How]
dwbc_funcs.set/get_privacy_mask isn't being used anymore, drop it
--- drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h | 6 ------ 1 file changed, 6 deletions(-)
drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h +0 -6
@@ -219,12 +219,6 @@ struct dwbc_funcs {struct dwbc *dwbc, const struct dc_transfer_func *in_transfer_func_dwb_ogam); -void (*get_privacy_mask)( -struct dwbc *dwbc,uint32_t *mask_id); - -void (*set_privacy_mask)( -struct dwbc *dwbc,uint32_t mask_id); -//TODO: merge with output_transfer_func? bool (*dwb_ogam_set_input_transfer_func)( struct dwbc *dwbc,
Signature · 1 line
2.36.1
PATCH 13/23 drm/amd/display: Fix comments
In reply to Hamza MahfoozFrom: Samson Tam <[email protected]>
[Why & how]
Fix format and typo of comments.
--- .../display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c | 1 - drivers/gpu/drm/amd/display/dc/core/dc_link.c | 8 ++++++-- .../dc/gpio/dcn20/hw_translate_dcn20.c | 17 ++++++++++------- .../dc/gpio/dcn21/hw_translate_dcn21.c | 17 ++++++++++------- .../dc/gpio/dcn30/hw_translate_dcn30.c | 19 +++++++++++-------- 5 files changed, 37 insertions(+), 25 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c +0 -1
@@ -436,7 +436,6 @@ void dcn2_read_clocks_from_hw_dentist(struct clk_mgr *clk_mgr_base) clk_mgr_base->clks.dppclk_khz = (DENTIST_DIVIDER_RANGE_SCALE_FACTOR * clk_mgr->base.dentist_vco_freq_khz) / dpp_divider; } - } void dcn2_get_clock(struct clk_mgr *clk_mgr,
drivers/gpu/drm/amd/display/dc/core/dc_link.c +6 -2
@@ -1379,7 +1379,9 @@ bool dc_link_get_hpd_state(struct dc_link *dc_link)static enum hpd_source_id get_hpd_line (struct dc_link *link) {struct gpio *hpd; -enum hpd_source_id hpd_id =HPD_SOURCEID_UNKNOWN ; +enum hpd_source_id hpd_id; + + hpd_id =HPD_SOURCEID_UNKNOWN ; hpd =get_hpd_gpio (link->ctx->dc_bios, link->link_id, link->ctx->gpio_service);
@@ -1418,7 +1420,9 @@ static enum hpd_source_id get_hpd_line(struct dc_link *link)static enum channel_id get_ddc_line (struct dc_link *link) {struct ddc *ddc; -enum channel_id channel =CHANNEL_ID_UNKNOWN ; +enum channel_id channel; + + channel =CHANNEL_ID_UNKNOWN ; ddc =dal_ddc_service_get_ddc_pin (link->ddc);
drivers/gpu/drm/amd/display/dc/gpio/dcn20/hw_translate_dcn20.c +10 -7
@@ -150,7 +150,8 @@ static bool offset_to_id(/* DDC */ /* we don't care about the GPIO_ID for DDC * in DdcHandle it will use GPIO_ID_DDC_DATA/GPIO_ID_DDC_CLOCK -* directly in the create method */ +* directly in the create method +*/ case REG (DC_GPIO_DDC1_A ): *en =GPIO_DDC_LINE_DDC1 ;return true;
@@ -173,14 +174,16 @@ static bool offset_to_id( *en =GPIO_DDC_LINE_DDC_VGA ;return true; -// case REG(DC_GPIO_I2CPAD_A): not exit -// case REG(DC_GPIO_PWRSEQ_A): -// case REG(DC_GPIO_PAD_STRENGTH_1): -// case REG(DC_GPIO_PAD_STRENGTH_2): -// case REG(DC_GPIO_DEBUG): +/* +* case REG(DC_GPIO_I2CPAD_A): not exit +* case REG(DC_GPIO_PWRSEQ_A): +* case REG(DC_GPIO_PAD_STRENGTH_1): +* case REG(DC_GPIO_PAD_STRENGTH_2): +* case REG(DC_GPIO_DEBUG): +*/ /* UNEXPECTED */ default : -// case REG(DC_GPIO_SYNCA_A): not exist +/* case REG(DC_GPIO_SYNCA_A): not exist */ ASSERT_CRITICAL (false);return false; }
drivers/gpu/drm/amd/display/dc/gpio/dcn21/hw_translate_dcn21.c +10 -7
@@ -153,7 +153,8 @@ static bool offset_to_id(/* DDC */ /* we don't care about the GPIO_ID for DDC * in DdcHandle it will use GPIO_ID_DDC_DATA/GPIO_ID_DDC_CLOCK -* directly in the create method */ +* directly in the create method +*/ case REG (DC_GPIO_DDC1_A ): *en =GPIO_DDC_LINE_DDC1 ;return true;
@@ -173,14 +174,16 @@ static bool offset_to_id( *en =GPIO_DDC_LINE_DDC_VGA ;return true; -// case REG(DC_GPIO_I2CPAD_A): not exit -// case REG(DC_GPIO_PWRSEQ_A): -// case REG(DC_GPIO_PAD_STRENGTH_1): -// case REG(DC_GPIO_PAD_STRENGTH_2): -// case REG(DC_GPIO_DEBUG): +/* +* case REG(DC_GPIO_I2CPAD_A): not exit +* case REG(DC_GPIO_PWRSEQ_A): +* case REG(DC_GPIO_PAD_STRENGTH_1): +* case REG(DC_GPIO_PAD_STRENGTH_2): +* case REG(DC_GPIO_DEBUG): +*/ /* UNEXPECTED */ default : -// case REG(DC_GPIO_SYNCA_A): not exist +/* case REG(DC_GPIO_SYNCA_A): not exista */ #ifdef PALLADIUM_SUPPORTED *id =GPIO_ID_HPD ; *en =GPIO_DDC_LINE_DDC1 ;
drivers/gpu/drm/amd/display/dc/gpio/dcn30/hw_translate_dcn30.c +11 -8
@@ -155,7 +155,8 @@ static bool offset_to_id(/* DDC */ /* we don't care about the GPIO_ID for DDC * in DdcHandle it will use GPIO_ID_DDC_DATA/GPIO_ID_DDC_CLOCK -* directly in the create method */ +* directly in the create method +*/ case REG (DC_GPIO_DDC1_A ): *en =GPIO_DDC_LINE_DDC1 ;return true;
@@ -178,14 +179,16 @@ static bool offset_to_id( *en =GPIO_DDC_LINE_DDC_VGA ;return true; -// case REG(DC_GPIO_I2CPAD_A): not exit -// case REG(DC_GPIO_PWRSEQ_A): -// case REG(DC_GPIO_PAD_STRENGTH_1): -// case REG(DC_GPIO_PAD_STRENGTH_2): -// case REG(DC_GPIO_DEBUG): +/* +* case REG(DC_GPIO_I2CPAD_A): not exit +* case REG(DC_GPIO_PWRSEQ_A): +* case REG(DC_GPIO_PAD_STRENGTH_1): +* case REG(DC_GPIO_PAD_STRENGTH_2): +* case REG(DC_GPIO_DEBUG): +*/ /* UNEXPECTED */ default : -// case REG(DC_GPIO_SYNCA_A): not exist +/* case REG(DC_GPIO_SYNCA_A): not exist */ ASSERT_CRITICAL (false);return false; }
@@ -369,7 +372,7 @@ static const struct hw_translate_funcs funcs = { };/* -* dal_hw_translate_dcn10_init +* dal_hw_translate_dcn30_init * * @brief * Initialize Hw translate function pointers.
Signature · 1 line
2.36.1
PATCH 14/23 drm/amd/display: DAL ACR, dc part, fix missing dcn30
In reply to Hamza MahfoozFrom: Ian Chen <[email protected]>
[Why]
- missing in dcn30 function
- Fix a divide by 0 when ACR trigger
[How]
- Add IS_SMU_TIMEOUT() to dcn30_smu_send_msg_with_param
- Add zero check in dcn20_update_clocks_update_dentist
--- .../display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c | 22 +++++++++++++------ .../dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c | 11 +++++++++- 2 files changed, 25 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c +15 -7
@@ -126,16 +126,24 @@ void dcn20_update_clocks_update_dpp_dto(struct clk_mgr_internal *clk_mgr,void dcn20_update_clocks_update_dentist (struct clk_mgr_internal *clk_mgr,struct dc_state *context) { -int dpp_divider =DENTIST_DIVIDER_RANGE_SCALE_FACTOR - * clk_mgr->base.dentist_vco_freq_khz / clk_mgr->base.clks.dppclk_khz; -int disp_divider =DENTIST_DIVIDER_RANGE_SCALE_FACTOR - * clk_mgr->base.dentist_vco_freq_khz / clk_mgr->base.clks.dispclk_khz; - -uint32_t dppclk_wdivider =dentist_get_did_from_divider (dpp_divider); -uint32_t dispclk_wdivider =dentist_get_did_from_divider (disp_divider); +int dpp_divider =0 ; +int disp_divider =0 ; +uint32_t dppclk_wdivider =0 ; +uint32_t dispclk_wdivider =0 ;uint32_t current_dispclk_wdivider;uint32_t i; +if (clk_mgr->base.clks.dppclk_khz ==0 || clk_mgr->base.clks.dispclk_khz ==0 ) +return ; + + dpp_divider =DENTIST_DIVIDER_RANGE_SCALE_FACTOR + * clk_mgr->base.dentist_vco_freq_khz / clk_mgr->base.clks.dppclk_khz; + disp_divider =DENTIST_DIVIDER_RANGE_SCALE_FACTOR + * clk_mgr->base.dentist_vco_freq_khz / clk_mgr->base.clks.dispclk_khz; + + dppclk_wdivider =dentist_get_did_from_divider (dpp_divider); + dispclk_wdivider =dentist_get_did_from_divider (disp_divider); +REG_GET (DENTIST_DISPCLK_CNTL ,DENTIST_DISPCLK_WDIVIDER , ¤t_dispclk_wdivider);
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c +10 -1
@@ -28,6 +28,8 @@#include "clk_mgr_internal.h" #include "reg_helper.h" +#include "dm_helpers.h" +#include "dalsmc.h" #include "dcn30_smu11_driver_if.h"
@@ -74,6 +76,7 @@ static uint32_t dcn30_smu_wait_for_response(struct clk_mgr_internal *clk_mgr, unstatic bool dcn30_smu_send_msg_with_param (struct clk_mgr_internal *clk_mgr,uint32_t msg_id,uint32_t param_in,uint32_t *param_out) { +uint32_t result;/* Wait for response register to be ready */ dcn30_smu_wait_for_response (clk_mgr,10 ,200000 );
@@ -86,8 +89,14 @@ static bool dcn30_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr, uint/* Trigger the message transaction by writing the message ID */ REG_WRITE (DAL_MSG_REG , msg_id); + result =dcn30_smu_wait_for_response (clk_mgr,10 ,200000 ); + +if (IS_SMU_TIMEOUT (result)) { +dm_helpers_smu_timeout (CTX , msg_id, param_in,10 *200000 ); + } +/* Wait for response */ -if (dcn30_smu_wait_for_response (clk_mgr,10 ,200000 ) == DALSMC_Result_OK) { +if (result == DALSMC_Result_OK) {if (param_out) *param_out =REG_READ (DAL_ARG_REG );
Signature · 1 line
2.36.1
PATCH 15/23 drm/amd/display: Firmware assisted MCLK switch and FS
In reply to Hamza MahfoozFrom: Felipe <[email protected]>
[WHY]
Memory clock switching has great potential for power savings.
[HOW]
The driver code was modified to notify the DMCUB firmware that it should stretch the vertical blank of frames when a memory clock switch is about to start so that no blackouts happen on the screen due to unavailability of the frame buffer.
The driver logic to determine when such firmware assisted strategy can be initiated is also implemented and consists on checking prerequisites of the feature.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 8 ++++-- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 2 ++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 5 +++- drivers/gpu/drm/amd/display/dc/dc_stream.h | 3 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 1 - .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 1 - .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 28 +++++++++++-------- .../drm/amd/display/dc/dcn30/dcn30_hwseq.h | 11 ++++++-- .../gpu/drm/amd/display/dc/dcn30/dcn30_init.c | 2 +- .../gpu/drm/amd/display/dc/dcn30/dcn30_optc.c | 1 + .../drm/amd/display/dc/dcn30/dcn30_resource.c | 1 + .../amd/display/dc/inc/hw_sequencer_private.h | 1 + .../amd/display/modules/freesync/freesync.c | 5 ++++ .../amd/display/modules/inc/mod_freesync.h | 4 +++ 14 files changed, 51 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +5 -3
@@ -397,7 +397,6 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc, struct dc_crtc_timing_adjust *adjust) {int i; -bool ret = false; stream->adjust.v_total_max = adjust->v_total_max; stream->adjust.v_total_mid = adjust->v_total_mid;
@@ -412,10 +411,10 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,1 , *adjust); - ret = true; +return true; } } -return ret; +return false; }/**
@@ -2650,6 +2649,9 @@ static void copy_stream_update_to_stream(struct dc *dc,if (update->vrr_infopacket) stream->vrr_infopacket = *update->vrr_infopacket; +if (update->allow_freesync) + stream->allow_freesync = *update->allow_freesync; +if (update->crtc_timing_adjust) stream->adjust = *update->crtc_timing_adjust;
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +2 -0
@@ -27,6 +27,8 @@#include "dc_dmub_srv.h" #include "../dmub/dmub_srv.h" #include "dm_helpers.h" +#include "dc_hw_types.h" +#include "core_types.h" #define CTX dc_dmub_srv->ctx#define DC_LOGGER CTX->logger
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +4 -1
@@ -31,6 +31,10 @@struct dmub_srv ;struct dc ; +struct pipe_ctx ; +struct dc_crtc_timing_adjust ; +struct dc_crtc_timing ; +struct dc_state ;struct dc_reg_helper_state {bool gather_in_progress;
@@ -69,7 +73,6 @@ bool dc_dmub_srv_get_dmub_outbox0_msg(const struct dc *dc, struct dmcub_trace_buvoid dc_dmub_trace_event_control (struct dc *dc,bool enable);void dc_dmub_srv_query_caps_cmd (struct dmub_srv *dmub); -void dc_dmub_srv_clear_inbox0_ack (struct dc_dmub_srv *dmub_srv);void dc_dmub_srv_wait_for_inbox0_ack (struct dc_dmub_srv *dmub_srv);void dc_dmub_srv_send_inbox0_cmd (struct dc_dmub_srv *dmub_srv,union dmub_inbox0_data_register data);
drivers/gpu/drm/amd/display/dc/dc_stream.h +2 -1
@@ -205,6 +205,7 @@ struct dc_stream_state {bool use_vsc_sdp_for_colorimetry;bool ignore_msa_timing_param; +bool allow_freesync;bool freesync_on_desktop;bool converter_disable_audio;
@@ -295,9 +296,9 @@ struct dc_stream_update {struct dc_info_packet *vrr_infopacket;struct dc_info_packet *vsc_infopacket;struct dc_info_packet *vsp_infopacket; -bool *dpms_off;bool integer_scaling_update; +bool *allow_freesync;struct colorspace_transform *gamut_remap;enum dc_color_space *output_color_space;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +0 -1
@@ -2613,7 +2613,6 @@ void dcn10_update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx) dc->hwss.update_visual_confirm_color (dc, pipe_ctx, &blnd_cfg.black_color, mpcc_id);ASSERT (new_mpcc !=NULL ); - hubp->opp_id = pipe_ctx->stream_res.opp->inst; hubp->mpcc_id = mpcc_id; }
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +0 -1
@@ -2446,7 +2446,6 @@ void dcn20_update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx)NULL , hubp->inst, mpcc_id); - dc->hwss.update_visual_confirm_color (dc, pipe_ctx, &blnd_cfg.black_color, mpcc_id);ASSERT (new_mpcc !=NULL );
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c +17 -11
@@ -48,6 +48,8 @@#include "dc_dmub_srv.h" #include "link_hwss.h" #include "dpcd_defs.h" +#include "../dcn20/dcn20_hwseq.h" +#include "dcn30_resource.h" #include "inc/dc_link_dp.h" #include "inc/link_dpcd.h"
@@ -344,17 +346,6 @@ void dcn30_enable_writeback( dwb->funcs->enable (dwb, &wb_info->dwb_params); } -void dcn30_prepare_bandwidth (struct dc *dc, -struct dc_state *context) -{ -if (dc->clk_mgr->dc_mode_softmax_enabled) -if (dc->clk_mgr->clks.dramclk_khz <= dc->clk_mgr->bw_params->dc_mode_softmax_memclk *1000 && - context->bw_ctx.bw.dcn.clk.dramclk_khz > dc->clk_mgr->bw_params->dc_mode_softmax_memclk *1000 ) - dc->clk_mgr->funcs->set_max_memclk (dc->clk_mgr, dc->clk_mgr->bw_params->clk_table.entries[dc->clk_mgr->bw_params->clk_table.num_entries -1 ].memclk_mhz); - -dcn20_prepare_bandwidth (dc, context); -} -void dcn30_disable_writeback (struct dc *dc,unsigned int dwb_pipe_inst)
@@ -647,6 +638,9 @@ void dcn30_init_hw(struct dc *dc)if (dc->res_pool->hubbub->funcs->init_crb) dc->res_pool->hubbub->funcs->init_crb (dc->res_pool->hubbub); +// Get DMCUB capabilities +dc_dmub_srv_query_caps_cmd (dc->ctx->dmub_srv->dmub); + dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr; }void dcn30_set_avmute (struct pipe_ctx *pipe_ctx,bool enable)
@@ -962,3 +956,15 @@ void dcn30_set_disp_pattern_generator(const struct dc *dc, pipe_ctx->stream_res.opp->funcs->opp_set_disp_pattern_generator (pipe_ctx->stream_res.opp, test_pattern, color_space, color_depth, solid_color, width, height, offset); } + +void dcn30_prepare_bandwidth (struct dc *dc, +struct dc_state *context) +{ +if (dc->clk_mgr->dc_mode_softmax_enabled) +if (dc->clk_mgr->clks.dramclk_khz <= dc->clk_mgr->bw_params->dc_mode_softmax_memclk *1000 && + context->bw_ctx.bw.dcn.clk.dramclk_khz > dc->clk_mgr->bw_params->dc_mode_softmax_memclk *1000 ) + dc->clk_mgr->funcs->set_max_memclk (dc->clk_mgr, dc->clk_mgr->bw_params->clk_table.entries[dc->clk_mgr->bw_params->clk_table.num_entries -1 ].memclk_mhz); + +dcn20_prepare_bandwidth (dc, context); +} +
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.h +8 -3
@@ -47,9 +47,6 @@ void dcn30_disable_writeback(struct dc *dc, unsigned int dwb_pipe_inst); -void dcn30_prepare_bandwidth (struct dc *dc, -struct dc_state *context); - bool dcn30_mmhubbub_warmup( struct dc *dc, unsigned int num_dwb,
@@ -83,4 +80,12 @@ void dcn30_set_disp_pattern_generator(const struct dc *dc,const struct tg_color *solid_color, int width, int height, int offset); +void dcn30_set_hubp_blank (const struct dc *dc, +struct pipe_ctx *pipe_ctx, +bool blank_enable); + +void dcn30_prepare_bandwidth (struct dc *dc, +struct dc_state *context); + +#endif /* __DC_HWSS_DCN30_H__ */
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_init.c +1 -1
@@ -59,7 +59,7 @@ static const struct hw_sequencer_funcs dcn30_funcs = { .pipe_control_lock = dcn20_pipe_control_lock, .interdependent_update_lock = dcn10_lock_all_pipes, .cursor_lock = dcn10_cursor_lock, - .prepare_bandwidth = dcn20_prepare_bandwidth, + .prepare_bandwidth = dcn30_prepare_bandwidth, .optimize_bandwidth = dcn20_optimize_bandwidth, .update_bandwidth = dcn20_update_bandwidth, .set_drr = dcn10_set_drr,
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c +1 -0
@@ -27,6 +27,7 @@#include "dcn30_optc.h" #include "dc.h" #include "dcn_calc_math.h" +#include "dc_dmub_srv.h" #include "dml/dcn30/dcn30_fpu.h"
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +1 -0
@@ -89,6 +89,7 @@#include "vm_helper.h" #include "dcn20/dcn20_vmid.h" #include "amdgpu_socbb.h" +#include "dc_dmub_srv.h" #define DC_LOGGER_INIT (logger)
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer_private.h +1 -0
@@ -68,6 +68,7 @@ struct dce_hwseq;struct timing_generator ;struct tg_color ;struct output_pixel_processor ; +struct mpcc_blnd_cfg ;struct hwseq_private_funcs {
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +5 -0
@@ -1374,6 +1374,11 @@ unsigned long long mod_freesync_calc_field_rate_from_timing(return field_rate_in_uhz; } +bool mod_freesync_get_freesync_enabled (struct mod_vrr_params *pVrr,struct dc_stream_state *const pStream) +{ +return (pVrr->state !=VRR_STATE_UNSUPPORTED ) && (pVrr->state !=VRR_STATE_DISABLED ); +} +bool mod_freesync_is_valid_range (uint32_t min_refresh_cap_in_uhz,uint32_t max_refresh_cap_in_uhz,uint32_t nominal_field_rate_in_uhz)
drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h +4 -0
@@ -194,4 +194,8 @@ unsigned int mod_freesync_calc_v_total_from_refresh(const struct dc_stream_state *stream, unsigned int refresh_in_uhz); +// Returns true when FreeSync is supported and enabled (even if it is inactive) +bool mod_freesync_get_freesync_enabled (struct mod_vrr_params *pVrr, +struct dc_stream_state *const pStream); +#endif
Signature · 1 line
2.36.1
PATCH 16/23 drm/amd/display: Add support for HF-VSIF
In reply to Hamza MahfoozFrom: Ahmad Othman <[email protected]>
[Why]
- Currently there is no support for HF-VSIF
- The current support of VSIF is limited to H14b infoframe
[How]
- refactor VSIF
- Added new builder for HF-VSIF
- Added the HF-VSIF packet to DisplayTarget
- Updates DC to apply HF-VSIF updates when updating streams
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 ++- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 11 +++++++++++ drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 ++ .../drm/amd/display/dc/dcn10/dcn10_stream_encoder.c | 8 +++++--- 4 files changed, 20 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -1
@@ -2732,7 +2732,8 @@ static void commit_planes_do_stream_update(struct dc *dc,if ((stream_update->hdr_static_metadata && !stream->use_dynamic_meta) || stream_update->vrr_infopacket || stream_update->vsc_infopacket || - stream_update->vsp_infopacket) { + stream_update->vsp_infopacket || + stream_update->hfvsif_infopacket) {resource_build_info_frame (pipe_ctx); dc->hwss.update_info_frame (pipe_ctx);
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +11 -0
@@ -2806,6 +2806,15 @@ static void set_vsc_info_packet( *info_packet = stream->vsc_infopacket; } +static void set_hfvs_info_packet ( +struct dc_info_packet *info_packet, +struct dc_stream_state *stream) +{ +if (!stream->hfvsif_infopacket.valid) +return ; + + *info_packet = stream->hfvsif_infopacket; +}void dc_resource_state_destruct (struct dc_state *context) {
@@ -2886,6 +2895,7 @@ void resource_build_info_frame(struct pipe_ctx *pipe_ctx) info->spd.valid = false; info->hdrsmd.valid = false; info->vsc.valid = false; + info->hfvsif.valid = false; signal = pipe_ctx->stream->signal;
@@ -2894,6 +2904,7 @@ void resource_build_info_frame(struct pipe_ctx *pipe_ctx)set_avi_info_frame (&info->avi, pipe_ctx);set_vendor_info_packet (&info->vendor, pipe_ctx->stream); +set_hfvs_info_packet (&info->hfvsif, pipe_ctx->stream);set_spd_info_packet (&info->spd, pipe_ctx->stream);
drivers/gpu/drm/amd/display/dc/dc_stream.h +2 -0
@@ -180,6 +180,7 @@ struct dc_stream_state {struct dc_info_packet vrr_infopacket;struct dc_info_packet vsc_infopacket;struct dc_info_packet vsp_infopacket; +struct dc_info_packet hfvsif_infopacket;uint8_t dsc_packed_pps[128 ];struct rect src;/* composition area */ struct rect dst;/* stream addressable area */
@@ -296,6 +297,7 @@ struct dc_stream_update {struct dc_info_packet *vrr_infopacket;struct dc_info_packet *vsc_infopacket;struct dc_info_packet *vsp_infopacket; +struct dc_info_packet *hfvsif_infopacket;bool *dpms_off;bool integer_scaling_update;bool *allow_freesync;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c +5 -3
@@ -675,11 +675,13 @@ static void enc1_stream_encoder_update_hdmi_info_packets(/* for bring up, disable dp double TODO */ REG_UPDATE (HDMI_DB_CONTROL ,HDMI_DB_DISABLE ,1 ); +/*Always add mandatory packets first followed by optional ones*/ enc1_update_hdmi_info_packet (enc1,0 , &info_frame->avi); -enc1_update_hdmi_info_packet (enc1,1 , &info_frame->vendor); +enc1_update_hdmi_info_packet (enc1,1 , &info_frame->hfvsif);enc1_update_hdmi_info_packet (enc1,2 , &info_frame->gamut); -enc1_update_hdmi_info_packet (enc1,3 , &info_frame->spd); -enc1_update_hdmi_info_packet (enc1,4 , &info_frame->hdrsmd); +enc1_update_hdmi_info_packet (enc1,3 , &info_frame->vendor); +enc1_update_hdmi_info_packet (enc1,4 , &info_frame->spd); +enc1_update_hdmi_info_packet (enc1,5 , &info_frame->hdrsmd); } static void enc1_stream_encoder_stop_hdmi_info_packets(
Signature · 1 line
2.36.1
PATCH 17/23 drm/amd/display: Copy hfvsif_infopacket when stream update
In reply to Hamza MahfoozFrom: Nicholas Kazlauskas <[email protected]>
[Why & How]
Miss to copy hfvsif_infopacket when copying stream updates. Check and copy it.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -0
@@ -2658,6 +2658,9 @@ static void copy_stream_update_to_stream(struct dc *dc,if (update->dpms_off) stream->dpms_off = *update->dpms_off; +if (update->hfvsif_infopacket) + stream->hfvsif_infopacket = *update->hfvsif_infopacket; +if (update->vsc_infopacket) stream->vsc_infopacket = *update->vsc_infopacket;
Signature · 1 line
2.36.1
PATCH 18/23 drm/amd/display: Adding VTEM to dc
In reply to Hamza MahfoozFrom: Ahmad Othman <[email protected]>
[Why]
Video Timing Extended Metadata packet (VTEM) is required for features like VRR and FVA
[How]
Adding support for VTEM transmission to stream encoders in DCN20 and DCN30 as part of FVA support
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 6 +++++- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 14 +++++++++++++- drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 ++ .../amd/display/dc/dcn20/dcn20_stream_encoder.c | 1 + .../display/dc/dcn30/dcn30_dio_stream_encoder.c | 1 + .../gpu/drm/amd/display/dc/inc/hw/stream_encoder.h | 1 + 6 files changed, 23 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +5 -1
@@ -2661,6 +2661,9 @@ static void copy_stream_update_to_stream(struct dc *dc,if (update->hfvsif_infopacket) stream->hfvsif_infopacket = *update->hfvsif_infopacket; +if (update->vtem_infopacket) + stream->vtem_infopacket = *update->vtem_infopacket; +if (update->vsc_infopacket) stream->vsc_infopacket = *update->vsc_infopacket;
@@ -2736,7 +2739,8 @@ static void commit_planes_do_stream_update(struct dc *dc, stream_update->vrr_infopacket || stream_update->vsc_infopacket || stream_update->vsp_infopacket || - stream_update->hfvsif_infopacket) { + stream_update->hfvsif_infopacket || + stream_update->vtem_infopacket) {resource_build_info_frame (pipe_ctx); dc->hwss.update_info_frame (pipe_ctx);
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +13 -1
@@ -2816,6 +2816,17 @@ static void set_hfvs_info_packet( *info_packet = stream->hfvsif_infopacket; } + +static void set_vtem_info_packet ( +struct dc_info_packet *info_packet, +struct dc_stream_state *stream) +{ +if (!stream->vtem_infopacket.valid) +return ; + + *info_packet = stream->vtem_infopacket; +} +void dc_resource_state_destruct (struct dc_state *context) {int i, j;
@@ -2896,7 +2907,7 @@ void resource_build_info_frame(struct pipe_ctx *pipe_ctx) info->hdrsmd.valid = false; info->vsc.valid = false; info->hfvsif.valid = false; - + info->vtem.valid = false; signal = pipe_ctx->stream->signal;/* HDMi and DP have different info packets*/
@@ -2905,6 +2916,7 @@ void resource_build_info_frame(struct pipe_ctx *pipe_ctx)set_vendor_info_packet (&info->vendor, pipe_ctx->stream);set_hfvs_info_packet (&info->hfvsif, pipe_ctx->stream); +set_vtem_info_packet (&info->vtem, pipe_ctx->stream);set_spd_info_packet (&info->spd, pipe_ctx->stream);
drivers/gpu/drm/amd/display/dc/dc_stream.h +2 -0
@@ -181,6 +181,7 @@ struct dc_stream_state {struct dc_info_packet vsc_infopacket;struct dc_info_packet vsp_infopacket;struct dc_info_packet hfvsif_infopacket; +struct dc_info_packet vtem_infopacket;uint8_t dsc_packed_pps[128 ];struct rect src;/* composition area */ struct rect dst;/* stream addressable area */
@@ -298,6 +299,7 @@ struct dc_stream_update {struct dc_info_packet *vsc_infopacket;struct dc_info_packet *vsp_infopacket;struct dc_info_packet *hfvsif_infopacket; +struct dc_info_packet *vtem_infopacket;bool *dpms_off;bool integer_scaling_update;bool *allow_freesync;
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.c +1 -0
@@ -159,6 +159,7 @@ static void enc2_stream_encoder_update_hdmi_info_packets(enc2_update_hdmi_info_packet (enc1,3 , &info_frame->vendor);enc2_update_hdmi_info_packet (enc1,4 , &info_frame->spd);enc2_update_hdmi_info_packet (enc1,5 , &info_frame->hdrsmd); +enc2_update_hdmi_info_packet (enc1,6 , &info_frame->vtem); } static void enc2_stream_encoder_stop_hdmi_info_packets(
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.c +1 -0
@@ -212,6 +212,7 @@ void enc3_stream_encoder_update_hdmi_info_packets(enc3_update_hdmi_info_packet (enc1,1 , &info_frame->vendor);enc3_update_hdmi_info_packet (enc1,3 , &info_frame->spd);enc3_update_hdmi_info_packet (enc1,4 , &info_frame->hdrsmd); +enc3_update_hdmi_info_packet (enc1,6 , &info_frame->vtem); } void enc3_stream_encoder_stop_hdmi_info_packets(
drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h +1 -0
@@ -77,6 +77,7 @@ struct encoder_info_frame {struct dc_info_packet gamut;struct dc_info_packet vendor;struct dc_info_packet hfvsif; +struct dc_info_packet vtem;/* source product description */ struct dc_info_packet spd;/* video stream configuration */
Signature · 1 line
2.36.1
PATCH 19/23 drm/amd/display: Pass vrr mode to dcn
In reply to Hamza MahfoozFrom: Felipe <[email protected]>
[WHY]
New features will require knowing the vrr mode for their enablement.
[HOW]
Pass the state via a member of dc_stream.
--- drivers/gpu/drm/amd/display/dc/dc_stream.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dc_stream.h +1 -0
@@ -208,6 +208,7 @@ struct dc_stream_state {bool ignore_msa_timing_param;bool allow_freesync; +bool vrr_active_variable;bool freesync_on_desktop;bool converter_disable_audio;
Signature · 1 line
2.36.1
PATCH 20/23 drm/amd/display: Disables dynamic memory clock switching in games
In reply to Hamza MahfoozFrom: Harry VanZyllDeJong <[email protected]>
[WHY]
Game performace may be affected if dynamic memory clock switching is enabled while playing games.
[HOW]
Propagate the vrr active state to dirty bit so that on mode set it disables dynamic memory clock switching.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++ drivers/gpu/drm/amd/display/dc/dc_stream.h | 1 + drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 2 +- drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h | 3 +-- 4 files changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -0
@@ -2652,6 +2652,9 @@ static void copy_stream_update_to_stream(struct dc *dc,if (update->allow_freesync) stream->allow_freesync = *update->allow_freesync; +if (update->vrr_active_variable) + stream->vrr_active_variable = *update->vrr_active_variable; +if (update->crtc_timing_adjust) stream->adjust = *update->crtc_timing_adjust;
drivers/gpu/drm/amd/display/dc/dc_stream.h +1 -0
@@ -304,6 +304,7 @@ struct dc_stream_update {bool *dpms_off;bool integer_scaling_update;bool *allow_freesync; +bool *vrr_active_variable;struct colorspace_transform *gamut_remap;enum dc_color_space *output_color_space;
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +1 -1
@@ -1374,7 +1374,7 @@ unsigned long long mod_freesync_calc_field_rate_from_timing(return field_rate_in_uhz; } -bool mod_freesync_get_freesync_enabled (struct mod_vrr_params *pVrr,struct dc_stream_state *const pStream) +bool mod_freesync_get_freesync_enabled (struct mod_vrr_params *pVrr) {return (pVrr->state !=VRR_STATE_UNSUPPORTED ) && (pVrr->state !=VRR_STATE_DISABLED ); }
drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h +1 -2
@@ -195,7 +195,6 @@ unsigned int mod_freesync_calc_v_total_from_refresh( unsigned int refresh_in_uhz);// Returns true when FreeSync is supported and enabled (even if it is inactive) -bool mod_freesync_get_freesync_enabled (struct mod_vrr_params *pVrr, -struct dc_stream_state *const pStream); +bool mod_freesync_get_freesync_enabled (struct mod_vrr_params *pVrr);#endif
Signature · 1 line
2.36.1
Re: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
Quoted 9 lines · Hamza Mahfooz
From: Harry VanZyllDeJong <[email protected]>
[WHY]
Game performace may be affected if dynamic memory clock switching is enabled while playing games.[HOW]
Propagate the vrr active state to dirty bit so that on mode set it disables dynamic memory clock switching.
So dynamic memory clock switching will be disabled whenever VRR is enabled?
Note that there is ongoing discussion about how Wayland compositors could usefully keep VRR enabled all the time, as opposed to only while there's a fullscreen application like a game. So "VRR is enabled" likely won't be equivalent to "game is running" in the long term.
Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer
RE: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
Hi,
Can you please elaborate on why dynamic memory clock switching can affect Game performance?
BR,
Chandan V N
Quoted 16 lines · Hamza Mahfooz
Quoted 9 lines
From: Harry VanZyllDeJong <[email protected]>
[WHY]
Game performace may be affected if dynamic memory clock switching is enabled while playing games.[HOW]
Propagate the vrr active state to dirty bit so that on mode set it disables dynamic memory clock switching.So dynamic memory clock switching will be disabled whenever VRR is enabled?
Note that there is ongoing discussion about how Wayland compositors could usefully keep VRR enabled all the time, as opposed to only while >there's a fullscreen application like a game. So "VRR is enabled" likely won't be equivalent to "game is running" in the long term.
Signature · 2 lines
Earthling Michel Dänzer | https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredhat.com%2F&data=05%7C01%7Cchandan.vurdigerenataraj%40amd.com%7C005764271a144b5832c408da4d293dee%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637907136793233201%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=NSiOtjfwkelxkZMRFLzFs1mFPvosOFZnqrcNvRb9J6E%3D&reserved=0 Libre software enthusiast | Mesa and Xwayland developer
RE: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
[AMD Official Use Only - General]
Hi Chandan,
When using Firmware Assisted Memory clock Switching (FAMS), when the memory clock is switched the frame rate is dropped for at least 1 frame, sometimes 2-3 frames to make the V-Blank long enough to handle the period where the GDDR6 memory is unavailable when the memory clock switches. This drop may be noticeable by gamers, especially if the memory clock wants to change it's clock rate several times a second, which is what we observed just on the desktop.
To guarantee best game performance, we disable FAMS during game play.
Harry
-----Original Message-----
From: VURDIGERENATARAJ, CHANDAN <[email protected]>
Sent: June 13, 2022 8:42 AM
To: Michel Dänzer <[email protected]>; Mahfooz, Hamza <[email protected]>; [email protected]
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Zuo, Jerry <[email protected]>; Pillai, Aurabindo <[email protected]>; Vanzylldejong, Harry <[email protected]>; Lin, Wayne <[email protected]>; Wentland, Harry <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: RE: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
Hi,
Can you please elaborate on why dynamic memory clock switching can affect Game performance?
BR,
Chandan V N
Quoted 7 lines · Hamza Mahfooz
Quoted 6 lines
From: Harry VanZyllDeJong <[email protected]>
[WHY]
Game performace may be affected if dynamic memory clock switching is enabled while playing games.
Quoted 9 lines
Quoted 3 lines
[HOW]
Propagate the vrr active state to dirty bit so that on mode set it disables dynamic memory clock switching.So dynamic memory clock switching will be disabled whenever VRR is enabled?
Note that there is ongoing discussion about how Wayland compositors could usefully keep VRR enabled all the time, as opposed to only while >there's a fullscreen application like a game. So "VRR is enabled" likely won't be equivalent to "game is running" in the long term.
--
Earthling Michel Dänzer | https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredhat.com%2F&data=05%7C01%7Cchandan.vurdigerenataraj%40amd.com%7C005764271a144b5832c408da4d293dee%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637907136793233201%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=NSiOtjfwkelxkZMRFLzFs1mFPvosOFZnqrcNvRb9J6E%3D&reserved=0
Libre software enthusiast | Mesa and Xwayland developer
Re: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
It should be noted that FAMS is an additional feature to enable mclk switching in more marginal cases than would normally be possible.
Alex
Quoted 48 lines · Harry
[AMD Official Use Only - General]
Hi Chandan,
When using Firmware Assisted Memory clock Switching (FAMS), when the memory clock is switched the frame rate is dropped for at least 1 frame, sometimes 2-3 frames to make the V-Blank long enough to handle the period where the GDDR6 memory is unavailable when the memory clock switches. This drop may be noticeable by gamers, especially if the memory clock wants to change it's clock rate several times a second, which is what we observed just on the desktop.
To guarantee best game performance, we disable FAMS during game play.Harry
-----Original Message-----
From: VURDIGERENATARAJ, CHANDAN <[email protected]>
Sent: June 13, 2022 8:42 AM
To: Michel Dänzer <[email protected]>; Mahfooz, Hamza <[email protected]>; [email protected]
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Zuo, Jerry <[email protected]>; Pillai, Aurabindo <[email protected]>; Vanzylldejong, Harry <[email protected]>; Lin, Wayne <[email protected]>; Wentland, Harry <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: RE: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in gamesHi,
Can you please elaborate on why dynamic memory clock switching can affect Game performance?
BR,
Chandan V NQuoted 7 lines · Hamza Mahfooz
Quoted 6 lines
From: Harry VanZyllDeJong <[email protected]>
[WHY]
Game performace may be affected if dynamic memory clock switching is enabled while playing games.Quoted 9 lines
Quoted 3 lines
[HOW]
Propagate the vrr active state to dirty bit so that on mode set it disables dynamic memory clock switching.So dynamic memory clock switching will be disabled whenever VRR is enabled?
Note that there is ongoing discussion about how Wayland compositors could usefully keep VRR enabled all the time, as opposed to only while >there's a fullscreen application like a game. So "VRR is enabled" likely won't be equivalent to "game is running" in the long term.
--
Earthling Michel Dänzer | https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredhat.com%2F&data=05%7C01%7Cchandan.vurdigerenataraj%40amd.com%7C005764271a144b5832c408da4d293dee%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637907136793233201%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=NSiOtjfwkelxkZMRFLzFs1mFPvosOFZnqrcNvRb9J6E%3D&reserved=0
Libre software enthusiast | Mesa and Xwayland developer
RE: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
[AMD Official Use Only - General]
+@Clark, Felipe
-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: June 13, 2022 10:34 AM
To: Vanzylldejong, Harry <[email protected]>
Cc: VURDIGERENATARAJ, CHANDAN <[email protected]>; Michel Dänzer <[email protected]>; Mahfooz, Hamza <[email protected]>; [email protected]; Wang, Chao-kai (Stylon) <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Zuo, Jerry <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: Re: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
It should be noted that FAMS is an additional feature to enable mclk switching in more marginal cases than would normally be possible.
Alex
Quoted 59 lines · Harry
[AMD Official Use Only - General]
Hi Chandan,
When using Firmware Assisted Memory clock Switching (FAMS), when the
memory clock is switched the frame rate is dropped for at least 1 frame, sometimes 2-3 frames to make the V-Blank long enough to handle the period where the GDDR6 memory is unavailable when the memory clock switches. This drop may be noticeable by gamers, especially if the memory clock
wants to change it's clock rate several times a second, which is what we observed just on the desktop.
To guarantee best game performance, we disable FAMS during game play.Harry
-----Original Message-----
From: VURDIGERENATARAJ, CHANDAN <[email protected]>
Sent: June 13, 2022 8:42 AM
To: Michel Dänzer <[email protected]>; Mahfooz, Hamza <[email protected]>; [email protected]
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Zuo, Jerry <[email protected]>; Pillai, Aurabindo <[email protected]>; Vanzylldejong, Harry <[email protected]>; Lin, Wayne <[email protected]>; Wentland, Harry <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: RE: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in gamesHi,
Can you please elaborate on why dynamic memory clock switching can affect Game performance?
BR,
Chandan V NQuoted 7 lines · Hamza Mahfooz
Quoted 6 lines
From: Harry VanZyllDeJong <[email protected]>
[WHY]
Game performace may be affected if dynamic memory clock switching is enabled while playing games.Quoted 9 lines
Quoted 3 lines
[HOW]
Propagate the vrr active state to dirty bit so that on mode set it disables dynamic memory clock switching.So dynamic memory clock switching will be disabled whenever VRR is enabled?
Note that there is ongoing discussion about how Wayland compositors could usefully keep VRR enabled all the time, as opposed to only while >there's a fullscreen application like a game. So "VRR is enabled" likely won't be equivalent to "game is running" in the long term.
--
Earthling Michel Dänzer | https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredhat.com%2F&data=05%7C01%7CHarry.Vanzylldejong%40amd.com%7Cf91798912ad54c6e4ab808da4d49d34e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637907276721240575%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=N9TpPbl5KEIYAR5hhPKeiT0VZQ31SYxa2XottQrStfU%3D&reserved=0
Libre software enthusiast | Mesa and Xwayland developer
Harry Wentland
maintainerRe: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
This seems to be a case of a Windows-centric commit description that doesn't completely make sense for Linux.
The code-change doesn't currently affect any behavior on Linux. It just lays the groundwork in DC to allow an implementation to do a memory-clock switching decision based around VRR support.
In short, this won't be a problem for us at this point.
Might be better to change the subject line and commit description to reflect that:
"drm/amd/display: Add vrr_active_variable to dc_stream_update
[Why]
The display driver on some OSes need to track it in order to perform memory clock switching decisions."
... or something like the above.
Harry
Quoted 74 lines · Harry
[AMD Official Use Only - General]
+@Clark, Felipe
-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: June 13, 2022 10:34 AM
To: Vanzylldejong, Harry <[email protected]>
Cc: VURDIGERENATARAJ, CHANDAN <[email protected]>; Michel Dänzer <[email protected]>; Mahfooz, Hamza <[email protected]>; [email protected]; Wang, Chao-kai (Stylon) <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Zuo, Jerry <[email protected]>; Pillai, Aurabindo <[email protected]>; Lin, Wayne <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: Re: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in gamesIt should be noted that FAMS is an additional feature to enable mclk switching in more marginal cases than would normally be possible.
Alex
Quoted 58 lines · Harry
[AMD Official Use Only - General]
Hi Chandan,
When using Firmware Assisted Memory clock Switching (FAMS), when the
memory clock is switched the frame rate is dropped for at least 1 frame, sometimes 2-3 frames to make the V-Blank long enough to handle the period where the GDDR6 memory is unavailable when the memory clock switches. This drop may be noticeable by gamers, especially if the memory clock
wants to change it's clock rate several times a second, which is what we observed just on the desktop.
To guarantee best game performance, we disable FAMS during game play.Harry
-----Original Message-----
From: VURDIGERENATARAJ, CHANDAN <[email protected]>
Sent: June 13, 2022 8:42 AM
To: Michel Dänzer <[email protected]>; Mahfooz, Hamza <[email protected]>; [email protected]
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Zuo, Jerry <[email protected]>; Pillai, Aurabindo <[email protected]>; Vanzylldejong, Harry <[email protected]>; Lin, Wayne <[email protected]>; Wentland, Harry <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: RE: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in gamesHi,
Can you please elaborate on why dynamic memory clock switching can affect Game performance?
BR,
Chandan V NQuoted 7 lines · Hamza Mahfooz
Quoted 6 lines
From: Harry VanZyllDeJong <[email protected]>
[WHY]
Game performace may be affected if dynamic memory clock switching is enabled while playing games.Quoted 9 lines
Quoted 3 lines
[HOW]
Propagate the vrr active state to dirty bit so that on mode set it disables dynamic memory clock switching.So dynamic memory clock switching will be disabled whenever VRR is enabled?
Note that there is ongoing discussion about how Wayland compositors could usefully keep VRR enabled all the time, as opposed to only while >there's a fullscreen application like a game. So "VRR is enabled" likely won't be equivalent to "game is running" in the long term.
--
Earthling Michel Dänzer | https://redhat.com/>>> Libre software enthusiast | Mesa and Xwayland developer
Re: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
Quoted 8 lines · Harry Wentland
This seems to be a case of a Windows-centric commit description that doesn't completely make sense for Linux.
The code-change doesn't currently affect any behavior on Linux. It just lays the groundwork in DC to allow an implementation to do a memory-clock switching decision based around VRR support.
In short, this won't be a problem for us at this point.
Thanks for the clarification.
Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer
Harry Wentland
maintainerRe: [PATCH 20/23] drm/amd/display: Disables dynamic memory clock switching in games
Quoted 4 lines · Michel Dänzer
Quoted 3 lines · Harry Wentland
This seems to be a case of a Windows-centric commit description that doesn't completely make sense for Linux.
Quoted 8 lines
Quoted 5 lines
The code-change doesn't currently affect any behavior on Linux. It just lays the groundwork in DC to allow an implementation to do a memory-clock switching decision based around VRR support.
In short, this won't be a problem for us at this point.
Thanks for the clarification.
No problem. Thanks for your review and for voicing your concern when something doesn't look right.
Harry
Quoted 1 line
PATCH 21/23 drm/amd/display: FVA timing adjustment
In reply to Hamza MahfoozFrom: Charlene Liu <[email protected]>
[why]
need to add timing adjustment for fva.
[how]
add hook to optc and hwseq.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +1 -0
@@ -165,6 +165,7 @@ void optc1_program_timing( optc1->vupdate_width = vupdate_width; patched_crtc_timing = *dc_crtc_timing;apply_front_porch_workaround (&patched_crtc_timing); + optc1->orginal_patched_timing = patched_crtc_timing;/* Load horizontal timing */
Signature · 1 line
2.36.1
PATCH 22/23 drm/amd/display: Add null check to dc_submit_i2c_oem
In reply to Hamza MahfoozFrom: Martin Leung <[email protected]>
[why]dc_submit_i2c_oem could be called with ddc null
[how]
add null check and fail the call instead
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +7 -4
@@ -3477,10 +3477,13 @@ bool dc_submit_i2c_oem( struct i2c_command *cmd) {struct ddc_service *ddc = dc->res_pool->oem_device; -return dce_i2c_submit_command ( - dc->res_pool, - ddc->ddc_pin, - cmd); +if (ddc) +return dce_i2c_submit_command ( + dc->res_pool, + ddc->ddc_pin, + cmd); + +return false; }static bool link_add_remote_sink_helper (struct dc_link *dc_link,struct dc_sink *sink)
Signature · 1 line
2.36.1
PATCH 23/23 drm/amd/display: Blank for uclk OC in dm instead of dc
In reply to Hamza MahfoozFrom: Joshua Aberback <[email protected]>
[Why]
All displays need to be blanked during the uclk OC interface so that we can guarantee pstate switching support. If the display config doesn't support pstate switching, only using core_link_disable_stream will not enable it as the front-end is untouched. We need to go through the full plane removal sequence to properly program the pipe to allow pstate switching.
[How]
- guard clk_mgr functions with non-NULL checks
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 34 +++++++++--------------- drivers/gpu/drm/amd/display/dc/dc.h | 10 ++----- 2 files changed, 14 insertions(+), 30 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +12 -22
@@ -3666,37 +3666,27 @@ void dc_allow_idle_optimizations(struct dc *dc, bool allow) dc->idle_optimizations_allowed = allow; } -/* -* blank all streams, and set min and max memory clock to -* lowest and highest DPM level, respectively -*/ +/* set min and max memory clock to lowest and highest DPM level, respectively */ void dc_unlock_memory_clock_frequency (struct dc *dc) { -unsigned int i; - -for (i =0 ; i <MAX_PIPES ; i++) -if (dc->current_state->res_ctx.pipe_ctx[i].plane_state) -core_link_disable_stream (&dc->current_state->res_ctx.pipe_ctx[i]); +if (dc->clk_mgr->funcs->set_hard_min_memclk) + dc->clk_mgr->funcs->set_hard_min_memclk (dc->clk_mgr, false); - dc->clk_mgr->funcs->set_hard_min_memclk (dc->clk_mgr, false); - dc->clk_mgr->funcs->set_hard_max_memclk (dc->clk_mgr); +if (dc->clk_mgr->funcs->set_hard_max_memclk) + dc->clk_mgr->funcs->set_hard_max_memclk (dc->clk_mgr); } -/* -* set min memory clock to the min required for current mode, -* max to maxDPM, and unblank streams -*/ +/* set min memory clock to the min required for current mode, max to maxDPM */ void dc_lock_memory_clock_frequency (struct dc *dc) { -unsigned int i; +if (dc->clk_mgr->funcs->get_memclk_states_from_smu) + dc->clk_mgr->funcs->get_memclk_states_from_smu (dc->clk_mgr); - dc->clk_mgr->funcs->get_memclk_states_from_smu (dc->clk_mgr); - dc->clk_mgr->funcs->set_hard_min_memclk (dc->clk_mgr, true); - dc->clk_mgr->funcs->set_hard_max_memclk (dc->clk_mgr); +if (dc->clk_mgr->funcs->set_hard_min_memclk) + dc->clk_mgr->funcs->set_hard_min_memclk (dc->clk_mgr, true); -for (i =0 ; i <MAX_PIPES ; i++) -if (dc->current_state->res_ctx.pipe_ctx[i].plane_state) -core_link_enable_stream (dc->current_state, &dc->current_state->res_ctx.pipe_ctx[i]); +if (dc->clk_mgr->funcs->set_hard_max_memclk) + dc->clk_mgr->funcs->set_hard_max_memclk (dc->clk_mgr); }static void blank_and_force_memclk (struct dc *dc,bool apply,unsigned int memclk_mhz)
drivers/gpu/drm/amd/display/dc/dc.h +2 -8
@@ -1437,16 +1437,10 @@ bool dc_is_plane_eligible_for_idle_optimizations(struct dc *dc, struct dc_plane_void dc_allow_idle_optimizations (struct dc *dc,bool allow); -/* -* blank all streams, and set min and max memory clock to -* lowest and highest DPM level, respectively -*/ +/* set min and max memory clock to lowest and highest DPM level, respectively */ void dc_unlock_memory_clock_frequency (struct dc *dc); -/* -* set min memory clock to the min required for current mode, -* max to maxDPM, and unblank streams -*/ +/* set min memory clock to the min required for current mode, max to maxDPM */ void dc_lock_memory_clock_frequency (struct dc *dc);/* set soft max for memclk, to be used for AC/DC switching clock limitations */
Signature · 1 line
2.36.1
[Public]
Hi all,
This week this patchset was tested on the following systems:
HP Envy 360, with Ryzen 5 4500U
Lenovo Thinkpad T14s Gen2, with AMD Ryzen 5 5650U
Sapphire Pulse RX5700XT
Reference AMD RX6800
Engineering board with Ryzen 9 5900H
These systems were tested on the following display types:
eDP, (1080p 60hz [4500U, 5650U, 5900H])
VGA and DVI (1680x1050 60HZ [DP to VGA/DVI, USB-C to DVI/VGA]) DP/HDMI/USB-C (1440p 170hz, 4k 60hz, 4k 144hz [Includes USB-C to DP/HDMI adapters])
MST tested with Startech MST14DP123DP and 2x 4k 60Hz displays
DSC tested with Cable Matters 101075 (DP to 3x DP), and 201375 (USB-C to 3x DP) with 3x 4k60 displays
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 - e426d449d8ce177c6dad562a1093332c738a56b3 -> drm/amd/amdgpu: Fix alignment issue) with new patches added on top of it. This branch is used for both Ubuntu and Chrome OS testing (ChromeOS on a bi-weekly basis).
Tested on Ubuntu 22.04 and Chrome OS
Thank you,
Dan Wheeler
Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Hamza Mahfooz
Sent: June 10, 2022 4:52 PM
To: [email protected]
Cc: Wang, Chao-kai (Stylon) <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Chiu, Solomon <[email protected]>; Zuo, Jerry <[email protected]>; Pillai, Aurabindo <[email protected]>; Mahfooz, Hamza <[email protected]>; Lin, Wayne <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Gutierrez, Agustin <[email protected]>; Kotarac, Pavle <[email protected]>
Subject: [PATCH 00/23] DC Patches June 06, 2022
This DC patchset brings improvements in multiple areas. In summary, we have:
* DP fixes
* Reduced frame size in the bouding boxes of a number of ASICs.
* Exiting idle optimizations
* General cleanup
* Power management optimizations
* HF-VSIF support
* VTEM support
* FVA timing improvements
Ahmad Othman (2):
drm/amd/display: Add support for HF-VSIF
drm/amd/display: Adding VTEM to dc
Aric Cyr (1):
drm/amd/display: 3.2.190
Charlene Liu (1):
drm/amd/display: FVA timing adjustment
Felipe (2):
drm/amd/display: Firmware assisted MCLK switch and FS drm/amd/display: Pass vrr mode to dcn
Hamza Mahfooz (1):
drm/amd/display: fix build when CONFIG_DRM_AMD_DC_DCN is not defined
Harry VanZyllDeJong (1):
drm/amd/display: Disables dynamic memory clock switching in games
Ian Chen (1):
drm/amd/display: DAL ACR, dc part, fix missing dcn30
Joshua Aberback (1):
drm/amd/display: Blank for uclk OC in dm instead of dc
Lee, Alvin (1):
drm/amd/display: Add debug option for exiting idle optimizations on
cursor updates
Martin Leung (1):
drm/amd/display: Add null check to dc_submit_i2c_oem
Nicholas Kazlauskas (1):
drm/amd/display: Copy hfvsif_infopacket when stream update
Oliver Logush (1):
drm/amd/display: Drop unused privacy_mask setters and getters
Qingqing Zhuo (1):
drm/amd/display: update topology_update_input_v3 struct
Rodrigo Siqueira (4):
drm/amd/display: Reduce frame size in the bouding box for DCN20 drm/amd/display: Reduce frame size in the bouding box for DCN301 drm/amd/display: Reduce frame size in the bouding box for DCN31/316 drm/amd/display: Reduce frame size in the bouding box for DCN21
Samson Tam (1):
drm/amd/display: Fix comments
Shah, Dharati (1):
drm/amd/display: Fix monitor flash issue
Wenjing Liu (1):
drm/amd/display: lower lane count first when CR done partially fails
in EQ
hersen wu (1):
drm/amd/display: dsc validate fail not pass to atomic check
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +- .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 2 + .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 43 ++++++++---- .../display/amdgpu_dm/amdgpu_dm_mst_types.h | 2 +- .../display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c | 23 ++++--- .../dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c | 11 ++- drivers/gpu/drm/amd/display/dc/core/dc.c | 66 +++++++++--------- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 8 ++- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 13 ++-- .../gpu/drm/amd/display/dc/core/dc_resource.c | 27 +++++++- .../gpu/drm/amd/display/dc/core/dc_stream.c | 5 +- drivers/gpu/drm/amd/display/dc/dc.h | 13 ++-- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 2 + drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 5 +- drivers/gpu/drm/amd/display/dc/dc_stream.h | 9 ++- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 1 - .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 1 + .../display/dc/dcn10/dcn10_stream_encoder.c | 8 ++- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 1 - .../display/dc/dcn20/dcn20_stream_encoder.c | 1 + .../dc/dcn30/dcn30_dio_stream_encoder.c | 1 + .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 28 +++++--- .../drm/amd/display/dc/dcn30/dcn30_hwseq.h | 11 ++- .../gpu/drm/amd/display/dc/dcn30/dcn30_init.c | 2 +- .../gpu/drm/amd/display/dc/dcn30/dcn30_optc.c | 1 + .../drm/amd/display/dc/dcn30/dcn30_resource.c | 1 + .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 67 +++++++++---------- .../amd/display/dc/dml/dcn301/dcn301_fpu.c | 30 ++++----- .../drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 64 ++++++++---------- .../dc/gpio/dcn20/hw_translate_dcn20.c | 17 +++-- .../dc/gpio/dcn21/hw_translate_dcn21.c | 17 +++-- .../dc/gpio/dcn30/hw_translate_dcn30.c | 19 +++--- drivers/gpu/drm/amd/display/dc/inc/hw/dwb.h | 6 -- .../amd/display/dc/inc/hw/stream_encoder.h | 1 + .../amd/display/dc/inc/hw_sequencer_private.h | 1 + .../amd/display/include/link_service_types.h | 2 + .../amd/display/modules/freesync/freesync.c | 5 ++ .../display/modules/hdcp/hdcp2_transition.c | 2 +- .../drm/amd/display/modules/hdcp/hdcp_psp.c | 4 ++ .../drm/amd/display/modules/hdcp/hdcp_psp.h | 11 +++ .../amd/display/modules/inc/mod_freesync.h | 3 + 41 files changed, 326 insertions(+), 214 deletions(-)
--
2.36.1