Skip to contentSkip to conversation

drm/i915/hdmi: Go for scrambling only if platform supports TMDS clock > 340MHz

PATCH Superseded Ankit Nautiyal 3 participants 5 messages Dec 13, 2022 – Dec 15, 2022

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/hdmi: Go for scrambling only if platform supports TMDS clock > 340MHz

There are cases, where devices have an HDMI1.4 retimer, and TMDS clock rate is capped to 340MHz via VBT. In such cases scrambling might be supported by the platform and an HDMI2.0 sink for lower TMDS rates, but not supported by the retimer, causing blankouts.

So avoid enabling scrambling, if the TMDS clock is capped to <= 340MHz.

---
 drivers/gpu/drm/i915/display/intel_hdmi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_hdmi.c +6 -1
index efa2da080f62..c124fe667bc0 100644
@@ -2244,6 +2244,11 @@ static bool intel_hdmi_is_cloned(const struct intel_crtc_state *crtc_state)
 		!is_power_of_2(crtc_state->uapi.encoder_mask);
 }
 
+static bool source_can_support_scrambling(struct intel_encoder *encoder)
+{
+	return intel_hdmi_source_max_tmds_clock(encoder) > 340000;
+}
+
 int intel_hdmi_compute_config(struct intel_encoder *encoder,
 			      struct intel_crtc_state *pipe_config,
 			      struct drm_connector_state *conn_state)
@@ -2301,7 +2306,7 @@ int intel_hdmi_compute_config(struct intel_encoder *encoder,
 
 	pipe_config->lane_count = 4;
 
-	if (scdc->scrambling.supported && DISPLAY_VER(dev_priv) >= 10) {
+	if (scdc->scrambling.supported && source_can_support_scrambling(encoder)) {
 		if (scdc->scrambling.low_rates)
 			pipe_config->hdmi_scrambling = true;
 
Signature · 1 line
2.25.1
#1 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/hdmi: Go for scrambling only if platform supports TMDS clock > 340MHz

== Series Details ==

== Series Details ==

Series: drm/i915/hdmi: Go for scrambling only if platform supports TMDS clock > 340MHz
URL : https://patchwork.freedesktop.org/series/111877/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_12498 -> Patchwork_111877v1
====================================================

Summary
-------

**FAILURE**

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

If you think the reported changes have nothing to do with the changes introduced in Patchwork_111877v1, please notify your bug team 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_111877v1/index.html

Participating hosts (39 -> 19)
------------------------------

ERROR: It appears as if the changes made in Patchwork_111877v1 prevented too many machines from booting.

Missing (20): fi-kbl-soraka bat-dg1-6 bat-dg1-5 bat-adlp-6 fi-skl-6600u fi-bsw-n3050 bat-dg2-8 bat-adlm-1 bat-dg2-9 fi-bwr-2160 bat-adln-1 bat-atsm-1 bat-jsl-3 bat-rplp-1 bat-dg2-11 fi-bsw-nick bat-dg1-7 bat-kbl-2 bat-adlp-9 bat-adlp-4

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

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

### IGT changes ###

#### Issues hit ####

* igt@kms_chamelium@common-hpd-after-suspend:
- fi-hsw-4770: NOTRUN -> [SKIP][1] ([fdo#109271] / [fdo#111827])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111877v1/fi-hsw-4770/igt@[email protected]

#### Possible fixes ####

* igt@gem_exec_gttfill@basic:
- fi-pnv-d510: [FAIL][2] ([i915#7229]) -> [PASS][3]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12498/fi-pnv-d510/igt@[email protected]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111877v1/fi-pnv-d510/igt@[email protected]

* igt@i915_selftest@live@hangcheck:
- fi-hsw-4770: [INCOMPLETE][4] ([i915#4785]) -> [PASS][5]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12498/fi-hsw-4770/igt@i915_selftest@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_111877v1/fi-hsw-4770/igt@i915_selftest@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4785]: https://gitlab.freedesktop.org/drm/intel/issues/4785
[i915#5153]: https://gitlab.freedesktop.org/drm/intel/issues/5153
[i915#6106]: https://gitlab.freedesktop.org/drm/intel/issues/6106
[i915#7229]: https://gitlab.freedesktop.org/drm/intel/issues/7229

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

* Linux: CI_DRM_12498 -> Patchwork_111877v1

CI-20190529: 20190529
CI_DRM_12498: 76c062e92f2d28ab3d6a1b122cae8931e55b4fd9 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7091: b8015f920c9f469d3733854263cb878373c1df51 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_111877v1: 76c062e92f2d28ab3d6a1b122cae8931e55b4fd9 @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

3c9f7099e0d8 drm/i915/hdmi: Go for scrambling only if platform supports TMDS clock > 340MHz

== Logs ==

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

#2 lore raw
In reply to Ankit Nautiyal
Quoted 8 lines

-----Original Message-----
From: Intel-gfx <[email protected]> On Behalf Of Ankit Nautiyal
Sent: Tuesday, December 13, 2022 11:21 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH] drm/i915/hdmi: Go for scrambling only if platform supports TMDS clock > 340MHz

Quoted 7 lines

There are cases, where devices have an HDMI1.4 retimer, and TMDS clock rate is capped to 340MHz via VBT. In such cases scrambling might be supported by the platform and an HDMI2.0 sink for lower TMDS rates, but not supported by the retimer, causing blankouts.

So avoid enabling scrambling, if the TMDS clock is capped to <= 340MHz.

Doesn't this clash with scrambling with low rates?

Thanks and Regards,
Arun R Murthy
--------------------

Quoted 35 lines
---
 drivers/gpu/drm/i915/display/intel_hdmi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_hdmi.c +4 -0
index efa2da080f62..c124fe667bc0 100644
@@ -2244,6 +2244,11 @@ static bool intel_hdmi_is_cloned(const struct
 intel_crtc_state *crtc_state)
 		!is_power_of_2(crtc_state->uapi.encoder_mask);
 }
 
+static bool source_can_support_scrambling(struct intel_encoder
+*encoder) {
+	return intel_hdmi_source_max_tmds_clock(encoder) > 340000; }
+
 int intel_hdmi_compute_config(struct intel_encoder *encoder,
 			      struct intel_crtc_state *pipe_config,
 			      struct drm_connector_state *conn_state) @@ -

2301,7 +2306,7 @@ int intel_hdmi_compute_config(struct intel_encoder *encoder,

drivers/gpu/drm/i915/display/intel_hdmi.c +2 -2
 	pipe_config->lane_count = 4;
 
-	if (scdc->scrambling.supported && DISPLAY_VER(dev_priv) >= 10) {
+	if (scdc->scrambling.supported &&
+source_can_support_scrambling(encoder)) {
 		if (scdc->scrambling.low_rates)
 			pipe_config->hdmi_scrambling = true;
 
--

2.25.1

#3 lore raw
Quoted 8 lines · Arun R
Quoted 8 lines

-----Original Message-----
From: Intel-gfx <[email protected]> On Behalf Of Ankit Nautiyal
Sent: Tuesday, December 13, 2022 11:21 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH] drm/i915/hdmi: Go for scrambling only if platform supports TMDS clock > 340MHz

Quoted 8 lines
Quoted 7 lines

There are cases, where devices have an HDMI1.4 retimer, and TMDS clock rate is capped to 340MHz via VBT. In such cases scrambling might be supported by the platform and an HDMI2.0 sink for lower TMDS rates, but not supported by the retimer, causing blankouts.

So avoid enabling scrambling, if the TMDS clock is capped to <= 340MHz.

Doesn't this clash with scrambling with low rates?

Hi Arun,

As per HDMI 2.0 spec, scrambling is always required when TMDS char rate > 340Mcsc

So scrambling is optional for rate <= 340, if source and sink both support scrambling, it is enabled by the source.

Gen 10 onward HDMI 2.0 is supported, the max tmds clock is 594MHz, and scrambling is supported.
But there seem to be cases where for certain platforms that support HDMI 2.0, there is an HDMI1.4 retimer chip and the max tmds clock is capped by VBT to less than 340MHz. In such cases when an HDMI2.0 sink is connected, the driver checks for Gen >= 10 + sink scrambling support, and goes with scrambling even for resolutions that require lower clocks. This creates problem as HDMI1.4 retimer chip doesn't support scrambling.

So in this patch, we replace the check for Gen >=10 with check if max source TMDS clock > 340 MHz (taking into account the VBT capping).

In general case for Gen>= 10 (when VBT does not restrict the max tmds clock), if sink also supports scrambling for lower rate, driver will go with scrambling with lower clocks too.

Thanks & Regards,

Ankit

Quoted 39 lines

Thanks and Regards,
Arun R Murthy
--------------------

Quoted 35 lines
---
  drivers/gpu/drm/i915/display/intel_hdmi.c | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_hdmi.c +4 -0
index efa2da080f62..c124fe667bc0 100644
@@ -2244,6 +2244,11 @@ static bool intel_hdmi_is_cloned(const struct
 intel_crtc_state *crtc_state)
  		!is_power_of_2(crtc_state->uapi.encoder_mask);
  }
 
+static bool source_can_support_scrambling(struct intel_encoder
+*encoder) {
+	return intel_hdmi_source_max_tmds_clock(encoder) > 340000; }
+
  int intel_hdmi_compute_config(struct intel_encoder *encoder,
  			      struct intel_crtc_state *pipe_config,
  			      struct drm_connector_state *conn_state) @@ -

2301,7 +2306,7 @@ int intel_hdmi_compute_config(struct intel_encoder *encoder,

  	pipe_config->lane_count = 4;
drivers/gpu/drm/i915/display/intel_hdmi.c +2 -2
-	if (scdc->scrambling.supported && DISPLAY_VER(dev_priv) >= 10) {
+	if (scdc->scrambling.supported &&
+source_can_support_scrambling(encoder)) {
  		if (scdc->scrambling.low_rates)
  			pipe_config->hdmi_scrambling = true;
 
--

2.25.1

Reviewed-by
#4 lore raw
Quoted 45 lines

-----Original Message-----
From: Nautiyal, Ankit K <[email protected]>
Sent: Wednesday, December 14, 2022 12:43 PM
To: Murthy, Arun R <[email protected]>; intel- [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915/hdmi: Go for scrambling only if platform supports TMDS clock > 340MHz

Quoted 8 lines · Arun R
Quoted 8 lines

-----Original Message-----
From: Intel-gfx <[email protected]> On Behalf Of Ankit Nautiyal
Sent: Tuesday, December 13, 2022 11:21 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH] drm/i915/hdmi: Go for scrambling only if platform supports TMDS clock > 340MHz

Quoted 8 lines
Quoted 7 lines

There are cases, where devices have an HDMI1.4 retimer, and TMDS clock rate is capped to 340MHz via VBT. In such cases scrambling might be supported by the platform and an HDMI2.0 sink for lower TMDS rates, but not supported by the retimer, causing blankouts.

So avoid enabling scrambling, if the TMDS clock is capped to <= 340MHz.

Doesn't this clash with scrambling with low rates?

Hi Arun,

As per HDMI 2.0 spec, scrambling is always required when TMDS char rate > 340Mcsc

So scrambling is optional for rate <= 340, if source and sink both support scrambling, it is enabled by the source.

Gen 10 onward HDMI 2.0 is supported, the max tmds clock is 594MHz, and scrambling is supported.
But there seem to be cases where for certain platforms that support HDMI 2.0, there is an HDMI1.4 retimer chip and the max tmds clock is capped by VBT to less than 340MHz.
In such cases when an HDMI2.0 sink is connected, the driver checks for Gen

Quoted 1 line

= 10 + sink scrambling support, and goes with scrambling even for

resolutions that require lower clocks.
This creates problem as HDMI1.4 retimer chip doesn't support scrambling.

Quoted 7 lines

So in this patch, we replace the check for Gen >=10 with check if max source TMDS clock > 340 MHz (taking into account the VBT capping).

In general case for Gen>= 10 (when VBT does not restrict the max tmds clock), if sink also supports scrambling for lower rate, driver will go with scrambling with lower clocks too.

Got it, thanks for the explanation. Better if this is commented in the code as well. Just to know the restriction coming from VBT.

With adding above comment in code,

Thanks and Regards,
Arun R Murthy
--------------------

Quoted 43 lines

Thanks & Regards,

Ankit

Quoted 39 lines

Thanks and Regards,
Arun R Murthy
--------------------

Quoted 35 lines
---
  drivers/gpu/drm/i915/display/intel_hdmi.c | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_hdmi.c +4 -0
index efa2da080f62..c124fe667bc0 100644
@@ -2244,6 +2244,11 @@ static bool intel_hdmi_is_cloned(const struct
 intel_crtc_state *crtc_state)
  		!is_power_of_2(crtc_state->uapi.encoder_mask);
  }
 
+static bool source_can_support_scrambling(struct intel_encoder
+*encoder) {
+	return intel_hdmi_source_max_tmds_clock(encoder) > 340000; }
+
  int intel_hdmi_compute_config(struct intel_encoder *encoder,
  			      struct intel_crtc_state *pipe_config,
  			      struct drm_connector_state *conn_state) @@ -

2301,7 +2306,7 @@ int intel_hdmi_compute_config(struct intel_encoder *encoder,

  	pipe_config->lane_count = 4;
drivers/gpu/drm/i915/display/intel_hdmi.c +2 -2
-	if (scdc->scrambling.supported && DISPLAY_VER(dev_priv) >= 10) {
+	if (scdc->scrambling.supported &&
+source_can_support_scrambling(encoder)) {
  		if (scdc->scrambling.low_rates)
  			pipe_config->hdmi_scrambling = true;
 
--

2.25.1