public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ramalingam C <ramalingam.c@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: daniel.vetter@ffwll.ch, rodrigo.vivi@intel.com
Subject: [PATCH 4/4] drm/i915: Check for downstream topology errors
Date: Thu, 18 Jan 2018 11:18:08 +0530	[thread overview]
Message-ID: <1516254488-4971-5-git-send-email-ramalingam.c@intel.com> (raw)
In-Reply-To: <1516254488-4971-1-git-send-email-ramalingam.c@intel.com>

HDCP compliant Repeaters can support max of 127 devices and max
depth of 7 for downstream topology.

If these max limits are exceeded, repeater will set the
topology error flags MAX_CASCADE_EXCEEDED and/or MAX_DEVS_EXCEEDED
in Bstatus followed by asserting READY/CP_IRQ for HDCP transmitter.

This patch check for these error flags as soon as READY bit is asserted.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 drivers/gpu/drm/i915/intel_hdcp.c | 6 ++++++
 include/drm/drm_hdcp.h            | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c
index 292c98fc8e72..6a78adc0456d 100644
--- a/drivers/gpu/drm/i915/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/intel_hdcp.c
@@ -160,6 +160,12 @@ int intel_hdcp_auth_downstream(struct intel_digital_port *intel_dig_port,
 	if (ret)
 		return ret;
 
+	if (DRM_HDCP_MAX_DEVICE_EXCEEDED(bstatus[0]) ||
+			DRM_HDCP_MAX_CASCADE_EXCEEDED(bstatus[1])) {
+		DRM_ERROR("Max Topology Limit Exceeded\n");
+		return -EPERM;
+	}
+
 	/* If there are no downstream devices, we're all done. */
 	num_downstream = DRM_HDCP_NUM_DOWNSTREAM(bstatus[0]);
 	if (num_downstream == 0) {
diff --git a/include/drm/drm_hdcp.h b/include/drm/drm_hdcp.h
index 43f7bd902b41..562fa7df2637 100644
--- a/include/drm/drm_hdcp.h
+++ b/include/drm/drm_hdcp.h
@@ -20,6 +20,8 @@
 #define DRM_HDCP_V_PRIME_PART_LEN		4
 #define DRM_HDCP_V_PRIME_NUM_PARTS		5
 #define DRM_HDCP_NUM_DOWNSTREAM(x)		(x & 0x3f)
+#define DRM_HDCP_MAX_CASCADE_EXCEEDED(x)	(x & BIT(3))
+#define DRM_HDCP_MAX_DEVICE_EXCEEDED(x)		(x & BIT(7))
 
 /* Slave address for the HDCP registers in the receiver */
 #define DRM_HDCP_DDC_ADDR			0x3A
-- 
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-01-18  5:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18  5:48 [PATCH 0/4] HDCP1.4 implementation enhancement Ramalingam C
2018-01-18  5:48 ` [PATCH 1/4] drm/i915: Extending HDCP for HSW, BDW and BXT+ Ramalingam C
2018-01-18  5:48 ` [PATCH 2/4] drm/i915: II stage HDCP auth for repeater only Ramalingam C
2018-01-18 22:23   ` Sean Paul
2018-01-19  3:50     ` C, Ramalingam
2018-01-19  5:39       ` Sean Paul
2018-01-18  5:48 ` [PATCH 3/4] drm/i915: Start repeater auth on READY/CP_IRQ Ramalingam C
2018-01-18  5:48 ` Ramalingam C [this message]
2018-01-18 11:41 ` ✓ Fi.CI.BAT: success for HDCP1.4 implementation enhancement Patchwork
2018-01-18 13:40 ` ✓ Fi.CI.IGT: " Patchwork
2018-01-19  5:40 ` [PATCH 0/4] " Sean Paul

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=1516254488-4971-5-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 \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox