All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: <intel-gfx@lists.freedesktop.org>, <intel-xe@lists.freedesktop.org>
Cc: Jerome Tollet <jerome.tollet@gmail.com>,
	Jerome Tollet <jtollet@cisco.com>,
	Arun R Murthy <arun.r.murthy@intel.com>
Subject: Re: [RESEND] drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status
Date: Thu, 11 Jun 2026 14:33:04 +0530	[thread overview]
Message-ID: <e4bbf7c4-778f-485c-90d8-0c3911e8e1c5@intel.com> (raw)
In-Reply-To: <20260520022544.3097252-1-ankit.k.nautiyal@intel.com>


On 5/20/2026 7:55 AM, Ankit Nautiyal wrote:
> From: Jerome Tollet <jerome.tollet@gmail.com>
>
> HDMI 2.0 section 6.1.3.1 specifies that after enabling
> Scrambling_Enable and starting scrambled video transmission, the source
> should poll Scrambling_Status until it reads 1 or until a timeout of
> 200 ms expires.
>
> Add a polling step after enabling the HDMI port to check the scrambling
> status when HDMI scrambling is enabled.
>
> On some HDMI 2.0 sinks, omitting this check can result in 4K@60Hz
> (594 MHz) failing to come up correctly because the sink has not yet
> finished its scrambling setup. In practice, waiting for the scrambling
> status here fixes such sinks.
>
> While this synchronous polling is not itself explicitly required for
> correct modeset sequencing, HDMI 2.0 section 6.1.3.1 does recommend it
> as the way for the source to verify that the TMDS link is functioning
> correctly with scrambling enabled.
>
> v3:
>   - Add explicit HDMI 2.0 section reference in code comment
>   - Clarify commit message around the observed sink fix
>
> v2:
>   - Poll TMDS_Scrambler_Status for up to 200 ms instead of using a fixed
>     delay
>
> Reported-by: Jerome Tollet <jtollet@cisco.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>
> Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com>


Thanks for the patch, comments and reviews. Pushed to drm-intel-next.

Regards,

Ankit

> ---
>
> 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 | 26 +++++++++++++++++++++++
>   drivers/gpu/drm/i915/display/intel_hdmi.h |  2 ++
>   3 files changed, 30 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 86520848892e..ac307a53576b 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -3505,6 +3505,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 9076c2b176ec..b9d11fb8559d 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -2728,6 +2728,32 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *_
>   		drm_connector_attach_max_bpc_property(&connector->base, 8, 12);
>   }
>   
> +/*
> + * HDMI 2.0 spec, section 6.1.3.1 (Scrambling Control): after
> + * enabling Scrambling_Enable and starting scrambled video
> + * transmission, poll Scrambling_Status 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);
> +}
> +
>   /*
>    * intel_hdmi_handle_sink_scrambling: handle sink scrambling/clock ratio setup
>    * @encoder: intel_encoder
> 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__ */

  parent reply	other threads:[~2026-06-11  9:03 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20  2:25 [RESEND] drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status Ankit Nautiyal
2026-05-20  2:47 ` ✓ CI.KUnit: success for drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status (rev3) Patchwork
2026-05-20  3:27 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-20  3:34 ` ✓ i915.CI.BAT: success for drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status (rev5) Patchwork
2026-05-20 12:35 ` ✗ Xe.CI.FULL: failure for drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status (rev3) Patchwork
2026-05-21  7:25 ` ✓ i915.CI.Full: success for drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status (rev5) Patchwork
2026-05-29  4:56 ` [RESEND] drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status Jerome Tollet
2026-06-09  9:31   ` Jerome Tollet
2026-06-11  9:03 ` Nautiyal, Ankit K [this message]
2026-06-29  6:17 ` 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-05-05  5:37 ` Jerome Tollet
     [not found] <[email protected]>
2026-02-21  7:37 ` Jerome Tollet
  -- strict thread matches above, loose matches on Subject: below --
2026-01-28 10:12 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
2026-01-13 13:38 Ankit Nautiyal
2026-01-13 21:39 ` 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-03-10 20:47     ` Jerome Tollet
2026-03-10 20:47     ` Jerome Tollet

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=e4bbf7c4-778f-485c-90d8-0c3911e8e1c5@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=arun.r.murthy@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jerome.tollet@gmail.com \
    --cc=jtollet@cisco.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.