drm/i915: Handle HDCP2.2 downstream topology change
authorRamalingam C <ramalingam.c@intel.com>
Sat, 16 Feb 2019 17:36:58 +0000 (23:06 +0530)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 20 Feb 2019 19:41:20 +0000 (20:41 +0100)
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:
  Typo in commit msg is fixed [Uma]
v4:
  Rebased as part of patch reordering.
  Minor style fixes.
v5:
  Rebased.
v6:
  Rebased.
v7:
  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>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1550338640-17470-12-git-send-email-ramalingam.c@intel.com
drivers/gpu/drm/i915/intel_hdcp.c

index 00fae3963caf0ccbc958f7842296607f820817e0..fe0445c0eaacd0260bda1da550d91339da8ac397 100644 (file)
@@ -1626,8 +1626,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 == 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) {