From: Hermes Wu via B4 Relay <devnull+Hermes.wu.ite.com.tw@kernel.org>
To: Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
Simona Vetter <simona@ffwll.ch>
Cc: Pet.Weng@ite.com.tw, Kenneth.Hung@ite.com.tw,
treapking@chromium.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, Hermes Wu <Hermes.wu@ite.com.tw>
Subject: [PATCH v2 5/5] drm/bridge: it6505: skip auto training when previous try fail
Date: Wed, 26 Mar 2025 13:34:17 +0800 [thread overview]
Message-ID: <20250326-fix-link-training-v2-5-756c8306f500@ite.com.tw> (raw)
In-Reply-To: <20250326-fix-link-training-v2-0-756c8306f500@ite.com.tw>
From: Hermes Wu <Hermes.wu@ite.com.tw>
When connect to device which can only training done by
step training, skip auto training when link training restart,
usually happen when display resolution is changed.
Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw>
---
drivers/gpu/drm/bridge/ite-it6505.c | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
index 2bbe787ccb1b57906f2a31a011dd92f327019b08..47f8134df8b6f5c2172c6cfdbc91da8063993a05 100644
--- a/drivers/gpu/drm/bridge/ite-it6505.c
+++ b/drivers/gpu/drm/bridge/ite-it6505.c
@@ -467,6 +467,7 @@ struct it6505 {
struct delayed_work hdcp_work;
struct work_struct hdcp_wait_ksv_list;
struct completion extcon_completion;
+ u8 step_train_only;
bool hdcp_desired;
bool is_repeater;
u8 hdcp_down_stream_count;
@@ -2457,11 +2458,13 @@ static void it6505_link_step_train_process(struct it6505 *it6505)
ret ? "pass" : "failed", i + 1);
if (ret) {
it6505_link_train_ok(it6505);
+ it6505->step_train_only = true;
return;
}
}
DRM_DEV_DEBUG_DRIVER(dev, "training fail");
+ it6505->step_train_only = false;
it6505->link_state = LINK_IDLE;
it6505_video_reset(it6505);
}
@@ -2477,18 +2480,19 @@ static void it6505_link_training_work(struct work_struct *work)
if (!it6505_get_sink_hpd_status(it6505))
return;
-
- for (retry = AUTO_TRAIN_RETRY; retry > 0; retry--) {
- it6505_link_training_setup(it6505);
- it6505_reset_hdcp(it6505);
- it6505_aux_reset(it6505);
-
- ret = it6505_link_start_auto_train(it6505);
- DRM_DEV_DEBUG_DRIVER(dev, "auto train %s,",
- ret ? "pass" : "failed");
- if (ret) {
- it6505_link_train_ok(it6505);
- return;
+ if (!it6505->step_train_only) {
+ for (retry = AUTO_TRAIN_RETRY; retry > 0; retry--) {
+ it6505_link_training_setup(it6505);
+ it6505_reset_hdcp(it6505);
+ it6505_aux_reset(it6505);
+
+ ret = it6505_link_start_auto_train(it6505);
+ DRM_DEV_DEBUG_DRIVER(dev, "auto train %s,",
+ ret ? "pass" : "failed");
+ if (ret) {
+ it6505_link_train_ok(it6505);
+ return;
+ }
}
}
@@ -2599,6 +2603,7 @@ static void it6505_irq_hpd(struct it6505 *it6505)
it6505_variable_config(it6505);
it6505_parse_link_capabilities(it6505);
}
+ it6505->step_train_only = false;
it6505_drm_dp_link_set_power(&it6505->aux, &it6505->link,
DP_SET_POWER_D0);
--
2.34.1
next prev parent reply other threads:[~2025-03-26 5:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 5:34 [PATCH v2 0/5] drm/bridge: it6505: fix DP link traning and improve compatibility Hermes Wu via B4 Relay
2025-03-26 5:34 ` [PATCH v2 1/5] drm/bridge: it6505: fix link training state HW register reset Hermes Wu via B4 Relay
2025-03-30 18:13 ` Dmitry Baryshkov
2025-03-26 5:34 ` [PATCH v2 2/5] drm/bridge: it6505: check INT_LINK_TRAIN_FAIL while link auto training Hermes Wu via B4 Relay
2025-03-30 18:17 ` Dmitry Baryshkov
2025-03-26 5:34 ` [PATCH v2 3/5] drm/bridge: it6505: modify DP " Hermes Wu via B4 Relay
2025-03-30 18:43 ` Dmitry Baryshkov
2025-03-31 2:31 ` Hermes.Wu
2025-03-31 7:30 ` Dmitry Baryshkov
2025-03-26 5:34 ` [PATCH v2 4/5] drm/bridge: it6505: modify DP link training work Hermes Wu via B4 Relay
2025-03-30 18:45 ` Dmitry Baryshkov
2025-03-26 5:34 ` Hermes Wu via B4 Relay [this message]
2025-03-30 18:46 ` [PATCH v2 5/5] drm/bridge: it6505: skip auto training when previous try fail Dmitry Baryshkov
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=20250326-fix-link-training-v2-5-756c8306f500@ite.com.tw \
--to=devnull+hermes.wu.ite.com.tw@kernel.org \
--cc=Hermes.wu@ite.com.tw \
--cc=Kenneth.Hung@ite.com.tw \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=Pet.Weng@ite.com.tw \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=simona@ffwll.ch \
--cc=treapking@chromium.org \
--cc=tzimmermann@suse.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®