summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRamalingam C <ramalingam.c@intel.com>2018-02-03 03:39:09 +0530
committerSean Paul <seanpaul@chromium.org>2018-02-05 12:59:23 -0500
commit6d983946513b05102e1c41ea195ce7f7a65e7047 (patch)
tree6b021fa82f69e622c1ac2038671c94ae2b17b1ed /drivers/gpu
parent791a98dd9bcfd214d8ef51d248f377354a9ea683 (diff)
drm/i915: Reauthenticate HDCP on failure
Incase of HDCP authentication failure, HDCP spec expects reauthentication. Hence this patch adds the reauthentications to be compliance with spec. v2: do-while to for loop for simplicity. [Seanpaul] v3: positioning the logs effectively. [Seanpaul] Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/1517609350-10698-8-git-send-email-ramalingam.c@intel.com
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/intel_hdcp.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c
index d8c0202cf0c0..14ca5d3057a7 100644
--- a/drivers/gpu/drm/i915/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/intel_hdcp.c
@@ -575,7 +575,7 @@ static int _intel_hdcp_disable(struct intel_connector *connector)
static int _intel_hdcp_enable(struct intel_connector *connector)
{
struct drm_i915_private *dev_priv = connector->base.dev->dev_private;
- int i, ret;
+ int i, ret, tries = 3;
DRM_DEBUG_KMS("[%s:%d] HDCP is being enabled...\n",
connector->base.name, connector->base.base.id);
@@ -596,17 +596,21 @@ static int _intel_hdcp_enable(struct intel_connector *connector)
return ret;
}
- ret = intel_hdcp_auth(conn_to_dig_port(connector),
- connector->hdcp_shim);
- if (ret) {
- DRM_ERROR("Failed to authenticate HDCP (%d)\n", ret);
+ /* Incase of authentication failures, HDCP spec expects reauth. */
+ for (i = 0; i < tries; i++) {
+ ret = intel_hdcp_auth(conn_to_dig_port(connector),
+ connector->hdcp_shim);
+ if (!ret)
+ return 0;
+
+ DRM_DEBUG_KMS("HDCP Auth failure (%d)\n", ret);
/* Ensuring HDCP encryption and signalling are stopped. */
_intel_hdcp_disable(connector);
- return ret;
}
- return 0;
+ DRM_ERROR("HDCP authentication failed (%d tries/%d)\n", tries, ret);
+ return ret;
}
static void intel_hdcp_check_work(struct work_struct *work)