DC Patches October 19, 2026
cover DC Patches October 19, 2026
This DC patchset brings improvements in multiple areas. In summary, we have:
- Fix HDMI FRL FFE compliance test and adjust FRL LT timeout.
- Align eDP DSC link policy to minimize lane count.
- Add AS-SDP V3 support for VESA Panel Replay.
- Add DPG force-on-flip support.
- Log PSR/Replay status and exit PSR/Replay on non-modeset full updates.
- Reject invalid per-mode FreeSync timing and set VRR_EN state.
- Align VRR timing gate with FreeSync module.
- Warn on unadvertised modes without scaling.
- Use DMUB to notify PME and update DMU cmd header.
- Do not allow vbios version of dmubfw in the driver.
- Use picoseconds for line time and correct next frame calculation.
- Fix YUV422 semi-planar color blurring and UPSP chroma upsampling.
- Reset UPSP and pre-CSC registers on DCN6 DPP reset.
- Handle exit LS in second ISHARP programming block.
- Remove hard-coded min dcfclk for AC.
- Do not WARN when removing an unallocated MST payload.
- Various cleanups, KUnit test fixes and debug flag gating.
Alvin Lee (3):
drm/amd/display: Update DMU cmd header drm/amd/display: Use picoseconds for line time on DCN6+ drm/amd/display: Correct next frame calculation
Aric Cyr (1):
drm/amd/display: move timing_adjust_pending into dc_stream_state
Charlene Liu (3):
drm/amd/display: use dmub to notify pme
drm/amd/display: Do not allow vbios version of dmubfw in the driver drm/amd/display: remove hard code min dcfclk for AC.
Dillon Varone (1):
drm/amd/display: set VRR_EN for inactive state
Fangzhi Zuo (4):
drm/amd/display: Simplify hdmi_automation debugfs with
debugfs_create_bool
drm/amd/display: reject invalid per-mode FreeSync timing drm/amd/display: warn on unadvertised modes without scaling drm/amd/display: align VRR timing gate with FreeSync module
Ilya Bakoulin (2):
drm/amd/display: Fix HDMI FRL FFE compliance test drm/amd/display: Adjust HDMI FRL LT timeout
Ivan Lipski (2):
drm/amd/display: Remove unused has_vsdb variable drm/amd/display: fix NULL dc deref in hpd_init KUnit tests
Kaier Hsueh (1):
drm/amd/display: YUV422 Semi-Planar Images Show Color Blurring at
Color Boundaries
Leon Huang (1):
drm/amd/display: Add AS-SDP V3 support for VESA PR
Mario Limonciello (1):
drm/amd/display: don't WARN when removing an unallocated MST payload
Piotr Maziarz (1):
drm/amd/display: Gate DP_TRACE_SOURCE_SEQUENCE emission on the debug
flag
Ray Wu (3):
drm/amd/display: Align eDP DSC link policy to minimize lane count drm/amd/display: Log PSR and Replay status after mode change drm/amd/display: Exit PSR/Replay on non-modeset full updates
Roman Li (1):
drm/amd/display: guard DCE-only hwseq definitions
Samson Tam (2):
drm/amd/display: handle exit LS in second ISHARP programming block drm/amd/display: handle UPSP chroma upsampling in DML
Sharique Pervaiz (1):
drm/amd/display: Add DPG force-on-flip support for SystemDisplayEnable
Sridevi Arvindekar (1):
drm/amd/display: Reset UPSP and pre-CSC registers on DCN6 DPP reset
Taimur Hassan (2):
drm/amd/display: [FW Promotion] Release 0.1.80.0 drm/amd/display: Promote DC to 3.2.403
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 61 ++++++--- .../display/amdgpu_dm/amdgpu_dm_connector.c | 44 +++--- .../display/amdgpu_dm/amdgpu_dm_connector.h | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 69 +--------- .../display/amdgpu_dm/amdgpu_dm_freesync.c | 43 +++++- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 7 +- .../tests/amdgpu_dm_connector_test.c | 8 +- .../amdgpu_dm/tests/amdgpu_dm_freesync_test.c | 55 +++++++- .../amdgpu_dm/tests/amdgpu_dm_helpers_test.c | 20 ++- .../amdgpu_dm/tests/amdgpu_dm_irq_test.c | 48 ++++++- .../dc/clk_mgr/dcn42b/dcn42b_clk_mgr.c | 2 - drivers/gpu/drm/amd/display/dc/core/dc.c | 55 ++++++-- .../drm/amd/display/dc/core/dc_hw_sequencer.c | 12 +- drivers/gpu/drm/amd/display/dc/dc.h | 4 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 17 +++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 11 ++ drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 3 +- .../gpu/drm/amd/display/dc/dc_hdmi_types.h | 4 +- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 1 - drivers/gpu/drm/amd/display/dc/dc_stream.h | 3 + .../dml2_core_dcn6_funcs_mode_programming.c | 4 +- .../dml2_core_dcn6_funcs_mode_support.c | 3 +- .../alternate_pstate_shared_lib.c | 11 +- .../amd/display/dc/dpp/dcn401/dcn401_dpp.h | 8 +- .../display/dc/dpp/dcn401/dcn401_dpp_dscl.c | 40 ++++-- .../drm/amd/display/dc/dpp/dcn60/dcn60_dpp.c | 17 ++- .../drm/amd/display/dc/dpp/dcn60/dcn60_dpp.h | 1 + .../amd/display/dc/dpp/dcn60/dcn60_dpp_dscl.c | 7 + .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 55 ++++++-- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 7 + .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 11 ++ .../display/dc/link/hwss/link_hwss_hpo_frl.c | 3 + .../gpu/drm/amd/display/dc/link/link_dpms.c | 2 + .../display/dc/link/protocols/link_hdmi_frl.c | 129 +++++++++++++----- drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c | 7 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 34 ++++- .../gpu/drm/amd/display/dmub/src/dmub_dcn42.c | 7 + .../amd/display/modules/inc/mod_info_packet.h | 5 + .../display/modules/info_packet/info_packet.c | 38 +++++- 39 files changed, 634 insertions(+), 224 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/30 drm/amd/display: Fix HDMI FRL FFE compliance test
From: Ilya Bakoulin <[email protected]>
[Why & How]
The FFE electrical compliance test behavior is not correct. The driver doesn't properly iterate over the FFE levels and select PS/DE based on test request and/or cable-ID.
Fix the initialization of the link state so that when the polling loop takes over, the test proceeds as described in the spec.
--- .../gpu/drm/amd/display/dc/dc_hdmi_types.h | 4 +- .../display/dc/link/hwss/link_hwss_hpo_frl.c | 3 + .../gpu/drm/amd/display/dc/link/link_dpms.c | 2 + .../display/dc/link/protocols/link_hdmi_frl.c | 127 +++++++++++++----- 4 files changed, 104 insertions(+), 32 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_hdmi_types.h +3 -1
@@ -235,7 +235,8 @@ enum link_result {LINK_RESULT_SUCCESS ,LINK_RESULT_LOWER_LINKRATE ,LINK_RESULT_TIMEOUT , -LINK_RESULT_FALLBACK +LINK_RESULT_FALLBACK , +LINK_RESULT_NO_TIMEOUT }; enum hdmi_frl_link_rate {
@@ -274,6 +275,7 @@ struct dc_hdmi_frl_flags {bool force_frl_dsc;bool force_frl_max;bool apply_vsdb_rcc_wa; +bool no_timeout; };struct dc_hdmi_frl_link_training_overrides {
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_hpo_frl.c +3 -0
@@ -59,6 +59,9 @@ static void disable_hpo_frl_link_output(struct dc_link *link, enum signal_type signal) { (void )link_res; +if (link->frl_flags.no_timeout) +return ; +if (dc_is_hdmi_frl_signal (signal)) link->hpo_frl_link_enc->funcs->disable_link_encoder (link->hpo_frl_link_enc); link->link_enc->funcs->disable_output (link->link_enc, signal);
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +2 -0
@@ -2090,6 +2090,8 @@ static enum dc_status enable_link_hdmi_frl(struct pipe_ctx *pipe_ctx) pipe_ctx->stream_res.hpo_frl_stream_enc->funcs->hdmi_frl_enable ( pipe_ctx->stream_res.hpo_frl_stream_enc, pipe_ctx->stream_res.tg->inst); + }else if (link_stat ==LINK_RESULT_NO_TIMEOUT ) { +return status; }else { status =DC_FAIL_HDMI_FRL_LINK_TRAINING ; stream->link->frl_link_settings.frl_link_rate =0 ;
drivers/gpu/drm/amd/display/dc/link/protocols/link_hdmi_frl.c +96 -31
194 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 2/30 drm/amd/display: Align eDP DSC link policy to minimize lane count
In reply to Ray Wu[Why]
The defaults eDP DSC link policy to minimize the link rate, while the preferred policy is to minimize the lane count.
[How]
Use the minimize-lane policy by default.
Fall back to the minimize-link-rate policy when FEC is unavailable or disabled. Update the KUnit expectation accordingly.
--- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 5 ++++- .../amdgpu_dm/tests/amdgpu_dm_helpers_test.c | 20 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +4 -1
@@ -1423,7 +1423,7 @@ void dm_helpers_init_panel_settings( panel_config->pps.extra_post_OUI_ms =0 ;// Feature DSC panel_config->dsc.disable_dsc_edp = false; - panel_config->dsc.force_dsc_edp_policy =0 ; + panel_config->dsc.force_dsc_edp_policy =1 ; }EXPORT_IF_KUNIT (dm_helpers_init_panel_settings);
@@ -1437,6 +1437,9 @@ void dm_helpers_override_panel_settings(if (amdgpu_dc_debug_mask &DC_DISABLE_DSC ) link->panel_config.dsc.disable_dsc_edp = true; +if (!dc_link_should_enable_fec (link)) + link->panel_config.dsc.force_dsc_edp_policy =0 ; +if (dc_get_edp_link_panel_inst (ctx->dc, link, &panel_inst) && panel_inst ==1 ) { link->panel_config.psr.disable_psr = true; link->panel_config.psr.disallow_psrsu = true;
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_helpers_test.c +19 -1
@@ -2092,7 +2092,12 @@ static void dm_test_init_panel_settings_dsc(struct kunit *test)dm_helpers_init_panel_settings (NULL , &panel_config, sink);KUNIT_EXPECT_FALSE (test, panel_config.dsc.disable_dsc_edp); -KUNIT_EXPECT_EQ (test, panel_config.dsc.force_dsc_edp_policy,0U ); +KUNIT_EXPECT_EQ (test, panel_config.dsc.force_dsc_edp_policy,1U ); +} + +static bool dm_test_dp_should_enable_fec (const struct dc_link *link) +{ +return true; }/* Tests for dm_helpers_override_panel_settings() */
@@ -2106,14 +2111,20 @@ static void dm_test_override_panel_settings_debug_mask_disables_dsc(struct kunitstruct dc_context *ctx;struct dc_link *link;struct dc *dc; +struct link_service *link_srv;uint old_debug_mask; ctx =kunit_kzalloc (test,sizeof (*ctx),GFP_KERNEL );KUNIT_ASSERT_NOT_NULL (test, ctx); dc =kunit_kzalloc (test,sizeof (*dc),GFP_KERNEL );KUNIT_ASSERT_NOT_NULL (test, dc); + link_srv =kunit_kzalloc (test,sizeof (*link_srv),GFP_KERNEL ); +KUNIT_ASSERT_NOT_NULL (test, link_srv); link =dm_kunit_alloc_link (test); ctx->dc = dc; + dc->link_srv = link_srv; + link->dc = dc; + link_srv->dp_should_enable_fec = dm_test_dp_should_enable_fec; link->connector_signal =SIGNAL_TYPE_DISPLAY_PORT ; old_debug_mask =dm_helpers_get_dc_debug_mask ();
@@ -2134,15 +2145,22 @@ static void dm_test_override_panel_settings_second_edp_disables_psr(struct kunitstruct dc_link *first_link;struct dc_link *second_link;struct dc *dc; +struct link_service *link_srv; ctx =kunit_kzalloc (test,sizeof (*ctx),GFP_KERNEL );KUNIT_ASSERT_NOT_NULL (test, ctx); dc =kunit_kzalloc (test,sizeof (*dc),GFP_KERNEL );KUNIT_ASSERT_NOT_NULL (test, dc); + link_srv =kunit_kzalloc (test,sizeof (*link_srv),GFP_KERNEL ); +KUNIT_ASSERT_NOT_NULL (test, link_srv); first_link =dm_kunit_alloc_link (test); second_link =dm_kunit_alloc_link (test); ctx->dc = dc; + dc->link_srv = link_srv; + link_srv->dp_should_enable_fec = dm_test_dp_should_enable_fec; + first_link->dc = dc; + second_link->dc = dc; dc->link_count =2 ; dc->links[0 ] = first_link; dc->links[1 ] = second_link;
Signature · 1 line
2.43.0
PATCH 3/30 drm/amd/display: Add AS-SDP V3 support for VESA PR
In reply to Ray WuFrom: Leon Huang <[email protected]>
[Why]
AS-SDP V3 extends the coasting vtotal field from 16 bits to 24 bits by adding DB9 for bits[23:16] for VESA Panel Replay.
[How]
Parse the capability from DPCD and apply when VESA PR is enabled
--- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 3 +- .../amd/display/modules/inc/mod_info_packet.h | 5 +++ .../display/modules/info_packet/info_packet.c | 34 +++++++++++++++++-- 3 files changed, 38 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dp_types.h +2 -1
@@ -922,7 +922,8 @@ union dpcd_dprx_feature_enumeration_list_cont_1 { uint8_t AS_SDP_FIRST_HALF_LINE_OR_3840_PIXEL_CYCLE_WINDOW_NOT_SUPPORTED: 1; uint8_t RESERVED0: 2; uint8_t VSC_EXT_SDP_VER1_SUPPORT: 1; - uint8_t RESERVED1: 3; + uint8_t AS_SDP_VERSION_3_SUPPORTED: 1; + uint8_t RESERVED1: 2; } bits;uint8_t raw; };
drivers/gpu/drm/amd/display/modules/inc/mod_info_packet.h +5 -0
@@ -52,9 +52,11 @@ enum adaptive_sync_sdp_version {AS_SDP_VER_0 =0x0 ,AS_SDP_VER_1 =0x1 ,AS_SDP_VER_2 =0x2 , + AS_SDP_VER_3 = 0x3, };#define AS_DP_SDP_LENGTH (9) +#define AS_DP_SDP_V3_LENGTH (0xA) struct frame_duration_op { bool support;
@@ -78,6 +80,9 @@ void mod_build_adaptive_sync_infopacket(const struct dc_stream_state *stream,void mod_build_adaptive_sync_infopacket_v2 (const struct dc_stream_state *stream,const struct AS_Df_params *param,struct dc_info_packet *info_packet); +void mod_build_adaptive_sync_infopacket_v3 (const struct dc_stream_state *stream, +const struct AS_Df_params *param,struct dc_info_packet *info_packet); +void mod_build_adaptive_sync_infopacket_v1 (struct dc_info_packet *info_packet);#endif
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +31 -3
@@ -770,9 +770,12 @@ void mod_build_adaptive_sync_infopacket(const struct dc_stream_state *stream,case FREESYNC_TYPE_PCON_IN_WHITELIST :case ADAPTIVE_SYNC_TYPE_EDP :if (stream && stream->link->replay_settings.config.replay_supported && - stream->link->replay_settings.config.replay_version ==DC_VESA_PANEL_REPLAY ) -mod_build_adaptive_sync_infopacket_v2 (stream, param, info_packet); -else + stream->link->replay_settings.config.replay_version ==DC_VESA_PANEL_REPLAY ) { +if (stream->link->dpcd_caps.adaptive_sync_caps.dp_adap_sync_caps.bits.AS_SDP_VERSION_3_SUPPORTED) +mod_build_adaptive_sync_infopacket_v3 (stream, param, info_packet); +else +mod_build_adaptive_sync_infopacket_v2 (stream, param, info_packet); + }else mod_build_adaptive_sync_infopacket_v1 (info_packet);break ;case ADAPTIVE_SYNC_TYPE_NONE :
@@ -815,3 +818,28 @@ void mod_build_adaptive_sync_infopacket_v2(const struct dc_stream_state *stream, } } +void mod_build_adaptive_sync_infopacket_v3 (const struct dc_stream_state *stream, +const struct AS_Df_params *param, +struct dc_info_packet *info_packet) +{ + info_packet->valid = true; +// HEADER {HB0, HB1, HB2, HB3} = {00, Type, Version, Length} +// For eDP VESA Panel Replay the coasting vtotal (DB7-DB9) is filled by the +// DMUB firmware,so only the header is built. + info_packet->hb0 =0x00 ; + info_packet->hb1 =0x22 ; + info_packet->hb2 =AS_SDP_VER_3 ; + info_packet->hb3 =AS_DP_SDP_V3_LENGTH ; + +if (param) { +//Payload + info_packet->sb[0 ] = param->supportMode;//1: AVT; 0: FAVT + info_packet->sb[1 ] = (stream->timing.v_total &0x00FF ); + info_packet->sb[2 ] = (stream->timing.v_total &0xFF00 ) >>8 ; +//info_packet->sb[3] = 0x00; Target RR, not use fot AVT + info_packet->sb[4 ] = (param->increase.support <<6 | param->decrease.support <<7 ); + info_packet->sb[5 ] = param->increase.frame_duration_hex; + info_packet->sb[6 ] = param->decrease.frame_duration_hex; + } +} +
Signature · 1 line
2.43.0
PATCH 4/30 drm/amd/display: Simplify hdmi_automation debugfs with debugfs_create_bool
In reply to Ray WuFrom: Fangzhi Zuo <[email protected]>
[Why & How]
Existing hdmi_automation debugfs entry
hand-rolled the boolean parsing (scratch buffer, parse_write_buffer_into_params(), a switch and kfree) that the debugfs core already provides.
hdmi_comp_auto is a plain bool, so bind it directly with debugfs_create_bool() and drop the custom write handler, its file_operations and the hdmi_debugfs_entries[] row.
--- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 69 +------------------ 1 file changed, 3 insertions(+), 66 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +3 -66
@@ -2995,64 +2995,6 @@ static ssize_t hdmi_cec_state_write(struct file *f, const char __user *buf,return size; } -/** -* hdmi_automation_enable - Enable/Disable HDMI automation feature -* @f: file structure. -* @buf: userspace buffer. set to '1' to enable; '0' to disable automation feature. -* @size: size of buffer from userpsace. -* @pos: unused. -* -* Return size on success, error code on failure -*/ -static ssize_t hdmi_automation_enable (struct file *f,const char __user *buf, -size_t size,loff_t *pos) -{ -struct amdgpu_dm_connector *aconnector =file_inode (f)->i_private; -char *wr_buf =NULL ; -const uint32_t wr_buf_size =40 ; -int max_param_num =1 ; -uint8_t param_nums =0 ; -long param[2 ]; -bool hdmi_comp_auto; - -if (size ==0 ) -return -EINVAL ; - - wr_buf =kcalloc (wr_buf_size,sizeof (char ),GFP_KERNEL ); -if (!wr_buf) -return -ENOSPC ; - -if (parse_write_buffer_into_params (wr_buf, wr_buf_size, - (long *)param, buf, - max_param_num, - ¶m_nums)) { -kfree (wr_buf); -return -EINVAL ; - } - -if (param_nums <=0 ) { -kfree (wr_buf); -DRM_DEBUG_DRIVER ("user data not be read\n" ); -return -EINVAL ; - } - -switch (param[0 ]) { -case 0 : - hdmi_comp_auto = false; -break ; -case 1 : -default : - hdmi_comp_auto = true; -break ; - } - -/* Persist setting across sink re-detection/hotplug. */ - aconnector->hdmi_comp_auto = hdmi_comp_auto; - -kfree (wr_buf); -return size; -} -DEFINE_SHOW_ATTRIBUTE (dp_dsc_fec_support);DEFINE_SHOW_ATTRIBUTE (dmub_fw_state);DEFINE_SHOW_ATTRIBUTE (dmub_tracebuffer);
@@ -3171,12 +3113,6 @@ static const struct file_operations dp_mst_link_settings_debugfs_fops = { .llseek = default_llseek }; -static const struct file_operations hdmi_automation_debugfs_fops = { - .owner =THIS_MODULE , - .write = hdmi_automation_enable, - .llseek = default_llseek -}; - static const struct { char *name; const struct file_operations *fops;
@@ -3209,8 +3145,7 @@ static const struct {const struct file_operations *fops; } hdmi_debugfs_entries[] = { {"hdcp_sink_capability", &hdcp_sink_capability_fops}, - {"hdmi_cec_state", &hdmi_cec_state_fops}, - {"hdmi_automation", &hdmi_automation_debugfs_fops} + {"hdmi_cec_state", &hdmi_cec_state_fops} };/*
@@ -3975,6 +3910,8 @@ void connector_debugfs_init(struct amdgpu_dm_connector *connector)0644 , dir, connector, hdmi_debugfs_entries[i].fops); } + +debugfs_create_bool ("hdmi_automation" ,0644 , dir, &connector->hdmi_comp_auto); } }
Signature · 1 line
2.43.0
PATCH 5/30 drm/amd/display: use dmub to notify pme
In reply to Ray WuFrom: Charlene Liu <[email protected]>
[Why & How]
Use dmub to notify pme instead of pmfw.
This is for asic which has no pmfw-driver-if interface support.
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 17 +++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 11 +++++++++++ .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 15 +++++++++++---- 4 files changed, 40 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -1331,6 +1331,7 @@ struct dc_debug_options {uint8_t iommu_mismatch_temp_wka;bool disable_dynamic_expansion_for_test_pattern;bool psr_phy_force_phy_power_down_up_level_2; +bool dmub_send_az_pme_restore;uint32_t dml21_custom_derate_num_dpms;uint32_t dml21_custom_derate_at_dpm[DML2_MAX_NUM_DPM_LVL ];bool override_utm_client_qc_profile;
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +17 -0
@@ -2606,3 +2606,20 @@ void dc_dmub_srv_hubbub_set_riommu_pctrl(const struct dc_context *ctx, uint32_tdc_wake_and_execute_dmub_cmd (ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } + +void dc_dmub_srv_nbif_az_pme_restore (const struct dc_context *ctx,uint32_t az_inst) +{ +union dmub_rb_cmd cmd; + + az_inst = (az_inst <0x7 ) ? az_inst :0 ;//dcnhw max aud_end point is 7 + +memset (&cmd,0 ,sizeof (cmd)); + + cmd.nbif_az_pme_restore.header.type =DMUB_CMD__NBIF_AZ_PME_RESTORE ; + cmd.nbif_az_pme_restore.header.payload_bytes =sizeof (cmd.nbif_az_pme_restore.data); + + cmd.nbif_az_pme_restore.data.az_inst = az_inst &0xF ; + +/* AZ must be out of D3 before the endpoint is accessed, so wait for completion */ +dc_wake_and_execute_dmub_cmd (ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +}
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +11 -0
@@ -476,4 +476,15 @@ bool dc_dmub_srv_panel_polarity_get_polarity(struct dc_dmub_srv *dc_dmub_srv, ui*/ void dc_dmub_srv_hubbub_set_riommu_pctrl (const struct dc_context *ctx,uint32_t value); +/** +* dc_dmub_srv_nbif_az_pme_restore() - Wake the AZ endpoint from D3 via DMCUB. +* +* Replaces the clk_mgr PME workaround on DCN4_2, where the NBIF AZ PME restore +* is performed by DMCUB on the driver's behalf. No-op on other ASICs. +* +* @ctx: dc context +* @az_inst: Azalia codec endpoint instance +*/ +void dc_dmub_srv_nbif_az_pme_restore (const struct dc_context *ctx,uint32_t az_inst); +#endif /* _DMUB_DC_SRV_H_ */
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +11 -4
@@ -60,6 +60,7 @@#include "dpcd_defs.h" #include "dsc.h" #include "dc_dp_types.h" +#include "dc_dmub_srv.h" /* include DCE11 register header files */ #include "dce/dce_11_0_d.h" #include "dce/dce_11_0_sh_mask.h"
@@ -1146,7 +1147,10 @@ void dce110_enable_audio_stream(struct pipe_ctx *pipe_ctx)if (dc->current_state->res_ctx.pipe_ctx[i].stream_res.audio !=NULL ) num_audio++; } -if (num_audio >=1 && clk_mgr->funcs->enable_pme_wa) { +if (dc->debug.dmub_send_az_pme_restore) { +/*wake AZ from D3 first before access az endpoint*/ +dc_dmub_srv_nbif_az_pme_restore (dc->ctx, pipe_ctx->stream_res.audio->inst); + }else if (num_audio >=1 && clk_mgr->funcs->enable_pme_wa) {/*wake AZ from D3 first before access az endpoint*/ clk_mgr->funcs->enable_pme_wa (clk_mgr); }
@@ -1184,10 +1188,13 @@ void dce110_disable_audio_stream(struct pipe_ctx *pipe_ctx)if (pipe_ctx->stream_res.audio) { pipe_ctx->stream_res.audio->enabled = false; -if (clk_mgr->funcs->enable_pme_wa) -/*this is the first audio. apply the PME w/a in order to wake AZ from D3*/ +if (dc->debug.dmub_send_az_pme_restore) { +/*wake AZ from D3 first before access az endpoint*/ +dc_dmub_srv_nbif_az_pme_restore (dc->ctx, pipe_ctx->stream_res.audio->inst); + }else if (clk_mgr->funcs->enable_pme_wa) { +/*wake AZ from D3 first before access az endpoint*/ clk_mgr->funcs->enable_pme_wa (clk_mgr); - + }/* TODO: notify audio driver for if audio modes list changed * add audio mode list change flag */ /* dal_audio_disable_azalia_audio_jack_presence(stream->audio,
Signature · 1 line
2.43.0
PATCH 6/30 drm/amd/display: YUV422 Semi-Planar Images Show Color Blurring at Color Boundaries
In reply to Ray WuFrom: Kaier Hsueh <[email protected]>
[Why & How]
Handle 90/270 degree rotation with YUV422 format by swapping the subsampling axis since rotation swaps the orientation. For 4:2:2 subsampling, when the image is rotated 90/270 degrees, the subsampling axis changes, so we need to update our tracking of which axis is subsampled.
--- drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c +7 -0
@@ -1018,6 +1018,13 @@ static bool spl_get_optimal_number_of_taps(bool is_horz_subsampled = (spl_is_subsampled_format (spl_in->basic_in.format) && !spl_in->upsp_mode);bool is_vert_subsampled = (spl_is_yuv420 (spl_in->basic_in.format) && !spl_in->upsp_mode); +/* Only 4:2:2 subsamples a single axis; 90/270 rotates that axis from horizontal to vertical +* (like the ratio/cositing swaps above) so the now-full-res axis gets the 1-tap sharp bypass */ +if ((spl_in->basic_in.rotation ==SPL_ROTATION_ANGLE_90 || + spl_in->basic_in.rotation ==SPL_ROTATION_ANGLE_270 ) && +spl_is_yuv422 (spl_in->basic_in.format)) +spl_swap (is_horz_subsampled, is_vert_subsampled); +if (spl_scratch->scl_data.viewport.width > spl_scratch->scl_data.h_active && max_downscale_src_width !=0 && spl_scratch->scl_data.viewport.width > max_downscale_src_width) {
Signature · 1 line
2.43.0
PATCH 7/30 drm/amd/display: Gate DP_TRACE_SOURCE_SEQUENCE emission on the debug flag
In reply to Ray WuFrom: Piotr Maziarz <[email protected]>
[Why]dp_trace_source_sequence() only writes DPCD when dc->debug.enable_driver_sequence_debug is set, and it reads that flag at execute time. The step was therefore emitted on every DP flip and then discarded by the callee whenever the flag was clear. The flag is set once at init, so the decision belongs in the build phase.
The fast-sequence site also hand-wrote the step, bypassing the bounds check in hwss_add_dp_trace_source_sequence(), and the golden dumper had no case for the operation despite core_golden.hpp carrying .source.
[How]
Emit the step only when the signal is DP and the flag is set. The guard inside dp_trace_source_sequence() stays, as many non-BLS callers rely on it. Use the bounds-checked helper in hwss_build_fast_sequence(), add the dumper case, and set the flag in FAST_UPDATE_INFO_FRAME so its golden still matches.
No functional change when the flag is set.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 +++- drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 10 ++++------ 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -1
@@ -4216,7 +4216,9 @@ static void commit_planes_do_stream_update_sequence(struct dc *dc,resource_build_info_frame (pipe_ctx);add_update_info_frame_sequence (&seq_state, pipe_ctx); -if (dc_is_dp_signal (pipe_ctx->stream->signal)) +/* The step only writes DPCD when the debug flag is set, so gate emission on it here. */ +if (dc_is_dp_signal (pipe_ctx->stream->signal) && + dc->debug.enable_driver_sequence_debug)hwss_add_dp_trace_source_sequence (&seq_state, pipe_ctx->stream->link,DPCD_SOURCE_SEQ_AFTER_UPDATE_INFO_FRAME );
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +4 -6
@@ -1292,12 +1292,10 @@ void hwss_build_fast_sequence(struct dc *dc, block_sequence[*num_steps].func =HWSS_UPDATE_INFO_FRAME ; (*num_steps)++; -if (dc_is_dp_signal (pipe_ctx->stream->signal)) { - block_sequence[*num_steps].params.dp_trace_source_sequence_params.link = pipe_ctx->stream->link; - block_sequence[*num_steps].params.dp_trace_source_sequence_params.source =DPCD_SOURCE_SEQ_AFTER_UPDATE_INFO_FRAME ; - block_sequence[*num_steps].func =DP_TRACE_SOURCE_SEQUENCE ; - (*num_steps)++; - } +/* The step only writes DPCD when the debug flag is set, so gate emission on it here. */ +if (dc_is_dp_signal (pipe_ctx->stream->signal) && dc->debug.enable_driver_sequence_debug) +hwss_add_dp_trace_source_sequence (&seq_state, pipe_ctx->stream->link, +DPCD_SOURCE_SEQ_AFTER_UPDATE_INFO_FRAME ); } if (dc->hwss.set_dmdata_attributes && stream->update_flags.bits.dmdata &&
Signature · 1 line
2.43.0
PATCH 8/30 drm/amd/display: reject invalid per-mode FreeSync timing
In reply to Ray WuFrom: Fangzhi Zuo <[email protected]>
[Why & How]
A zero EDID FreeSync VCP code means that no dynamic FreeSync on/off control is available from the monitor OSD; it does not mean that the sink lacks FreeSync capability. Do not clear freesync_capable solely because freesync_vcp_code is zero; keep capability based on the parsed FreeSync range while validating VRR timing per CRTC.
Some display modes cannot represent the sink's advertised maximum FreeSync refresh without reducing the mode's nominal vertical total. The FreeSync module clamps such a calculated vtotal back to nominal while the stream can remain FreeSync-capable, leaving no valid timing window for the requested maximum refresh. This affects low-clock timings such as 720x576p50.
Compute the vtotal required at max_vfreq from each mode's pixel clock and htotal, using ceiling division. Mark VRR unsupported when this value is below the mode's nominal vtotal. If timing or range inputs are incomplete, preserve the existing capability decision.
Add KUnit coverage for the invalid 720x576 timing and a valid 4K60 timing.
--- .../display/amdgpu_dm/amdgpu_dm_connector.c | 6 --- .../display/amdgpu_dm/amdgpu_dm_freesync.c | 26 ++++++++++- .../tests/amdgpu_dm_connector_test.c | 8 ++-- .../amdgpu_dm/tests/amdgpu_dm_freesync_test.c | 45 +++++++++++++++++-- 4 files changed, 70 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c +0 -6
@@ -4018,12 +4018,6 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, amdgpu_dm_connector->min_vfreq; } -/* HDMI/PCON without an EDID FreeSync VCP code is not FreeSync-capable. */ -if ((sink->sink_signal ==SIGNAL_TYPE_HDMI_TYPE_A || - as_type ==FREESYNC_TYPE_PCON_IN_WHITELIST ) && - !sink->edid_caps.freesync_vcp_code) - freesync_capable = false; -/* Handle MCCS */ if (do_mccs) {dm_helpers_read_mccs_caps (adev->dm.dc->ctx, amdgpu_dm_connector->dc_link, sink);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c +25 -1
@@ -112,6 +112,26 @@ void amdgpu_dm_reset_freesync_config_for_crtc( }EXPORT_IF_KUNIT (amdgpu_dm_reset_freesync_config_for_crtc); +static bool amdgpu_dm_is_vrr_timing_valid (const struct drm_display_mode *mode, +int max_vfreq) +{ +u64 numerator, denominator, vtotal_at_max_refresh; + +/* +* Leave the existing decision unchanged without complete timing data; +* otherwise, the computed vtotal must not be below the nominal vtotal. +*/ +if (!mode->clock || !mode->htotal || !mode->vtotal || max_vfreq <=0 ) +return true; + + numerator = (u64 )mode->clock *1000 ; + denominator = (u64 )mode->htotal * max_vfreq; + vtotal_at_max_refresh = +div64_u64 (numerator + denominator -1 , denominator); + +return vtotal_at_max_refresh >= mode->vtotal; +} +void amdgpu_dm_get_freesync_config_for_crtc (struct dm_crtc_state *new_crtc_state,struct dm_connector_state *new_con_state)
@@ -121,15 +141,19 @@ void amdgpu_dm_get_freesync_config_for_crtc(struct drm_display_mode *mode = &new_crtc_state->base.mode;int vrefresh =drm_mode_vrefresh (mode);bool fs_vid_mode = false; +bool vrr_timing_valid;if (new_con_state->base.connector->connector_type ==DRM_MODE_CONNECTOR_WRITEBACK )return ; aconnector =to_amdgpu_dm_connector (new_con_state->base.connector); + vrr_timing_valid =amdgpu_dm_is_vrr_timing_valid (mode, aconnector->max_vfreq); + new_crtc_state->vrr_supported = new_con_state->freesync_capable && vrefresh >= aconnector->min_vfreq && - vrefresh <= aconnector->max_vfreq; + vrefresh <= aconnector->max_vfreq && + vrr_timing_valid;if (new_crtc_state->vrr_supported) { new_crtc_state->stream->ignore_msa_timing_param = true;
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c +4 -4
@@ -9572,7 +9572,7 @@ static void dm_test_fs_caps_hdmi_vsdb(struct kunit *test)KUNIT_EXPECT_EQ (test, ctx->aconnector->max_vfreq,60 );KUNIT_EXPECT_EQ (test, connector->display_info.monitor_range.min_vfreq,24 );KUNIT_EXPECT_EQ (test, connector->display_info.monitor_range.max_vfreq,60 ); -KUNIT_EXPECT_FALSE (test,dm_test_fs_caps_capable (ctx)); +KUNIT_EXPECT_TRUE (test,dm_test_fs_caps_capable (ctx)); }/**
@@ -9599,8 +9599,8 @@ static void dm_test_fs_caps_hdmi_no_vsdb(struct kunit *test)* @test: The KUnit test context * * A whitelisted protocol converter re-parses the AMD VSDB, enables SDP v1.3 -* packing and adopts the converter adaptive sync type. Without an EDID -* FreeSync VCP code, the connector is not marked FreeSync-capable. +* packing and adopts the converter adaptive sync type. The connector remains +* FreeSync-capable when the EDID has no FreeSync VCP code. */ static void dm_test_fs_caps_pcon_whitelist (struct kunit *test) {
@@ -9622,7 +9622,7 @@ static void dm_test_fs_caps_pcon_whitelist(struct kunit *test) (int)FREESYNC_TYPE_PCON_IN_WHITELIST);KUNIT_EXPECT_EQ (test, ctx->aconnector->min_vfreq,24 );KUNIT_EXPECT_EQ (test, ctx->aconnector->max_vfreq,60 ); -KUNIT_EXPECT_FALSE (test,dm_test_fs_caps_capable (ctx)); +KUNIT_EXPECT_TRUE (test,dm_test_fs_caps_capable (ctx)); }/**
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_freesync_test.c +41 -4
81 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 9/30 drm/amd/display: Add DPG force-on-flip support for SystemDisplayEnable
In reply to Ray WuFrom: Sharique Pervaiz <[email protected]>
[Why & How]
Add force_dpg_on_flip debug option so DM can drive a solid-color DPG pattern on the final flip instead of a real surface flip.
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 7 +++++++ .../gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 11 +++++++++++ 3 files changed, 19 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -1188,6 +1188,7 @@ struct dc_debug_options {bool enable_dmcub_surface_flip;bool usbc_combo_phy_reset_wa;bool force_fva; +bool force_dpg_on_flip;int max_frl_rate;unsigned int force_frl_rate;bool ignore_ffe;
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +7 -0
@@ -1249,6 +1249,13 @@ void dcn20_blank_pixel_data(/* get opp dpg blank color */ color_space_to_black_color (dc, color_space, &black_color); +/* Debug: force a solid blue DPG pattern. */ +if (dc->debug.force_dpg_on_flip) { + black_color.color_r_cr =0 ; + black_color.color_g_y =0 ; + black_color.color_b_cb =0x3ff ; + } +if (blank) { dc->hwss.set_abm_immediate_disable (pipe_ctx);
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +11 -0
@@ -2723,6 +2723,17 @@ void dcn401_program_front_end_for_ctx( pipe->plane_res.hubp->funcs->hubp_wait_pipe_read_start (pipe->plane_res.hubp); } } + +/* Debug (DM SystemDisplayEnable, driver disabled): force solid-color DPG +* output last, after all normal pipe/OPP programming, so it isn't overwritten. +*/ +if (dc->debug.force_dpg_on_flip && hws->funcs.blank_pixel_data) { +for (i =0 ; i < dc->res_pool->pipe_count; i++) { + pipe = &context->res_ctx.pipe_ctx[i]; +if (resource_is_pipe_type (pipe,OTG_MASTER )) + hws->funcs.blank_pixel_data (dc, pipe, true); + } + } } void dcn401_post_unlock_program_front_end(
Signature · 1 line
2.43.0
PATCH 10/30 drm/amd/display: Log PSR and Replay status after mode change
In reply to Ray Wu[Why & How]
The PSR status log was emitted during hardware initialization, before the power module completed PSR setup. This could report a stale PSR status. Move the PSR log after mod_power_notify_mode_change() and add Replay status logging at the same point.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +24 -7
@@ -2616,13 +2616,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)if (psr_feature_enabled) {amdgpu_dm_set_psr_caps (link, aconnector); -drm_info (adev_to_drm (adev),"%s: PSR support %d, DC PSR ver %d, sink PSR ver %d DPCD caps 0x%x su_y_granularity %d\n" , - aconnector->base.name, - link->psr_settings.psr_feature_enabled, - link->psr_settings.psr_version, - link->dpcd_caps.psr_info.psr_version, - link->dpcd_caps.psr_info.psr_dpcd_caps.raw, - link->dpcd_caps.psr_info.psr2_su_y_granularity_cap); } } }
@@ -4547,12 +4540,36 @@ STATIC_IFN_KUNIT void amdgpu_dm_mod_power_setup_streams(struct drm_atomic_commitcontinue ;if (new_crtc_state->active) { +struct amdgpu_dm_connector *aconnector = + (struct amdgpu_dm_connector *) + dm_new_crtc_state->stream->dm_stream_context; +struct dc_link *link = dm_new_crtc_state->stream->link; +amdgpu_dm_link_setup_replay (dm_new_crtc_state->stream, &acrtc->dm_irq_params.vrr_params);mod_power_notify_mode_change (dm->power_module, dm_new_crtc_state->stream, false); +if (link->replay_settings.config.replay_cap_support) { +drm_info (state->dev, +"%s: Replay enabled %d, Allow active %d, Config ver %d\n" , + aconnector->base.name, + link->replay_settings.replay_feature_enabled, + link->replay_settings.replay_allow_active, + link->replay_settings.config.replay_version); + } +if (link->psr_settings.psr_version !=DC_PSR_VERSION_UNSUPPORTED ) { +drm_info (state->dev, +"%s: PSR support %d, DC PSR ver %d, Sink PSR ver %d, DPCD caps 0x%x, su_y_granularity %d\n" , + aconnector->base.name, + link->psr_settings.psr_feature_enabled, + link->psr_settings.psr_version, + link->dpcd_caps.psr_info.psr_version, + link->dpcd_caps.psr_info.psr_dpcd_caps.raw, + link->dpcd_caps.psr_info.psr2_su_y_granularity_cap); + } +/* * Block PSR / Replay on the new stream until display settles post-modeset. * These events will be cleared by amdgpu_dm_enable_self_refresh() once
Signature · 1 line
2.43.0
PATCH 11/30 drm/amd/display: Exit PSR/Replay on non-modeset full updates
In reply to Ray Wu[Why]
The greeter issues non-modeset full updates on the existing stream, but amdgpu_dm_mod_power_update_streams() returns early for those, so Replay is not exited. Xorg then renders directly to the front buffer and no further commit reaches the driver.
[How]
Set psr_event_hw_programming and replay_event_hw_programming for every active CRTC before the modeset check, so PSR/Replay is exited whenever the DC state is reprogrammed, not only on modeset. Keep the mod_power add, replace and remove stream calls for modesets that change the stream.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +17 -13
@@ -4451,12 +4451,12 @@ STATIC_IFN_KUNIT void dm_clear_writeback(struct amdgpu_display_manager *dm,EXPORT_IF_KUNIT (dm_clear_writeback);/** -* amdgpu_dm_mod_power_update_streams - update mod_power stream state on modeset +* amdgpu_dm_mod_power_update_streams - update mod_power stream state * @state: the drm atomic state * @dm: the display manager to update mod_power on * -* Notify mod_power of stream changes on modeset events, and disable PSR/Replay -* in preparation for hardware programming. See also +* Disable PSR/Replay before hardware programming for active streams, and +* update mod_power stream state when a modeset changes the stream. See also * amdgpu_dm_mod_power_setup_streams() for post-modeset mod_power setup. */ STATIC_IFN_KUNIT void amdgpu_dm_mod_power_update_streams(struct drm_atomic_commit *state,
@@ -4472,15 +4472,15 @@ STATIC_IFN_KUNIT void amdgpu_dm_mod_power_update_streams(struct drm_atomic_commi dm_old_crtc_state =to_dm_crtc_state (old_crtc_state); dm_new_crtc_state =to_dm_crtc_state (new_crtc_state); -if (!drm_atomic_crtc_needs_modeset (new_crtc_state)) -continue ; -/* -* Update mod_power on modeset event in preparation for hw -* programming. Always use the old stream, since it would have -* been previously added to mod_power. If old stream is null (on -* crtc enable, for example), mod_power will no-op, which is the -* desried behavior. +* Notify mod_power that hardware programming is about to occur. +* This must be done before the modeset check because a non-modeset +* commit can still update an active framebuffer or plane while +* PSR/Replay is enabled. +* +* Always use the old stream since it is the stream currently +* registered with mod_power. If old stream is NULL, the event +* helpers will no-op. */ if (old_crtc_state->active) { scoped_guard(mutex, &dm->dc_lock) {
@@ -4489,11 +4489,15 @@ STATIC_IFN_KUNIT void amdgpu_dm_mod_power_update_streams(struct drm_atomic_commi psr_event_hw_programming, true);amdgpu_dm_replay_set_event (dm, dm_old_crtc_state->stream, true, replay_event_hw_programming, true); -amdgpu_dm_replay_set_event (dm, dm_old_crtc_state->stream, false, - replay_event_general_ui, false); } } +if (!drm_atomic_crtc_needs_modeset (new_crtc_state)) +continue ; + +if (dm_old_crtc_state->stream == dm_new_crtc_state->stream) +continue ; +if (new_crtc_state->active) { aconnector = (struct amdgpu_dm_connector *) dm_new_crtc_state->stream->dm_stream_context;
Signature · 1 line
2.43.0
PATCH 12/30 drm/amd/display: Update DMU cmd header
In reply to Ray WuFrom: Alvin Lee <[email protected]>
[Why & How]
Update DMU cmd header for DML submission dependency.
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +10 -4
@@ -2802,8 +2802,11 @@ union dmub_fams2_stream_static_sub_state_v2 {struct dmub_fams2_stream_static_state {enum fams2_stream_type type; -uint32_t otg_vline_time_ns; -uint32_t otg_vline_time_ticks; +union { +uint32_t otg_vline_time_ns;// used by DCN4 +uint32_t otg_vline_time_ps;// used by DCN6+ + }; +uint32_t otg_vline_time_ticks;// U22.10 fixed point, see FAMS2_OTG_VLINE_TIME_TICKS_U22_10_FRAC_BITS uint16_t htotal;uint16_t vtotal;// nominal vtotal uint16_t vblank_start;
@@ -2835,8 +2838,11 @@ struct dmub_fams2_stream_static_state {struct dmub_fams2_cmd_stream_static_base_state {enum fams2_stream_type type; -uint32_t otg_vline_time_ns; -uint32_t otg_vline_time_ticks; +union { +uint32_t otg_vline_time_ns;// used by DCN4 +uint32_t otg_vline_time_ps;// used by DCN6+ + }; +uint32_t otg_vline_time_ticks;// U22.10 fixed point, see FAMS2_OTG_VLINE_TIME_TICKS_U22_10_FRAC_BITS uint16_t htotal;uint16_t vtotal;// nominal vtotal uint16_t vblank_start;
Signature · 1 line
2.43.0
PATCH 13/30 drm/amd/display: Use picoseconds for line time on DCN6+
In reply to Ray WuFrom: Alvin Lee <[email protected]>
[Why & How]
- Update to use picoseconds for line time in FAMS2 for DCN6+
--- .../src/dml2_core/dml2_core_dcn6_funcs_mode_programming.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_mode_programming.c +2 -2
@@ -700,8 +700,8 @@ static void dcn6_populate_fams2_programming(const struct dml2_core_internal_disp base_programming->config.bits.is_drr = stream_descriptor->timing.drr_config.enabled;/* from meta */ - base_programming->otg_vline_time_ns = - (unsigned int )(stream_pstate_meta->otg_vline_time_us *1000.0 ); + base_programming->otg_vline_time_ps = + (unsigned int )(stream_pstate_meta->otg_vline_time_us *1000000.0 ); base_programming->scheduling_delay_otg_vlines = (uint8_t )stream_pstate_meta->scheduling_delay_otg_vlines; base_programming->contention_delay_otg_vlines = (uint8_t )stream_pstate_meta->contention_delay_otg_vlines; base_programming->vline_int_ack_delay_otg_vlines = (uint8_t )stream_pstate_meta->vertical_interrupt_ack_delay_otg_vlines;
Signature · 1 line
2.43.0
PATCH 14/30 drm/amd/display: Do not allow vbios version of dmubfw in the driver
In reply to Ray WuFrom: Charlene Liu <[email protected]>
[Why & How]
The vbios version of the dmubfw lacks driver feature support such as HWFLIPQ, PSR/PSRSU/Replay/IPS, etc. Allowing the driver to use the vbios version of dmubfw risks a deadlock and system hang.
--- drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.c +8 -0
@@ -384,10 +384,18 @@ bool dmub_dcn42_is_hw_init(struct dmub_srv *dmub) {union dmub_fw_boot_status status;uint32_t is_hw_init; +uint32_t fw_version; +bool is_vbios_fw; status.all =REG_READ (DMCUB_SCRATCH0 );REG_GET (DMCUB_CNTL ,DMCUB_ENABLE , &is_hw_init); + fw_version =REG_READ (DMCUB_SCRATCH1 ); + is_vbios_fw = ((fw_version >>6 ) &0x01 ) ? true : false; +if (is_vbios_fw) { +dm_output_to_console ("\n: DMU started with VBIOS FW, fw_version = 0x%x\n" , fw_version); +return false; + }return is_hw_init !=0 && status.bits.dal_fw; }
Signature · 1 line
2.43.0
PATCH 15/30 drm/amd/display: remove hard code min dcfclk for AC.
In reply to Ray WuFrom: Charlene Liu <[email protected]>
[Why & How]
At driver init time, power_source is not initialized.
It will override DC's min dcfclk as well.
Since latest pmfw has the fix release, we can remove the previous w/a.
--- .../gpu/drm/amd/display/dc/clk_mgr/dcn42b/dcn42b_clk_mgr.c | 2 -- drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.c | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn42b/dcn42b_clk_mgr.c +0 -2
@@ -418,8 +418,6 @@ static void dcn42b_update_clocks(struct clk_mgr *clk_mgr_base, dc->debug.force_min_dcfclk_mhz =DCN42B_MIN_DCFCLK_MHZ ; else if (dc->debug.force_min_dcfclk_mhz > DCN42B_MAX_DCFCLK_MHZ) dc->debug.force_min_dcfclk_mhz = DCN42B_MAX_DCFCLK_MHZ; - }else if (power_supply_is_system_supplied ()) { - dc->debug.force_min_dcfclk_mhz =DCN42B_AC_MIN_DCFCLK_MHZ ; }dcn42_update_clocks (clk_mgr_base, context, safe_to_lower);
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.c +2 -3
@@ -392,10 +392,9 @@ bool dmub_dcn42_is_hw_init(struct dmub_srv *dmub) fw_version =REG_READ (DMCUB_SCRATCH1 ); is_vbios_fw = ((fw_version >>6 ) &0x01 ) ? true : false; -if (is_vbios_fw) { -dm_output_to_console ("\n: DMU started with VBIOS FW, fw_version = 0x%x\n" , fw_version); +if (is_vbios_fw)return false; - } +return is_hw_init !=0 && status.bits.dal_fw; }
Signature · 1 line
2.43.0
PATCH 16/30 drm/amd/display: don't WARN when removing an unallocated MST payload
In reply to Ray WuFrom: Mario Limonciello <[email protected]>
[Why]
On an MST teardown that runs through the reset path (dcn31_reset_hw_ctx_wrap -> link_set_dpms_off -> deallocate_mst_payload), fill_dc_mst_payload_table_from_drm() is asked to remove a payload whose vcpi is not present in link->mst_stream_alloc_table and trips:
WARNING: .../amdgpu_dm_helpers.c:275 fill_dc_mst_payload_table_from_drm
This is a legitimate case, not an error: deallocate_mst_payload() can be called for a stream whose MST payload was never programmed into DC's HW-maintained table (a new stream created for a modeset whose enable never completed, as already documented in deallocate_mst_payload()). There is simply nothing to remove.
[How]
Drop the ASSERT and fall through to the fill loop, which rebuilds the allocation table from the remaining entries. The table ends up unchanged, which is correct: the payload being removed was never in it.
Note the loop must not early-return here - the caller passes a zeroed proposed_table, so returning early would zero the whole link's table and drop the other MST streams sharing the link.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +1 -1
@@ -309,7 +309,7 @@ fill_dc_mst_payload_table_from_drm(struct dc_link *link,break ; } } -ASSERT (i != copy_of_link_table.stream_count); +/* Payload absent from HW table when never allocated: nothing to remove. */ }/* Fill payload info*/
Signature · 1 line
2.43.0
PATCH 17/30 drm/amd/display: handle exit LS in second ISHARP programming block
In reply to Ray WuFrom: Samson Tam <[email protected]>
[Why]
The hardware programming guide indicates that we must exit LS before any coefficient writes.
ISHARP LUT table write occurs earlier to handle case where only sharpness level has changed. So it occurs before exit LS
[How]
Add dpp401_power_on_isharp call to explicitly handle exit LS for ISHARP programming
Call power_on_isharp on before and power_on_isharp off after ISHARP programming in both cases
--- .../amd/display/dc/dpp/dcn401/dcn401_dpp.h | 8 ++-- .../display/dc/dpp/dcn401/dcn401_dpp_dscl.c | 40 +++++++++++++------ .../amd/display/dc/dpp/dcn60/dcn60_dpp_dscl.c | 7 ++++ 3 files changed, 38 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/dc/dpp/dcn401/dcn401_dpp.h +4 -4
@@ -757,10 +757,6 @@ enum dcn401_dscl_mode_sel dpp401_dscl_get_dscl_mode(const struct scaler_data *data, bool dbg_always_scale); -void dpp401_power_on_dscl ( -struct dpp *dpp_base, -bool power_on); -void dpp401_dscl_set_recout (struct dcn401_dpp *dpp,const struct rect *recout);
@@ -793,4 +789,8 @@ void dpp401_dscl_program_easf(struct dpp *dpp_base, const struct scaler_data *scl_data); +void dpp401_power_on_isharp ( +struct dpp *dpp_base, +bool power_on); +#endif /* __DCN401_DPP_H__ */
drivers/gpu/drm/amd/display/dc/dpp/dcn401/dcn401_dpp_dscl.c +27 -13
@@ -146,7 +146,7 @@ enum dcn401_dscl_mode_sel dpp401_dscl_get_dscl_mode(return DCN401_DSCL_MODE_SCALING_420_YCBCR_ENABLE ; } -void dpp401_power_on_dscl ( +static void dpp401_power_on_dscl (struct dpp *dpp_base,bool power_on) {
@@ -173,6 +173,25 @@ void dpp401_power_on_dscl( } } +void dpp401_power_on_isharp ( +struct dpp *dpp_base, +bool power_on) +{ +struct dcn401_dpp *dpp =TO_DCN401_DPP (dpp_base); + +if (power_on) { +/* exit LS prior to programming ISHARP LUT */ +REG_UPDATE_2 (ISHARP_DELTA_LUT_MEM_PWR_CTRL , +ISHARP_DELTA_LUT_MEM_PWR_FORCE ,0 , +ISHARP_DELTA_LUT_MEM_PWR_DIS ,1 ); +REG_WAIT (ISHARP_DELTA_LUT_MEM_PWR_CTRL , +ISHARP_DELTA_LUT_MEM_PWR_STATE ,0 ,1 ,100 ); + }else { +REG_UPDATE_SEQ_2 (ISHARP_DELTA_LUT_MEM_PWR_CTRL , +ISHARP_DELTA_LUT_MEM_PWR_FORCE ,0 , +ISHARP_DELTA_LUT_MEM_PWR_DIS ,0 ); + } +} static void dpp401_dscl_set_lb( struct dcn401_dpp *dpp,
@@ -964,13 +983,6 @@ void dpp401_dscl_program_isharp(struct dpp *dpp_base, *bs_coeffs_updated = false;PERF_TRACE (); -/*power on isharp_delta_mem first*/ -REG_UPDATE_2 (ISHARP_DELTA_LUT_MEM_PWR_CTRL , -ISHARP_DELTA_LUT_MEM_PWR_FORCE ,0 , -ISHARP_DELTA_LUT_MEM_PWR_DIS ,1 ); - -REG_WAIT (ISHARP_DELTA_LUT_MEM_PWR_CTRL , -ISHARP_DELTA_LUT_MEM_PWR_STATE ,0 ,1 ,100 );/* ISHARP_MODE */ REG_SET_6(ISHARP_MODE, 0,
@@ -1049,11 +1061,6 @@ void dpp401_dscl_program_isharp(struct dpp *dpp_base, } } -/*power on isharp_delta_mem first*/ -REG_UPDATE_SEQ_2 (ISHARP_DELTA_LUT_MEM_PWR_CTRL , -ISHARP_DELTA_LUT_MEM_PWR_FORCE ,0 , -ISHARP_DELTA_LUT_MEM_PWR_DIS ,0 ); -PERF_TRACE (); }// dpp401_dscl_program_isharp /**
@@ -1096,7 +1103,10 @@ void dpp401_dscl_set_scaler_manual_scale(struct dpp *dpp_base, (dpp->scl_data.dscl_prog_data.sharpness_level != scl_data->dscl_prog_data.sharpness_level)) {/* ISHARP_DELTA_LUT */ +dpp401_power_on_isharp (dpp_base, true);dpp401_dscl_set_isharp_filter (dpp, scl_data->dscl_prog_data.isharp_delta); +dpp401_power_on_isharp (dpp_base, false); + dpp->scl_data.dscl_prog_data.sharpness_level = scl_data->dscl_prog_data.sharpness_level;memcpy (dpp->scl_data.dscl_prog_data.isharp_delta, scl_data->dscl_prog_data.isharp_delta,sizeof (uint32_t ) *ISHARP_LUT_TABLE_SIZE );
@@ -1159,7 +1169,9 @@ void dpp401_dscl_set_scaler_manual_scale(struct dpp *dpp_base,if (dscl_mode ==DCN401_DSCL_MODE_SCALING_444_BYPASS ) {if (dpp->base.ctx->dc->config.prefer_easf)dpp401_dscl_disable_easf (dpp_base, scl_data); +dpp401_power_on_isharp (dpp_base, true);dpp401_dscl_program_isharp (dpp_base, scl_data, program_isharp_1dlut, &bs_coeffs_updated); +dpp401_power_on_isharp (dpp_base, false);return ; }
@@ -1193,7 +1205,9 @@ void dpp401_dscl_set_scaler_manual_scale(struct dpp *dpp_base,* WB scaler coeffs and toggle coeff RAM together */ //if (dpp->base.ctx->dc->config.prefer_easf) +dpp401_power_on_isharp (dpp_base, true);dpp401_dscl_program_isharp (dpp_base, scl_data, program_isharp_1dlut, &bs_coeffs_updated); +dpp401_power_on_isharp (dpp_base, false);dpp401_dscl_set_scl_filter (dpp, scl_data, ycbcr, bs_coeffs_updated);/* Edge adaptive scaler function configuration */
drivers/gpu/drm/amd/display/dc/dpp/dcn60/dcn60_dpp_dscl.c +7 -0
@@ -166,7 +166,10 @@ void dpp60_dscl_set_scaler_manual_scale(struct dpp *dpp_base, (dpp->scl_data.dscl_prog_data.sharpness_level != scl_data->dscl_prog_data.sharpness_level)) {/* ISHARP_DELTA_LUT */ +dpp401_power_on_isharp (dpp_base, true);dpp401_dscl_set_isharp_filter (dpp401, scl_data->dscl_prog_data.isharp_delta); +dpp401_power_on_isharp (dpp_base, false); + dpp->scl_data.dscl_prog_data.sharpness_level = scl_data->dscl_prog_data.sharpness_level;memcpy (dpp->scl_data.dscl_prog_data.isharp_delta, scl_data->dscl_prog_data.isharp_delta,sizeof (uint32_t ) *ISHARP_LUT_TABLE_SIZE );
@@ -230,7 +233,9 @@ void dpp60_dscl_set_scaler_manual_scale(struct dpp *dpp_base,if (dscl_mode ==DCN401_DSCL_MODE_SCALING_444_BYPASS ) {if (dpp->base.ctx->dc->config.prefer_easf)dpp401_dscl_disable_easf (dpp_base, scl_data); +dpp401_power_on_isharp (dpp_base, true);dpp401_dscl_program_isharp (dpp_base, scl_data, program_isharp_1dlut, &bs_coeffs_updated); +dpp401_power_on_isharp (dpp_base, false);return ; }
@@ -261,7 +266,9 @@ void dpp60_dscl_set_scaler_manual_scale(struct dpp *dpp_base,* WB scaler coeffs and toggle coeff RAM together */ //if (dpp->base.ctx->dc->config.prefer_easf) +dpp401_power_on_isharp (dpp_base, true);dpp401_dscl_program_isharp (dpp_base, scl_data, program_isharp_1dlut, &bs_coeffs_updated); +dpp401_power_on_isharp (dpp_base, false);dpp401_dscl_set_scl_filter (dpp401, scl_data, ycbcr, bs_coeffs_updated);/* Edge adaptive scaler function configuration */
Signature · 1 line
2.43.0
PATCH 18/30 drm/amd/display: move timing_adjust_pending into dc_stream_state
In reply to Ray WuFrom: Aric Cyr <[email protected]>
[Why]dc_stream_adjust_vmin_vmax() short circuits when the requested v_totals match stream->adjust and nothing is pending. A display that is not driving DRR requests a constant v_total, so that short circuit is permanent once hardware stops matching - and init_hw() resets the OTG DRR registers and the static screen trigger mask. The commit that follows need not restore them either: apply_ctx_to_hw() skips enable_stream_timing() when pipe_need_reprogram() considers the pipe unchanged, and dc_commit_streams() can skip the commit entirely on !streams_changed(). Panel replay never sees a static screen trigger again.
timing_adjust_pending should cover this, but it lives inside struct dc_crtc_timing_adjust, which is copied and compared by value. hwss.set_drr() takes it by value, and copy_stream_update_to_stream() wrote the flag back into the caller's struct.
[How]
Move timing_adjust_pending into struct dc_stream_state so a dc_crtc_timing_adjust is pure request data, safe to copy and compare.
Add program_pending_drr_adjust() to settle any stream still carrying a pending adjustment at the end of a commit, so a commit always leaves stream->adjust describing the OTG. It is a no-op when nothing is pending.
--- .../display/amdgpu_dm/amdgpu_dm_freesync.c | 2 +- .../amdgpu_dm/tests/amdgpu_dm_freesync_test.c | 4 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 51 +++++++++++++++---- .../drm/amd/display/dc/core/dc_hw_sequencer.c | 2 +- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 1 - drivers/gpu/drm/amd/display/dc/dc_stream.h | 3 ++ 6 files changed, 47 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c +1 -1
@@ -42,7 +42,7 @@bool amdgpu_dm_is_dc_timing_adjust_needed (struct dm_crtc_state *old_state,struct dm_crtc_state *new_state) { -if (new_state->stream->adjust.timing_adjust_pending) +if (new_state->stream->timing_adjust_pending)return true;if (new_state->freesync_config.state ==VRR_STATE_ACTIVE_FIXED )return true;
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_freesync_test.c +2 -2
@@ -173,7 +173,7 @@ static void dm_test_dc_timing_adjust_pending(struct kunit *test)KUNIT_ASSERT_NOT_ERR_OR_NULL (test, stream); new_state->stream = stream; - stream->adjust.timing_adjust_pending =1 ; + stream->timing_adjust_pending =1 ;KUNIT_EXPECT_TRUE (test,amdgpu_dm_is_dc_timing_adjust_needed (old_state, new_state)); }
@@ -592,7 +592,7 @@ static void dm_test_update_freesync_state_pre_ai_active(struct kunit *test)amdgpu_dm_update_freesync_state_on_stream (&adev->dm, &crtc_state, stream, surface,0 ); -KUNIT_EXPECT_FALSE (test, stream->adjust.timing_adjust_pending); +KUNIT_EXPECT_FALSE (test, stream->timing_adjust_pending); }static void dm_test_update_freesync_state_pcon_version (struct kunit *test,u8 version)
drivers/gpu/drm/amd/display/dc/core/dc.c +40 -11
106 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +1 -1
@@ -756,7 +756,7 @@ void set_drr_and_clear_adjust_pending(if (stream)/* A null params resets DRR in hw, leaving stream->adjust stale. */ - stream->adjust.timing_adjust_pending = (params ==NULL ); + stream->timing_adjust_pending = (params ==NULL ); } void get_fams2_visual_confirm_color(
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +0 -1
@@ -1083,7 +1083,6 @@ struct dc_crtc_timing_adjust {uint32_t v_total_mid;uint32_t v_total_mid_frame_num;uint32_t allow_otg_v_count_halt; -uint8_t timing_adjust_pending; };struct dtbclk_dto_params {
drivers/gpu/drm/amd/display/dc/dc_stream.h +3 -0
@@ -336,6 +336,9 @@ struct dc_stream_state {enum dc_blending_linearity blending_linearity;struct dc_update_scratch_space *update_scratch;bool firmware_controlled_hdr_info_packet; + +/* timing adjust has not been propagated to hardware yet. */ +bool timing_adjust_pending; };#define ABM_LEVEL_IMMEDIATE_DISABLE 255
Signature · 1 line
2.43.0
PATCH 19/30 drm/amd/display: Remove unused has_vsdb variable
In reply to Ray WuFrom: Ivan Lipski <[email protected]>
[Why & How]
Coverity analysis flagged this variable as unused, so remove it.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c +1 -1
@@ -3901,7 +3901,7 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, freesync_capable = true; } - has_vsdb =get_amd_vsdb (amdgpu_dm_connector, &vsdb_info); +get_amd_vsdb (amdgpu_dm_connector, &vsdb_info);if (vsdb_info.replay_mode) { amdgpu_dm_connector->vsdb_info.replay_mode = vsdb_info.replay_mode;
Signature · 1 line
2.43.0
PATCH 20/30 drm/amd/display: Reset UPSP and pre-CSC registers on DCN6 DPP reset
In reply to Ray WuFrom: Sridevi Arvindekar <[email protected]>
[Why]dpp_reset() only clears software state, so CNVC_UPSP_MODE and PRE_CSC_MODE stay programmed on DCN6 after UPSP was used.
[How]
Add a DCN6 dpp_reset, dcn6_dpp_reset(), which clears both registers when UPSP was in use and then calls the common dpp_reset().
--- .../drm/amd/display/dc/dpp/dcn60/dcn60_dpp.c | 17 ++++++++++++++++- .../drm/amd/display/dc/dpp/dcn60/dcn60_dpp.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dpp/dcn60/dcn60_dpp.c +16 -1
@@ -316,10 +316,25 @@ void dpp60_full_bypass(struct dpp *dpp_base)REG_SET (CM_CONTROL ,0 ,CM_BYPASS ,1 ); } +void dcn6_dpp_reset (struct dpp *dpp_base) +{ +struct dcn60_dpp *dpp =TO_DCN60_DPP (dpp_base); + +if (dpp->scl_data.upsp) { +if (dpp->tf_mask->UPSP_MODE) { +// Reset dpp registers used for upsp, lls +REG_WRITE (CNVC_UPSP_MODE ,0 ); +REG_WRITE (PRE_CSC_MODE ,0 ); + } + } + +dpp_reset (dpp_base); +} +static struct dpp_funcs dcn60_dpp_funcs = { .dpp_program_gamcor_lut = dpp6_program_gamcor_lut, .dpp_read_state = dpp401_read_state, - .dpp_reset = dpp_reset, + .dpp_reset = dcn6_dpp_reset, .dpp_set_scaler = dpp60_dscl_set_scaler_manual_scale, .dpp_get_optimal_number_of_taps = dpp3_get_optimal_number_of_taps, .dpp_set_pre_degam =NULL ,
drivers/gpu/drm/amd/display/dc/dpp/dcn60/dcn60_dpp.h +1 -0
@@ -522,5 +522,6 @@ bool dpp60_construct(struct dcn60_dpp *dpp60,bool dpp6_program_gamcor_lut (struct dpp *dpp_base,const struct pwl_params *params); +void dcn6_dpp_reset (struct dpp *dpp_base);#endif /* __DCN60_DPP_H__ */
Signature · 1 line
2.43.0
PATCH 21/30 drm/amd/display: guard DCE-only hwseq definitions
In reply to Ray WuFrom: Roman Li <[email protected]>
[Why]
When CONFIG_DRM_AMD_DC_DCE is disabled, the DCE110 hw_sequencer function tables along with the DCE-only callbacks and helpers are unused. Some compilers emit unused-function warnings for them, and the function tables keep references to code that is not needed in this configuration.
[How]
Wrap the DCE-only function tables, the constructor, and the DCE-only callbacks and helpers in #if defined(CONFIG_DRM_AMD_DC_DCE) so they are only compiled when DCE support is enabled. Shared functions used by the other DCE/DCN hardware sequencers remain compiled unconditionally. Replace the IS_ENABLED() runtime check in dce110_hw_sequencer_construct() with the compile-time guard.
--- .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 40 +++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +36 -4
@@ -102,6 +102,7 @@ struct dce110_hw_seq_reg_offsets {uint32_t crtc; }; +#if defined(CONFIG_DRM_AMD_DC_DCE) static const struct dce110_hw_seq_reg_offsets reg_offsets[] = { { .crtc = (mmCRTC0_CRTC_GSL_CONTROL - mmCRTC_GSL_CONTROL),
@@ -122,6 +123,7 @@ static const struct dce110_hw_seq_reg_offsets reg_offsets[] = {#define HW_REG_CRTC (reg, id)\ (reg + reg_offsets[id].crtc) +#endif #define MAX_WATERMARK 0xFFFF#define SAFE_NBP_MARK 0x7FFF
@@ -130,6 +132,7 @@ static const struct dce110_hw_seq_reg_offsets reg_offsets[] = {* Private definitions ******************************************************************************/ /***************************PIPE_CONTROL***********************************/ +#if defined(CONFIG_DRM_AMD_DC_DCE )static void dce110_init_pte (struct dc_context *ctx) {uint32_t addr;
@@ -196,6 +199,7 @@ static void dce110_init_pte(struct dc_context *ctx) dm_write_reg(ctx, addr, value); } } +#endif /**************************************************************************/ static void enable_display_pipe_clock_gating(
@@ -207,6 +211,7 @@ static void enable_display_pipe_clock_gating(/*TODO*/ } +#if defined(CONFIG_DRM_AMD_DC_DCE ) static bool dce110_enable_display_power_gating( struct dc *dc, uint8_t controller_id,
@@ -631,6 +636,8 @@ dce110_set_output_transfer_func(struct set_output_transfer_func_params *params) return true; } +#endif +void dce110_update_info_frame (struct pipe_ctx *pipe_ctx) {bool is_hdmi_tmds;
@@ -698,6 +705,7 @@ dce110_external_encoder_control(enum bp_external_encoder_control_action action,DC_LOG_ERROR ("Failed to execute external encoder action: 0x%x\n" , action); } +#if defined(CONFIG_DRM_AMD_DC_DCE )static void dce110_prepare_ddc (struct dc_link *link) {
@@ -717,6 +725,8 @@ dce110_dac_load_detect(struct dc_link *link)return bp_result ==BP_RESULT_OK ; } +#endif +void dce110_enable_stream (struct pipe_ctx *pipe_ctx) { enum dc_lane_count lane_count =
@@ -1595,6 +1605,7 @@ void build_audio_output( } } +#if defined(CONFIG_DRM_AMD_DC_DCE )static void program_scaler (const struct dc *dc,const struct pipe_ctx *pipe_ctx) {
@@ -1700,6 +1711,8 @@ static enum dc_status dce110_enable_stream_timing(return DC_OK ; } +#endif + enum dc_status dce110_apply_single_controller_ctx_to_hw( struct pipe_ctx *pipe_ctx, struct dc_state *context,
@@ -2284,6 +2297,7 @@ void dce110_set_safe_displaymarks(* Public functions ******************************************************************************/ +#if defined(CONFIG_DRM_AMD_DC_DCE )static void set_drr (struct pipe_ctx **pipe_ctx,int num_pipes,struct dc_crtc_timing_adjust adjust) {
@@ -2358,6 +2372,8 @@ static void set_static_screen_control(struct pipe_ctx **pipe_ctx, triggers, params->num_frames); } +#endif +/* * Check if FBC can be enabled */
@@ -2450,6 +2466,7 @@ void enable_fbc( } } +#if defined(CONFIG_DRM_AMD_DC_DCE )static void dce110_reset_hw_ctx_wrap (struct dc *dc,struct dc_state *context)
@@ -2522,6 +2539,8 @@ static void dce110_reset_hw_ctx_wrap( } } +#endif +static void dce110_setup_audio_dto (struct dc *dc,struct dc_state *context)
@@ -2764,6 +2783,7 @@ enum dc_status dce110_apply_ctx_to_hw(/******************************************************************************* * Front End programming ******************************************************************************/ +#if defined(CONFIG_DRM_AMD_DC_DCE )static void set_default_colors (struct pipe_ctx *pipe_ctx) {struct default_adjustment default_adjust = {0 };
@@ -2893,12 +2913,15 @@ static void dce110_update_pending_status(struct pipe_ctx *pipe_ctx) } } +#endif +void dce110_power_down (struct dc *dc) {power_down_all_hw_blocks (dc);disable_vga_and_power_gate_all_controllers (dc); } +#if defined(CONFIG_DRM_AMD_DC_DCE )static bool wait_for_reset_trigger_to_occur (struct dc_context *dc_ctx,struct timing_generator *tg)
@@ -3105,6 +3128,8 @@ static void dce110_init_hw(struct dc *dc) } +#endif +void dce110_prepare_bandwidth (struct dc *dc,struct dc_state *context)
@@ -3134,6 +3159,7 @@ void dce110_optimize_bandwidth( true); } +#if defined(CONFIG_DRM_AMD_DC_DCE )static void dce110_program_front_end_for_pipe (struct dc *dc,struct pipe_ctx *pipe_ctx) {
@@ -3411,6 +3437,8 @@ static void dce110_set_cursor_attribute(struct pipe_ctx *pipe_ctx) pipe_ctx->plane_res.xfm, attributes); } +#endif +bool dce110_set_backlight_level (struct pipe_ctx *pipe_ctx,struct set_backlight_level_params *backlight_level_params) {
@@ -3514,6 +3542,7 @@ void dce110_enable_tmds_link_output(struct dc_link *link, link->ddc_hw_inst, false); } +#if defined(CONFIG_DRM_AMD_DC_DCE )static void dce110_enable_analog_link_output (struct dc_link *link,uint32_t pix_clk_100hz)
@@ -3523,6 +3552,8 @@ static void dce110_enable_analog_link_output( pix_clk_100hz); } +#endif + void dce110_enable_dp_link_output( struct dc_link *link, const struct link_resource *link_res,
@@ -3622,6 +3653,7 @@ void dce110_disable_link_output(struct dc_link *link, dc->link_srv->dp_trace_source_sequence (link,DPCD_SOURCE_SEQ_AFTER_DISABLE_LINK_PHY ); } +#if defined(CONFIG_DRM_AMD_DC_DCE )static const struct hw_sequencer_funcs dce110_funcs = { .program_gamut_remap = program_gamut_remap, .program_output_csc = program_output_csc,
@@ -3688,8 +3720,8 @@ static const struct hwseq_private_funcs dce110_private_funcs = {void dce110_hw_sequencer_construct (struct dc *dc) { -if (IS_ENABLED (CONFIG_DRM_AMD_DC_DCE )) { - dc->hwss = dce110_funcs; - dc->hwseq->funcs = dce110_private_funcs; - } + dc->hwss = dce110_funcs; + dc->hwseq->funcs = dce110_private_funcs; } + +#endif /* CONFIG_DRM_AMD_DC_DCE */
Signature · 1 line
2.43.0
PATCH 22/30 drm/amd/display: warn on unadvertised modes without scaling
In reply to Ray WuFrom: Fangzhi Zuo <[email protected]>
[Why]
Selecting an unadvertised custom mode without scaling can send an unsupported timing directly to the display.
[How]
Post a warning when this selection is made and advise to choose an advertised/native mode when visual defect is observed.
--- .../display/amdgpu_dm/amdgpu_dm_connector.c | 36 ++++++++++++------- .../display/amdgpu_dm/amdgpu_dm_connector.h | 2 +- 2 files changed, 24 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c +23 -13
@@ -1397,6 +1397,21 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector, }#endif +STATIC_IFN_KUNIT bool is_duplicate_mode(struct amdgpu_dm_connector *aconnector, +const struct drm_display_mode *mode) +{ +struct drm_display_mode *m; + +list_for_each_entry (m, &aconnector->base.probed_modes, head) { +if (drm_mode_equal (m, mode)) +return true; + } + +return false; +} + +EXPORT_IF_KUNIT (is_duplicate_mode); + void amdgpu_dm_update_stream_scaling_settings(struct drm_device *dev, const struct drm_display_mode *mode, const struct dm_connector_state *dm_state,
@@ -1473,6 +1488,7 @@ create_stream_for_sink(struct drm_connector *connector,struct drm_display_mode *freesync_mode =NULL ;bool native_mode_found = false;bool recalculate_timing = false; +bool unadvertised_mode = false;bool scale = dm_state->scaling !=RMX_OFF ;int mode_refresh;int preferred_refresh =0 ;
@@ -1559,6 +1575,13 @@ create_stream_for_sink(struct drm_connector *connector, &mode, preferred_mode, scale); preferred_refresh =drm_mode_vrefresh (preferred_mode); + unadvertised_mode = !is_duplicate_mode (aconnector, drm_mode); + +if (unadvertised_mode && dm_state->scaling ==RMX_OFF ) +drm_dbg_driver (dev, +"Unadvertised mode %dx%d@%d with RMX_OFF\n" , + drm_mode->hdisplay, drm_mode->vdisplay, +drm_mode_vrefresh (drm_mode)); } }
@@ -2961,19 +2984,6 @@ STATIC_IFN_KUNIT void amdgpu_dm_connector_ddc_get_modes(struct drm_connector *co }EXPORT_IF_KUNIT (amdgpu_dm_connector_ddc_get_modes); -STATIC_IFN_KUNIT bool is_duplicate_mode(struct amdgpu_dm_connector *aconnector, -struct drm_display_mode *mode) -{ -struct drm_display_mode *m; - -list_for_each_entry (m, &aconnector->base.probed_modes, head) { -if (drm_mode_equal (m, mode)) -return true; - } - -return false; -} -EXPORT_IF_KUNIT (is_duplicate_mode); STATIC_IFN_KUNIT uint add_fs_modes(struct amdgpu_dm_connector *aconnector) {
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.h +1 -1
@@ -214,7 +214,7 @@ bool adjust_colour_depth_from_display_info(struct dc_crtc_timing *timing_out, const struct drm_display_info *info);int to_drm_connector_type (enum signal_type st,uint32_t connector_id); -bool is_duplicate_mode (struct amdgpu_dm_connector *aconnector,struct drm_display_mode *mode); +bool is_duplicate_mode (struct amdgpu_dm_connector *aconnector,const struct drm_display_mode *mode);enum dc_aspect_ratio get_aspect_ratio (const struct drm_display_mode *mode_in);void copy_crtc_timing_for_drm_display_mode (const struct drm_display_mode *src_mode,struct drm_display_mode *dst_mode);
Signature · 1 line
2.43.0
PATCH 23/30 drm/amd/display: set VRR_EN for inactive state
In reply to Ray WuFrom: Dillon Varone <[email protected]>
[Why & How]
Same as freesync, when VRR state is inactive, set VRR_EN=1 so sinks react accordingly when VRR abruptly becomes active.
--- drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +2 -2
@@ -669,8 +669,8 @@ static void build_vtem_infopacket_data(const struct dc_stream_state *stream,set_field_with_mask (&infopacket->sb[VTEM_MD0 ],MASK_VTEM_MD0__FVA_FACTOR_M1 , (fva_factor >0 ) ? (fva_factor -1 ) :0 );/* VRR Parameters */ -if (vrr->state ==VRR_STATE_ACTIVE_VARIABLE || - vrr->state ==VRR_STATE_ACTIVE_FIXED ) { +if (vrr->state !=VRR_STATE_DISABLED && + vrr->state !=VRR_STATE_UNSUPPORTED ) {set_field_with_mask (&infopacket->sb[VTEM_MD0 ],MASK_VTEM_MD0__VRR_EN ,1 ); }else {set_field_with_mask (&infopacket->sb[VTEM_MD0 ],MASK_VTEM_MD0__VRR_EN ,0 );
Signature · 1 line
2.43.0
PATCH 24/30 drm/amd/display: fix NULL dc deref in hpd_init KUnit tests
In reply to Ray WuFrom: Ivan Lipski <[email protected]>
[Why & How]amdgpu_dm_hpd_init() was changed to walk adev->dm.dc->links directly, so the two tests that left adev->dm.dc NULL now panic on a NULL dc dereference.
Give both tests a real DC via dm_test_alloc_dc_with_irq_service() with a dc_link and dc->links[0] / link_count = 1.
--- .../amdgpu_dm/tests/amdgpu_dm_irq_test.c | 48 ++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_irq_test.c +42 -6
@@ -2035,14 +2035,27 @@ static void dm_test_outbox_init_null_dc(struct kunit *test)static void dm_test_hpd_init_empty_connectors (struct kunit *test) {struct amdgpu_device *adev; +struct dc_link *link; +struct dc *dc; adev =dm_kunit_alloc_adev (test);/* -* With an empty connector list the per-connector loop is skipped and -* the initial clear loop relies on amdgpu_dm_irq_set() being a no-op -* for a NULL dc, so init must complete without touching the DC. +* The initial clear loop walks adev->dm.dc->links, so a DC with a +* populated irq service is required. With an empty connector list the +* per-connector loop is skipped, so init must complete after only the +* clear loop runs. */ + dc =dm_test_alloc_dc_with_irq_service (test, &dm_test_irq_service_funcs_dcn10); + adev->dm.dc = dc; + + link =kunit_kzalloc (test,sizeof (*link),GFP_KERNEL ); +KUNIT_ASSERT_NOT_ERR_OR_NULL (test, link); + link->irq_source_hpd =DC_IRQ_SOURCE_HPD1 ; + link->irq_source_hpd_rx =DC_IRQ_SOURCE_HPD1RX ; + dc->links[0 ] = link; + dc->link_count =1 ; +amdgpu_dm_hpd_init (adev); }
@@ -2070,13 +2083,17 @@ static void dm_test_hpd_init_fini_with_connectors(struct kunit *test)struct drm_connector *wbconn;struct amdgpu_device *adev;struct dc_link *link; +struct dc *dc; adev =dm_kunit_alloc_adev (test); +/* The clear loop walks dc->links, so set up a DC with an irq service. */ + dc =dm_test_alloc_dc_with_irq_service (test, &dm_test_irq_service_funcs_dcn10); + adev->dm.dc = dc; +/* * num_hpd = 0 forces irq_type >= num_hpd so the loop takes the HW -* fallback (amdgpu_dm_irq_set()) instead of amdgpu_irq_get(); with a -* NULL dc that fallback is a safe no-op. +* fallback (amdgpu_dm_irq_set()) instead of amdgpu_irq_get(). */ adev->mode_info.num_hpd =0 ;
@@ -2102,8 +2119,10 @@ static void dm_test_hpd_init_fini_with_connectors(struct kunit *test) link->irq_source_hpd =DC_IRQ_SOURCE_HPD1 ; link->irq_source_hpd_rx =DC_IRQ_SOURCE_HPD1RX ; aconn->dc_link = link; + dc->links[0 ] = link; + dc->link_count =1 ; -/* DC is absent (NULL), so the HW writes are NULL-safe no-ops. */ +/* The irq service stubs accept the HW writes without register access. */ amdgpu_dm_hpd_init (adev);amdgpu_dm_hpd_fini (adev); }
@@ -2117,10 +2136,15 @@ static void dm_test_hpd_init_fini_analog_connector(struct kunit *test)struct amdgpu_dm_connector *aconn;struct amdgpu_device *adev;struct dc_link *link; +struct dc *dc; adev =dm_kunit_alloc_adev (test); adev->mode_info.num_hpd =0 ; +/* The clear loop walks dc->links, so set up a DC with an irq service. */ + dc =dm_test_alloc_dc_with_irq_service (test, &dm_test_irq_service_funcs_dcn10); + adev->dm.dc = dc; + aconn =kunit_kzalloc (test,sizeof (*aconn),GFP_KERNEL );KUNIT_ASSERT_NOT_ERR_OR_NULL (test, aconn); KUNIT_ASSERT_EQ(test, drm_connector_init(&adev->ddev, &aconn->base,
@@ -2136,6 +2160,8 @@ static void dm_test_hpd_init_fini_analog_connector(struct kunit *test)/* An analog connector id makes the loop request polling. */ link->link_id.id =CONNECTOR_ID_VGA ; aconn->dc_link = link; + dc->links[0 ] = link; + dc->link_count =1 ;/* use_polling becomes true, so init must enable KMS polling. */ amdgpu_dm_hpd_init (adev);
@@ -2155,9 +2181,14 @@ static void dm_test_hpd_init_fini_irq_ref(struct kunit *test)struct amdgpu_dm_connector *aconn;struct amdgpu_device *adev;struct dc_link *link; +struct dc *dc; adev =dm_kunit_alloc_adev (test); +/* The clear loop walks dc->links, so set up a DC with an irq service. */ + dc =dm_test_alloc_dc_with_irq_service (test, &dm_test_irq_service_funcs_dcn10); + adev->dm.dc = dc; +/* * num_hpd >= 1 makes irq_type (0) < num_hpd, so the loop takes the * amdgpu_irq_get()/amdgpu_irq_put() branch instead of the
@@ -2180,6 +2211,8 @@ static void dm_test_hpd_init_fini_irq_ref(struct kunit *test) link->irq_source_hpd =DC_IRQ_SOURCE_HPD1 ; link->irq_source_hpd_rx =DC_IRQ_SOURCE_INVALID ; aconn->dc_link = link; + dc->links[0 ] = link; + dc->link_count =1 ;amdgpu_dm_hpd_init (adev);amdgpu_dm_hpd_fini (adev);
@@ -2200,6 +2233,9 @@ static void dm_test_hpd_init_skips_connector_without_link(struct kunit *test) adev =dm_kunit_alloc_adev (test); adev->mode_info.num_hpd =0 ; +/* The clear loop walks dc->links, so set up a DC with an irq service. */ + adev->dm.dc =dm_test_alloc_dc_with_irq_service (test, &dm_test_irq_service_funcs_dcn10); + aconn =kunit_kzalloc (test,sizeof (*aconn),GFP_KERNEL );KUNIT_ASSERT_NOT_ERR_OR_NULL (test, aconn); KUNIT_ASSERT_EQ(test, drm_connector_init(&adev->ddev, &aconn->base,
Signature · 1 line
2.43.0
PATCH 25/30 drm/amd/display: align VRR timing gate with FreeSync module
In reply to Ray WuFrom: Fangzhi Zuo <[email protected]>
[Why & How]
Use mod_freesync_calc_nominal_field_rate() when validating per-CRTC VRR timing so atomic check uses the same stream timing basis as the later FreeSync VRR parameter builder.
The previous gate compared the vtotal required for the sink's advertised maximum refresh against the mode's nominal vtotal. That rejects every mode below the panel's maximum refresh, even though VRR only needs to vary below the mode's nominal refresh.
Cap the usable maximum at the mode nominal refresh and require a 10 Hz minimum span above min_vfreq, matching the FreeSync module's MIN_REFRESH_RANGE. This enables the affected 4K120 and 1080p60 modes while continuing to reject degenerate ranges such as 720x576p50.
--- .../display/amdgpu_dm/amdgpu_dm_freesync.c | 43 +++++++++++++------ .../amdgpu_dm/tests/amdgpu_dm_freesync_test.c | 8 +++- 2 files changed, 36 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c +29 -14
@@ -112,24 +112,28 @@ void amdgpu_dm_reset_freesync_config_for_crtc( }EXPORT_IF_KUNIT (amdgpu_dm_reset_freesync_config_for_crtc); -static bool amdgpu_dm_is_vrr_timing_valid (const struct drm_display_mode *mode, -int max_vfreq) +/* FreeSync module gates ACTIVE_VARIABLE on this minimum refresh span (Hz). */ +#define AMDGPU_DM_VRR_MIN_REFRESH_RANGE 10 + +static bool amdgpu_dm_is_vrr_timing_valid (const struct dc_stream_state *stream, +int min_vfreq,int max_vfreq) { -u64 numerator, denominator, vtotal_at_max_refresh; +u64 nominal_vfreq_uhz, usable_max_vfreq_uhz; -/* -* Leave the existing decision unchanged without complete timing data; -* otherwise, the computed vtotal must not be below the nominal vtotal. -*/ -if (!mode->clock || !mode->htotal || !mode->vtotal || max_vfreq <=0 ) +/* Without complete timing/range data, leave the existing decision. */ +if (!stream || !stream->timing.pix_clk_100hz || + !stream->timing.h_total || !stream->timing.v_total || + min_vfreq <=0 || max_vfreq <=0 )return true; - numerator = (u64 )mode->clock *1000 ; - denominator = (u64 )mode->htotal * max_vfreq; - vtotal_at_max_refresh = -div64_u64 (numerator + denominator -1 , denominator); +/* Match the FreeSync module's nominal-rate calculation. */ + nominal_vfreq_uhz =mod_freesync_calc_nominal_field_rate (stream); + usable_max_vfreq_uhz =min_t (u64, (u64 )max_vfreq *1000000 , + nominal_vfreq_uhz); -return vtotal_at_max_refresh >= mode->vtotal; +return usable_max_vfreq_uhz >= + (u64 )min_vfreq *1000000 + + (u64 )AMDGPU_DM_VRR_MIN_REFRESH_RANGE *1000000 ; } void amdgpu_dm_get_freesync_config_for_crtc(
@@ -148,7 +152,18 @@ void amdgpu_dm_get_freesync_config_for_crtc( aconnector =to_amdgpu_dm_connector (new_con_state->base.connector); - vrr_timing_valid =amdgpu_dm_is_vrr_timing_valid (mode, aconnector->max_vfreq); + vrr_timing_valid =amdgpu_dm_is_vrr_timing_valid (new_crtc_state->stream, + aconnector->min_vfreq, + aconnector->max_vfreq); +if (!vrr_timing_valid) +drm_dbg_kms (new_con_state->base.connector->dev, +"VRR invalid %s %s %dx%d@%d %d-%d clk=%u h=%u v=%u\n" , + new_con_state->base.connector->name, mode->name, + mode->hdisplay, mode->vdisplay, vrefresh, + aconnector->min_vfreq, aconnector->max_vfreq, + new_crtc_state->stream->timing.pix_clk_100hz, + new_crtc_state->stream->timing.h_total, + new_crtc_state->stream->timing.v_total); new_crtc_state->vrr_supported = new_con_state->freesync_capable && vrefresh >= aconnector->min_vfreq &&
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_freesync_test.c +7 -1
@@ -349,8 +349,11 @@ static void dm_test_freesync_config_invalid_timing(struct kunit *test)struct dm_test_freesync_ctx *ctx =dm_test_freesync_ctx_alloc (test); ctx->conn_state->freesync_capable = true; - ctx->aconnector->min_vfreq =40 ; + ctx->aconnector->min_vfreq =45 ; ctx->aconnector->max_vfreq =60 ; + ctx->stream->timing.pix_clk_100hz =270000 ; + ctx->stream->timing.h_total =864 ; + ctx->stream->timing.v_total =625 ; ctx->crtc_state->base.mode.clock =27000 ; ctx->crtc_state->base.mode.hdisplay =720 ; ctx->crtc_state->base.mode.vdisplay =576 ;
@@ -363,6 +366,9 @@ static void dm_test_freesync_config_invalid_timing(struct kunit *test)KUNIT_EXPECT_EQ (test, (int )ctx->crtc_state->freesync_config.state, (int )VRR_STATE_UNSUPPORTED ); + ctx->stream->timing.pix_clk_100hz =5940000 ; + ctx->stream->timing.h_total =4400 ; + ctx->stream->timing.v_total =2250 ; ctx->crtc_state->base.mode.clock =594000 ; ctx->crtc_state->base.mode.hdisplay =3840 ; ctx->crtc_state->base.mode.vdisplay =2160 ;
Signature · 1 line
2.43.0
PATCH 26/30 drm/amd/display: Adjust HDMI FRL LT timeout
In reply to Ray WuFrom: Ilya Bakoulin <[email protected]>
[Why & How]
Extend LT timeout for link rates <16G to avoid intermittent compliance failures.
--- drivers/gpu/drm/amd/display/dc/link/protocols/link_hdmi_frl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_hdmi_frl.c +1 -1
@@ -442,7 +442,7 @@ static enum link_result hdmi_frl_perform_link_training(struct ddc_service *ddc_sunion hdmi_scdc_status_flags_data status_data = {0 };union hdmi_scdc_source_test_req test_req = {0 };union hdmi_scdc_LTP_req_data ltp_req = {0 }; -unsigned long long poll_timeout_ns =200 *1000 *1000 ; +unsigned long long poll_timeout_ns =220 *1000 *1000 ;unsigned long long wait_time_ns =2 *1000 *1000 ;unsigned long long num_polls =0 ;struct hpo_frl_link_encoder *hpo_frl_link_enc = ddc_service->link->hpo_frl_link_enc;
Signature · 1 line
2.43.0
PATCH 27/30 drm/amd/display: handle UPSP chroma upsampling in DML
In reply to Ray WuFrom: Samson Tam <[email protected]>
[Why]
420 video at 1:1 has chroma scaling. DML has check to enforce 420 video must be scaled. When UPSP does chroma upscaling for 420, SPL treats 420 video at 1:1 as not being scaled. But this triggers DML check to fail validation
[How]
Add check for UPSP in DML 42x scaler validation If 42x is not being scaled but UPSP is enabled, then do not fail validation
--- .../dml21/src/dml2_core/dml2_core_dcn6_funcs_mode_support.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_funcs_mode_support.c +2 -1
@@ -126,7 +126,8 @@ bool dcn6_ms_check_scaler_support(for (k =0 ; k < display_cfg->num_planes; k++) { plane = &display_cfg->plane_descriptors[k]; if (plane->composition.scaler_info.enabled == false - && (dml2_core_utils_is_420(plane->pixel_format) || dml2_core_utils_is_422_planar(plane->pixel_format) || dml2_core_utils_is_422_packed(plane->pixel_format) + && (((dml2_core_utils_is_420(plane->pixel_format) || dml2_core_utils_is_422_planar(plane->pixel_format) + || dml2_core_utils_is_422_packed(plane->pixel_format)) && plane->composition.scaler_info.upsp_enabled == false) || plane->composition.scaler_info.plane0.h_ratio != 1.0 || plane->composition.scaler_info.plane0.h_taps != 1.0 || plane->composition.scaler_info.plane0.v_ratio != 1.0
Signature · 1 line
2.43.0
PATCH 28/30 drm/amd/display: Correct next frame calculation
In reply to Ray WuFrom: Alvin Lee <[email protected]>
[Why & How]
There was a wrong assumption initially made that assumed the swath associated with a given dst line is always in the same frame. However, there are scenarios where dst_y_prefetch is larger than vblank_end, so prefetch starts in the previous frame but the actual deadline is in the next frame. This wrong assumption causes a scenario where "next frame" is not calculated correctly.
Apply special case handling for this scenario to ensure when this case is detected, we increment the frame count so that "next frame" is calculated correctly.
--- .../alternate_pstate_shared_lib.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_standalone_libraries/alternate_pstate_shared_lib.c +10 -1
@@ -346,6 +346,7 @@ static bool is_svp_dst_in_next_frame( uint16_t vstartup) {uint32_t dst_deadline; +uint32_t dst_deadline_frame_count; dst_deadline = calculate_swath_deadline_dst( swath_index,
@@ -355,7 +356,15 @@ static bool is_svp_dst_in_next_frame( pre_hdl_delta_x1000, rec_hdl_delta_x1000); -if ((swath_index <END_SWATH_REC &&is_dst_in_next_frame (curr_otg_line, curr_frame_count, dst_deadline, target_frame_count, vstartup)) || +// Special case for when prefetch_start (i.e., vblank_end - dst_y_prefetch) is in the previous frame, +// but the actual prefetch deadline is in the next frame. We must increment the frame count to ensure +// the swath is marked with "next frame" correctly. +if (swath_index ==0 && pre_swath_incl_boundary > (pre_first_hdl_x1000 /1000 ) && dst_deadline < dst_line) + dst_deadline_frame_count = target_frame_count ==MAX_FRAME_COUNT ?0 : target_frame_count +1 ; +else + dst_deadline_frame_count = target_frame_count; + +if ((swath_index <END_SWATH_REC &&is_dst_in_next_frame (curr_otg_line, curr_frame_count, dst_deadline, dst_deadline_frame_count, vstartup)) || (swath_index >=END_SWATH_REC &&is_end_swath_in_next_frame (target_frame_count, curr_frame_count, curr_otg_line, dst_line, pre_swath_incl_boundary, vstartup))) {return true; }
Signature · 1 line
2.43.0
PATCH 29/30 drm/amd/display: [FW Promotion] Release 0.1.80.0
In reply to Ray WuFrom: Taimur Hassan <[email protected]>
Updated DMUB interface
- Add DMUB_CMD__DC_BLS_DCN_INIT command to run the fixed DCN hardware init sequence
--- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +20 -0
@@ -1192,6 +1192,10 @@ enum dmub_dc_bls_command_type {* Placeholder for block-level initialization of the DCHVM */ DMUB_CMD__DC_BLS_DCHVM_INIT =0 , +/** +* Runs the fixed DCN hardware init sequence. +*/ + DMUB_CMD__DC_BLS_DCN_INIT = 1, };/**
@@ -7694,6 +7698,17 @@ struct dmub_rb_cmd_boot_time_crc_init {struct dmub_cmd_boot_time_crc_init_data data; }; +/** +* Definition of a DMUB_CMD__DC_BLS_DCN_INIT command. +* +* Runs a fixed DCN hardware init sequence after the pre-OS to post-OS +* transition. Carries no payload; anything driver-configurable is +* programmed by the driver after this command completes. +*/ +struct dmub_rb_cmd_dc_bls_dcn_init { +struct dmub_cmd_header header;/**< Command header */ +}; +/** * union dmub_rb_cmd - DMUB inbox command. */
@@ -8098,6 +8113,11 @@ union dmub_rb_cmd {*/ struct dmub_rb_cmd_boot_time_crc_init boot_time_crc_init; +/** +* Definition of a DMUB_CMD__DC_BLS_DCN_INIT command. +*/ +struct dmub_rb_cmd_dc_bls_dcn_init dc_bls_dcn_init; +/** * Definition of a DMUB_CMD__PANEL_POLARITY_ENABLE command. */
Signature · 1 line
2.43.0
PATCH 30/30 drm/amd/display: Promote DC to 3.2.403
In reply to Ray WuFrom: Taimur Hassan <[email protected]>
This version brings along the following updates:
- Fix HDMI FRL FFE compliance test and adjust FRL LT timeout.
- Align eDP DSC link policy to minimize lane count.
- Add AS-SDP V3 support for VESA Panel Replay.
- Add DPG force-on-flip support.
- Log PSR/Replay status and exit PSR/Replay on non-modeset full updates.
- Reject invalid per-mode FreeSync timing and set VRR_EN state.
- Align VRR timing gate with FreeSync module.
- Warn on unadvertised modes without scaling.
- Use DMUB to notify PME and update DMU cmd header.
- Do not allow vbios version of dmubfw in the driver.
- Use picoseconds for line time and correct next frame calculation.
- Fix YUV422 semi-planar color blurring and UPSP chroma upsampling.
- Reset UPSP and pre-CSC registers on DCN6 DPP reset.
- Handle exit LS in second ISHARP programming block.
- Remove hard-coded min dcfclk for AC.
- Do not WARN when removing an unallocated MST payload.
- Various cleanups, KUnit test fixes and debug flag gating.
--- 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
@@ -68,7 +68,7 @@ struct dcn_dsc_reg_state;struct dcn_optc_reg_state ;struct dcn_dccg_reg_state ; -#define DC_VER "3.2.402" +#define DC_VER "3.2.403"/** * MAX_SURFACES - representative of the upper bound of surfaces that can be piped to a single CRTC
Signature · 1 line
2.43.0
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, 1920x1200 165hz, 3840x2400 60hz
* 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
* Samsung ATNA60YV02-0 3840x2400 60Hz OLED eDP
The patchset consists of the amd-staging-drm-next branch (Head commit -> e057322aedb24072dc6c7f531b1bbbaa0497c31b -> drm/amd/ras: report the bad page threshold in every work mode) with new patches added on top of it.
Tested on Ubuntu 26.04, on Gnome Wayland.
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com
-----Original Message-----
From: Ray Wu <[email protected]>
Sent: Tuesday, October 13, 2026 7:08 AM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Pillai, Aurabindo <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Chung, ChiaHsuan (Tom) <[email protected]>; Zuo, Jerry <[email protected]>; Wheeler, Daniel <[email protected]>; Wu, Ray <[email protected]>; LIPSKI, IVAN <[email protected]>; Hung, Alex <[email protected]>; Lin, Ping Lei <[email protected]>; Chen, Chen-Yu <[email protected]>; Wu, Ray <[email protected]>
Subject: [PATCH 00/30] DC Patches October 19, 2026
This DC patchset brings improvements in multiple areas. In summary, we have:
- Fix HDMI FRL FFE compliance test and adjust FRL LT timeout.
- Align eDP DSC link policy to minimize lane count.
- Add AS-SDP V3 support for VESA Panel Replay.
- Add DPG force-on-flip support.
- Log PSR/Replay status and exit PSR/Replay on non-modeset full updates.
- Reject invalid per-mode FreeSync timing and set VRR_EN state.
- Align VRR timing gate with FreeSync module.
- Warn on unadvertised modes without scaling.
- Use DMUB to notify PME and update DMU cmd header.
- Do not allow vbios version of dmubfw in the driver.
- Use picoseconds for line time and correct next frame calculation.
- Fix YUV422 semi-planar color blurring and UPSP chroma upsampling.
- Reset UPSP and pre-CSC registers on DCN6 DPP reset.
- Handle exit LS in second ISHARP programming block.
- Remove hard-coded min dcfclk for AC.
- Do not WARN when removing an unallocated MST payload.
- Various cleanups, KUnit test fixes and debug flag gating.
Alvin Lee (3):
drm/amd/display: Update DMU cmd header drm/amd/display: Use picoseconds for line time on DCN6+ drm/amd/display: Correct next frame calculation
Aric Cyr (1):
drm/amd/display: move timing_adjust_pending into dc_stream_state
Charlene Liu (3):
drm/amd/display: use dmub to notify pme
drm/amd/display: Do not allow vbios version of dmubfw in the driver drm/amd/display: remove hard code min dcfclk for AC.
Dillon Varone (1):
drm/amd/display: set VRR_EN for inactive state
Fangzhi Zuo (4):
drm/amd/display: Simplify hdmi_automation debugfs with
debugfs_create_bool
drm/amd/display: reject invalid per-mode FreeSync timing drm/amd/display: warn on unadvertised modes without scaling drm/amd/display: align VRR timing gate with FreeSync module
Ilya Bakoulin (2):
drm/amd/display: Fix HDMI FRL FFE compliance test drm/amd/display: Adjust HDMI FRL LT timeout
Ivan Lipski (2):
drm/amd/display: Remove unused has_vsdb variable drm/amd/display: fix NULL dc deref in hpd_init KUnit tests
Kaier Hsueh (1):
drm/amd/display: YUV422 Semi-Planar Images Show Color Blurring at
Color Boundaries
Leon Huang (1):
drm/amd/display: Add AS-SDP V3 support for VESA PR
Mario Limonciello (1):
drm/amd/display: don't WARN when removing an unallocated MST payload
Piotr Maziarz (1):
drm/amd/display: Gate DP_TRACE_SOURCE_SEQUENCE emission on the debug
flag
Ray Wu (3):
drm/amd/display: Align eDP DSC link policy to minimize lane count drm/amd/display: Log PSR and Replay status after mode change drm/amd/display: Exit PSR/Replay on non-modeset full updates
Roman Li (1):
drm/amd/display: guard DCE-only hwseq definitions
Samson Tam (2):
drm/amd/display: handle exit LS in second ISHARP programming block drm/amd/display: handle UPSP chroma upsampling in DML
Sharique Pervaiz (1):
drm/amd/display: Add DPG force-on-flip support for SystemDisplayEnable
Sridevi Arvindekar (1):
drm/amd/display: Reset UPSP and pre-CSC registers on DCN6 DPP reset
Taimur Hassan (2):
drm/amd/display: [FW Promotion] Release 0.1.80.0 drm/amd/display: Promote DC to 3.2.403
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 61 ++++++--- .../display/amdgpu_dm/amdgpu_dm_connector.c | 44 +++--- .../display/amdgpu_dm/amdgpu_dm_connector.h | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 69 +--------- .../display/amdgpu_dm/amdgpu_dm_freesync.c | 43 +++++- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 7 +- .../tests/amdgpu_dm_connector_test.c | 8 +- .../amdgpu_dm/tests/amdgpu_dm_freesync_test.c | 55 +++++++- .../amdgpu_dm/tests/amdgpu_dm_helpers_test.c | 20 ++- .../amdgpu_dm/tests/amdgpu_dm_irq_test.c | 48 ++++++- .../dc/clk_mgr/dcn42b/dcn42b_clk_mgr.c | 2 - drivers/gpu/drm/amd/display/dc/core/dc.c | 55 ++++++-- .../drm/amd/display/dc/core/dc_hw_sequencer.c | 12 +- drivers/gpu/drm/amd/display/dc/dc.h | 4 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 17 +++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 11 ++ drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 3 +- .../gpu/drm/amd/display/dc/dc_hdmi_types.h | 4 +- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 1 - drivers/gpu/drm/amd/display/dc/dc_stream.h | 3 + .../dml2_core_dcn6_funcs_mode_programming.c | 4 +- .../dml2_core_dcn6_funcs_mode_support.c | 3 +- .../alternate_pstate_shared_lib.c | 11 +- .../amd/display/dc/dpp/dcn401/dcn401_dpp.h | 8 +- .../display/dc/dpp/dcn401/dcn401_dpp_dscl.c | 40 ++++-- .../drm/amd/display/dc/dpp/dcn60/dcn60_dpp.c | 17 ++- .../drm/amd/display/dc/dpp/dcn60/dcn60_dpp.h | 1 + .../amd/display/dc/dpp/dcn60/dcn60_dpp_dscl.c | 7 + .../amd/display/dc/hwss/dce110/dce110_hwseq.c | 55 ++++++-- .../amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 7 + .../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 11 ++ .../display/dc/link/hwss/link_hwss_hpo_frl.c | 3 + .../gpu/drm/amd/display/dc/link/link_dpms.c | 2 + .../display/dc/link/protocols/link_hdmi_frl.c | 129 +++++++++++++----- drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c | 7 + .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 34 ++++- .../gpu/drm/amd/display/dmub/src/dmub_dcn42.c | 7 + .../amd/display/modules/inc/mod_info_packet.h | 5 + .../display/modules/info_packet/info_packet.c | 38 +++++- 39 files changed, 634 insertions(+), 224 deletions(-)
--
2.43.0