Skip to contentSkip to conversation

drm/i915/dp: reset HDMI 2.1 PCON FRL state on disconnect

PATCH New Xiao Lu 3 participants 3 messages Sep 3

Subsystems (3)
lore
Share & tools
lore

Xiao Lu

author
#0 lore raw

PATCH 1/1 drm/i915/dp: reset HDMI 2.1 PCON FRL state on disconnect

When a DP-to-HDMI 2.1 PCON is disconnected, frl.is_trained remains set from the previous connection. On reconnect, intel_dp_check_frl_training() checks this flag first and returns early if set, bypassing the entire FRL training sequence entirely - including drm_dp_pcon_frl_prepare() which sets SOURCE_CONTROLLED_MODE. As a result the source never drives FRL negotiation on reconnect, and the HDMI FRL link may not be re-established correctly.

The root cause is that frl.is_trained reflects the driver's last known state and is not invalidated when the physical link goes away. From the source's perspective, once the PCON is disconnected the downstream HDMI FRL link state is unknown and must be treated as gone.

Add intel_dp_pcon_disconnect(), mirroring intel_dp_mst_disconnect() and intel_dp_tunnel_disconnect(), which clears frl.is_trained and frl.trained_rate_gbps on disconnect. This ensures intel_dp_check_frl_training() always performs a fresh FRL negotiation on the next connect.

---
 drivers/gpu/drm/i915/display/intel_dp.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
drivers/gpu/drm/i915/display/intel_dp.c +23 -0
index 113d767e62e9..3643b6c4c1bc 100644
@@ -4996,6 +4996,27 @@ intel_dp_mst_disconnect(struct intel_dp *intel_dp)
 	drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst.mgr, intel_dp->is_mst);
 }
 
+/*
+ * On disconnect, the downstream PCON and its HDMI FRL link state are gone
+ * from the source's perspective. Clear the cached FRL training state so that
+ * intel_dp_check_frl_training() performs a fresh FRL negotiation on the next
+ * connect, rather than skipping training based on stale state.
+ */
+static void
+intel_dp_pcon_disconnect(struct intel_dp *intel_dp)
+{
+	struct intel_display *display = to_intel_display(intel_dp);
+
+	if (!intel_dp_is_hdmi_2_1_sink(intel_dp))
+		return;
+
+	drm_dbg_kms(display->drm,
+		    "PCON HDMI2.1 sink disconnected, resetting FRL state (was trained at %d Gbps)\n",
+		    intel_dp->frl.trained_rate_gbps);
+	intel_dp->frl.is_trained = false;
+	intel_dp->frl.trained_rate_gbps = 0;
+}
+
 #define INTEL_DP_DEVICE_SERVICE_IRQ_MASK_SST	(DP_AUTOMATED_TEST_REQUEST | \
 						 DP_CP_IRQ | \
 						 DP_SINK_SPECIFIC_IRQ)
@@ -6337,6 +6358,8 @@ intel_dp_detect(struct drm_connector *_connector,
 
 		intel_dp_tunnel_disconnect(intel_dp);
 
+		intel_dp_pcon_disconnect(intel_dp);
+
 		intel_dp_tunnel_uhbr_lanes_wa_reset(intel_dp);
 
 		goto out_unset_edid;
Signature · 1 line
2.43.0
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] FRL training state is not cleared if the EDID is invalidated before a disconnect, causing…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] FRL training state is not cleared if the EDID is invalidated before a disconnect, causing subsequent FRL training to be skipped permanently. --

commit 666a7a052848216c6b509f4ba1711921db6e5b40
Author: Xiao Lu <[email protected]>

drm/i915/dp: reset HDMI 2.1 PCON FRL state on disconnect

When a DP-to-HDMI 2.1 PCON is disconnected, frl.is_trained remains set from the previous connection. On reconnect, intel_dp_check_frl_training() checks this flag first and returns early if set, bypassing the entire FRL training sequence entirely.

Quoted 4 lines
drivers/gpu/drm/i915/display/intel_dp.c +0 -0
index 113d767e62e9c..3643b6c4c1bc5 100644

[ ... ]

drivers/gpu/drm/i915/display/intel_dp.c intel_dp_mst_disconnect(struct intel_dp *intel_dp) · line 5011

Quoted 13 lines
drivers/gpu/drm/i915/display/intel_dp.c +13 -0
+/*
+ * On disconnect, the downstream PCON and its HDMI FRL link state are gone
+ * from the source's perspective. Clear the cached FRL training state so that
+ * intel_dp_check_frl_training() performs a fresh FRL negotiation on the next
+ * connect, rather than skipping training based on stale state.
+ */
+static void
+intel_dp_pcon_disconnect(struct intel_dp *intel_dp)
+{
+	struct intel_display *display = to_intel_display(intel_dp);
+
+	if (!intel_dp_is_hdmi_2_1_sink(intel_dp))
+		return;

[Severity: High]
Can this early return prevent clearing the FRL state if the EDID is invalidated before a disconnect?

If a transient I2C-over-AUX error occurs during a background reprobe while the monitor is still physically connected, it can cause intel_dp_set_edid() to fail. This failure causes drm_edid_connector_update() to be called with NULL, which clears connector->base.display_info and sets is_hdmi to false.

If the monitor is subsequently unplugged, triggering a disconnect, this function returns early because intel_dp_is_hdmi_2_1_sink() evaluates to false. The frl.is_trained flag remains true.

When the monitor is reconnected, intel_dp_check_frl_training() skips training because is_trained is still true, leading to a permanent blank screen or severely limited resolution until a driver reload or reboot.

Should the state clearing be performed unconditionally, since the current sink capabilities can be stale or invalidated?

Quoted 7 lines
drivers/gpu/drm/i915/display/intel_dp.c +7 -0
+
+	drm_dbg_kms(display->drm,
+		    "PCON HDMI2.1 sink disconnected, resetting FRL state (was trained at %d Gbps)\n",
+		    intel_dp->frl.trained_rate_gbps);
+	intel_dp->frl.is_trained = false;
+	intel_dp->frl.trained_rate_gbps = 0;
+}
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#2 lore raw

✗ i915.CI.BAT: failure for drm/i915/dp: reset HDMI 2.1 PCON FRL state on disconnect

In reply to Xiao Lu
== Series Details ==

== Series Details ==

Series: drm/i915/dp: reset HDMI 2.1 PCON FRL state on disconnect
URL : https://patchwork.freedesktop.org/series/173298/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_19082 -> Patchwork_173298v1
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_173298v1 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes
introduced in Patchwork_173298v1, please notify your bug team ([email protected]) to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_173298v1/index.html

Participating hosts (37 -> 37)
------------------------------

Additional (1): fi-skl-6600u
Missing (1): bat-dg2-13

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_173298v1:

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live:
- bat-arlh-3: [PASS][1] -> [INCOMPLETE][2] +1 other test incomplete
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19082/bat-arlh-3/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_173298v1/bat-arlh-3/igt@[email protected]

Known issues
------------

Here are the changes found in Patchwork_173298v1 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_huc_copy@huc-copy:
- fi-skl-6600u: NOTRUN -> [SKIP][3] ([i915#2190])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_173298v1/fi-skl-6600u/igt@[email protected]

* igt@gem_lmem_swapping@random-engines:
- fi-skl-6600u: NOTRUN -> [SKIP][4] ([i915#4613]) +3 other tests skip
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_173298v1/fi-skl-6600u/igt@[email protected]

* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12@pipe-c-edp-1:
- fi-skl-6600u: NOTRUN -> [SKIP][5] +10 other tests skip
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_173298v1/fi-skl-6600u/igt@kms_pipe_crc_basic@[email protected]

#### Possible fixes ####

* igt@i915_pm_rpm@module-reload:
- bat-arlh-2: [INCOMPLETE][6] -> [PASS][7]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19082/bat-arlh-2/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_173298v1/bat-arlh-2/igt@[email protected]

* igt@i915_selftest@live@gem_migrate:
- bat-mtlp-9: [INCOMPLETE][8] ([i915#16229]) -> [PASS][9] +1 other test pass
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_19082/bat-mtlp-9/igt@i915_selftest@live@gem_migrate.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_173298v1/bat-mtlp-9/igt@i915_selftest@live@gem_migrate.html

[i915#16229]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/16229
[i915#2190]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/2190
[i915#4613]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/4613

Build changes
-------------

* Linux: CI_DRM_19082 -> Patchwork_173298v1

CI-20190529: 20190529
CI_DRM_19082: ac238a043f935a7115a9c6e099fd45a4682a1b3c @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_9082: 2d61f578d998115259b87f9fa27f597ce11a0c89 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_173298v1: ac238a043f935a7115a9c6e099fd45a4682a1b3c @ git://anongit.freedesktop.org/gfx-ci/linux

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_173298v1/index.html