drm/i915: HDCP: fix Ri prime check done during link check
Subsystems (3)
PATCH 1/3 drm/i915: HDCP: fix Ri prime check done during link check
The check was always succeeding even in case of a mismatch due to the HDCP_STATUS_ENC bit being set. Make sure both bits are actually set.
--- drivers/gpu/drm/i915/display/intel_hdmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_hdmi.c +2 -1
@@ -1526,7 +1526,8 @@ bool intel_hdmi_hdcp_check_link(struct intel_digital_port *intel_dig_port)I915_WRITE (HDCP_RPRIME (dev_priv, cpu_transcoder, port), ri.reg);/* Wait for Ri prime match */ -if (wait_for (I915_READ (HDCP_STATUS (dev_priv, cpu_transcoder, port)) & +if (wait_for ((I915_READ (HDCP_STATUS (dev_priv, cpu_transcoder, port)) & + (HDCP_STATUS_RI_MATCH |HDCP_STATUS_ENC )) == (HDCP_STATUS_RI_MATCH |HDCP_STATUS_ENC ),1 )) { DRM_ERROR("Ri' mismatch detected, link check failed (%x)\n", I915_READ(HDCP_STATUS(dev_priv, cpu_transcoder,
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/3 drm/i915: HDCP: fix Ri prime and R0 checks during auth
Including HDCP_STATUS_ENC bit in the checks is pointless. It is simply not set at this point.
--- drivers/gpu/drm/i915/display/intel_hdcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_hdcp.c +2 -2
@@ -689,7 +689,7 @@ static int intel_hdcp_auth(struct intel_connector *connector)/* Wait for R0 ready */ if (wait_for (I915_READ (HDCP_STATUS (dev_priv, cpu_transcoder, port)) & - (HDCP_STATUS_R0_READY |HDCP_STATUS_ENC ),1 )) { +HDCP_STATUS_R0_READY ,1 )) {DRM_ERROR ("Timed out waiting for R0 ready\n" );return -ETIMEDOUT ; }
@@ -721,7 +721,7 @@ static int intel_hdcp_auth(struct intel_connector *connector)/* Wait for Ri prime match */ if (!wait_for (I915_READ (HDCP_STATUS (dev_priv, cpu_transcoder, port)) & - (HDCP_STATUS_RI_MATCH |HDCP_STATUS_ENC ),1 )) +HDCP_STATUS_RI_MATCH ,1 ))break ; }
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/3 drm/i915: HDCP: retry link integrity check on failure
In reply to Oliver BartaA single Ri mismatch doesn't automatically mean that the link integrity is broken. Update and check of Ri and Ri' are done asynchronously. In case an update happens just between the read of Ri' and the check against Ri there will be a mismatch even if the link integrity is fine otherwise.
A failure can also be caused by transmission errors on DDC.
--- drivers/gpu/drm/i915/display/intel_hdmi.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_hdmi.c +15 -2
@@ -1505,7 +1505,7 @@ int intel_hdmi_hdcp_toggle_signalling(struct intel_digital_port *intel_dig_port, }static -bool intel_hdmi_hdcp_check_link (struct intel_digital_port *intel_dig_port) +bool intel_hdmi_hdcp_check_link_once (struct intel_digital_port *intel_dig_port) {struct drm_i915_private *dev_priv = intel_dig_port->base.base.dev->dev_private;
@@ -1529,7 +1529,7 @@ bool intel_hdmi_hdcp_check_link(struct intel_digital_port *intel_dig_port)if (wait_for ((I915_READ (HDCP_STATUS (dev_priv, cpu_transcoder, port)) & (HDCP_STATUS_RI_MATCH |HDCP_STATUS_ENC )) == (HDCP_STATUS_RI_MATCH |HDCP_STATUS_ENC ),1 )) { -DRM_ERROR ("Ri' mismatch detected, link check failed (%x)\n" , +DRM_DEBUG ("Ri' mismatch detected (%x)\n" ,I915_READ (HDCP_STATUS (dev_priv, cpu_transcoder, port)));return false;
@@ -1537,6 +1537,19 @@ bool intel_hdmi_hdcp_check_link(struct intel_digital_port *intel_dig_port)return true; } +static +bool intel_hdmi_hdcp_check_link (struct intel_digital_port *intel_dig_port) +{ +int retry; + +for (retry =0 ; retry <3 ; retry++) +if (intel_hdmi_hdcp_check_link_once (intel_dig_port)) +return true; + +DRM_ERROR ("Link check failed\n" ); +return false; +} +struct hdcp2_hdmi_msg_timeout {u8 msg_id;u16 timeout;
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [1/3] drm/i915: HDCP: fix Ri prime check done during link check
In reply to Oliver Barta== Series Details ==
== Series Details ==
Series: series starting with [1/3] drm/i915: HDCP: fix Ri prime check done during link check
URL : https://patchwork.freedesktop.org/series/73961/
State : failure
== Summary ==
Applying: drm/i915: HDCP: fix Ri prime check done during link check Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/display/intel_hdmi.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/gpu/drm/i915/display/intel_hdmi.c
CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/display/intel_hdmi.c
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch' to see the failed patch Patch failed at 0001 drm/i915: HDCP: fix Ri prime check done during link check When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/3 drm/i915: HDCP: fix Ri prime check done during link check
In reply to Oliver BartaFrom: Oliver Barta <[email protected]>
The check was always succeeding even in case of a mismatch due to the HDCP_STATUS_ENC bit being set. Make sure both bits are actually set.
---
[v2] Rebased patch series from master to drm-intel-next-queued branch.
drivers/gpu/drm/i915/display/intel_hdmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_hdmi.c +2 -1
@@ -1536,7 +1536,8 @@ bool intel_hdmi_hdcp_check_link(struct intel_digital_port *intel_dig_port)intel_de_write (i915,HDCP_RPRIME (i915, cpu_transcoder, port), ri.reg);/* Wait for Ri prime match */ -if (wait_for (intel_de_read (i915,HDCP_STATUS (i915, cpu_transcoder, port)) & +if (wait_for ((intel_de_read (i915,HDCP_STATUS (i915, cpu_transcoder, + port)) & (HDCP_STATUS_RI_MATCH |HDCP_STATUS_ENC )) == (HDCP_STATUS_RI_MATCH |HDCP_STATUS_ENC ),1 )) {DRM_ERROR ("Ri' mismatch detected, link check failed (%x)\n" ,intel_de_read (i915,HDCP_STATUS (i915, cpu_transcoder, port)));
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 2/3 drm/i915: HDCP: fix Ri prime and R0 checks during auth
From: Oliver Barta <[email protected]>
Including HDCP_STATUS_ENC bit in the checks is pointless. It is simply not set at this point.
---
[v2] Rebased patch series from master to drm-intel-next-queued branch.
drivers/gpu/drm/i915/display/intel_hdcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_hdcp.c +2 -2
@@ -705,7 +705,7 @@ static int intel_hdcp_auth(struct intel_connector *connector)/* Wait for R0 ready */ if (wait_for (intel_de_read (dev_priv,HDCP_STATUS (dev_priv, cpu_transcoder, port)) & - (HDCP_STATUS_R0_READY |HDCP_STATUS_ENC ),1 )) { +HDCP_STATUS_R0_READY ,1 )) {DRM_ERROR ("Timed out waiting for R0 ready\n" );return -ETIMEDOUT ; }
@@ -738,7 +738,7 @@ static int intel_hdcp_auth(struct intel_connector *connector)/* Wait for Ri prime match */ if (!wait_for (intel_de_read (dev_priv,HDCP_STATUS (dev_priv, cpu_transcoder, port)) & - (HDCP_STATUS_RI_MATCH |HDCP_STATUS_ENC ),1 )) +HDCP_STATUS_RI_MATCH ,1 ))break ; }
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 3/3 drm/i915: HDCP: retry link integrity check on failure
In reply to Oliver BartaFrom: Oliver Barta <[email protected]>
A single Ri mismatch doesn't automatically mean that the link integrity is broken. Update and check of Ri and Ri' are done asynchronously. In case an update happens just between the read of Ri' and the check against Ri there will be a mismatch even if the link integrity is fine otherwise. A failure can also be caused by transmission errors on DDC.
---
[v2] Rebased patch series from master to drm-intel-next-queued branch.
drivers/gpu/drm/i915/display/intel_hdmi.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_hdmi.c +15 -2
@@ -1516,7 +1516,7 @@ int intel_hdmi_hdcp_toggle_signalling(struct intel_digital_port *intel_dig_port, }static -bool intel_hdmi_hdcp_check_link (struct intel_digital_port *intel_dig_port) +bool intel_hdmi_hdcp_check_link_once (struct intel_digital_port *intel_dig_port) {struct drm_i915_private *i915 =to_i915 (intel_dig_port->base.base.dev); struct intel_connector *connector =
@@ -1539,13 +1539,26 @@ bool intel_hdmi_hdcp_check_link(struct intel_digital_port *intel_dig_port)if (wait_for ((intel_de_read (i915,HDCP_STATUS (i915, cpu_transcoder, port)) & (HDCP_STATUS_RI_MATCH |HDCP_STATUS_ENC )) == (HDCP_STATUS_RI_MATCH |HDCP_STATUS_ENC ),1 )) { -DRM_ERROR ("Ri' mismatch detected, link check failed (%x)\n" , +DRM_DEBUG ("Ri' mismatch detected (%x)\n" ,intel_de_read (i915,HDCP_STATUS (i915, cpu_transcoder, port)));return false; }return true; } +static +bool intel_hdmi_hdcp_check_link (struct intel_digital_port *intel_dig_port) +{ +int retry; + +for (retry =0 ; retry <3 ; retry++) +if (intel_hdmi_hdcp_check_link_once (intel_dig_port)) +return true; + +DRM_ERROR ("Link check failed\n" ); +return false; +} +struct hdcp2_hdmi_msg_timeout {u8 msg_id;u16 timeout;
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [v2,3/3] drm/i915: HDCP: retry link integrity check on failure (rev3)
In reply to Oliver Barta== Series Details ==
== Series Details ==
Series: series starting with [v2,3/3] drm/i915: HDCP: retry link integrity check on failure (rev3)
URL : https://patchwork.freedesktop.org/series/73961/
State : failure
== Summary ==
Applying: drm/i915: HDCP: retry link integrity check on failure
error: sha1 information is lacking or useless (drivers/gpu/drm/i915/display/intel_hdmi.c).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch' to see the failed patch
Patch failed at 0001 drm/i915: HDCP: retry link integrity check on failure When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx