Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/dp: reset HDMI 2.1 PCON FRL state on disconnect
@ 2026-09-03 10:44 Xiao Lu
  2026-09-03 11:01 ` sashiko-bot
  2026-09-03 12:40 ` ✗ i915.CI.BAT: failure for " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Xiao Lu @ 2026-09-03 10:44 UTC (permalink / raw)
  To: intel-gfx
  Cc: jani.nikula, ville.syrjala, imre.deak, ankit.k.nautiyal, Xiao Lu

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.

Signed-off-by: Xiao Lu <xiaolu.xie@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 113d767e62e9..3643b6c4c1bc 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -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;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915/dp: reset HDMI 2.1 PCON FRL state on disconnect
  2026-09-03 10:44 [PATCH] drm/i915/dp: reset HDMI 2.1 PCON FRL state on disconnect Xiao Lu
@ 2026-09-03 11:01 ` sashiko-bot
  2026-09-03 12:40 ` ✗ i915.CI.BAT: failure for " Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-09-03 11:01 UTC (permalink / raw)
  To: Xiao Lu; +Cc: intel-gfx

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 <xiaolu.xie@intel.com>

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.

> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 113d767e62e9c..3643b6c4c1bc5 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
[ ... ]
> +/*
> + * 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?

> +
> +	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;
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260903104400.498178-1-xiaolu.xie@intel.com?part=1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* ✗ i915.CI.BAT: failure for drm/i915/dp: reset HDMI 2.1 PCON FRL state on disconnect
  2026-09-03 10:44 [PATCH] drm/i915/dp: reset HDMI 2.1 PCON FRL state on disconnect Xiao Lu
  2026-09-03 11:01 ` sashiko-bot
@ 2026-09-03 12:40 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2026-09-03 12:40 UTC (permalink / raw)
  To: Xiao Lu; +Cc: intel-gfx

[-- Attachment #1: Type: text/plain, Size: 3759 bytes --]

== 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 (I915-ci-infra@lists.freedesktop.org) 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@i915_selftest@live.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_173298v1/bat-arlh-3/igt@i915_selftest@live.html

  
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@gem_huc_copy@huc-copy.html

  * 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@gem_lmem_swapping@random-engines.html

  * 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@compare-crc-sanitycheck-nv12@pipe-c-edp-1.html

  
#### 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@i915_pm_rpm@module-reload.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_173298v1/bat-arlh-2/igt@i915_pm_rpm@module-reload.html

  * 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

[-- Attachment #2: Type: text/html, Size: 4525 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-03 12:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 10:44 [PATCH] drm/i915/dp: reset HDMI 2.1 PCON FRL state on disconnect Xiao Lu
2026-09-03 11:01 ` sashiko-bot
2026-09-03 12:40 ` ✗ i915.CI.BAT: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox