All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramalingam C <ramalingam.c@intel.com>
To: intel-gfx@lists.freedesktop.org, seanpaul@chromium.org
Cc: daniel.vetter@ffwll.ch, rodrigo.vivi@intel.com
Subject: [PATCH v2 7/8] drm/i915: Reauthenticate HDCP on failure
Date: Sat,  3 Feb 2018 01:41:35 +0530	[thread overview]
Message-ID: <1517602296-2386-8-git-send-email-ramalingam.c@intel.com> (raw)
In-Reply-To: <1517602296-2386-1-git-send-email-ramalingam.c@intel.com>

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].

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 drivers/gpu/drm/i915/intel_hdcp.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c
index 4b2821feb4b4..4a3db5de229e 100644
--- a/drivers/gpu/drm/i915/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/intel_hdcp.c
@@ -572,7 +572,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);
@@ -593,17 +593,26 @@ 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++) {
+		if (i)
+			DRM_DEBUG_KMS("[%s:%d] HDCP Reauth...\n",
+				      connector->base.name,
+				      connector->base.base.id);
+
+		ret = intel_hdcp_auth(conn_to_dig_port(connector),
+				      connector->hdcp_shim);
+		if (!ret)
+			return 0;
+
+		DRM_ERROR("[%s:%d] Failed to authenticate HDCP (%d)\n",
+			  connector->base.name, connector->base.base.id, ret);
 
 		/* Ensuring HDCP encryption and signalling are stopped. */
 		_intel_hdcp_disable(connector);
-		return ret;
 	}
 
-	return 0;
+	return ret;
 }
 
 static void intel_hdcp_check_work(struct work_struct *work)
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-02-02 20:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02 20:11 [PATCH v2 0/8] Adhering to HDCP1.4 Compliance Test Spec Ramalingam C
2018-02-02 20:11 ` [PATCH v2 1/8] drm/i915: Handle failure from 2nd stage HDCP auth Ramalingam C
2018-02-02 20:52   ` Sean Paul
2018-02-02 20:11 ` [PATCH v2 2/8] drm/i915: Stop encryption for repeater with no sink Ramalingam C
2018-02-02 20:52   ` Sean Paul
2018-02-02 20:11 ` [PATCH v2 3/8] drm/i915: Connector info in HDCP debug msgs Ramalingam C
2018-02-02 20:52   ` Sean Paul
2018-02-02 20:11 ` [PATCH v2 4/8] drm/i915: Retry HDCP bksv read Ramalingam C
2018-02-02 20:44   ` Sean Paul
2018-02-02 20:11 ` [PATCH v2 5/8] drm/i915: Optimize HDCP key load Ramalingam C
2018-02-02 20:11 ` [PATCH v2 6/8] drm/i915: Detect panel's hdcp capability Ramalingam C
2018-02-02 20:46   ` Sean Paul
2018-02-02 20:11 ` Ramalingam C [this message]
2018-02-02 20:51   ` [PATCH v2 7/8] drm/i915: Reauthenticate HDCP on failure Sean Paul
2018-02-02 20:11 ` [PATCH v2 8/8] drm/i915: fix misalignment in HDCP register def Ramalingam C
2018-02-02 21:20 ` ✗ Fi.CI.BAT: warning for Adhering to HDCP1.4 Compliance Test Spec (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1517602296-2386-8-git-send-email-ramalingam.c@intel.com \
    --to=ramalingam.c@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=seanpaul@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.