DC Patches Dec 13, 2024
cover DC Patches Dec 13, 2024
* Update DML21 code.
* Fixes for FAMS2 interface.
* HDMI fixes.
* Compilation warning fixes.
Cc: Daniel Wheeler <[email protected]>
Alex Hung (1):
drm/amd/display: Fix uninitialized variables in amdgpu_dm_debugfs
Alvin Lee (1):
drm/amd/display: Update FAMS2 config cmd
Aric Cyr (1):
drm/amd/display: 3.2.314
Austin Zheng (1):
drm/amd/display: DML21 Reintegration For Various Fixes
Charlene Liu (1):
drm/amd/display: init dc_power_state
Chris Park (1):
drm/amd/display: Block Invalid TMDS operation
Dillon Varone (3):
drm/amd/display: Add support for FAMS2+ interface versions drm/amd/display: Add new message for DF throttling optimization on
dcn401
drm/amd/display: Re-validate streams on commit_streams
Fangzhi Zuo (1):
drm/amd/display: Fix Mode Cutoff in DSC Passthrough to DP2.1 Monitor
George Shen (1):
drm/amd/display: Disable MPC rate control on ODM pipe update
Harry VanZyllDeJong (1):
drm/amd/display: Fix brightness adjustment on MiniLED
Meerpate Patel (1):
drm/amd/display: initialize uninitialized variable
Nicholas Kazlauskas (2):
drm/amd/display: Apply (some) policy for DML2 formulation on
DCN35/DCN351
drm/amd/display: Don't allow IPS2 in D0 for RCG Dynamic
Rodrigo Siqueira (1):
Revert "drm/amd/display: Fix green screen issue after suspend"
Shunlu Zhang (1):
drm/amd/display: delete legacy code
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 +-
.../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 8 +-
.../display/amdgpu_dm/amdgpu_dm_mst_types.c | 6 +-
.../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 22 +-
.../amd/display/amdgpu_dm/amdgpu_dm_plane.h | 3 +-
.../dc/clk_mgr/dcn401/dcn401_clk_mgr.c | 46 +
.../dc/clk_mgr/dcn401/dcn401_clk_mgr.h | 1 +
.../clk_mgr/dcn401/dcn401_clk_mgr_smu_msg.c | 23 +
.../clk_mgr/dcn401/dcn401_clk_mgr_smu_msg.h | 3 +
drivers/gpu/drm/amd/display/dc/core/dc.c | 11 +-
drivers/gpu/drm/amd/display/dc/dc.h | 6 +-
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 40 +-
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 1 +
.../drm/amd/display/dc/dce/dce_clock_source.c | 3 +
.../dc/dml/dcn30/display_rq_dlg_calc_30.c | 1 +
drivers/gpu/drm/amd/display/dc/dml2/Makefile | 15 +-
.../amd/display/dc/dml2/display_mode_core.c | 6 +-
.../dc/dml2/display_mode_core_structs.h | 103 +-
.../amd/display/dc/dml2/display_mode_util.c | 6 +-
.../dc/dml2/dml21/dml21_translation_helper.c | 16 +-
.../amd/display/dc/dml2/dml21/dml21_utils.c | 80 +-
.../dml21/inc/bounding_boxes/dcn4_soc_bb.h | 3 +-
.../dml21/inc/dml_top_display_cfg_types.h | 52 +-
.../dml21/inc/dml_top_soc_parameter_types.h | 2 +
.../display/dc/dml2/dml21/inc/dml_top_types.h | 77 +-
.../dml2/dml21/src/dml2_core/dml2_core_dcn4.c | 42 +-
.../src/dml2_core/dml2_core_dcn4_calcs.c | 1306 +++++++++++------
.../src/dml2_core/dml2_core_dcn4_calcs.h | 2 +-
.../src/dml2_core/dml2_core_shared_types.h | 129 +-
.../dml21/src/dml2_core/dml2_core_utils.c | 223 ++-
.../dml21/src/dml2_core/dml2_core_utils.h | 6 +-
.../dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c | 49 +-
.../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c | 394 +++--
.../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.h | 7 +
.../dml21/src/dml2_pmo/dml2_pmo_factory.c | 1 -
.../dml21/src/dml2_top/dml2_top_interfaces.c | 51 +
.../dml2/dml21/src/dml2_top/dml2_top_legacy.c | 4 +
.../dml2/dml21/src/dml2_top/dml2_top_legacy.h | 9 +
.../src/dml2_top/dml2_top_optimization.c | 307 ----
.../src/dml2_top/dml2_top_optimization.h | 33 -
.../dml2/dml21/src/dml2_top/dml2_top_soc15.c | 1177 +++++++++++++++
.../{dml_top_mcache.h => dml2_top_soc15.h} | 20 +-
.../dml2/dml21/src/dml2_top/dml_top_mcache.c | 549 -------
.../dc/dml2/dml21/src/inc/dml2_debug.c | 5 +
.../dc/dml2/dml21/src/inc/dml2_debug.h | 46 +-
.../src/inc/dml2_internal_shared_types.h | 60 +-
.../display/dc/dml2/dml2_translation_helper.c | 54 +-
.../display/dc/dml2/dml_display_rq_dlg_calc.c | 12 -
.../amd/display/dc/hwss/dcn31/dcn31_init.c | 2 +-
.../amd/display/dc/hwss/dcn314/dcn314_hwseq.c | 12 +
.../amd/display/dc/hwss/dcn314/dcn314_init.c | 2 +-
.../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 12 +
.../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 5 +-
.../gpu/drm/amd/display/dc/inc/core_types.h | 3 +-
.../gpu/drm/amd/display/dc/link/link_dpms.c | 4 +
.../drm/amd/display/dc/mpc/dcn30/dcn30_mpc.c | 18 +
.../drm/amd/display/dc/mpc/dcn30/dcn30_mpc.h | 7 +
.../amd/display/dc/optc/dcn401/dcn401_optc.c | 4 +-
.../dc/resource/dcn401/dcn401_resource.c | 4 +
59 files changed, 3225 insertions(+), 1880 deletions(-)
create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_interfaces.c
create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_legacy.c
create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_legacy.h
delete mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_optimization.c
delete mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_optimization.h
create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_soc15.c
rename drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/{dml_top_mcache.h => dml2_top_soc15.h} (58%)
delete mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml_top_mcache.cSignature · 1 line
2.45.2
PATCH 1/17 drm/amd/display: Update FAMS2 config cmd
From: Alvin Lee <[email protected]>
The FAMS2 stream and sub-state have been separated into 2 different commands. Update the cmd function to send one command each for the stream and sub-state.
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 25 ++++++++++++++----- .../gpu/drm/amd/display/dc/inc/core_types.h | 1 + 2 files changed, 20 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +19 -6
@@ -1694,10 +1694,10 @@ void dc_dmub_srv_fams2_update_config(struct dc *dc, {uint8_t num_cmds =1 ;uint32_t i; -union dmub_rb_cmd cmd[MAX_STREAMS +1 ]; +union dmub_rb_cmd cmd[2 *MAX_STREAMS +1 ];struct dmub_rb_cmd_fams2 *global_cmd = &cmd[0 ].fams2_config; -memset (cmd,0 ,sizeof (union dmub_rb_cmd ) * (MAX_STREAMS +1 )); +memset (cmd,0 ,sizeof (union dmub_rb_cmd ) * (2 *MAX_STREAMS +1 ));/* fill in generic command header */ global_cmd->header.type =DMUB_CMD__FW_ASSISTED_MCLK_SWITCH ; global_cmd->header.sub_type =DMUB_CMD__FAMS2_CONFIG ;
@@ -1715,16 +1715,29 @@ void dc_dmub_srv_fams2_update_config(struct dc *dc,/* construct per-stream configs */ for (i =0 ; i < context->bw_ctx.bw.dcn.fams2_global_config.num_streams; i++) {struct dmub_rb_cmd_fams2 *stream_cmd = &cmd[i+1 ].fams2_config; +struct dmub_rb_cmd_fams2 *sub_state_cmd = &cmd[i+1 +context->bw_ctx.bw.dcn.fams2_global_config.num_streams].fams2_config;/* configure command header */ stream_cmd->header.type =DMUB_CMD__FW_ASSISTED_MCLK_SWITCH ; stream_cmd->header.sub_type =DMUB_CMD__FAMS2_CONFIG ; stream_cmd->header.payload_bytes =sizeof (struct dmub_rb_cmd_fams2 ) -sizeof (struct dmub_cmd_header ); stream_cmd->header.multi_cmd_pending =1 ; + sub_state_cmd->header.type =DMUB_CMD__FW_ASSISTED_MCLK_SWITCH ; + sub_state_cmd->header.sub_type =DMUB_CMD__FAMS2_CONFIG ; + sub_state_cmd->header.payload_bytes =sizeof (struct dmub_rb_cmd_fams2 ) -sizeof (struct dmub_cmd_header ); + sub_state_cmd->header.multi_cmd_pending =1 ;/* copy stream static state */ -memcpy (&stream_cmd->config.stream, +memcpy (&stream_cmd->config.stream_v1.base, &context->bw_ctx.bw.dcn.fams2_stream_params[i], -sizeof (struct dmub_fams2_stream_static_state )); +sizeof (struct dmub_fams2_cmd_stream_static_base_state )); +// TODO: Use the below memcpy call instead of the above once DML is updated +/*memcpy(&stream_cmd->config.stream_v1.base, +&context->bw_ctx.bw.dcn.fams2_stream_params[i].base, +sizeof(struct dmub_fams2_cmd_stream_static_base_state));*/ +/* copy stream sub state */ +memcpy (&stream_cmd->config.stream_v1.sub_state, + &context->bw_ctx.bw.dcn.fams2_stream_params[i].sub_state, +sizeof (union dmub_fams2_cmd_stream_static_sub_state )); } }
@@ -1735,8 +1748,8 @@ void dc_dmub_srv_fams2_update_config(struct dc *dc,if (enable && context->bw_ctx.bw.dcn.fams2_global_config.features.bits.enable) {/* set multi pending for global, and unset for last stream cmd */ global_cmd->header.multi_cmd_pending =1 ; - cmd[context->bw_ctx.bw.dcn.fams2_global_config.num_streams].fams2_config.header.multi_cmd_pending =0 ; - num_cmds += context->bw_ctx.bw.dcn.fams2_global_config.num_streams; + cmd[2 * context->bw_ctx.bw.dcn.fams2_global_config.num_streams].fams2_config.header.multi_cmd_pending =0 ; + num_cmds +=2 * context->bw_ctx.bw.dcn.fams2_global_config.num_streams; }dm_execute_dmub_cmd_list (dc->ctx, num_cmds, cmd,DM_DMUB_WAIT_TYPE_WAIT );
drivers/gpu/drm/amd/display/dc/inc/core_types.h +1 -0
@@ -540,6 +540,7 @@ struct dcn_bw_output {struct dml2_mcache_surface_allocation mcache_allocations[DML2_MAX_PLANES ];struct dmub_cmd_fams2_global_config fams2_global_config;struct dmub_fams2_stream_static_state fams2_stream_params[DML2_MAX_PLANES ]; +/*struct dmub_fams2_stream_static_state_v1 fams2_stream_params[DML2_MAX_PLANES];*/ // TODO: Update to this once DML is updated struct dml2_display_arb_regs arb_regs; };
Signature · 1 line
2.45.2
PATCH 2/17 drm/amd/display: Add support for FAMS2+ interface versions
In reply to Rodrigo SiqueiraFrom: Dillon Varone <[email protected]>
Current driver interface does not allow for flexibility in coexistence of multiple interface versions, so add support for checking minor interface revisions and providing appropriate programming.
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 40 ++++----- .../amd/display/dc/dml2/dml21/dml21_utils.c | 80 +++++++++++------ .../dml21/inc/bounding_boxes/dcn4_soc_bb.h | 2 +- .../display/dc/dml2/dml21/inc/dml_top_types.h | 3 +- .../dml2/dml21/src/dml2_core/dml2_core_dcn4.c | 3 +- .../src/dml2_core/dml2_core_dcn4_calcs.c | 90 ++++++++++--------- .../src/dml2_core/dml2_core_dcn4_calcs.h | 2 +- .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 3 +- .../gpu/drm/amd/display/dc/inc/core_types.h | 4 +- .../amd/display/dc/optc/dcn401/dcn401_optc.c | 4 +- .../dc/resource/dcn401/dcn401_resource.c | 4 + 12 files changed, 134 insertions(+), 102 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -1056,6 +1056,7 @@ struct dc_debug_options {bool dml21_force_pstate_method;uint32_t dml21_force_pstate_method_values[MAX_PIPES ];uint32_t dml21_disable_pstate_method_mask; +union fw_assisted_mclk_switch_version fams_version;union dmub_fams2_global_feature_config fams2_config;bool enable_legacy_clock_update;unsigned int force_cositing;
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +18 -22
@@ -1714,30 +1714,26 @@ void dc_dmub_srv_fams2_update_config(struct dc *dc,/* construct per-stream configs */ for (i =0 ; i < context->bw_ctx.bw.dcn.fams2_global_config.num_streams; i++) { -struct dmub_rb_cmd_fams2 *stream_cmd = &cmd[i+1 ].fams2_config; -struct dmub_rb_cmd_fams2 *sub_state_cmd = &cmd[i+1 +context->bw_ctx.bw.dcn.fams2_global_config.num_streams].fams2_config; +struct dmub_rb_cmd_fams2 *stream_base_cmd = &cmd[i+1 ].fams2_config; +struct dmub_rb_cmd_fams2 *stream_sub_state_cmd = &cmd[i+1 +context->bw_ctx.bw.dcn.fams2_global_config.num_streams].fams2_config;/* configure command header */ - stream_cmd->header.type =DMUB_CMD__FW_ASSISTED_MCLK_SWITCH ; - stream_cmd->header.sub_type =DMUB_CMD__FAMS2_CONFIG ; - stream_cmd->header.payload_bytes =sizeof (struct dmub_rb_cmd_fams2 ) -sizeof (struct dmub_cmd_header ); - stream_cmd->header.multi_cmd_pending =1 ; - sub_state_cmd->header.type =DMUB_CMD__FW_ASSISTED_MCLK_SWITCH ; - sub_state_cmd->header.sub_type =DMUB_CMD__FAMS2_CONFIG ; - sub_state_cmd->header.payload_bytes =sizeof (struct dmub_rb_cmd_fams2 ) -sizeof (struct dmub_cmd_header ); - sub_state_cmd->header.multi_cmd_pending =1 ; -/* copy stream static state */ -memcpy (&stream_cmd->config.stream_v1.base, - &context->bw_ctx.bw.dcn.fams2_stream_params[i], -sizeof (struct dmub_fams2_cmd_stream_static_base_state )); -// TODO: Use the below memcpy call instead of the above once DML is updated -/*memcpy(&stream_cmd->config.stream_v1.base, -&context->bw_ctx.bw.dcn.fams2_stream_params[i].base, -sizeof(struct dmub_fams2_cmd_stream_static_base_state));*/ -/* copy stream sub state */ -memcpy (&stream_cmd->config.stream_v1.sub_state, - &context->bw_ctx.bw.dcn.fams2_stream_params[i].sub_state, -sizeof (union dmub_fams2_cmd_stream_static_sub_state )); + stream_base_cmd->header.type =DMUB_CMD__FW_ASSISTED_MCLK_SWITCH ; + stream_base_cmd->header.sub_type =DMUB_CMD__FAMS2_CONFIG ; + stream_base_cmd->header.payload_bytes =sizeof (struct dmub_rb_cmd_fams2 ) -sizeof (struct dmub_cmd_header ); + stream_base_cmd->header.multi_cmd_pending =1 ; + stream_sub_state_cmd->header.type =DMUB_CMD__FW_ASSISTED_MCLK_SWITCH ; + stream_sub_state_cmd->header.sub_type =DMUB_CMD__FAMS2_CONFIG ; + stream_sub_state_cmd->header.payload_bytes =sizeof (struct dmub_rb_cmd_fams2 ) -sizeof (struct dmub_cmd_header ); + stream_sub_state_cmd->header.multi_cmd_pending =1 ; +/* copy stream static base state */ +memcpy (&stream_base_cmd->config, + &context->bw_ctx.bw.dcn.fams2_stream_base_params[i], +sizeof (union dmub_cmd_fams2_config )); +/* copy stream static sub state */ +memcpy (&stream_sub_state_cmd->config, + &context->bw_ctx.bw.dcn.fams2_stream_sub_params[i], +sizeof (union dmub_cmd_fams2_config )); } }
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_utils.c +52 -28
111 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/bounding_boxes/dcn4_soc_bb.h +1 -1
@@ -354,7 +354,7 @@ static const struct dml2_ip_capabilities dml2_dcn401_max_ip_caps = { .fams2 = { .max_allow_delay_us = 100 * 1000, - .scheduling_delay_us = 125, + .scheduling_delay_us = 550, .vertical_interrupt_ack_delay_us = 40, .allow_programming_delay_us = 18, .min_allow_width_us = 20,
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/dml_top_types.h +2 -1
@@ -289,7 +289,8 @@ struct dml2_per_stream_programming {union dml2_global_sync_programming global_sync; } phantom_stream; -struct dmub_fams2_stream_static_state fams2_params; +union dmub_cmd_fams2_config fams2_base_params; +union dmub_cmd_fams2_config fams2_sub_params; };//-----------------
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4.c +2 -1
@@ -360,7 +360,8 @@ static void pack_mode_programming_params_with_implicit_subvp(struct dml2_core_in/* unconditionally populate fams2 params */ dml2_core_calcs_get_stream_fams2_programming (&core->clean_me_up.mode_lib, display_cfg, - &programming->stream_programming[main_plane->stream_index].fams2_params, + &programming->stream_programming[main_plane->stream_index].fams2_base_params, + &programming->stream_programming[main_plane->stream_index].fams2_sub_params, programming->stream_programming[main_plane->stream_index].uclk_pstate_method, plane_index);
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c +47 -43
161 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.h +1 -1
@@ -28,7 +28,7 @@ void dml2_core_calcs_get_plane_support_info(const struct dml2_display_cfg *displvoid dml2_core_calcs_get_informative (const struct dml2_core_internal_display_mode_lib *mode_lib,struct dml2_display_cfg_programming *out);void dml2_core_calcs_get_stream_support_info (const struct dml2_display_cfg *display_cfg,const struct dml2_core_internal_display_mode_lib *mode_lib,struct core_stream_support_info *out,int plane_index);void dml2_core_calcs_get_mall_allocation (struct dml2_core_internal_display_mode_lib *mode_lib,unsigned int *out,int pipe_index); -void dml2_core_calcs_get_stream_fams2_programming (const struct dml2_core_internal_display_mode_lib *mode_lib,const struct display_configuation_with_meta *display_cfg,struct dmub_fams2_stream_static_state *fams2_programming,enum dml2_uclk_pstate_support_method pstate_method,int plane_index); +void dml2_core_calcs_get_stream_fams2_programming (const struct dml2_core_internal_display_mode_lib *mode_lib,const struct display_configuation_with_meta *display_cfg,union dmub_cmd_fams2_config *fams2_base_programming,union dmub_cmd_fams2_config *fams2_sub_programming,enum dml2_uclk_pstate_support_method pstate_method,int plane_index);void dml2_core_calcs_get_global_fams2_programming (const struct dml2_core_internal_display_mode_lib *mode_lib,const struct display_configuation_with_meta *display_cfg,struct dmub_cmd_fams2_global_config *fams2_global_config);void dml2_core_calcs_get_dpte_row_height (unsigned int *dpte_row_height,struct dml2_core_internal_display_mode_lib *mode_lib,bool is_plane1,enum dml2_source_format_class SourcePixelFormat,enum dml2_swizzle_mode SurfaceTiling,enum dml2_rotation_angle ScanDirection,unsigned int pitch,unsigned int GPUVMMinPageSizeKBytes);
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +2 -1
@@ -435,7 +435,8 @@ void dcn401_init_hw(struct dc *dc) dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr; dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch_ver >0 ; dc->caps.dmub_caps.fams_ver = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch_ver; - dc->debug.fams2_config.bits.enable &= dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch_ver ==2 ; + dc->debug.fams2_config.bits.enable &= + dc->caps.dmub_caps.fams_ver == dc->debug.fams_version.ver;// sw & fw fams versions must match for support if ((!dc->debug.fams2_config.bits.enable && dc->res_pool->funcs->update_bw_bounding_box) || res_pool->ref_clocks.dchub_ref_clock_inKhz /1000 != current_dchub_ref_freq) {/* update bounding box if FAMS2 disabled, or if dchub clk has changed */
drivers/gpu/drm/amd/display/dc/inc/core_types.h +2 -2
@@ -539,8 +539,8 @@ struct dcn_bw_output {bool legacy_svp_drr_stream_index_valid;struct dml2_mcache_surface_allocation mcache_allocations[DML2_MAX_PLANES ];struct dmub_cmd_fams2_global_config fams2_global_config; -struct dmub_fams2_stream_static_state fams2_stream_params[DML2_MAX_PLANES ]; -/*struct dmub_fams2_stream_static_state_v1 fams2_stream_params[DML2_MAX_PLANES];*/ // TODO: Update to this once DML is updated +union dmub_cmd_fams2_config fams2_stream_base_params[DML2_MAX_PLANES ]; +union dmub_cmd_fams2_config fams2_stream_sub_params[DML2_MAX_PLANES ];struct dml2_display_arb_regs arb_regs; };
drivers/gpu/drm/amd/display/dc/optc/dcn401/dcn401_optc.c +2 -2
@@ -315,7 +315,7 @@ void optc401_set_drr(struct drr_params amended_params = {0 };bool program_manual_trigger = false; -if (dc->caps.dmub_caps.fams_ver >=2 && dc->debug.fams2_config.bits.enable) { +if (dc->caps.dmub_caps.fams_ver == dc->debug.fams_version.ver && dc->debug.fams2_config.bits.enable) {if (params !=NULL && params->vertical_total_max >0 && params->vertical_total_min >0 ) {
@@ -380,7 +380,7 @@ void optc401_set_vtotal_min_max(struct timing_generator *optc, int vtotal_min, i {struct dc *dc = optc->ctx->dc; -if (dc->caps.dmub_caps.fams_ver >=2 && dc->debug.fams2_config.bits.enable) { +if (dc->caps.dmub_caps.fams_ver == dc->debug.fams_version.ver && dc->debug.fams2_config.bits.enable) {/* FAMS2 */ dc_dmub_srv_fams2_drr_update(dc, optc->inst, vtotal_min,
drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c +4 -0
@@ -726,6 +726,10 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_unbounded_requesting = false, .enable_legacy_fast_update = false, .dcc_meta_propagation_delay_us = 10, + .fams_version = { + .minor = 1, + .major = 2, + }, //v2.1 .fams2_config = { .bits = { .enable = true,
Signature · 1 line
2.45.2
PATCH 3/17 drm/amd/display: initialize uninitialized variable
In reply to Rodrigo SiqueiraFrom: Meerpate Patel <[email protected]>
[WHY]
There is one uninitialized variable in file dc/hwss/dcn401/dcn401_hwseq.c, which trigger com compile warnings.
[HOW]
Initialize the unininitialized variable.
--- drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +1 -1
@@ -822,7 +822,7 @@ enum dc_status dcn401_enable_stream_timing(int opp_inst[MAX_PIPES ] = {0 };struct pipe_ctx *opp_heads[MAX_PIPES ] = {0 };struct dc_crtc_timing patched_crtc_timing = stream->timing; -bool manual_mode; +bool manual_mode = false;unsigned int tmds_div =PIXEL_RATE_DIV_NA ;unsigned int unused_div =PIXEL_RATE_DIV_NA ;int odm_slice_width;
Signature · 1 line
2.45.2
PATCH 4/17 drm/amd/display: init dc_power_state
In reply to Rodrigo SiqueiraFrom: Charlene Liu <[email protected]>
Initialize the power state for dc use
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +4 -2
@@ -5311,11 +5311,13 @@ void dc_set_power_state(struct dc *dc, enum dc_acpi_cm_power_state power_state) dc->vm_pa_config.valid) { dc->hwss.init_sys_ctx (dc->hwseq, dc, &dc->vm_pa_config); } - +/*mark d0 last*/ + dc->power_state = power_state;break ;default :ASSERT (dc->current_state->stream_count ==0 ); - +/*mark d3 first*/ + dc->power_state = power_state;dc_dmub_srv_notify_fw_dc_power_state (dc->ctx->dmub_srv, power_state);dc_state_destruct (dc->current_state);
Signature · 1 line
2.45.2
PATCH 5/17 drm/amd/display: Fix Mode Cutoff in DSC Passthrough to DP2.1 Monitor
In reply to Rodrigo SiqueiraFrom: Fangzhi Zuo <[email protected]>
Source --> DP2.1 MST hub --> DP1.4/2.1 monitor
When change from DP1.4 to DP2.1 from monitor manual, modes higher than 4k120 are all cutoff by mode validation. Switch back to DP1.4 gets all the modes up to 4k240 available to be enabled by dsc passthrough.
[why]
Compared to DP1.4 link from hub to monitor, DP2.1 link has larger full_pbn value that causes overflow in the process of doing conversion from pbn to kbps.
[how]
Change the data type accordingly to fit into the data limit during conversion calculation.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +3 -3
@@ -1688,16 +1688,16 @@ int pre_validate_dsc(struct drm_atomic_state *state,return ret; } -static unsigned int kbps_from_pbn (unsigned int pbn) +static uint32_t kbps_from_pbn (unsigned int pbn) { -unsigned int kbps = pbn; +uint64_t kbps = (uint64_t )pbn; kbps *= (1000000 /PEAK_FACTOR_X1000 ); kbps *=8 ; kbps *=54 ; kbps /=64 ; -return kbps; +return (uint32_t )kbps; } static bool is_dsc_common_config_possible(struct dc_stream_state *stream,
Signature · 1 line
2.45.2
PATCH 6/17 drm/amd/display: Fix brightness adjustment on MiniLED
In reply to Rodrigo SiqueiraFrom: Harry VanZyllDeJong <[email protected]>
[Why]
Older Asics were changed to target new DCN while still needing older support causing brightness adjustments to fail.
[How]
Reverted the DCN targets on required DCNs
--- drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_init.c | 2 +- drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_init.c +1 -1
@@ -97,7 +97,7 @@ static const struct hw_sequencer_funcs dcn31_funcs = { .set_flip_control_gsl = dcn20_set_flip_control_gsl, .get_vupdate_offset_from_vsync = dcn10_get_vupdate_offset_from_vsync, .calc_vupdate_position = dcn10_calc_vupdate_position, - .set_backlight_level = dcn31_set_backlight_level, + .set_backlight_level = dcn21_set_backlight_level, .set_abm_immediate_disable = dcn21_set_abm_immediate_disable, .set_pipe = dcn21_set_pipe, .enable_lvds_link_output = dce110_enable_lvds_link_output,
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c +1 -1
@@ -99,7 +99,7 @@ static const struct hw_sequencer_funcs dcn314_funcs = { .set_flip_control_gsl = dcn20_set_flip_control_gsl, .get_vupdate_offset_from_vsync = dcn10_get_vupdate_offset_from_vsync, .calc_vupdate_position = dcn10_calc_vupdate_position, - .set_backlight_level = dcn31_set_backlight_level, + .set_backlight_level = dcn21_set_backlight_level, .set_abm_immediate_disable = dcn21_set_abm_immediate_disable, .set_pipe = dcn21_set_pipe, .enable_lvds_link_output = dce110_enable_lvds_link_output,
Signature · 1 line
2.45.2
PATCH 7/17 drm/amd/display: DML21 Reintegration For Various Fixes
In reply to Rodrigo SiqueiraFrom: Austin Zheng <[email protected]>
Reintegrate latest DML21 code.
---
drivers/gpu/drm/amd/display/dc/dml2/Makefile | 15 +-
.../amd/display/dc/dml2/display_mode_core.c | 6 +-
.../dc/dml2/display_mode_core_structs.h | 103 +-
.../amd/display/dc/dml2/display_mode_util.c | 6 +-
.../dc/dml2/dml21/dml21_translation_helper.c | 14 +-
.../dml21/inc/bounding_boxes/dcn4_soc_bb.h | 1 +
.../dml21/inc/dml_top_display_cfg_types.h | 52 +-
.../dml21/inc/dml_top_soc_parameter_types.h | 2 +
.../display/dc/dml2/dml21/inc/dml_top_types.h | 69 +-
.../dml2/dml21/src/dml2_core/dml2_core_dcn4.c | 39 +-
.../src/dml2_core/dml2_core_dcn4_calcs.c | 1214 +++++++++++------
.../src/dml2_core/dml2_core_dcn4_calcs.h | 2 +-
.../src/dml2_core/dml2_core_shared_types.h | 129 +-
.../dml21/src/dml2_core/dml2_core_utils.c | 223 ++-
.../dml21/src/dml2_core/dml2_core_utils.h | 6 +-
.../dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c | 6 +-
.../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c | 394 ++++--
.../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.h | 7 +
.../dml21/src/dml2_pmo/dml2_pmo_factory.c | 1 -
.../dml21/src/dml2_top/dml2_top_interfaces.c | 51 +
.../dml2/dml21/src/dml2_top/dml2_top_legacy.c | 4 +
.../dml2/dml21/src/dml2_top/dml2_top_legacy.h | 9 +
.../src/dml2_top/dml2_top_optimization.c | 307 -----
.../src/dml2_top/dml2_top_optimization.h | 33 -
.../dml2/dml21/src/dml2_top/dml2_top_soc15.c | 1177 ++++++++++++++++
.../{dml_top_mcache.h => dml2_top_soc15.h} | 20 +-
.../dml2/dml21/src/dml2_top/dml_top_mcache.c | 549 --------
.../dc/dml2/dml21/src/inc/dml2_debug.c | 5 +
.../dc/dml2/dml21/src/inc/dml2_debug.h | 46 +-
.../src/inc/dml2_internal_shared_types.h | 60 +-
30 files changed, 2819 insertions(+), 1731 deletions(-)
create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_interfaces.c
create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_legacy.c
create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_legacy.h
delete mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_optimization.c
delete mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_optimization.h
create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_soc15.c
rename drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/{dml_top_mcache.h => dml2_top_soc15.h} (58%)
delete mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml_top_mcache.cdrivers/gpu/drm/amd/display/dc/dml2/Makefile +6 -9
@@ -73,9 +73,8 @@ AMD_DAL_DML2 = $(addprefix $(AMDDALPATH)/dc/dml2/,$(DML2)) AMD_DISPLAY_FILES += $(AMD_DAL_DML2) -CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_top/dml_top.o := $(dml2_ccflags) -CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_top/dml_top_mcache.o := $(dml2_ccflags) -CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_top/dml2_top_optimization := $(dml2_ccflags) +CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_top/dml2_top_interfaces.o := $(dml2_ccflags) +CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_top/dml2_top_soc15.o := $(dml2_ccflags) CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4.o := $(dml2_ccflags) CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.o := $(dml2_ccflags) $(frame_warn_flag) CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_core/dml2_core_factory.o := $(dml2_ccflags)
@@ -94,9 +93,8 @@ CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/dml21_translation_helper.o := $(dml2_ccflags) CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/dml21_utils.o := $(dml2_ccflags) CFLAGS_$(AMDDALPATH)/dc/dml2/dml21/inc/dml2_debug.o := $(dml2_ccflags) -CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_top/dml_top.o := $(dml2_rcflags) -CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_top/dml_top_mcache.o := $(dml2_rcflags) -CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_top/dml2_top_optimization.o := $(dml2_rcflags) +CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_top/dml2_top_interfaces.o := $(dml2_rcflags) +CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_top/dml2_top_soc15.o := $(dml2_rcflags) CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4.o := $(dml2_rcflags) CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.o := $(dml2_rcflags) CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/src/dml2_core/dml2_core_factory.o := $(dml2_rcflags)
@@ -113,9 +111,8 @@ CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/dml21_translation_helper.o := $(dml2_r CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/dml21_utils.o := $(dml2_rcflags) CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml2/dml21/inc/dml2_debug.o := $(dml2_rcflags) -DML21 := src/dml2_top/dml_top.o -DML21 += src/dml2_top/dml_top_mcache.o -DML21 += src/dml2_top/dml2_top_optimization.o +DML21 := src/dml2_top/dml2_top_interfaces.o +DML21 += src/dml2_top/dml2_top_soc15.o DML21 += src/inc/dml2_debug.o DML21 += src/dml2_core/dml2_core_dcn4.o DML21 += src/dml2_core/dml2_core_factory.o
drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c +3 -3
@@ -8318,7 +8318,7 @@ void dml_core_mode_programming(struct display_mode_lib_st *mode_lib, const strucif (clk_cfg->dcfclk_option != dml_use_override_freq) locals->Dcfclk = mode_lib->ms.DCFCLK;else - locals->Dcfclk = clk_cfg->dcfclk_freq_mhz; + locals->Dcfclk = clk_cfg->dcfclk_mhz;#ifdef __DML_VBA_DEBUG__dml_print_dml_policy (&mode_lib->ms.policy);
@@ -8371,7 +8371,7 @@ void dml_core_mode_programming(struct display_mode_lib_st *mode_lib, const strucif (clk_cfg->dispclk_option == dml_use_required_freq) locals->Dispclk = locals->Dispclk_calculated;else if (clk_cfg->dispclk_option == dml_use_override_freq) - locals->Dispclk = clk_cfg->dispclk_freq_mhz; + locals->Dispclk = clk_cfg->dispclk_mhz;else locals->Dispclk = mode_lib->ms.state.dispclk_mhz;#ifdef __DML_VBA_DEBUG__
@@ -8412,7 +8412,7 @@ void dml_core_mode_programming(struct display_mode_lib_st *mode_lib, const strucif (clk_cfg->dppclk_option[k] == dml_use_required_freq) locals->Dppclk[k] = locals->Dppclk_calculated[k];else if (clk_cfg->dppclk_option[k] == dml_use_override_freq) - locals->Dppclk[k] = clk_cfg->dppclk_freq_mhz[k]; + locals->Dppclk[k] = clk_cfg->dppclk_mhz[k];else locals->Dppclk[k] = mode_lib->ms.state.dppclk_mhz;#ifdef __DML_VBA_DEBUG__
drivers/gpu/drm/amd/display/dc/dml2/display_mode_core_structs.h +80 -23
180 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/display_mode_util.c +3 -3
@@ -690,12 +690,12 @@ __DML_DLL_EXPORT__ void dml_print_clk_cfg(const struct dml_clk_cfg_st *clk_cfg)dml_print ("DML: clk_cfg: dcfclk_option = %d\n" , clk_cfg->dcfclk_option);dml_print ("DML: clk_cfg: dispclk_option = %d\n" , clk_cfg->dispclk_option); -dml_print ("DML: clk_cfg: dcfclk_freq_mhz = %f\n" , clk_cfg->dcfclk_freq_mhz); -dml_print ("DML: clk_cfg: dispclk_freq_mhz = %f\n" , clk_cfg->dispclk_freq_mhz); +dml_print ("DML: clk_cfg: dcfclk_mhz = %f\n" , clk_cfg->dcfclk_mhz); +dml_print ("DML: clk_cfg: dispclk_mhz = %f\n" , clk_cfg->dispclk_mhz);for (dml_uint_t i =0 ; i <DCN_DML__NUM_PLANE ; i++) {dml_print ("DML: clk_cfg: i=%d, dppclk_option = %d\n" , i, clk_cfg->dppclk_option[i]); -dml_print ("DML: clk_cfg: i=%d, dppclk_freq_mhz = %f\n" , i, clk_cfg->dppclk_freq_mhz[i]); +dml_print ("DML: clk_cfg: i=%d, dppclk_mhz = %f\n" , i, clk_cfg->dppclk_mhz[i]); } }
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c +7 -7
@@ -1226,22 +1226,22 @@ void dml21_set_dc_p_state_type( bool sub_vp_enabled) {switch (stream_programming->uclk_pstate_method) { -case dml2_uclk_pstate_support_method_vactive: -case dml2_uclk_pstate_support_method_fw_vactive_drr: +case dml2_pstate_method_vactive: +case dml2_pstate_method_fw_vactive_drr: pipe_ctx->p_state_type =P_STATE_V_ACTIVE ;break ; -case dml2_uclk_pstate_support_method_vblank: -case dml2_uclk_pstate_support_method_fw_vblank_drr: +case dml2_pstate_method_vblank: +case dml2_pstate_method_fw_vblank_drr:if (sub_vp_enabled) pipe_ctx->p_state_type =P_STATE_V_BLANK_SUB_VP ;else pipe_ctx->p_state_type =P_STATE_V_BLANK ;break ; -case dml2_uclk_pstate_support_method_fw_subvp_phantom: -case dml2_uclk_pstate_support_method_fw_subvp_phantom_drr: +case dml2_pstate_method_fw_svp: +case dml2_pstate_method_fw_svp_drr: pipe_ctx->p_state_type =P_STATE_SUB_VP ;break ; -case dml2_uclk_pstate_support_method_fw_drr: +case dml2_pstate_method_fw_drr:if (sub_vp_enabled) pipe_ctx->p_state_type =P_STATE_DRR_SUB_VP ;else
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/bounding_boxes/dcn4_soc_bb.h +1 -0
@@ -344,6 +344,7 @@ static const struct dml2_ip_capabilities dml2_dcn401_max_ip_caps = { .config_return_buffer_segment_size_in_kbytes = 64, .meta_fifo_size_in_kentries = 22, .compressed_buffer_segment_size_in_kbytes = 64, + .cursor_buffer_size = 24, .max_flip_time_us = 80, .max_flip_time_lines = 32, .hostvm_mode = 0,
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/dml_top_display_cfg_types.h +26 -26
86 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/dml_top_soc_parameter_types.h +2 -0
@@ -167,11 +167,13 @@ struct dml2_ip_capabilities {unsigned int max_num_dp2p0_streams;unsigned int max_num_hdmi_frl_outputs;unsigned int max_num_dp2p0_outputs; +unsigned int max_num_wb;unsigned int rob_buffer_size_kbytes;unsigned int config_return_buffer_size_in_kbytes;unsigned int config_return_buffer_segment_size_in_kbytes;unsigned int meta_fifo_size_in_kentries;unsigned int compressed_buffer_segment_size_in_kbytes; +unsigned int cursor_buffer_size;unsigned int max_flip_time_us;unsigned int max_flip_time_lines;unsigned int hostvm_mode;
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/dml_top_types.h +33 -36
129 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4.c +11 -28
@@ -9,7 +9,7 @@#include "dml2_debug.h" #include "lib_float_math.h" -static const struct dml2_core_ip_params core_dcn4_ip_caps_base = { +struct dml2_core_ip_params core_dcn4_ip_caps_base = {// Hardcoded values for DCN3x .vblank_nom_default_us =668 , .remote_iommu_outstanding_translations =256 ,
@@ -90,6 +90,7 @@ static void patch_ip_caps_with_explicit_ip_params(struct dml2_ip_capabilities *i ip_caps->config_return_buffer_segment_size_in_kbytes = ip_params->config_return_buffer_segment_size_in_kbytes; ip_caps->meta_fifo_size_in_kentries = ip_params->meta_fifo_size_in_kentries; ip_caps->compressed_buffer_segment_size_in_kbytes = ip_params->compressed_buffer_segment_size_in_kbytes; + ip_caps->cursor_buffer_size = ip_params->cursor_buffer_size; ip_caps->max_flip_time_us = ip_params->max_flip_time_us; ip_caps->max_flip_time_lines = ip_params->max_flip_time_lines; ip_caps->hostvm_mode = ip_params->hostvm_mode;
@@ -114,6 +115,7 @@ static void patch_ip_params_with_ip_caps(struct dml2_core_ip_params *ip_params, ip_params->config_return_buffer_segment_size_in_kbytes = ip_caps->config_return_buffer_segment_size_in_kbytes; ip_params->meta_fifo_size_in_kentries = ip_caps->meta_fifo_size_in_kentries; ip_params->compressed_buffer_segment_size_in_kbytes = ip_caps->compressed_buffer_segment_size_in_kbytes; + ip_params->cursor_buffer_size = ip_caps->cursor_buffer_size; ip_params->max_flip_time_us = ip_caps->max_flip_time_us; ip_params->max_flip_time_lines = ip_caps->max_flip_time_lines; ip_params->hostvm_mode = ip_caps->hostvm_mode;
@@ -316,28 +318,9 @@ static void pack_mode_programming_params_with_implicit_subvp(struct dml2_core_in// Setup the appropriate p-state strategy if (display_cfg->stage3.performed && display_cfg->stage3.success) { -switch (display_cfg->stage3.pstate_switch_modes[plane_index]) { -case dml2_uclk_pstate_support_method_vactive: -case dml2_uclk_pstate_support_method_vblank: -case dml2_uclk_pstate_support_method_fw_subvp_phantom: -case dml2_uclk_pstate_support_method_fw_drr: -case dml2_uclk_pstate_support_method_fw_vactive_drr: -case dml2_uclk_pstate_support_method_fw_vblank_drr: -case dml2_uclk_pstate_support_method_fw_subvp_phantom_drr: - programming->plane_programming[plane_index].uclk_pstate_support_method = display_cfg->stage3.pstate_switch_modes[plane_index]; -break ; -case dml2_uclk_pstate_support_method_reserved_hw: -case dml2_uclk_pstate_support_method_reserved_fw: -case dml2_uclk_pstate_support_method_reserved_fw_drr_fixed: -case dml2_uclk_pstate_support_method_reserved_fw_drr_var: -case dml2_uclk_pstate_support_method_not_supported: -case dml2_uclk_pstate_support_method_count: -default : - programming->plane_programming[plane_index].uclk_pstate_support_method = dml2_uclk_pstate_support_method_not_supported; -break ; - } + programming->plane_programming[plane_index].uclk_pstate_support_method = display_cfg->stage3.pstate_switch_modes[plane_index]; }else { - programming->plane_programming[plane_index].uclk_pstate_support_method = dml2_uclk_pstate_support_method_not_supported; + programming->plane_programming[plane_index].uclk_pstate_support_method = dml2_pstate_method_na; }dml2_core_calcs_get_mall_allocation (&core->clean_me_up.mode_lib, &programming->plane_programming[plane_index].surface_size_mall_bytes, dml_internal_pipe_index);
@@ -573,18 +556,18 @@ bool core_dcn4_mode_programming(struct dml2_core_mode_programming_in_out *in_out in_out->programming->plane_programming[plane_index].num_dpps_required = core->clean_me_up.mode_lib.mp.NoOfDPP[plane_index];if (in_out->programming->display_config.plane_descriptors[plane_index].overrides.legacy_svp_config == dml2_svp_mode_override_main_pipe) - in_out->programming->plane_programming[plane_index].uclk_pstate_support_method = dml2_uclk_pstate_support_method_fw_subvp_phantom; + in_out->programming->plane_programming[plane_index].uclk_pstate_support_method = dml2_pstate_method_fw_svp;else if (in_out->programming->display_config.plane_descriptors[plane_index].overrides.legacy_svp_config == dml2_svp_mode_override_phantom_pipe) - in_out->programming->plane_programming[plane_index].uclk_pstate_support_method = dml2_uclk_pstate_support_method_fw_subvp_phantom; + in_out->programming->plane_programming[plane_index].uclk_pstate_support_method = dml2_pstate_method_fw_svp;else if (in_out->programming->display_config.plane_descriptors[plane_index].overrides.legacy_svp_config == dml2_svp_mode_override_phantom_pipe_no_data_return) - in_out->programming->plane_programming[plane_index].uclk_pstate_support_method = dml2_uclk_pstate_support_method_fw_subvp_phantom; + in_out->programming->plane_programming[plane_index].uclk_pstate_support_method = dml2_pstate_method_fw_svp;else {if (core->clean_me_up.mode_lib.mp.MaxActiveDRAMClockChangeLatencySupported[plane_index] >= core->clean_me_up.mode_lib.soc.power_management_parameters.dram_clk_change_blackout_us) - in_out->programming->plane_programming[plane_index].uclk_pstate_support_method = dml2_uclk_pstate_support_method_vactive; + in_out->programming->plane_programming[plane_index].uclk_pstate_support_method = dml2_pstate_method_vactive;else if (core->clean_me_up.mode_lib.mp.TWait[plane_index] >= core->clean_me_up.mode_lib.soc.power_management_parameters.dram_clk_change_blackout_us) - in_out->programming->plane_programming[plane_index].uclk_pstate_support_method = dml2_uclk_pstate_support_method_vblank; + in_out->programming->plane_programming[plane_index].uclk_pstate_support_method = dml2_pstate_method_vblank;else - in_out->programming->plane_programming[plane_index].uclk_pstate_support_method = dml2_uclk_pstate_support_method_not_supported; + in_out->programming->plane_programming[plane_index].uclk_pstate_support_method = dml2_pstate_method_na; }dml2_core_calcs_get_mall_allocation (&core->clean_me_up.mode_lib, &in_out->programming->plane_programming[plane_index].surface_size_mall_bytes, dml_internal_pipe_index);
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c +777 -437
2,014 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.h +1 -1
@@ -28,7 +28,7 @@ void dml2_core_calcs_get_plane_support_info(const struct dml2_display_cfg *displvoid dml2_core_calcs_get_informative (const struct dml2_core_internal_display_mode_lib *mode_lib,struct dml2_display_cfg_programming *out);void dml2_core_calcs_get_stream_support_info (const struct dml2_display_cfg *display_cfg,const struct dml2_core_internal_display_mode_lib *mode_lib,struct core_stream_support_info *out,int plane_index);void dml2_core_calcs_get_mall_allocation (struct dml2_core_internal_display_mode_lib *mode_lib,unsigned int *out,int pipe_index); -void dml2_core_calcs_get_stream_fams2_programming (const struct dml2_core_internal_display_mode_lib *mode_lib,const struct display_configuation_with_meta *display_cfg,union dmub_cmd_fams2_config *fams2_base_programming,union dmub_cmd_fams2_config *fams2_sub_programming,enum dml2_uclk_pstate_support_method pstate_method,int plane_index); +void dml2_core_calcs_get_stream_fams2_programming (const struct dml2_core_internal_display_mode_lib *mode_lib,const struct display_configuation_with_meta *display_cfg,union dmub_cmd_fams2_config *fams2_base_programming,union dmub_cmd_fams2_config *fams2_sub_programming,enum dml2_pstate_method pstate_method,int plane_index);void dml2_core_calcs_get_global_fams2_programming (const struct dml2_core_internal_display_mode_lib *mode_lib,const struct display_configuation_with_meta *display_cfg,struct dmub_cmd_fams2_global_config *fams2_global_config);void dml2_core_calcs_get_dpte_row_height (unsigned int *dpte_row_height,struct dml2_core_internal_display_mode_lib *mode_lib,bool is_plane1,enum dml2_source_format_class SourcePixelFormat,enum dml2_swizzle_mode SurfaceTiling,enum dml2_rotation_angle ScanDirection,unsigned int pitch,unsigned int GPUVMMinPageSizeKBytes);
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_shared_types.h +100 -29
317 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_utils.c +188 -35
69 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_utils.h +5 -1
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c +247 -147
394 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.h +7 -0
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_factory.c +0 -1
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_interfaces.c new file +51 -0
51 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_legacy.c new file +4 -0
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_legacy.h new file +9 -0
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_optimization.c deleted +0 -307
307 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_optimization.h deleted +0 -33
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_soc15.c new file +1177 -0
1,177 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_soc15.h renamed from drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml_top_mcache.h +5 -15
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml_top_mcache.c deleted +0 -549
549 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/inc/dml2_debug.c +5 -0
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/inc/dml2_debug.h +45 -1
46 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/inc/dml2_internal_shared_types.h +23 -37
60 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.45.2
Part of the diff is not shown here. View the raw message.
PATCH 8/17 drm/amd/display: Add new message for DF throttling optimization on dcn401
In reply to Rodrigo SiqueiraFrom: Dillon Varone <[email protected]>
[WHY]
When effective bandwidth from the SoC is enough to perform SubVP prefetchs, then DF throttling is not required.
[HOW]
Provide SMU the required clocks for which DF throttling is not required.
--- .../dc/clk_mgr/dcn401/dcn401_clk_mgr.c | 46 +++++++++++++++++++ .../dc/clk_mgr/dcn401/dcn401_clk_mgr.h | 1 + .../clk_mgr/dcn401/dcn401_clk_mgr_smu_msg.c | 23 ++++++++++ .../clk_mgr/dcn401/dcn401_clk_mgr_smu_msg.h | 3 ++ drivers/gpu/drm/amd/display/dc/dc.h | 3 ++ .../dc/dml2/dml21/dml21_translation_helper.c | 2 + .../display/dc/dml2/dml21/inc/dml_top_types.h | 5 ++ .../dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c | 43 +++++++++++++++++ 8 files changed, 126 insertions(+)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c +46 -0
@@ -141,6 +141,20 @@ static bool dcn401_is_ppclk_idle_dpm_enabled(struct clk_mgr_internal *clk_mgr, Preturn ppclk_idle_dpm_enabled; } +static bool dcn401_is_df_throttle_opt_enabled (struct clk_mgr_internal *clk_mgr) +{ +bool is_df_throttle_opt_enabled = false; + +if (ASICREV_IS_GC_12_0_1_A0 (clk_mgr->base.ctx->asic_id.hw_internal_rev) && + clk_mgr->smu_ver >=0x663500 ) { + is_df_throttle_opt_enabled = !clk_mgr->base.ctx->dc->debug.force_subvp_df_throttle; + } + + is_df_throttle_opt_enabled &= clk_mgr->smu_present; + +return is_df_throttle_opt_enabled; +} +/* Query SMU for all clock states for a particular clock */ static void dcn401_init_single_clock (struct clk_mgr_internal *clk_mgr,PPCLK_e clk,unsigned int *entry_0,unsigned int *num_levels)
@@ -869,6 +883,12 @@ static void dcn401_execute_block_sequence(struct clk_mgr *clk_mgr_base, unsigned params->update_idle_hardmin_params.uclk_mhz, params->update_idle_hardmin_params.fclk_mhz);break ; +case CLK_MGR401_UPDATE_SUBVP_HARDMINS : +dcn401_smu_set_subvp_uclk_fclk_hardmin ( + clk_mgr_internal, + params->update_idle_hardmin_params.uclk_mhz, + params->update_idle_hardmin_params.fclk_mhz); +break ;case CLK_MGR401_UPDATE_DEEP_SLEEP_DCFCLK : dcn401_smu_set_min_deep_sleep_dcef_clk( clk_mgr_internal,
@@ -945,15 +965,21 @@ static unsigned int dcn401_build_update_bandwidth_clocks_sequence(bool update_active_uclk = false;bool update_idle_fclk = false;bool update_idle_uclk = false; +bool update_subvp_prefetch_dramclk = false; +bool update_subvp_prefetch_fclk = false;bool is_idle_dpm_enabled =dcn401_is_ppclk_dpm_enabled (clk_mgr_internal,PPCLK_UCLK ) &&dcn401_is_ppclk_dpm_enabled (clk_mgr_internal,PPCLK_FCLK ) &&dcn401_is_ppclk_idle_dpm_enabled (clk_mgr_internal,PPCLK_UCLK ) &&dcn401_is_ppclk_idle_dpm_enabled (clk_mgr_internal,PPCLK_FCLK ); +bool is_df_throttle_opt_enabled = is_idle_dpm_enabled && +dcn401_is_df_throttle_opt_enabled (clk_mgr_internal);int total_plane_count =clk_mgr_helper_get_active_plane_cnt (dc, context);int active_uclk_mhz =khz_to_mhz_ceil (clk_mgr_base->clks.dramclk_khz);int active_fclk_mhz =khz_to_mhz_ceil (clk_mgr_base->clks.fclk_khz);int idle_uclk_mhz =khz_to_mhz_ceil (clk_mgr_base->clks.idle_dramclk_khz);int idle_fclk_mhz =khz_to_mhz_ceil (clk_mgr_base->clks.idle_fclk_khz); +int subvp_prefetch_dramclk_mhz =khz_to_mhz_ceil (clk_mgr_base->clks.subvp_prefetch_dramclk_khz); +int subvp_prefetch_fclk_mhz =khz_to_mhz_ceil (clk_mgr_base->clks.subvp_prefetch_fclk_khz);unsigned int num_steps =0 ;
@@ -1109,6 +1135,12 @@ static unsigned int dcn401_build_update_bandwidth_clocks_sequence( } } +if (should_set_clock (safe_to_lower, new_clocks->subvp_prefetch_dramclk_khz, clk_mgr_base->clks.subvp_prefetch_dramclk_khz)) { + clk_mgr_base->clks.subvp_prefetch_dramclk_khz = new_clocks->subvp_prefetch_dramclk_khz; + update_subvp_prefetch_dramclk = true; + subvp_prefetch_dramclk_mhz =khz_to_mhz_ceil (clk_mgr_base->clks.subvp_prefetch_dramclk_khz); + } +/* FCLK */ /* Always update saved value, even if new value not set due to P-State switching unsupported */ if (should_set_clock (safe_to_lower, new_clocks->fclk_khz, clk_mgr_base->clks.fclk_khz)) {
@@ -1129,6 +1161,12 @@ static unsigned int dcn401_build_update_bandwidth_clocks_sequence( } } +if (should_set_clock (safe_to_lower, new_clocks->subvp_prefetch_fclk_khz, clk_mgr_base->clks.subvp_prefetch_fclk_khz)) { + clk_mgr_base->clks.subvp_prefetch_fclk_khz = new_clocks->subvp_prefetch_fclk_khz; + update_subvp_prefetch_fclk = true; + subvp_prefetch_fclk_mhz =khz_to_mhz_ceil (clk_mgr_base->clks.subvp_prefetch_fclk_khz); + } +/* When idle DPM is enabled, need to send active and idle hardmins separately */ /* CLK_MGR401_UPDATE_ACTIVE_HARDMINS */ if ((update_active_uclk || update_active_fclk) && is_idle_dpm_enabled) {
@@ -1146,6 +1184,14 @@ static unsigned int dcn401_build_update_bandwidth_clocks_sequence( num_steps++; } +/* CLK_MGR401_UPDATE_SUBVP_HARDMINS */ +if ((update_subvp_prefetch_dramclk || update_subvp_prefetch_fclk) && is_df_throttle_opt_enabled) { + block_sequence[num_steps].params.update_idle_hardmin_params.uclk_mhz = subvp_prefetch_dramclk_mhz; + block_sequence[num_steps].params.update_idle_hardmin_params.fclk_mhz = subvp_prefetch_fclk_mhz; + block_sequence[num_steps].func =CLK_MGR401_UPDATE_SUBVP_HARDMINS ; + num_steps++; + } +/* set UCLK to requested value if P-State switching is supported, or to re-enable P-State switching */ if (update_active_uclk || update_idle_uclk) {if (!is_idle_dpm_enabled) {
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.h +1 -0
@@ -90,6 +90,7 @@ enum dcn401_clk_mgr_block_sequence_func {CLK_MGR401_UPDATE_DTBCLK_DTO ,CLK_MGR401_UPDATE_DENTIST ,CLK_MGR401_UPDATE_PSR_WAIT_LOOP , + CLK_MGR401_UPDATE_SUBVP_HARDMINS, }; struct dcn401_clk_mgr_block_sequence {
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr_smu_msg.c +23 -0
@@ -21,6 +21,11 @@#define smu_print (str, ...) {DC_LOG_SMU(str, ##__VA_ARGS__); } +/* temporary define */ +#ifndef DALSMC_MSG_SubvpUclkFclk +#define DALSMC_MSG_SubvpUclkFclk 0x1B +#endif +/* * Function to be used instead of REG_WAIT macro because the wait ends when * the register is NOT EQUAL to zero, and because the translation in msg_if.h
@@ -296,6 +301,24 @@ bool dcn401_smu_set_active_uclk_fclk_hardmin(struct clk_mgr_internal *clk_mgr,return success; } +bool dcn401_smu_set_subvp_uclk_fclk_hardmin (struct clk_mgr_internal *clk_mgr, +uint16_t uclk_freq_mhz, +uint16_t fclk_freq_mhz) +{ +uint32_t response =0 ; +bool success; + +/* 15:0 for uclk, 32:16 for fclk */ +uint32_t param = (fclk_freq_mhz <<16 ) | uclk_freq_mhz; + +smu_print ("SMU Set active hardmin by freq: uclk_freq_mhz = %d MHz, fclk_freq_mhz = %d MHz\n" , uclk_freq_mhz, fclk_freq_mhz); + + success =dcn401_smu_send_msg_with_param (clk_mgr, + DALSMC_MSG_SubvpUclkFclk, param, &response); + +return success; +} +void dcn401_smu_set_min_deep_sleep_dcef_clk (struct clk_mgr_internal *clk_mgr,uint32_t freq_mhz) {smu_print ("SMU Set min deep sleep dcef clk: freq_mhz = %d MHz\n" , freq_mhz);
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr_smu_msg.h +3 -0
@@ -23,6 +23,9 @@ bool dcn401_smu_set_idle_uclk_fclk_hardmin(struct clk_mgr_internal *clk_mgr,bool dcn401_smu_set_active_uclk_fclk_hardmin (struct clk_mgr_internal *clk_mgr,uint16_t uclk_freq_mhz,uint16_t fclk_freq_mhz); +bool dcn401_smu_set_subvp_uclk_fclk_hardmin (struct clk_mgr_internal *clk_mgr, +uint16_t uclk_freq_mhz, +uint16_t fclk_freq_mhz);void dcn401_smu_set_min_deep_sleep_dcef_clk (struct clk_mgr_internal *clk_mgr,uint32_t freq_mhz);void dcn401_smu_set_num_of_displays (struct clk_mgr_internal *clk_mgr,uint32_t num_displays);
drivers/gpu/drm/amd/display/dc/dc.h +3 -0
@@ -629,6 +629,8 @@ struct dc_clocks {int bw_dispclk_khz;int idle_dramclk_khz;int idle_fclk_khz; +int subvp_prefetch_dramclk_khz; +int subvp_prefetch_fclk_khz; };struct dc_bw_validation_profile {
@@ -1072,6 +1074,7 @@ struct dc_debug_options {bool skip_full_updated_if_possible;unsigned int enable_oled_edp_power_up_opt;bool enable_hblank_borrow; +bool force_subvp_df_throttle; };
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c +2 -0
@@ -1077,6 +1077,8 @@ void dml21_copy_clocks_to_dc_state(struct dml2_context *in_ctx, struct dc_state context->bw_ctx.bw.dcn.clk.dtbclk_en = in_ctx->v21.mode_programming.programming->min_clocks.dcn4x.dtbrefclk_khz >0 ; context->bw_ctx.bw.dcn.clk.ref_dtbclk_khz = in_ctx->v21.mode_programming.programming->min_clocks.dcn4x.dtbrefclk_khz; context->bw_ctx.bw.dcn.clk.socclk_khz = in_ctx->v21.mode_programming.programming->min_clocks.dcn4x.socclk_khz; + context->bw_ctx.bw.dcn.clk.subvp_prefetch_dramclk_khz = in_ctx->v21.mode_programming.programming->min_clocks.dcn4x.svp_prefetch_no_throttle.uclk_khz; + context->bw_ctx.bw.dcn.clk.subvp_prefetch_fclk_khz = in_ctx->v21.mode_programming.programming->min_clocks.dcn4x.svp_prefetch_no_throttle.fclk_khz; }void dml21_extract_legacy_watermark_set (const struct dc *in_dc,struct dcn_watermarks *watermark,enum dml2_dchub_watermark_reg_set_index reg_set_idx,struct dml2_context *in_ctx)
drivers/gpu/drm/amd/display/dc/dml2/dml21/inc/dml_top_types.h +5 -0
@@ -387,6 +387,11 @@ struct dml2_display_cfg_programming {unsigned long fclk_khz;unsigned long dcfclk_khz; } svp_prefetch; +struct { +unsigned long uclk_khz; +unsigned long fclk_khz; +unsigned long dcfclk_khz; + } svp_prefetch_no_throttle;unsigned long deepsleep_dcfclk_khz;unsigned long dispclk_khz;
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c +43 -0
61 lines not on this page · raw message
Signature · 1 line
2.45.2
PATCH 9/17 drm/amd/display: delete legacy code
In reply to Rodrigo SiqueiraFrom: Shunlu Zhang <[email protected]>
Delete unused code.
--- .../display/dc/dml/dcn30/display_rq_dlg_calc_30.c | 1 + .../amd/display/dc/dml2/dml_display_rq_dlg_calc.c | 12 ------------ 2 files changed, 1 insertion(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn30/display_rq_dlg_calc_30.c +1 -0
@@ -1562,6 +1562,7 @@ static void dml_rq_dlg_get_dlg_params(struct display_mode_lib *mode_lib,dml_print ("DML_DLG: %s: disp_dlg_regs->dst_y_per_row_vblank = 0x%x\n" , __func__, disp_dlg_regs->dst_y_per_row_vblank);dml_print ("DML_DLG: %s: disp_dlg_regs->dst_y_per_vm_flip = 0x%x\n" , __func__, disp_dlg_regs->dst_y_per_vm_flip);dml_print ("DML_DLG: %s: disp_dlg_regs->dst_y_per_row_flip = 0x%x\n" , __func__, disp_dlg_regs->dst_y_per_row_flip); + disp_dlg_regs->refcyc_per_pte_group_vblank_l = (unsigned int )(dst_y_per_row_vblank * (double )htotal * ref_freq_to_pix_freq / (double )dpte_groups_per_row_ub_l);
drivers/gpu/drm/amd/display/dc/dml2/dml_display_rq_dlg_calc.c +0 -12
@@ -427,18 +427,6 @@ void dml_rq_dlg_get_dlg_reg(dml_display_dlg_regs_st *disp_dlg_regs,dml_print ("DML_DLG: %s: disp_dlg_regs->dst_y_per_vm_flip = 0x%x\n" , __func__, disp_dlg_regs->dst_y_per_vm_flip);dml_print ("DML_DLG: %s: disp_dlg_regs->dst_y_per_row_flip = 0x%x\n" , __func__, disp_dlg_regs->dst_y_per_row_flip); -// hack for FPGA -/* NOTE: We dont have getenv defined in driver and it does not make any sense in the driver */ -/*char* fpga_env = getenv("FPGA_FPDIV"); -if(fpga_env !=NULL) -{ -if(disp_dlg_regs->vratio_prefetch >= (dml_uint_t)dml_pow(2, 22)) -{ -disp_dlg_regs->vratio_prefetch = (dml_uint_t)dml_pow(2, 22)-1; -dml_print("FPGA msg: vratio_prefetch exceed the max value, the register field is [21:0]\n"); -} -}*/ - disp_dlg_regs->refcyc_per_vm_group_vblank = (dml_uint_t)(dml_get_refcyc_per_vm_group_vblank_in_us (mode_lib, pipe_idx) * refclk_freq_in_mhz); disp_dlg_regs->refcyc_per_vm_group_flip = (dml_uint_t)(dml_get_refcyc_per_vm_group_flip_in_us (mode_lib, pipe_idx) * refclk_freq_in_mhz); disp_dlg_regs->refcyc_per_vm_req_vblank = (dml_uint_t)(dml_get_refcyc_per_vm_req_vblank_in_us (mode_lib, pipe_idx) * refclk_freq_in_mhz *dml_pow (2 ,10 ));
Signature · 1 line
2.45.2
PATCH 10/17 drm/amd/display: Apply (some) policy for DML2 formulation on DCN35/DCN351
In reply to Rodrigo SiqueiraFrom: Nicholas Kazlauskas <[email protected]>
[Why]
Dropping the entirety of dml2_policy_build_synthetic_soc_states exposes an issue for states that cannot be filled via bbox_overrides and rely on the default parameters that may or may not be present depending on the DM.
For amdgpu_dm this results in missing parameters for most of the struct in higher states:
- sr_exit_time_us
- sr_enter_plus_exit_time_us
- sr_exit_z8_time_us
- sr_enter_plus_exit_z8_time_us
- urgent_latency_pixel_data_only_us
- urgent_latency_pixel_mixed_with_vm_data_us
- urgent_latency_vm_data_only_us
- dram_clock_change_latency_us
- fclk_change_latency_us
- usr_retraining_latency_us
- writeback_latency_us
- urgent_latency_adjustment_fabric_clock_component_us
- urgent_latency_adjustment_fabric_clock_reference_mhz
- dscclk_mhz
- phyclk_mhz
- phyclk_d18_mhz
- phyclk_d32_mhz
- use_ideal_dram_bw_strobe
[How]
Copy from the first state, applying a minimal policy to set max clocks for SOC independent values.
Then copy the SOC dependent ones from the states modified by bbox_overrides.
--- .../display/dc/dml2/dml2_translation_helper.c | 54 ++++++++++++++++--- 1 file changed, 47 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c +47 -7
@@ -553,13 +553,53 @@ void dml2_init_soc_states(struct dml2_context *dml2, const struct dc *in_dc, } } -dml2_policy_build_synthetic_soc_states (s, p); -if (dml2->v20.dml_core_ctx.project == dml_project_dcn35) { -// Override last out_state with data from last in_state -// This will ensure that out_state contains max fclk -memcpy (&p->out_states->state_array[p->out_states->num_states -1 ], - &p->in_states->state_array[p->in_states->num_states -1 ], -sizeof (struct soc_state_bounding_box_st )); +if (dml2->v20.dml_core_ctx.project == dml_project_dcn35 || + dml2->v20.dml_core_ctx.project == dml_project_dcn351) { +int max_dcfclk_mhz =0 , max_dispclk_mhz =0 , max_dppclk_mhz =0 , max_phyclk_mhz =0 , + max_dtbclk_mhz =0 , max_fclk_mhz =0 , max_uclk_mhz =0 , max_socclk_mhz =0 ; + +for (i =0 ; i < p->in_states->num_states; i++) { +if (p->in_states->state_array[i].dcfclk_mhz > max_dcfclk_mhz) + max_dcfclk_mhz = (int )p->in_states->state_array[i].dcfclk_mhz; +if (p->in_states->state_array[i].fabricclk_mhz > max_fclk_mhz) + max_fclk_mhz = (int )p->in_states->state_array[i].fabricclk_mhz; +if (p->in_states->state_array[i].socclk_mhz > max_socclk_mhz) + max_socclk_mhz = (int )p->in_states->state_array[i].socclk_mhz; +if (p->in_states->state_array[i].dram_speed_mts > max_uclk_mhz) + max_uclk_mhz = (int )p->in_states->state_array[i].dram_speed_mts; +if (p->in_states->state_array[i].dispclk_mhz > max_dispclk_mhz) + max_dispclk_mhz = (int )p->in_states->state_array[i].dispclk_mhz; +if (p->in_states->state_array[i].dppclk_mhz > max_dppclk_mhz) + max_dppclk_mhz = (int )p->in_states->state_array[i].dppclk_mhz; +if (p->in_states->state_array[i].phyclk_mhz > max_phyclk_mhz) + max_phyclk_mhz = (int )p->in_states->state_array[i].phyclk_mhz; +if (p->in_states->state_array[i].dtbclk_mhz > max_dtbclk_mhz) + max_dtbclk_mhz = (int )p->in_states->state_array[i].dtbclk_mhz; + } + +for (i =0 ; i < p->in_states->num_states; i++) { +/* Independent states - including base (unlisted) parameters from state 0. */ + p->out_states->state_array[i] = p->in_states->state_array[0 ]; + + p->out_states->state_array[i].dispclk_mhz = max_dispclk_mhz; + p->out_states->state_array[i].dppclk_mhz = max_dppclk_mhz; + p->out_states->state_array[i].dtbclk_mhz = max_dtbclk_mhz; + p->out_states->state_array[i].phyclk_mhz = max_phyclk_mhz; + + p->out_states->state_array[i].dscclk_mhz = max_dispclk_mhz /3.0 ; + p->out_states->state_array[i].phyclk_mhz = max_phyclk_mhz; + p->out_states->state_array[i].dtbclk_mhz = max_dtbclk_mhz; + +/* Dependent states. */ + p->out_states->state_array[i].dram_speed_mts = p->in_states->state_array[i].dram_speed_mts; + p->out_states->state_array[i].fabricclk_mhz = p->in_states->state_array[i].fabricclk_mhz; + p->out_states->state_array[i].socclk_mhz = p->in_states->state_array[i].socclk_mhz; + p->out_states->state_array[i].dcfclk_mhz = p->in_states->state_array[i].dcfclk_mhz; + } + + p->out_states->num_states = p->in_states->num_states; + }else { +dml2_policy_build_synthetic_soc_states (s, p); } }
Signature · 1 line
2.45.2
PATCH 11/17 drm/amd/display: Fix uninitialized variables in amdgpu_dm_debugfs
In reply to Rodrigo SiqueiraFrom: Alex Hung <[email protected]>
[WHAT]
Some fields in struct dc_link_settings and link_training_settings are not initialized and using them can cause unexpected results.
[HOW]
Initialize struct dc_link_settings and link_training_settings to zero.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +4 -4
@@ -258,7 +258,7 @@ static ssize_t dp_link_settings_write(struct file *f, const char __user *buf,struct dc_link *link = connector->dc_link;struct amdgpu_device *adev =drm_to_adev (connector->base.dev);struct dc *dc = (struct dc *)link->dc; -struct dc_link_settings prefer_link_settings; +struct dc_link_settings prefer_link_settings = {0 };char *wr_buf =NULL ;const uint32_t wr_buf_size =40 ;/* 0: lane_count; 1: link_rate */
@@ -389,7 +389,7 @@ static ssize_t dp_mst_link_setting(struct file *f, const char __user *buf,struct dc_link *link = aconnector->dc_link;struct amdgpu_device *adev =drm_to_adev (aconnector->base.dev);struct dc *dc = (struct dc *)link->dc; -struct dc_link_settings prefer_link_settings; +struct dc_link_settings prefer_link_settings = {0 };char *wr_buf =NULL ;const uint32_t wr_buf_size =40 ;/* 0: lane_count; 1: link_rate */
@@ -613,7 +613,7 @@ static ssize_t dp_phy_settings_write(struct file *f, const char __user *buf,uint32_t wr_buf_size =40 ;long param[3 ];bool use_prefer_link_setting; -struct link_training_settings link_lane_settings; +struct link_training_settings link_lane_settings = {0 };int max_param_num =3 ;uint8_t param_nums =0 ;int r =0 ;
@@ -768,7 +768,7 @@ static ssize_t dp_phy_test_pattern_debugfs_write(struct file *f, const char __us LINK_RATE_UNKNOWN, LINK_SPREAD_DISABLED};struct dc_link_settings cur_link_settings = {LANE_COUNT_UNKNOWN ,LINK_RATE_UNKNOWN ,LINK_SPREAD_DISABLED }; -struct link_training_settings link_training_settings; +struct link_training_settings link_training_settings = {0 };int i;if (size ==0 )
Signature · 1 line
2.45.2
PATCH 12/17 Revert "drm/amd/display: Fix green screen issue after suspend"
In reply to Rodrigo SiqueiraThis reverts commit 87b7ebc2e16c14d32a912f18206a4d6cc9abc3e8.
A long time ago, we had an issue with the Raven system when it was connected to two displays: one with DP and another with HDMI. After the system woke up from suspension, we saw a solid green screen caused by an underflow generated by bad DCC metadata. To workaround this issue, the 'commit 87b7ebc2e16c ("drm/amd/display: Fix green screen issue after suspend")' was introduced to disable the DCC for a few frames after in the resume phase. However, in hindsight, this solution was probably a workaround at the kernel level for some issues from another part (probably other driver components or user space). After applying this patch and trying to reproduce the green issue in a similar hardware system but using the latest kernel and userspace, we cannot see the issue, which makes this workaround obsolete and creates extra unnecessary complexity to the code; for all of this reason, this commit reverts the original change.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++++------ .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 22 +++++++------------ .../amd/display/amdgpu_dm/amdgpu_dm_plane.h | 3 +-- 3 files changed, 13 insertions(+), 24 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -8
@@ -5524,8 +5524,7 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev,const u64 tiling_flags, struct dc_plane_info *plane_info, struct dc_plane_address *address, - bool tmz_surface, - bool force_disable_dcc) + bool tmz_surface) { const struct drm_framebuffer *fb = plane_state->fb; const struct amdgpu_framebuffer *afb =
@@ -5624,7 +5623,7 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev, &plane_info->tiling_info, &plane_info->plane_size, &plane_info->dcc, address, - tmz_surface, force_disable_dcc); + tmz_surface);if (ret)return ret;
@@ -5645,7 +5644,6 @@ static int fill_dc_plane_attributes(struct amdgpu_device *adev,struct dc_scaling_info scaling_info;struct dc_plane_info plane_info;int ret; -bool force_disable_dcc = false; ret =amdgpu_dm_plane_fill_dc_scaling_info (adev, plane_state, &scaling_info);if (ret)
@@ -5656,13 +5654,11 @@ static int fill_dc_plane_attributes(struct amdgpu_device *adev, dc_plane_state->clip_rect = scaling_info.clip_rect; dc_plane_state->scaling_quality = scaling_info.scaling_quality; - force_disable_dcc = adev->asic_type ==CHIP_RAVEN && adev->in_suspend; ret =fill_dc_plane_info_and_addr (adev, plane_state, afb->tiling_flags, &plane_info, &dc_plane_state->address, - afb->tmz_surface, - force_disable_dcc); + afb->tmz_surface);if (ret)return ret;
@@ -9099,7 +9095,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, afb->tiling_flags, &bundle->plane_infos[planes_count], &bundle->flip_addrs[planes_count].address, - afb->tmz_surface, false); + afb->tmz_surface); drm_dbg_state(state->dev, "plane: id=%d dcc_en=%d\n", new_plane_state->plane->index,
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +8 -14
@@ -310,8 +310,7 @@ static int amdgpu_dm_plane_fill_gfx9_plane_attributes_from_modifiers(struct amdgconst struct plane_size *plane_size, union dc_tiling_info *tiling_info, struct dc_plane_dcc_param *dcc, - struct dc_plane_address *address, - const bool force_disable_dcc) + struct dc_plane_address *address) { const uint64_t modifier = afb->base.modifier;int ret =0 ;
@@ -319,7 +318,7 @@ static int amdgpu_dm_plane_fill_gfx9_plane_attributes_from_modifiers(struct amdgamdgpu_dm_plane_fill_gfx9_tiling_info_from_modifier (adev, tiling_info, modifier); tiling_info->gfx9.swizzle =amdgpu_dm_plane_modifier_gfx9_swizzle_mode (modifier); -if (amdgpu_dm_plane_modifier_has_dcc (modifier) && !force_disable_dcc) { +if (amdgpu_dm_plane_modifier_has_dcc (modifier)) {uint64_t dcc_address = afb->address + afb->base.offsets[1 ];bool independent_64b_blks =AMD_FMT_MOD_GET (DCC_INDEPENDENT_64B , modifier);bool independent_128b_blks =AMD_FMT_MOD_GET (DCC_INDEPENDENT_128B , modifier);
@@ -361,8 +360,7 @@ static int amdgpu_dm_plane_fill_gfx12_plane_attributes_from_modifiers(struct amdconst struct plane_size *plane_size, union dc_tiling_info *tiling_info, struct dc_plane_dcc_param *dcc, - struct dc_plane_address *address, - const bool force_disable_dcc) + struct dc_plane_address *address) { const uint64_t modifier = afb->base.modifier;int ret =0 ;
@@ -372,7 +370,7 @@ static int amdgpu_dm_plane_fill_gfx12_plane_attributes_from_modifiers(struct amd tiling_info->gfx9.swizzle =amdgpu_dm_plane_modifier_gfx9_swizzle_mode (modifier); -if (amdgpu_dm_plane_modifier_has_dcc (modifier) && !force_disable_dcc) { +if (amdgpu_dm_plane_modifier_has_dcc (modifier)) {int max_compressed_block =AMD_FMT_MOD_GET (DCC_MAX_COMPRESSED_BLOCK , modifier); dcc->enable =1 ;
@@ -840,8 +838,7 @@ int amdgpu_dm_plane_fill_plane_buffer_attributes(struct amdgpu_device *adev,struct plane_size *plane_size, struct dc_plane_dcc_param *dcc, struct dc_plane_address *address, - bool tmz_surface, - bool force_disable_dcc) + bool tmz_surface) { const struct drm_framebuffer *fb = &afb->base;int ret;
@@ -901,16 +898,14 @@ int amdgpu_dm_plane_fill_plane_buffer_attributes(struct amdgpu_device *adev, ret =amdgpu_dm_plane_fill_gfx12_plane_attributes_from_modifiers (adev, afb, format, rotation, plane_size, tiling_info, dcc, - address, - force_disable_dcc); + address);if (ret)return ret; }else if (adev->family >=AMDGPU_FAMILY_AI ) { ret =amdgpu_dm_plane_fill_gfx9_plane_attributes_from_modifiers (adev, afb, format, rotation, plane_size, tiling_info, dcc, - address, - force_disable_dcc); + address);if (ret)return ret; }else {
@@ -1001,14 +996,13 @@ static int amdgpu_dm_plane_helper_prepare_fb(struct drm_plane *plane, dm_plane_state_old->dc_state != dm_plane_state_new->dc_state) {struct dc_plane_state *plane_state = dm_plane_state_new->dc_state; -bool force_disable_dcc = !plane_state->dcc.enable;amdgpu_dm_plane_fill_plane_buffer_attributes ( adev, afb, plane_state->format, plane_state->rotation, afb->tiling_flags, &plane_state->tiling_info, &plane_state->plane_size, &plane_state->dcc, &plane_state->address, - afb->tmz_surface, force_disable_dcc); + afb->tmz_surface); }return 0 ;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.h +1 -2
@@ -51,8 +51,7 @@ int amdgpu_dm_plane_fill_plane_buffer_attributes(struct amdgpu_device *adev,struct plane_size *plane_size, struct dc_plane_dcc_param *dcc, struct dc_plane_address *address, - bool tmz_surface, - bool force_disable_dcc); + bool tmz_surface); int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, struct drm_plane *plane,
Signature · 1 line
2.45.2
Re: [PATCH 12/17] Revert "drm/amd/display: Fix green screen issue after suspend"
Quoted 1 line · Rodrigo Siqueira
This reverts commit
87b7ebc2e16c14d32a912f18206a4d6cc9abc3e8.
Blast from the past, that's from 5.7!
Nice tech debt removal.
Quoted 182 lines
A long time ago, we had an issue with the Raven system when it was connected to two displays: one with DP and another with HDMI. After the system woke up from suspension, we saw a solid green screen caused by an underflow generated by bad DCC metadata. To workaround this issue, the 'commit
87b7ebc2e16c("drm/amd/display: Fix green screen issue after suspend")' was introduced to disable the DCC for a few frames after in the resume phase. However, in hindsight, this solution was probably a workaround at the kernel level for some issues from another part (probably other driver components or user space). After applying this patch and trying to reproduce the green issue in a similar hardware system but using the latest kernel and userspace, we cannot see the issue, which makes this workaround obsolete and creates extra unnecessary complexity to the code; for all of this reason, this commit reverts the original change.Cc Mario Limonciello <[email protected]>Cc Pierre-Eric Pelloux-Prayer <[email protected]>Reviewed-by Aurabindo Pillai <[email protected]>Signed-off-by Rodrigo Siqueira <[email protected]>--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++++------ .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 22 +++++++------------ .../amd/display/amdgpu_dm/amdgpu_dm_plane.h | 3 +-- 3 files changed, 13 insertions(+), 24 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4
-8@@ -5524,8 +5524,7 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev,const u64 tiling_flags, struct dc_plane_info *plane_info, struct dc_plane_address *address, - bool tmz_surface, - bool force_disable_dcc) + bool tmz_surface) { const struct drm_framebuffer *fb = plane_state->fb; const struct amdgpu_framebuffer *afb =@@ -5624,7 +5623,7 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev, &plane_info->tiling_info, &plane_info->plane_size, &plane_info->dcc, address, - tmz_surface, force_disable_dcc); + tmz_surface);if (ret)return ret;@@ -5645,7 +5644,6 @@ static int fill_dc_plane_attributes(struct amdgpu_device *adev,struct dc_scaling_info scaling_info;struct dc_plane_info plane_info;int ret; -bool force_disable_dcc = false; ret =amdgpu_dm_plane_fill_dc_scaling_info (adev, plane_state, &scaling_info);if (ret)@@ -5656,13 +5654,11 @@ static int fill_dc_plane_attributes(struct amdgpu_device *adev, dc_plane_state->clip_rect = scaling_info.clip_rect; dc_plane_state->scaling_quality = scaling_info.scaling_quality; - force_disable_dcc = adev->asic_type ==CHIP_RAVEN && adev->in_suspend; ret =fill_dc_plane_info_and_addr (adev, plane_state, afb->tiling_flags, &plane_info, &dc_plane_state->address, - afb->tmz_surface, - force_disable_dcc); + afb->tmz_surface);if (ret)return ret;@@ -9099,7 +9095,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, afb->tiling_flags, &bundle->plane_infos[planes_count], &bundle->flip_addrs[planes_count].address, - afb->tmz_surface, false); + afb->tmz_surface); drm_dbg_state(state->dev, "plane: id=%d dcc_en=%d\n", new_plane_state->plane->index,drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +8
-14@@ -310,8 +310,7 @@ static int amdgpu_dm_plane_fill_gfx9_plane_attributes_from_modifiers(struct amdgconst struct plane_size *plane_size, union dc_tiling_info *tiling_info, struct dc_plane_dcc_param *dcc, - struct dc_plane_address *address, - const bool force_disable_dcc) + struct dc_plane_address *address) { const uint64_t modifier = afb->base.modifier;int ret =0 ;@@ -319,7 +318,7 @@ static int amdgpu_dm_plane_fill_gfx9_plane_attributes_from_modifiers(struct amdgamdgpu_dm_plane_fill_gfx9_tiling_info_from_modifier (adev, tiling_info, modifier); tiling_info->gfx9.swizzle =amdgpu_dm_plane_modifier_gfx9_swizzle_mode (modifier); -if (amdgpu_dm_plane_modifier_has_dcc (modifier) && !force_disable_dcc) { +if (amdgpu_dm_plane_modifier_has_dcc (modifier)) {uint64_t dcc_address = afb->address + afb->base.offsets[1 ];bool independent_64b_blks =AMD_FMT_MOD_GET (DCC_INDEPENDENT_64B , modifier);bool independent_128b_blks =AMD_FMT_MOD_GET (DCC_INDEPENDENT_128B , modifier);@@ -361,8 +360,7 @@ static int amdgpu_dm_plane_fill_gfx12_plane_attributes_from_modifiers(struct amdconst struct plane_size *plane_size, union dc_tiling_info *tiling_info, struct dc_plane_dcc_param *dcc, - struct dc_plane_address *address, - const bool force_disable_dcc) + struct dc_plane_address *address) { const uint64_t modifier = afb->base.modifier;int ret =0 ;@@ -372,7 +370,7 @@ static int amdgpu_dm_plane_fill_gfx12_plane_attributes_from_modifiers(struct amd tiling_info->gfx9.swizzle =amdgpu_dm_plane_modifier_gfx9_swizzle_mode (modifier); -if (amdgpu_dm_plane_modifier_has_dcc (modifier) && !force_disable_dcc) { +if (amdgpu_dm_plane_modifier_has_dcc (modifier)) {int max_compressed_block =AMD_FMT_MOD_GET (DCC_MAX_COMPRESSED_BLOCK , modifier); dcc->enable =1 ;@@ -840,8 +838,7 @@ int amdgpu_dm_plane_fill_plane_buffer_attributes(struct amdgpu_device *adev,struct plane_size *plane_size, struct dc_plane_dcc_param *dcc, struct dc_plane_address *address, - bool tmz_surface, - bool force_disable_dcc) + bool tmz_surface) { const struct drm_framebuffer *fb = &afb->base;int ret;@@ -901,16 +898,14 @@ int amdgpu_dm_plane_fill_plane_buffer_attributes(struct amdgpu_device *adev, ret =amdgpu_dm_plane_fill_gfx12_plane_attributes_from_modifiers (adev, afb, format, rotation, plane_size, tiling_info, dcc, - address, - force_disable_dcc); + address);if (ret)return ret; }else if (adev->family >=AMDGPU_FAMILY_AI ) { ret =amdgpu_dm_plane_fill_gfx9_plane_attributes_from_modifiers (adev, afb, format, rotation, plane_size, tiling_info, dcc, - address, - force_disable_dcc); + address);if (ret)return ret; }else {@@ -1001,14 +996,13 @@ static int amdgpu_dm_plane_helper_prepare_fb(struct drm_plane *plane, dm_plane_state_old->dc_state != dm_plane_state_new->dc_state) {struct dc_plane_state *plane_state = dm_plane_state_new->dc_state; -bool force_disable_dcc = !plane_state->dcc.enable;amdgpu_dm_plane_fill_plane_buffer_attributes ( adev, afb, plane_state->format, plane_state->rotation, afb->tiling_flags, &plane_state->tiling_info, &plane_state->plane_size, &plane_state->dcc, &plane_state->address, - afb->tmz_surface, force_disable_dcc); + afb->tmz_surface); }return 0 ;drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.h +1
-2@@ -51,8 +51,7 @@ int amdgpu_dm_plane_fill_plane_buffer_attributes(struct amdgpu_device *adev,struct plane_size *plane_size, struct dc_plane_dcc_param *dcc, struct dc_plane_address *address, - bool tmz_surface, - bool force_disable_dcc); + bool tmz_surface); int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, struct drm_plane *plane,
PATCH 13/17 drm/amd/display: Re-validate streams on commit_streams
In reply to Rodrigo SiqueiraFrom: Dillon Varone <[email protected]>
To prevent invalid HW programming, streams should be revalidated first before committing to HW.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +5 -0
@@ -2153,6 +2153,11 @@ enum dc_status dc_commit_streams(struct dc *dc, struct dc_commit_streams_paramsstruct dc_stream_state *stream = params->streams[i];struct dc_stream_status *status =dc_stream_get_status (stream); +/* revalidate streams */ + res =dc_validate_stream (dc, stream); +if (res !=DC_OK ) +return res; +dc_stream_log (dc, stream); set[i].stream = stream;
Signature · 1 line
2.45.2
PATCH 14/17 drm/amd/display: Block Invalid TMDS operation
In reply to Rodrigo SiqueiraFrom: Chris Park <[email protected]>
[Why]
When sink type is TMDS, PHY programming does not block against pixel clock greater than 600MHz.
[How]
Based on sink type, block greater than 600MHz phy programming.
--- drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c | 3 +++ drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 4 ++++ 2 files changed, 7 insertions(+)
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +3 -0
@@ -1105,6 +1105,9 @@ static bool dcn401_program_pix_clk( &dto_params); }else { +if (pll_settings->actual_pix_clk_100hz >6000000UL ) +return false; +/* disables DP DTO when provided with TMDS signal type */ clock_source->ctx->dc->res_pool->dccg->funcs->set_dp_dto( clock_source->ctx->dc->res_pool->dccg,
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +4 -0
@@ -1953,6 +1953,10 @@ static void enable_link_hdmi(struct pipe_ctx *pipe_ctx) stream->phy_pix_clk = stream->timing.pix_clk_100hz /10 ;if (stream->phy_pix_clk >340000 ) is_over_340mhz = true; +if (dc_is_tmds_signal (stream->signal) && stream->phy_pix_clk >6000000UL ) { +ASSERT (false); +return ; + }if (dc_is_hdmi_signal (pipe_ctx->stream->signal)) { unsigned short masked_chip_caps = pipe_ctx->stream->link->chip_caps &
Signature · 1 line
2.45.2
PATCH 15/17 drm/amd/display: Don't allow IPS2 in D0 for RCG Dynamic
In reply to Rodrigo SiqueiraFrom: Nicholas Kazlauskas <[email protected]>
[Why]
The existing changes to the DPMS off flag should help reduce accidental entry, but this change further restricts the entry condition.
[How]
Record last power state as sent to DMUB.
Don't send IPS2 allow if it's D0.
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 5 ++++- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +4 -1
@@ -1313,7 +1313,8 @@ static void dc_dmub_srv_notify_idle(const struct dc *dc, bool allow_idle) new_signals.bits.allow_ips2 =1 ; }else if (dc->config.disable_ips ==DMUB_IPS_RCG_IN_ACTIVE_IPS2_IN_OFF ) {/* TODO: Move this logic out to hwseq */ -if (count_active_streams (dc) ==0 ) { +if (dc_dmub_srv->last_power_state ==DC_ACPI_CM_POWER_STATE_D3 && +count_active_streams (dc) ==0 ) {/* IPS2 - Display off */ new_signals.bits.allow_pg =1 ; new_signals.bits.allow_ips1 =1 ;
@@ -1517,6 +1518,8 @@ void dc_dmub_srv_notify_fw_dc_power_state(struct dc_dmub_srv *dc_dmub_srv, }dc_wake_and_execute_dmub_cmd (dc_dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); + + dc_dmub_srv->last_power_state = power_state; }bool dc_dmub_srv_should_detect (struct dc_dmub_srv *dc_dmub_srv)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +1 -0
@@ -56,6 +56,7 @@ struct dc_dmub_srv {union dmub_shared_state_ips_driver_signals driver_signals;bool idle_allowed;bool needs_idle_wake; +enum dc_acpi_cm_power_state last_power_state; };void dc_dmub_srv_wait_idle (struct dc_dmub_srv *dc_dmub_srv);
Signature · 1 line
2.45.2
PATCH 16/17 drm/amd/display: Disable MPC rate control on ODM pipe update
In reply to Rodrigo SiqueiraFrom: George Shen <[email protected]>
[Why]
Seamless boot skips MPC init for the active pipe, resulting in stale MPC rate control state being retained. This will cause issues since other logic assumes it is disabled (as DCN30 and newer does not need it).
[How]
Disable MPC rate control on ODM pipe update to cover the seamless boot case.
--- .../amd/display/dc/hwss/dcn314/dcn314_hwseq.c | 12 ++++++++++++ .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 12 ++++++++++++ .../drm/amd/display/dc/mpc/dcn30/dcn30_mpc.c | 18 ++++++++++++++++++ .../drm/amd/display/dc/mpc/dcn30/dcn30_mpc.h | 7 +++++++ 4 files changed, 49 insertions(+)
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c +12 -0
@@ -162,6 +162,8 @@ void dcn314_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctxint opp_inst[MAX_PIPES ] = {0 };int odm_slice_width =resource_get_odm_slice_dst_width (pipe_ctx, false);int last_odm_slice_width =resource_get_odm_slice_dst_width (pipe_ctx, true); +struct mpc *mpc = dc->res_pool->mpc; +int i; opp_cnt =get_odm_config (pipe_ctx, opp_inst);
@@ -174,6 +176,16 @@ void dcn314_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx pipe_ctx->stream_res.tg->funcs->set_odm_bypass ( pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing); +if (mpc->funcs->set_out_rate_control) { +for (i =0 ; i < opp_cnt; ++i) { + mpc->funcs->set_out_rate_control ( + mpc, opp_inst[i], + false, +0 , +NULL ); + } + } +for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe) { odm_pipe->stream_res.opp->funcs->opp_pipe_clock_control( odm_pipe->stream_res.opp,
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +12 -0
@@ -426,6 +426,8 @@ void dcn35_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx *int opp_inst[MAX_PIPES ] = {0 };int odm_slice_width =resource_get_odm_slice_dst_width (pipe_ctx, false);int last_odm_slice_width =resource_get_odm_slice_dst_width (pipe_ctx, true); +struct mpc *mpc = dc->res_pool->mpc; +int i; opp_cnt =get_odm_config (pipe_ctx, opp_inst);
@@ -438,6 +440,16 @@ void dcn35_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx * pipe_ctx->stream_res.tg->funcs->set_odm_bypass ( pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing); +if (mpc->funcs->set_out_rate_control) { +for (i =0 ; i < opp_cnt; ++i) { + mpc->funcs->set_out_rate_control ( + mpc, opp_inst[i], + false, +0 , +NULL ); + } + } +for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe) { odm_pipe->stream_res.opp->funcs->opp_pipe_clock_control( odm_pipe->stream_res.opp,
drivers/gpu/drm/amd/display/dc/mpc/dcn30/dcn30_mpc.c +18 -0
@@ -110,6 +110,23 @@ void mpc3_disable_dwb_mux( MPC_DWB0_MUX, 0xf); } +void mpc3_set_out_rate_control ( +struct mpc *mpc, +int opp_id, +bool enable, +bool rate_2x_mode, +struct mpc_dwb_flow_control *flow_control) +{ +struct dcn30_mpc *mpc30 =TO_DCN30_MPC (mpc); + +/* Always disable mpc out rate and flow control. +* MPC flow rate control is not needed for DCN30 and above. +*/ +REG_UPDATE_2 (MUX [opp_id], +MPC_OUT_RATE_CONTROL_DISABLE ,1 , +MPC_OUT_RATE_CONTROL ,0 ); +} +enum dc_lut_mode mpc3_get_ogam_current (struct mpc *mpc,int mpcc_id) {/*Contrary to DCN2 and DCN1 wherein a single status register field holds this info;
@@ -1519,6 +1536,7 @@ static const struct mpc_funcs dcn30_mpc_funcs = { .set_dwb_mux = mpc3_set_dwb_mux, .disable_dwb_mux = mpc3_disable_dwb_mux, .is_dwb_idle = mpc3_is_dwb_idle, + .set_out_rate_control = mpc3_set_out_rate_control, .set_gamut_remap = mpc3_set_gamut_remap, .program_shaper = mpc3_program_shaper, .acquire_rmu = mpcc3_acquire_rmu,
drivers/gpu/drm/amd/display/dc/mpc/dcn30/dcn30_mpc.h +7 -0
@@ -1085,6 +1085,13 @@ bool mpc3_is_dwb_idle(struct mpc *mpc, int dwb_id); +void mpc3_set_out_rate_control ( +struct mpc *mpc, +int opp_id, +bool enable, +bool rate_2x_mode, +struct mpc_dwb_flow_control *flow_control); +void mpc3_power_on_ogam_lut (struct mpc *mpc,int mpcc_id,bool power_on);
Signature · 1 line
2.45.2
PATCH 17/17 drm/amd/display: 3.2.314
In reply to Rodrigo SiqueiraFrom: Aric Cyr <[email protected]>
DC 3.2.314 contains some improvements as summarized below:
* Update DML21 code.
* Fixes for FAMS2 interface.
* HDMI fixes.
* Compilation warning fixes.
--- 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
@@ -55,7 +55,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.313" +#define DC_VER "3.2.314"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.45.2
[Public]
Hi all,
This week this patchset was tested on 4 systems, two dGPU and two APU based, and tested across multiple display and connection types.
APU
• Single Display eDP -> 1080p 60hz, 2560x1600 120hz, 1920x1200 165hz
• Single Display DP (SST DSC) -> 4k144hz, 4k240hz
• Multi display -> eDP + DP/HDMI/USB-C -> 1080p 60hz eDP + 4k 144hz, 4k 240hz (Includes USB-C to DP/HDMI adapters)
• Thunderbolt -> LG Ultrafine 5k
• MST DSC -> Cable Matters 101075 (DP to 3x DP) with 3x 4k60hz displays, HP Hook G2 with 2x 4k60hz displays
• USB 4 -> HP Hook G4, Lenovo Thunderbolt Dock, both with 2x 4k60hz DP and 1x 4k60hz HDMI displays
• SST PCON -> Club3D CAC-1085 + 1x 4k 144hz, FRL3, at a max resolution supported by the dongle of 4k 120hz YUV420 12bpc.
• MST PCON -> 1x 4k 144hz, FRL3, at a max resolution supported by the adapter of 4k 120hz RGB 8bpc.
DGPU
• Single Display DP (SST DSC) -> 4k144hz, 4k240hz
• Multiple Display DP -> 4k240hz + 4k144hz
• MST (Startech MST14DP123DP [DP to 3x DP] and 2x 4k 60hz displays)
• MST DSC (with Cable Matters 101075 [DP to 3x DP] with 3x 4k60hz displays)
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to)
• Changing display configurations and settings
• Video/Audio playback
• Benchmark testing
• Suspend/Resume testing
• Feature testing (Freesync, HDCP, etc.)
Automated testing includes (but is not limited to)
• Script testing (scripts to automate some of the manual checks)
• IGT testing
The testing is mainly tested on the following displays, but occasionally there are tests with other displays
• Samsung G8 Neo 4k240hz
• Samsung QN55QN95B 4k 120hz
• Acer XV322QKKV 4k144hz
• HP U27 4k Wireless 4k60hz
• LG 27UD58B 4k60hz
• LG 32UN650WA 4k60hz
• LG Ultrafine 5k 5k60hz
• AU Optronics B140HAN01.1 1080p 60hz eDP
• AU Optronics B160UAN01.J 1920x1200 165hz eDP
• AU Optronics B160QAN02.L 2560x1600 120hz eDP
The patchset consists of the amd-staging-drm-next branch (Head commit - ba056752aa4b6d428f002f9050e2b2e1d276b582 -> drm/amdgpu: rename register headers to dcn_2_0_1) with new patches added on top of it.
Tested on Ubuntu 24.04.1, 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
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
Facebook | Twitter | amd.com
-----Original Message-----
From: Siqueira, Rodrigo <[email protected]>
Sent: Friday, December 13, 2024 10:53 AM
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]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Mohamed, Zaeem <[email protected]>; Chiu, Solomon <[email protected]>; Wheeler, Daniel <[email protected]>; Siqueira, Rodrigo <[email protected]>
Subject: [PATCH 00/17] DC Patches Dec 13, 2024
* Update DML21 code.
* Fixes for FAMS2 interface.
* HDMI fixes.
* Compilation warning fixes.
Alex Hung (1):
drm/amd/display: Fix uninitialized variables in amdgpu_dm_debugfs
Alvin Lee (1):
drm/amd/display: Update FAMS2 config cmd
Aric Cyr (1):
drm/amd/display: 3.2.314
Austin Zheng (1):
drm/amd/display: DML21 Reintegration For Various Fixes
Charlene Liu (1):
drm/amd/display: init dc_power_state
Chris Park (1):
drm/amd/display: Block Invalid TMDS operation
Dillon Varone (3):
drm/amd/display: Add support for FAMS2+ interface versions drm/amd/display: Add new message for DF throttling optimization on
dcn401
drm/amd/display: Re-validate streams on commit_streams
Fangzhi Zuo (1):
drm/amd/display: Fix Mode Cutoff in DSC Passthrough to DP2.1 Monitor
George Shen (1):
drm/amd/display: Disable MPC rate control on ODM pipe update
Harry VanZyllDeJong (1):
drm/amd/display: Fix brightness adjustment on MiniLED
Meerpate Patel (1):
drm/amd/display: initialize uninitialized variable
Nicholas Kazlauskas (2):
drm/amd/display: Apply (some) policy for DML2 formulation on
DCN35/DCN351
drm/amd/display: Don't allow IPS2 in D0 for RCG Dynamic
Rodrigo Siqueira (1):
Revert "drm/amd/display: Fix green screen issue after suspend"
Shunlu Zhang (1):
drm/amd/display: delete legacy code
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 +-
.../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 8 +-
.../display/amdgpu_dm/amdgpu_dm_mst_types.c | 6 +-
.../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 22 +-
.../amd/display/amdgpu_dm/amdgpu_dm_plane.h | 3 +-
.../dc/clk_mgr/dcn401/dcn401_clk_mgr.c | 46 +
.../dc/clk_mgr/dcn401/dcn401_clk_mgr.h | 1 +
.../clk_mgr/dcn401/dcn401_clk_mgr_smu_msg.c | 23 +
.../clk_mgr/dcn401/dcn401_clk_mgr_smu_msg.h | 3 +
drivers/gpu/drm/amd/display/dc/core/dc.c | 11 +-
drivers/gpu/drm/amd/display/dc/dc.h | 6 +-
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 40 +-
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 1 +
.../drm/amd/display/dc/dce/dce_clock_source.c | 3 +
.../dc/dml/dcn30/display_rq_dlg_calc_30.c | 1 +
drivers/gpu/drm/amd/display/dc/dml2/Makefile | 15 +-
.../amd/display/dc/dml2/display_mode_core.c | 6 +-
.../dc/dml2/display_mode_core_structs.h | 103 +-
.../amd/display/dc/dml2/display_mode_util.c | 6 +-
.../dc/dml2/dml21/dml21_translation_helper.c | 16 +-
.../amd/display/dc/dml2/dml21/dml21_utils.c | 80 +-
.../dml21/inc/bounding_boxes/dcn4_soc_bb.h | 3 +-
.../dml21/inc/dml_top_display_cfg_types.h | 52 +-
.../dml21/inc/dml_top_soc_parameter_types.h | 2 +
.../display/dc/dml2/dml21/inc/dml_top_types.h | 77 +-
.../dml2/dml21/src/dml2_core/dml2_core_dcn4.c | 42 +-
.../src/dml2_core/dml2_core_dcn4_calcs.c | 1306 +++++++++++------
.../src/dml2_core/dml2_core_dcn4_calcs.h | 2 +-
.../src/dml2_core/dml2_core_shared_types.h | 129 +-
.../dml21/src/dml2_core/dml2_core_utils.c | 223 ++-
.../dml21/src/dml2_core/dml2_core_utils.h | 6 +-
.../dml2/dml21/src/dml2_dpmm/dml2_dpmm_dcn4.c | 49 +-
.../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c | 394 +++--
.../dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.h | 7 +
.../dml21/src/dml2_pmo/dml2_pmo_factory.c | 1 -
.../dml21/src/dml2_top/dml2_top_interfaces.c | 51 +
.../dml2/dml21/src/dml2_top/dml2_top_legacy.c | 4 +
.../dml2/dml21/src/dml2_top/dml2_top_legacy.h | 9 +
.../src/dml2_top/dml2_top_optimization.c | 307 ----
.../src/dml2_top/dml2_top_optimization.h | 33 -
.../dml2/dml21/src/dml2_top/dml2_top_soc15.c | 1177 +++++++++++++++
.../{dml_top_mcache.h => dml2_top_soc15.h} | 20 +-
.../dml2/dml21/src/dml2_top/dml_top_mcache.c | 549 -------
.../dc/dml2/dml21/src/inc/dml2_debug.c | 5 +
.../dc/dml2/dml21/src/inc/dml2_debug.h | 46 +-
.../src/inc/dml2_internal_shared_types.h | 60 +-
.../display/dc/dml2/dml2_translation_helper.c | 54 +-
.../display/dc/dml2/dml_display_rq_dlg_calc.c | 12 -
.../amd/display/dc/hwss/dcn31/dcn31_init.c | 2 +-
.../amd/display/dc/hwss/dcn314/dcn314_hwseq.c | 12 +
.../amd/display/dc/hwss/dcn314/dcn314_init.c | 2 +-
.../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 12 +
.../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 5 +-
.../gpu/drm/amd/display/dc/inc/core_types.h | 3 +-
.../gpu/drm/amd/display/dc/link/link_dpms.c | 4 +
.../drm/amd/display/dc/mpc/dcn30/dcn30_mpc.c | 18 +
.../drm/amd/display/dc/mpc/dcn30/dcn30_mpc.h | 7 +
.../amd/display/dc/optc/dcn401/dcn401_optc.c | 4 +-
.../dc/resource/dcn401/dcn401_resource.c | 4 +
59 files changed, 3225 insertions(+), 1880 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_interfaces.c
create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_legacy.c
create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_legacy.h
delete mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_optimization.c
delete mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_optimization.h
create mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml2_top_soc15.c
rename drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/{dml_top_mcache.h => dml2_top_soc15.h} (58%) delete mode 100644 drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml_top_mcache.c--
2.45.2