From: <Roman.Li@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Harry Wentland <harry.wentland@amd.com>,
Leo Li <sunpeng.li@amd.com>, Roman Li <roman.li@amd.com>,
Wayne Lin <wayne.lin@amd.com>,
Tom Chung <chiahsuan.chung@amd.com>,
Fangzhi Zuo <jerry.zuo@amd.com>,
Dan Wheeler <daniel.wheeler@amd.com>, Ray Wu <Ray.Wu@amd.com>,
Ivan Lipski <ivan.lipski@amd.com>, Alex Hung <alex.hung@amd.com>,
James Lin <PingLei.Lin@amd.com>,
Chenyu Chen <Chen-Yu.Chen@amd.com>,
Martin Tsai <Martin.Tsai@amd.com>,
Anthony Koo <anthony.koo@amd.com>
Subject: [PATCH 08/17] drm/amd/display: allow skipping link bandwidth clear
Date: Fri, 2 Oct 2026 15:32:31 -0400 [thread overview]
Message-ID: <20261002193240.3441018-9-Roman.Li@amd.com> (raw)
In-Reply-To: <20261002193240.3441018-1-Roman.Li@amd.com>
From: Martin Tsai <Martin.Tsai@amd.com>
[why]
To set link bandwidth with zero could hit error protection
from Sink panel to fail link training and cause screen
corruption.
[how]
To skip link bw cleaning in two conditions:
1. eDP v1.5 or latter, because the last write will take effect.
2. Sink requires not to clear it.
Reviewed-by: Anthony Koo <anthony.koo@amd.com>
Signed-off-by: Martin Tsai <Martin.Tsai@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
---
.../drm/amd/display/dc/core/dc_link_exports.c | 5 +++++
drivers/gpu/drm/amd/display/dc/dc.h | 3 +++
drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 1 +
.../dc/link/protocols/link_dp_training.c | 20 ++++++++++++++-----
.../amd/display/include/link_service_types.h | 1 +
5 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_exports.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_exports.c
index fef857c7336b..5926e8a4f95a 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_exports.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_exports.c
@@ -263,6 +263,11 @@ void dc_link_set_preferred_training_settings(struct dc *dc,
lt_overrides, link, skip_immediate_retrain);
}
+void dc_link_set_skip_link_bw_clear(struct dc_link *link, bool skip)
+{
+ link->preferred_training_settings.skip_link_bw_clear = skip;
+}
+
bool dc_dp_trace_is_initialized(struct dc_link *link)
{
return link->dc->link_srv->dp_trace_is_initialized(link);
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index d2256c454424..957e15e4a84c 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -2869,6 +2869,9 @@ void dc_link_set_preferred_training_settings(struct dc *dc,
struct dc_link *link,
bool skip_immediate_retrain);
+/* Configure the sink-specific policy for future DP link training. */
+void dc_link_set_skip_link_bw_clear(struct dc_link *link, bool skip);
+
/* return - true if FEC is supported with connected DP RX, false otherwise */
bool dc_link_is_fec_supported(const struct dc_link *link);
diff --git a/drivers/gpu/drm/amd/display/dc/dc_dp_types.h b/drivers/gpu/drm/amd/display/dc/dc_dp_types.h
index d0ba9ad67a3e..b0e91b321f43 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dp_types.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_dp_types.h
@@ -203,6 +203,7 @@ struct dc_link_training_overrides {
bool *enhanced_framing;
bool *mst_enable;
bool *fec_enable;
+ bool skip_link_bw_clear;
};
union payload_table_update_status {
diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c
index 04eedec8a230..3be36d1063de 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c
@@ -724,6 +724,8 @@ void override_training_settings(
{
uint32_t lane;
+ lt_settings->skip_link_bw_clear = overrides->skip_link_bw_clear;
+
/* Override link spread */
if (!link->dp_ss_off && overrides->downspread != NULL)
lt_settings->link_settings.link_spread = *overrides->downspread ?
@@ -1095,7 +1097,7 @@ enum dc_status dpcd_set_link_settings(
struct dc_link *link,
const struct link_training_settings *lt_settings)
{
- uint8_t rate;
+ uint8_t rate = 0;
enum dc_status status;
union down_spread_ctrl downspread = {0};
@@ -1129,7 +1131,7 @@ enum dc_status dpcd_set_link_settings(
if (link->dpcd_caps.dpcd_rev.raw >= DPCD_REV_13 &&
lt_settings->link_settings.use_link_rate_set == true) {
- rate = 0;
+
/* WA for some MUX chips that will power down with eDP and lose supported
* link rate set for eDP 1.4. Source reads DPCD 0x010 again to ensure
* MUX chip gets link rate set back before link training.
@@ -1140,9 +1142,17 @@ enum dc_status dpcd_set_link_settings(
core_link_read_dpcd(link, DP_SUPPORTED_LINK_RATES,
supported_link_rates, sizeof(supported_link_rates));
}
- status = core_link_write_dpcd(link, DP_LINK_BW_SET, &rate, 1);
- if (status != DC_OK)
- DC_LOG_ERROR("%s:%d: core_link_write_dpcd (DP_LINK_BW_SET) failed\n", __func__, __LINE__);
+
+ /*
+ * It doesn't need to clear 0x100 in below two conditions:
+ * 1. eDP v1.5 or later, because the last write will take effect in Sink.
+ * 2. Sink requires not to clear 0x100.
+ */
+ if (!lt_settings->skip_link_bw_clear && link->dpcd_caps.edp_rev <= DP_EDP_14b) {
+ status = core_link_write_dpcd(link, DP_LINK_BW_SET, &rate, 1);
+ if (status != DC_OK)
+ DC_LOG_ERROR("%s:%d: core_link_write_dpcd (DP_LINK_BW_SET) failed\n", __func__, __LINE__);
+ }
status = core_link_write_dpcd(link, DP_LINK_RATE_SET,
<_settings->link_settings.link_rate_set, 1);
diff --git a/drivers/gpu/drm/amd/display/include/link_service_types.h b/drivers/gpu/drm/amd/display/include/link_service_types.h
index da74ed66c8f9..798d83238828 100644
--- a/drivers/gpu/drm/amd/display/include/link_service_types.h
+++ b/drivers/gpu/drm/amd/display/include/link_service_types.h
@@ -73,6 +73,7 @@ struct link_training_settings {
enum dc_pre_emphasis *pre_emphasis;
enum dc_post_cursor2 *post_cursor2;
bool should_set_fec_ready;
+ bool skip_link_bw_clear;
union dc_dp_ffe_preset *ffe_preset;
uint16_t cr_pattern_time;
--
2.34.1
next prev parent reply other threads:[~2026-10-02 19:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 19:32 [PATCH 00/17] DC Patches October 2, 2026 Roman.Li
2026-10-02 19:32 ` [PATCH 01/17] drm/amd/display: enable shaper when programming 3DLUT Roman.Li
2026-10-02 19:32 ` [PATCH 02/17] drm/amd/display: log MCM shaper and 3D LUT mode in the DTN log Roman.Li
2026-10-02 19:32 ` [PATCH 03/17] drm/amd/display: only reprogram DRR when v_total values change Roman.Li
2026-10-02 19:32 ` [PATCH 04/17] drm/amd/display: Add HDMI RR and SCDC skips Roman.Li
2026-10-02 19:32 ` [PATCH 05/17] drm/amd/display: Set cursor_offload for all pipes for a given stream Roman.Li
2026-10-02 19:32 ` [PATCH 06/17] drm/amd/display: Refactor DMUB fast lock sequencing Roman.Li
2026-10-02 19:32 ` [PATCH 07/17] drm/amd/display: Skip link off frame count for general UI Roman.Li
2026-10-02 19:32 ` Roman.Li [this message]
2026-10-02 19:32 ` [PATCH 09/17] drm/amd/display: Prepare DSC configuration before BLS execution Roman.Li
2026-10-02 19:32 ` [PATCH 10/17] drm/amd/display: Assign alt wa bit in fams2 cmd Roman.Li
2026-10-02 19:32 ` [PATCH 11/17] drm/amd/display: Update link training no timeout behaviour on HDMI Roman.Li
2026-10-02 19:32 ` [PATCH 12/17] drm/amd/display: Revert "avoid to write signal specific for tmds" Roman.Li
2026-10-02 19:32 ` [PATCH 13/17] drm/amd/display: Handle virtual link encoder Roman.Li
2026-10-02 19:32 ` [PATCH 14/17] drm/amd/display: Add dcn42b project id Roman.Li
2026-10-02 19:32 ` [PATCH 15/17] drm/amd/display: Add debug option to override low power SR latencies Roman.Li
2026-10-02 19:32 ` [PATCH 16/17] drm/amd/display: Send HDMI VRR metadata in VTEM info packet slot Roman.Li
2026-10-02 19:32 ` [PATCH 17/17] drm/amd/display: Promote DC to 3.2.401 Roman.Li
2026-10-05 13:30 ` [PATCH 00/17] DC Patches October 2, 2026 Wheeler, Daniel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261002193240.3441018-9-Roman.Li@amd.com \
--to=roman.li@amd.com \
--cc=Chen-Yu.Chen@amd.com \
--cc=Martin.Tsai@amd.com \
--cc=PingLei.Lin@amd.com \
--cc=Ray.Wu@amd.com \
--cc=alex.hung@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=anthony.koo@amd.com \
--cc=chiahsuan.chung@amd.com \
--cc=daniel.wheeler@amd.com \
--cc=harry.wentland@amd.com \
--cc=ivan.lipski@amd.com \
--cc=jerry.zuo@amd.com \
--cc=sunpeng.li@amd.com \
--cc=wayne.lin@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.