Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND] drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status
@ 2026-01-13 13:38 Ankit Nautiyal
  2026-01-13 14:48 ` ✓ i915.CI.BAT: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 23+ messages in thread
From: Ankit Nautiyal @ 2026-01-13 13:38 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: jani.nikula, ville.syrjala, Jerome Tollet, Ankit Nautiyal

From: Jerome Tollet <jerome.tollet@gmail.com>

As per HDMI 2.0 specification, after scrambled video transmission begins,
the source must poll the TMDS_Scrambler_Status bit until it reads 1 or
until a timeout of 200 ms.

Add a polling step after enabling the HDMI port to verify scrambling
status, following the spec requirement.

Without the wait for the scrambling bit to set, some HDMI 2.0 monitors fail
to decode the signal at 4K@60Hz (594 MHz) when SCDC scrambling is not yet
fully configured by the sink.

v2:
 - Instead of the fixed delay, poll for TMDS scramble status for 200 msec
   as per the HDMI spec. (Ankit)

Reported-by: Jerome Tollet <jerome.tollet@gmail.com>
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/6868
Link: https://lore.kernel.org/dri-devel/20251230091037.5603-1-jerome.tollet@gmail.com/
Signed-off-by: Jerome Tollet <jerome.tollet@gmail.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---

Rebased and resend to intel-gfx and intel-xe so that the patch is picked
up by intel gfx CI.

---
 drivers/gpu/drm/i915/display/intel_ddi.c  |  2 ++
 drivers/gpu/drm/i915/display/intel_hdmi.c | 25 +++++++++++++++++++++++
 drivers/gpu/drm/i915/display/intel_hdmi.h |  2 ++
 3 files changed, 29 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index cb91d07cdaa6..c708b713f0e8 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -3506,6 +3506,8 @@ static void intel_ddi_enable_hdmi(struct intel_atomic_state *state,
 	}
 
 	intel_ddi_buf_enable(encoder, buf_ctl);
+
+	intel_hdmi_poll_for_scrambling_enable(crtc_state, connector);
 }
 
 static void intel_ddi_enable(struct intel_atomic_state *state,
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 055e68810d0d..6f7dcd7365a4 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -3363,3 +3363,28 @@ intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int slice_width, int num_slices,
 
 	return 0;
 }
+
+/*
+ * As Per HDMI 2.0 spec: after scrambled video transmission begins,
+ * poll TMDS_Scrambler_Status until it reads 1, for up to 200 ms.
+ */
+void
+intel_hdmi_poll_for_scrambling_enable(const struct intel_crtc_state *crtc_state,
+				      struct drm_connector *_connector)
+{
+	struct intel_connector *connector = to_intel_connector(_connector);
+	struct intel_display *display = to_intel_display(crtc_state);
+	bool scrambling_enabled = false;
+	int ret;
+
+	if (!crtc_state->hdmi_scrambling)
+		return;
+
+	/* Poll for a max of 200 msec as per HDMI spec */
+	ret = poll_timeout_us(scrambling_enabled = drm_scdc_get_scrambling_status(&connector->base),
+			      scrambling_enabled, 1000, 200 * 1000, false);
+	if (ret)
+		drm_dbg_kms(display->drm,
+			    "[CONNECTOR:%d:%s] Timed out waiting for scrambling enable\n",
+			    connector->base.base.id, connector->base.name);
+}
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.h b/drivers/gpu/drm/i915/display/intel_hdmi.h
index be2fad57e4ad..0fa3661568e8 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.h
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.h
@@ -70,5 +70,7 @@ void hsw_read_infoframe(struct intel_encoder *encoder,
 			const struct intel_crtc_state *crtc_state,
 			unsigned int type,
 			void *frame, ssize_t len);
+void intel_hdmi_poll_for_scrambling_enable(const struct intel_crtc_state *crtc_state,
+					   struct drm_connector *_connector);
 
 #endif /* __INTEL_HDMI_H__ */
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread
* Re: [RESEND] drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status
@ 2026-01-28 10:12 Jérôme Tollet
  2026-02-07  3:14 ` Jérôme Tollet
  0 siblings, 1 reply; 23+ messages in thread
From: Jérôme Tollet @ 2026-01-28 10:12 UTC (permalink / raw)
  To: intel-gfx; +Cc: ville.syrjala, Ankit Nautiyal

Hi Ville,
Following Ankit's response on January 21st where he suggested
considering a panel-specific quirk instead of a generic solution, I
wanted to get your input on the preferred approach.
As a reminder, testing showed the delay works at any placement in the
modeset sequence (all 4 test positions succeeded), suggesting this is
a timing issue rather than being tied to a specific operation.

Three approaches are available:
1. Generic SCDC polling after port enable - aligns with Windows
behavior which also performs ~200ms SCDC poll post-enable
2. Panel-specific quirk for affected displays (Cisco Desk Pro in my case)
3. Fixed delay after SCDC config (my v2 patch from Jan 14)

I'm happy with any approach that gets merged.

Thanks
Jerome

^ permalink raw reply	[flat|nested] 23+ messages in thread
[parent not found: <[email protected]>]
[parent not found: <20260113143107.1446909-1-ankit.k.nautiyal@intel.com>]

end of thread, other threads:[~2026-05-11 14:40 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-13 13:38 [RESEND] drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status Ankit Nautiyal
2026-01-13 14:48 ` ✓ i915.CI.BAT: success for " Patchwork
2026-01-13 20:56 ` ✗ i915.CI.Full: failure " Patchwork
2026-01-13 21:39 ` [RESEND] " Ville Syrjälä
2026-01-21 12:56   ` Nautiyal, Ankit K
2026-02-19 15:45     ` Jerome Tollet
2026-02-27 13:16     ` Jerome Tollet
2026-02-27 14:03       ` Nautiyal, Ankit K
2026-04-01 12:11 ` ✓ i915.CI.BAT: success for drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status (rev2) Patchwork
2026-04-02  4:23 ` ✓ i915.CI.Full: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2026-01-28 10:12 [RESEND] drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status Jérôme Tollet
2026-02-07  3:14 ` Jérôme Tollet
2026-02-14 16:17   ` Jérôme Tollet
2026-02-17  8:14     ` Nautiyal, Ankit K
     [not found] <[email protected]>
2026-02-21  7:37 ` Jerome Tollet
     [not found] <20260113143107.1446909-1-ankit.k.nautiyal@intel.com>
2026-03-26  5:41 ` Jerome Tollet
2026-04-01 11:23   ` Ville Syrjälä
2026-04-01 12:26     ` Jerome Tollet
2026-04-17 14:14 ` [PATCH v3] " Jerome Tollet
2026-04-20 20:15 ` ✗ LGCI.VerificationFailed: failure for drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status (rev3) Patchwork
2026-05-05  5:37 ` [RESEND] drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status Jerome Tollet
2026-05-06 10:11 ` ✗ LGCI.VerificationFailed: failure for drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status (rev4) Patchwork
2026-05-07 15:55 ` [PATCH] drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status Jerome Tollet

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