<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 12/13/2018 1:47 PM, Winkler, Tomas
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:5B8DA87D05A7694D9FA63FD143655C1B9DA51DBC@hasmsx108.ger.corp.intel.com">
      <pre class="moz-quote-pre" wrap="">

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">
All HDCP1.4 routines are gathered together, followed by the generic functions
those can be extended for HDCP2.2 too.

Signed-off-by: Ramalingam C <a class="moz-txt-link-rfc2396E" href="mailto:ramalingam.c@intel.com"><ramalingam.c@intel.com></a>
---
 drivers/gpu/drm/i915/intel_hdcp.c | 118 +++++++++++++++++++------------------
-
 1 file changed, 59 insertions(+), 59 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_hdcp.c
b/drivers/gpu/drm/i915/intel_hdcp.c
index e000e54ad569..506b4cc6f46b 100644
--- a/drivers/gpu/drm/i915/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/intel_hdcp.c
@@ -731,6 +731,65 @@ struct intel_connector
*intel_hdcp_to_connector(struct intel_hdcp *hdcp)
        return container_of(hdcp, struct intel_connector, hdcp);  }

+/* Implements Part 3 of the HDCP authorization procedure */ int
+intel_hdcp_check_link(struct intel_connector *connector) {
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">

Should be static</pre>
    </blockquote>
    <pre>At this point in time, invoked from intel_dp.c. But at later part of
this series this function can be defined as static. Will do it then.

-Ram
</pre>
    <blockquote type="cite"
cite="mid:5B8DA87D05A7694D9FA63FD143655C1B9DA51DBC@hasmsx108.ger.corp.intel.com">
      <pre class="moz-quote-pre" wrap="">

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">+  struct intel_hdcp *hdcp = &connector->hdcp;
+       struct drm_i915_private *dev_priv = connector->base.dev-
</pre>
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">dev_private;
</pre>
        </blockquote>
        <pre class="moz-quote-pre" wrap="">+  struct intel_digital_port *intel_dig_port =
conn_to_dig_port(connector);
+       enum port port = intel_dig_port->base.port;
+       int ret = 0;
+
+       if (!hdcp->shim)
+               return -ENOENT;
+
+       mutex_lock(&hdcp->mutex);
+
+       if (hdcp->value == DRM_MODE_CONTENT_PROTECTION_UNDESIRED)
+               goto out;
+
+       if (!(I915_READ(PORT_HDCP_STATUS(port)) & HDCP_STATUS_ENC)) {
+               DRM_ERROR("%s:%d HDCP check failed: link is not
encrypted,%x\n",
+                         connector->base.name, connector->base.base.id,
+                         I915_READ(PORT_HDCP_STATUS(port)));
+               ret = -ENXIO;
+               hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
+               schedule_work(&hdcp->prop_work);
+               goto out;
+       }
+
+       if (hdcp->shim->check_link(intel_dig_port)) {
+               if (hdcp->value !=
DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
+                       hdcp->value =
DRM_MODE_CONTENT_PROTECTION_ENABLED;
+                       schedule_work(&hdcp->prop_work);
+               }
+               goto out;
+       }
+
+       DRM_DEBUG_KMS("[%s:%d] HDCP link failed, retrying
authentication\n",
+                     connector->base.name, connector->base.base.id);
+
+       ret = _intel_hdcp_disable(connector);
+       if (ret) {
+               DRM_ERROR("Failed to disable hdcp (%d)\n", ret);
+               hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
+               schedule_work(&hdcp->prop_work);
+               goto out;
+       }
+
+       ret = _intel_hdcp_enable(connector);
+       if (ret) {
+               DRM_ERROR("Failed to enable hdcp (%d)\n", ret);
+               hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
+               schedule_work(&hdcp->prop_work);
+               goto out;
+       }
+
+out:
+       mutex_unlock(&hdcp->mutex);
+       return ret;
+}
+
 static void intel_hdcp_check_work(struct work_struct *work)  {
        struct intel_hdcp *hdcp = container_of(to_delayed_work(work),
@@ -867,62 +926,3 @@ void intel_hdcp_atomic_check(struct drm_connector
*connector,
                                                   new_state->crtc);
        crtc_state->mode_changed = true;
 }
-
-/* Implements Part 3 of the HDCP authorization procedure */ -int
intel_hdcp_check_link(struct intel_connector *connector) -{
-       struct intel_hdcp *hdcp = &connector->hdcp;
-       struct drm_i915_private *dev_priv = connector->base.dev-
</pre>
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">dev_private;
</pre>
        </blockquote>
        <pre class="moz-quote-pre" wrap="">-  struct intel_digital_port *intel_dig_port =
conn_to_dig_port(connector);
-       enum port port = intel_dig_port->base.port;
-       int ret = 0;
-
-       if (!hdcp->shim)
-               return -ENOENT;
-
-       mutex_lock(&hdcp->mutex);
-
-       if (hdcp->value == DRM_MODE_CONTENT_PROTECTION_UNDESIRED)
-               goto out;
-
-       if (!(I915_READ(PORT_HDCP_STATUS(port)) & HDCP_STATUS_ENC)) {
-               DRM_ERROR("%s:%d HDCP check failed: link is not
encrypted,%x\n",
-                         connector->base.name, connector->base.base.id,
-                         I915_READ(PORT_HDCP_STATUS(port)));
-               ret = -ENXIO;
-               hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
-               schedule_work(&hdcp->prop_work);
-               goto out;
-       }
-
-       if (hdcp->shim->check_link(intel_dig_port)) {
-               if (hdcp->value !=
DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
-                       hdcp->value =
DRM_MODE_CONTENT_PROTECTION_ENABLED;
-                       schedule_work(&hdcp->prop_work);
-               }
-               goto out;
-       }
-
-       DRM_DEBUG_KMS("[%s:%d] HDCP link failed, retrying
authentication\n",
-                     connector->base.name, connector->base.base.id);
-
-       ret = _intel_hdcp_disable(connector);
-       if (ret) {
-               DRM_ERROR("Failed to disable hdcp (%d)\n", ret);
-               hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
-               schedule_work(&hdcp->prop_work);
-               goto out;
-       }
-
-       ret = _intel_hdcp_enable(connector);
-       if (ret) {
-               DRM_DEBUG_KMS("Failed to enable hdcp (%d)\n", ret);
-               hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
-               schedule_work(&hdcp->prop_work);
-               goto out;
-       }
-
-out:
-       mutex_unlock(&hdcp->mutex);
-       return ret;
-}
--
2.7.4
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
</pre>
    </blockquote>
  </body>
</html>