]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/hdcp: HDCP2.2 MST Link failure recovery
authorAnshuman Gupta <anshuman.gupta@intel.com>
Fri, 19 Mar 2021 10:02:06 +0000 (15:32 +0530)
committerAnshuman Gupta <anshuman.gupta@intel.com>
Mon, 22 Mar 2021 06:48:14 +0000 (12:18 +0530)
DP MST Link Check performed only for the connector involved with
HDCP port authentication and encryption, for other connector it
simply returns link check with true and update the uevent.
Therefore in case of HDCP 2.2 link failure, disable HDCP encryption
and de-authenticate the port so next time it can enable port
authentication and encryption.

Cc: Ramalingam C <ramalingam.c@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210319100208.5886-2-anshuman.gupta@intel.com
drivers/gpu/drm/i915/display/intel_hdcp.c

index 5b2e2625779bd16b0ae5c6320f9734c1438a1878..25fee483458826a9a94065cf9c45ebf8a1330ab9 100644 (file)
@@ -1942,7 +1942,8 @@ static int _intel_hdcp2_enable(struct intel_connector *connector)
        return 0;
 }
 
-static int _intel_hdcp2_disable(struct intel_connector *connector)
+static int
+_intel_hdcp2_disable(struct intel_connector *connector, bool hdcp2_link_recovery)
 {
        struct intel_digital_port *dig_port = intel_attached_dig_port(connector);
        struct drm_i915_private *i915 = to_i915(connector->base.dev);
@@ -1963,7 +1964,7 @@ static int _intel_hdcp2_disable(struct intel_connector *connector)
                drm_dbg_kms(&i915->drm, "HDCP 2.2 transcoder: %s stream encryption disabled\n",
                            transcoder_name(hdcp->stream_transcoder));
 
-               if (dig_port->num_hdcp_streams > 0)
+               if (dig_port->num_hdcp_streams > 0 && !hdcp2_link_recovery)
                        return 0;
        }
 
@@ -2006,6 +2007,7 @@ static int intel_hdcp2_check_link(struct intel_connector *connector)
                        "HDCP2.2 link stopped the encryption, %x\n",
                        intel_de_read(dev_priv, HDCP2_STATUS(dev_priv, cpu_transcoder, port)));
                ret = -ENXIO;
+               _intel_hdcp2_disable(connector, true);
                intel_hdcp_update_value(connector,
                                        DRM_MODE_CONTENT_PROTECTION_DESIRED,
                                        true);
@@ -2045,7 +2047,7 @@ static int intel_hdcp2_check_link(struct intel_connector *connector)
                            connector->base.name, connector->base.base.id);
        }
 
-       ret = _intel_hdcp2_disable(connector);
+       ret = _intel_hdcp2_disable(connector, true);
        if (ret) {
                drm_err(&dev_priv->drm,
                        "[%s:%d] Failed to disable hdcp2.2 (%d)\n",
@@ -2355,7 +2357,7 @@ int intel_hdcp_disable(struct intel_connector *connector)
        intel_hdcp_update_value(connector,
                                DRM_MODE_CONTENT_PROTECTION_UNDESIRED, false);
        if (hdcp->hdcp2_encrypted)
-               ret = _intel_hdcp2_disable(connector);
+               ret = _intel_hdcp2_disable(connector, false);
        else if (hdcp->hdcp_encrypted)
                ret = _intel_hdcp_disable(connector);