[v8,10/35] drm/i915: Handle HDCP2.2 downstream topology change

Submitted by Ramalingam C on Nov. 27, 2018, 10:43 a.m.

Details

Message ID 1543315413-24302-11-git-send-email-ramalingam.c@intel.com
State New
Headers show
Series "drm/i915: Implement HDCP2.2" ( rev: 10 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Ramalingam C Nov. 27, 2018, 10:43 a.m.
When repeater notifies a downstream topology change, this patch
reauthenticate the repeater alone without disabling the hdcp
encryption. If that fails then complete reauthentication is executed.

v2:
  Rebased.
v3:
  No Changes.
v4:
  Typo in commit msg is fixed [Uma]
v5:
  Rebased as part of patch reordering.
  Minor style fixes.
v6:
  Rebased.
v7:
  Rebased.
v8:
  Errors due to sinks are reported as DEBUG logs.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
---
 drivers/gpu/drm/i915/intel_hdcp.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c
index 98b112395a5a..df0fb6d9200b 100644
--- a/drivers/gpu/drm/i915/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/intel_hdcp.c
@@ -1662,8 +1662,24 @@  static int intel_hdcp2_check_link(struct intel_connector *connector)
 		goto out;
 	}
 
-	DRM_DEBUG_KMS("[%s:%d] HDCP2.2 link failed, retrying auth\n",
-		      connector->base.name, connector->base.base.id);
+	if (ret == DRM_HDCP_TOPOLOGY_CHANGE) {
+		if (hdcp->value == DRM_MODE_CONTENT_PROTECTION_UNDESIRED)
+			goto out;
+
+		DRM_DEBUG_KMS("HDCP2.2 Downstream topology change\n");
+		ret = hdcp2_authenticate_repeater_topology(connector);
+		if (!ret) {
+			hdcp->value = DRM_MODE_CONTENT_PROTECTION_ENABLED;
+			schedule_work(&hdcp->prop_work);
+			goto out;
+		}
+		DRM_DEBUG_KMS("[%s:%d] Repeater topology auth failed.(%d)\n",
+			      connector->base.name, connector->base.base.id,
+			      ret);
+	} else {
+		DRM_DEBUG_KMS("[%s:%d] HDCP2.2 link failed, retrying auth\n",
+			      connector->base.name, connector->base.base.id);
+	}
 
 	ret = _intel_hdcp2_disable(connector);
 	if (ret) {

Comments

On Tue, Nov 27, 2018 at 04:13:08PM +0530, Ramalingam C wrote:
> When repeater notifies a downstream topology change, this patch
> reauthenticate the repeater alone without disabling the hdcp
> encryption. If that fails then complete reauthentication is executed.
> 
> v2:
>   Rebased.
> v3:
>   No Changes.
> v4:
>   Typo in commit msg is fixed [Uma]
> v5:
>   Rebased as part of patch reordering.
>   Minor style fixes.
> v6:
>   Rebased.
> v7:
>   Rebased.
> v8:
>   Errors due to sinks are reported as DEBUG logs.
> 
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> Reviewed-by: Uma Shankar <uma.shankar@intel.com>

Trusting Uma's hdcp knowledge here.
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_hdcp.c | 20 ++++++++++++++++++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c
> index 98b112395a5a..df0fb6d9200b 100644
> --- a/drivers/gpu/drm/i915/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/intel_hdcp.c
> @@ -1662,8 +1662,24 @@ static int intel_hdcp2_check_link(struct intel_connector *connector)
>  		goto out;
>  	}
>  
> -	DRM_DEBUG_KMS("[%s:%d] HDCP2.2 link failed, retrying auth\n",
> -		      connector->base.name, connector->base.base.id);
> +	if (ret == DRM_HDCP_TOPOLOGY_CHANGE) {
> +		if (hdcp->value == DRM_MODE_CONTENT_PROTECTION_UNDESIRED)
> +			goto out;
> +
> +		DRM_DEBUG_KMS("HDCP2.2 Downstream topology change\n");
> +		ret = hdcp2_authenticate_repeater_topology(connector);
> +		if (!ret) {
> +			hdcp->value = DRM_MODE_CONTENT_PROTECTION_ENABLED;
> +			schedule_work(&hdcp->prop_work);
> +			goto out;
> +		}
> +		DRM_DEBUG_KMS("[%s:%d] Repeater topology auth failed.(%d)\n",
> +			      connector->base.name, connector->base.base.id,
> +			      ret);
> +	} else {
> +		DRM_DEBUG_KMS("[%s:%d] HDCP2.2 link failed, retrying auth\n",
> +			      connector->base.name, connector->base.base.id);
> +	}
>  
>  	ret = _intel_hdcp2_disable(connector);
>  	if (ret) {
> -- 
> 2.7.4
>